Bug 172805 - Fix catopen(3)'s EINVAL usage and document EFTYPE
Summary: Fix catopen(3)'s EINVAL usage and document EFTYPE
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 8.3-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-standards (Nobody)
Keywords: patch
Depends on:
Reported: 2012-10-17 06:40 UTC by lichray
Modified: 2022-04-07 14:11 UTC (History)
1 user (show)

See Also:

catopen3.patch (2.07 KB, patch)
2012-10-17 06:40 UTC, lichray
no flags Details | Diff
catopen3_1.patch (2.43 KB, patch)
2012-10-17 09:42 UTC, lichray
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lichray 2012-10-17 06:40:00 UTC
	1. catopen("", 0) should set errno to ENOENT;
	2. Document EFTYPE. POSIX says nothing about how to report a corrupt
	   catalog.  NetBSD and OpenBSD do nothing (errno == 0), while we set
	   EFTYPE.  Document it.
	3. Fix errno under a rare condition (fstat(2) fails after open(2)).
Comment 1 lichray 2012-10-17 09:42:41 UTC
Further points out more EFTYPE errors.

The exact explanation of EFTYPE here should be "The file designated by
the named catalog is not a regular file or a symbolic link pointing to
a regular file, or its data format is not POSIX NLS catalog.", which
confirms with the general meaning of EFTYPE "Inappropriate file type
or format.  The file was the wrong type for the operation, or a data
file had the wrong format.". Please help improve the wording in
catopen.3 is you find that the current version is not enough.

Zhihao Yuan, nickname lichray
The best way to predict the future is to invent it.
4BSD -- http://4bsd.biz/
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-23 10:27:16 UTC
batch change of PRs untouched in 2018 marked "in progress" back to open.
Comment 3 Minsoo Choo 2022-04-04 11:58:52 UTC
Now catopen("", 0) sets errno to ENOENT.
Comment 4 Minsoo Choo 2022-04-07 14:11:11 UTC