aboutsummaryrefslogtreecommitdiff
path: root/src/stat/fstat.c (follow)
Commit message (Expand)AuthorAgeFilesLines
* disable lfs64 aliases for remapped time64 functions•••these functions cannot provide the glibc lfs64-ABI-compatible symbols when time_t differs from what it was in that ABI. instead, the aliases need to be provided by the time32 compat shims or through some other mechanism. Rich Felker2019-10-281-0/+2
* restore property that fstat(AT_FDCWD) fails with EBADF•••AT_FDCWD is not a valid file descriptor, so POSIX requires fstat to fail with EBADF. if passed to fstatat, the call would spuriously succeed and return results for the working directory. Rich Felker2019-07-181-0/+1
* refactor all stat functions in terms of fstatat•••equivalent logic for fstat+O_PATH fallback and direct use of stat/lstat syscalls where appropriate is kept, now in the fstatat function. this change both improves functionality (now, fstatat forms equivalent to fstat/lstat/stat will work even on kernels too old to have the at functions) and localizes direct interfacing with the kernel stat structure to one file. Rich Felker2019-07-181-11/+2
* remove spurious inclusion of libc.h for LFS64 ABI aliases•••the LFS64 macro was not self-documenting and barely saved any characters. simply use weak_alias directly so that it's clear what's being done, and doesn't depend on a header to provide a strange macro. Rich Felker2018-09-121-2/+1
* move and deduplicate declarations of __procfdname to make it checkable•••syscall.h was chosen as the header to declare it, since its intended usage is alongside syscalls as a fallback for operations the direct syscall does not support. Rich Felker2018-09-121-2/+0
* fix missing flags arg to fstatat syscall in fstat fallback path•••this code path is used only on archs without the plain, non-at syscalls, and only when the fstat syscall fails with EBADF on a valid file descriptor. this in turn can happen only for O_PATH file descriptors, and may not happen at all on the newer kernels needed for supporting such archs. with the flags argument omitted, spurious fstat failures may happen when the argument register happens to have the AT_SYMLINK_NOFOLLOW bit set. Rich Felker2014-07-181-1/+1
* additional fixes for linux kernel apis with old syscalls removedRich Felker2014-05-301-0/+4
* 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. Rich Felker2013-12-191-1/+3
* make fchdir, fchmod, fchown, and fstat support O_PATH file descriptors•••on newer kernels, fchdir and fstat work anyway. this same fix should be applied to any other syscalls that are similarly affected. with this change, the current definitions of O_SEARCH and O_EXEC as O_PATH are mostly conforming to POSIX requirements. the main remaining issue is that O_NOFOLLOW has different semantics. Rich Felker2013-08-021-2/+10
* global cleanup to use the new syscall interfaceRich Felker2011-03-201-1/+1
* finish moving 32-bit-specific junk out of source files.Rich Felker2011-02-151-1/+1
* initial check-in, version 0.5.0Rich Felker2011-02-121-0/+10