musl/src
Rich Felker 65ea604c74 fix failure of fchmod, fstat, fchdir, and fchown to produce EBADF
the workaround/fallback code for supporting O_PATH file descriptors
when the kernel lacks support for performing these operations on them
caused EBADF to get replaced by ENOENT (due to missing entry in
/proc/self/fd). this is unlikely to affect real-world code (calls that
might yield EBADF are generally unsafe, especially in library code)
but it was breaking some test cases.

the fix I've applied is something of a tradeoff: it adds one syscall
to these operations on kernels where the workaround is needed. the
alternative would be to catch ENOENT from the /proc lookup and
translate it to EBADF, but I want to avoid doing that in the interest
of not touching/depending on /proc at all in these functions as long
as the kernel correctly supports the operations. this is following the
general principle of isolating hacks to code paths that are taken on
broken systems, and keeping the code for correct systems completely
hack-free.
2013-12-19 14:24:55 -05:00
..
aio support configurable page size on mips, powerpc and microblaze 2013-09-15 02:00:32 +00:00
complex complex: add C11 CMPLX macros and replace cpack with them 2012-11-13 01:31:49 +01:00
conf correct the sysconf value for RTSIG_MAX 2013-09-20 01:49:03 -04:00
crypt comment potentially-confusing use of struct crypt_data type 2013-04-20 14:07:01 -04:00
ctype include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
dirent include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
env include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
errno fix typo in newly-added error message for EOWNERDEAD 2013-02-07 03:13:35 -05:00
exit include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
fcntl include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
fenv fenv: fix i386 fesetround for sse 2013-10-28 20:33:54 +00:00
internal include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
ipc fix harmless inconsistency in semtimedop 2013-11-09 17:54:20 -05:00
ldso fix dynamic linker entry point for microblaze 2013-12-14 19:51:48 -05:00
legacy include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
linux include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
locale include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
malloc include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
math math: define _GNU_SOURCE when implementing non-standard math functions 2013-12-12 03:42:11 +00:00
misc optimize get_current_dir_name to reduce stack bloat 2013-12-13 02:25:09 -05:00
mman include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
mq use restrict everywhere it's required by c99 and/or posix 2008 2012-09-06 22:44:55 -04:00
multibyte include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
network include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
passwd include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
prng include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
process include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
regex include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
sched add pthread_setaffinity_np and pthread_getaffinity_np functions 2013-08-10 21:41:05 -04:00
search POSIX conformance fix: define struct entry in search.h 2013-10-29 20:25:11 +00:00
select remove __SYSCALL_SSLEN arch macro in favor of using public _NSIG 2013-03-26 23:07:31 -04:00
setjmp remove fenv saving/loading code from setjmp/longjmp on arm 2012-12-05 19:13:47 -05:00
signal use 0 instead of NULL for null pointer constants 2013-12-13 02:20:07 -05:00
stat fix failure of fchmod, fstat, fchdir, and fchown to produce EBADF 2013-12-19 14:24:55 -05:00
stdio include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
stdlib include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
string include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
temp include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
termios include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
thread include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
time fix hangs in localtime for near-overflowing time_t values on 64-bit archs 2013-12-19 05:05:13 -05:00
unistd fix failure of fchmod, fstat, fchdir, and fchown to produce EBADF 2013-12-19 14:24:55 -05:00