Bug 2363 - EOPNOTSUPP and ENOTSUP in errno.h must be different, according to SUSv3
Summary: EOPNOTSUPP and ENOTSUP in errno.h must be different, according to SUSv3
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.6
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-20 02:42 UTC by Brian M. Carlson
Modified: 2019-08-22 23:34 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments
document the equality (1.34 KB, patch)
2018-11-05 09:58 UTC, nicolas
Details | Diff
let doc say that ENOTSUP==EOPNOTSUPP on linux (1.56 KB, patch)
2018-11-06 00:01 UTC, nicolas
Details | Diff
corrections from Carlos O'Donell on libc-alpha@sourceware.org (1.57 KB, patch)
2019-08-22 23:34 UTC, nicolas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian M. Carlson 2006-02-20 02:42:15 UTC
The values of EOPNOTSUPP and ENOTSUP must be different according to SUSv3,
whereas in glibc they are the same.

Steps to Reproduce:
0. Create a source file including a switch statement with both EOPNOTSUPP and
ENOTSUP as case values.
1. Attempt to compile said file.
2. Scream in frustration.

Actual Results:
gcc complains about duplicate case values because the two errors are the same.

Expected Results:
gcc doesn't complain because there is no syntax error.

Build Date and Platform:
Debian GNU/Linux i386/sid, using libc6 2.3.6-1.

Additional Builds and Platforms:
- Also Occurs On:
  Debian GNU/Linux powerpc/sid, using libc6 2.3.6-1.
Comment 1 Ulrich Drepper 2006-02-20 03:04:12 UTC
Tell this to the kernel people once you finish your time machine and go back to
1991.  This is part of the ABI.
Comment 2 Brian M. Carlson 2006-02-20 04:03:05 UTC
If this is part of the ABI, then the ABI is broken.  Just because things have
always been one way does not mean that way is right, or even acceptable; an
argument from tradition is a logical fallacy.

Currently glibc claims to support SUSv3, by setting _POSIX_VERSION to 200112L. 
If it is not your intention to fix this, then please don't lie to the programmer
and tell them you support a standard which you do not.
Comment 3 Ulrich Drepper 2006-02-20 04:31:38 UTC
Stop reopening this bug.  Not only is this fixed by the ABI, this also has
nothing to do with the libc as the kernel defines the error numbers.
Comment 4 Samuel Thibault 2006-12-06 22:18:31 UTC
Just leaving a note about the bug: this topic was discussed at opengroup, see
http://www.opengroup.org/austin/aardvark/latest/xbdbug2.txt
ENOTSUP and EOPNOTSUPP may then be equal.
Comment 5 nicolas 2018-11-05 09:58:02 UTC
Created attachment 11380 [details]
document the equality

Please consider at least documenting the issue, as done for EAGAIN and EWOULDBLOCK.
Thanks.
Comment 6 Florian Weimer 2018-11-05 11:53:00 UTC
The patch is not correct as written because the values of EOPNOTSUPP and ENOTSUP are distinct on Hurd.

(And please post patches to the libc-alpha mailing list.)
Comment 7 nicolas 2018-11-06 00:01:52 UTC
Created attachment 11383 [details]
let doc say that ENOTSUP==EOPNOTSUPP on linux

Is this modified patch more correct?
Comment 8 nicolas 2019-08-22 23:34:32 UTC
Created attachment 11962 [details]
corrections from Carlos O'Donell  on libc-alpha@sourceware.org