about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/fxstatat.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Remove __ASSUME_ATFCTS conditionals in sysdeps/unix/sysv/linux/.Joseph Myers2014-06-201-83/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up for __ASSUME_ATFCTS now always being true for the supported Linux kernel versions by removing conditional code in sysdeps/unix/sysv/linux. Several fchownat.c files that were only present because of differences in the fallback syscalls used (depending on the architecture-specific names of chown-related syscalls for 32-bit uids) are removed. Files that looks like they could be replaced by syscalls.list entries have the standard "Consider moving to syscalls.list." comment (see bug 14138) added. Conditionals on the relevant __NR_* syscall numbers being defined are also removed, since my analysis indicated that the relevant syscalls are always defined for all relevant kernel versions using any affected file. Much of the removed fallback code had unbounded stack allocations, so this reduces the number of cases to consider for anyone reviewing uses of alloca and VLAs in glibc. There remain tests of __ASSUME_ATFCTS in io/openat.c (to determine whether to define __have_atfcts) and sysdeps/posix/getcwd.c (which also uses __have_atfcts); thus, the definition of __ASSUME_ATFCTS remains in kernel-features.h. The logical condition relevant there is whether openat64_not_cancel_3 is known to work. Hurd doesn't use this version of getcwd at all, so the conditionals in getcwd.c are always true in glibc. However, this code is also used in gnulib. So the best way to deal with the conditionals there may be for gnulib people to deal with merging all relevant changes in both directions between the glibc and gnulib versions of this file, at the end of which the openat conditionals should be in whatever form is best for gnulib, and hardcoded in the _LIBC case to having openat supported. Tested by comparing before-and-after disassembly of installed (stripped) shared libraries, on x86_64 and x86. On x86 the patch made no change to the disassembly; on x86_64, the only changes were in readlinkat, where formerly the return value from the readlinkat syscall was stored in an int variable before being converted to ssize_t for the return, and now the return value is returned directly without truncation to int. I think it's clearly correct not to truncate the return value (although I also think the truncation would not have been a user-visible bug because the kernel would never have returned a value it could have affected). * include/fcntl.h (__atfct_seterrno): Remove prototype. (__atfct_seterrno_2): Likewise. * sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c: Do not include <kernel-features.h>. (__ASSUME_ATFCTS): Do not undefine and redefine. * sysdeps/unix/sysv/linux/alpha/fxstatat.c [__ASSUME_ATFCTS] (__have_atfcts): Remove conditional definition. (__fxstatat([__NR_fstatat64]: Make code unconditional. (__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code and code unreachable if [__ASSUME_ATFCTS]. * sysdeps/unix/sysv/linux/dl-fxstatat64.c (__ASSUME_ATFCTS): Do not undefine and redefine. * sysdeps/unix/sysv/linux/faccessat.c: Do not include <kernel-features.h>. (faccessat) [__NR_faccessat]: Make code unconditional. (faccessat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/fchmodat.c: Do not include <kernel-features.h>. (fchmodat) [__NR_fchmodat]: Make code unconditional. (fchmodat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/fchownat.c: Do not include <kernel-features.h>. (fchownat) [__NR_fchownat]: Make code unconditional. (fchownat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/futimesat.c: Do not include <kernel-features.h>. (futimesat) [__NR_futimesat]: Make code unconditional. (futimesat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/fxstatat.c: Do not include <kernel-features.h>. (__fxstatat) [__NR_newfstatat]: Make code unconditional. (__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/fxstatat64.c: Do not include <kernel-features.h>. (__fxstatat64) [__NR_fstatat64]: Make code unconditional. (__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/i386/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/i386/fxstatat.c: Do not include <kernel-features.h>. (__fxstatat) [__NR_fstatat64]: Make code unconditional. (__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/linkat.c: Do not include <kernel-features.h>. (linkat) [__NR_linkat]: Make code unconditional. (linkat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/m68k/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include <kernel-features.h>. (__fxstatat64) [__NR_newfstatat]: Make code unconditional. (__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/mkdirat.c: Do not include <kernel-features.h>. (mkdirat) [__NR_mkdirat]: Make code unconditional. (mkdirat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/openat.c: Do not include <kernel-features.h>. [!__ASSUME_ATFCTS] (__atfct_seterrno): Remove function. [!__ASSUME_ATFCTS] (__have_atfcts): Remove variable. (OPENAT_NOT_CANCEL) [__NR_openat]: Make code unconditional. (OPENAT_NOT_CANCEL) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/powerpc/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/readlinkat.c: Do not include <kernel-features.h>. (readlinkat) [__NR_readlinkat]: Make code unconditional. (readlinkat) [!__ASSUME_ATFCTS]: Remove conditional code. Return result of INLINE_SYSCALL directly, not via int variable. * sysdeps/unix/sysv/linux/renameat.c: Do not include <kernel-features.h>. [!__ASSUME_ATFCTS] (__atfct_seterrno_2): Remove function. (renameat) [__NR_renameat]: Make code unconditional. (renameat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/sh/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: Remove file. * sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c (__ASSUME_ATFCTS): Do not undefine and redefine. * sysdeps/unix/sysv/linux/symlinkat.c: Do not include <kernel-features.h>. (symlinkat) [__NR_symlinkat]: Make code unconditional. (symlinkat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/unlinkat.c: Do not include <kernel-features.h>. (unlinkat) [__NR_unlinkat]: Make code unconditional. (unlinkat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/wordsize-64/dl-fxstatat64.c (__ASSUME_ATFCTS): Do not undefine and redefine. * sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Do not include <kernel-features.h>. (__fxstatat) [__NR_newfstatat]: Make code unconditional. (__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code. * sysdeps/unix/sysv/linux/xmknodat.c: Do not include <kernel-features.h>. (__xmknodat) [__NR_mknodat]: Make code unconditional. (__xmknodat) [!__ASSUME_ATFCTS]: Remove conditional code.
* Use glibc_likely instead __builtin_expect.Ondřej Bílka2014-02-101-3/+3
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Remove __ptrvalue, __bounded and __unbounded.Joseph Myers2013-02-131-2/+2
|
* Remove CHECK_1 and CHECK_1_NULL_OK.Joseph Myers2013-02-081-3/+2
|
* Remove CHECK_STRING, CHECK_STRING_NULL_OK and __ubp_memchr.Joseph Myers2013-02-041-6/+4
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Include string.h in sysdeps/unix/sysv/linux/fxstatat.c.Joseph Myers2012-11-171-1/+2
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* Fix compat handling in *at functions.Ulrich Drepper2009-10-291-1/+7
| | | | | When passed an empty string for the filename, the compat code using /proc in all *at functions did the wrong thing.
* * nscd/servicescache.c: Include kernel-features.h.Ulrich Drepper2007-08-131-1/+2
| | | | | | | | | | | | | * nscd/gai.c: Likewise. * sysdeps/unix/sysv/linux/statfs64.c: Likewise. * sysdeps/unix/sysv/linux/fstatfs64.c: Likewise. * sysdeps/unix/sysv/linux/fxstatat.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/mmap.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S: Likewise. * sysdeps/unix/sysv/linux/xstatconv.c: Likewise. * sysdeps/unix/sysv/linux/if_index.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/xstat.c: Likewise. * sysdeps/unix/sysv/linux/ifaddrs.c: Likewise.
* [BZ #2226]Ulrich Drepper2006-02-121-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-02-12 Ulrich Drepper <drepper@redhat.com> * io/ftw.c: Start using *at functions. * io/ftw64.c: Likewise. * sysdeps/generic/not-cancel.h: Define openat_not_cancel, openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3. * sysdeps/unix/sysv/linux/not-cancel.h: Likewise. * sysdeps/unix/sysv/linux/openat.c: Create separate _nocancel functions. * io/fxstatat.c: Add __fxstatat alias. * sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Likewise. * sysdeps/unix/sysv/linux/fxstatat.c: Likewise. Add support for newfstatat syscall. * sysdeps/unix/sysv/linux/i386/fxstatat.c: Add __fxstatat alias. Add support for fstatat64 syscall. * include/sys/stat.h: Declare __fxstatat. * io/fxstatat64.c: Add __fxstatat64 alias. * sysdeps/unix/sysv/linux/fxstatat64.c: Add support for fstatat64 syscall. * dirent/fdopendir.c: Add __fdopendir alias. * sysdeps/unix/fdopendir.c: Likewise. * sysdeps/mach/hurd/fdopendir.c: Likewise. * include/dirent.h: Add __fdopendir declaration. [BZ #2226] * libio/wgenops.c (_IO_wsetb): Use correct size of wide char buffer in FREE_BUF call.
* * sysdeps/unix/sysv/linux/i386/fxstatat.c [XSTAT_IS_STAT64]Roland McGrath2006-02-011-0/+1
| | | | | | | | | (__fxstatat64): Add libc_hidden_ver. * sysdeps/unix/sysv/linux/fxstatat.c [XSTAT_IS_STAT64] (__fxstatat64): Likewise. * sysdeps/sparc/sparc64/jmpbuf-unwind.h: Remove jmpbuf-offsets.h include.
* * sysdeps/unix/sysv/linux/fxstatat.c [STAT_IS_KERNEL_STAT]Ulrich Drepper2006-01-191-4/+6
| | | | (__fxstatat): Correct handling of invalid vers values.
* * io/Makefile (routines): Add fstatat, fstatat64, fxstatat, fxstatat64,Ulrich Drepper2005-11-111-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fchownat, and unlinkat. (static-only-routines): Add fstatat and fstatat64. (tests): Add tst-unlinkat, tst-fstatat, tst-futimesat, tst-renameat, and tst-fchownat. * io/Versions [GLIBC_2.4]: Add fchownat, __fxstatat, __fxstatat64, and unlinkat. * io/fcntl.h: Define AT_FDCWD, AT_SYMLINK_NOFOLLOW, and AT_REMOVEDIR. * io/fstatat.c: New file. * io/fstatat64.c: New file. * io/sys/stat.h: Declare fstatat, fstatat64, __fxstatat, __fxstatat64 and define fstatat and fstatat64 inline functions. * libio/stdio.h: Declare renameat. * misc/Makefile (routines): Add futimesat. * misc/Versions [GLIBC_2.4]: Add futimesat. * posix/unistd.h: Declare fchownat and unlinkat. * stdio-common/Makefile (routines): Add renameat. * stdio-common/Versions [GLIBC_2.4]: Add renameat. * sysdeps/generic/fchownat.c: New file. * sysdeps/generic/futimesat.c: New file. * sysdeps/generic/fxstatat.c: New file. * sysdeps/generic/fxstatat64.c: New file. * sysdeps/generic/renameat.c: New file. * sysdeps/generic/unlinkat.c: New file. * sysdeps/unix/sysv/linux/fchownat.c: New file. * sysdeps/unix/sysv/linux/futimesat.c: New file. * sysdeps/unix/sysv/linux/fxstatat.c: New file. * sysdeps/unix/sysv/linux/fxstatat64.c: New file. * sysdeps/unix/sysv/linux/renameat.c: New file. * sysdeps/unix/sysv/linux/unlinkat.c: New file. * sysdeps/unix/sysv/linux/alpha/fxstatat.c: New file. * sysdeps/unix/sysv/linux/i386/fchownat.c: New file. * sysdeps/unix/sysv/linux/i386/fxstatat.c: New file. * sysdeps/unix/sysv/linux/m68k/fchownat.c: New file. * sysdeps/unix/sysv/linux/m68k/fxstatat.c: New file. * sysdeps/unix/sysv/linux/powerpc/fchownat.c: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fxstatat.c: New file. * sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c: New file. * sysdeps/unix/sysv/linux/s390/s390-32/fxstatat.c: New file. * sysdeps/unix/sysv/linux/sh/fchownat.c: New file. * sysdeps/unix/sysv/linux/sh/fxstatat.c: New file. * sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: New file. * sysdeps/unix/sysv/linux/sparc/sparc32/fxstatat.c: New file. * sysdeps/unix/sysv/linux/sparc/sparc64/fxstatat.c: New file. * sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: New file. * sysdeps/unix/sysv/linux/wordsize-64/fxstatat64.c: New file. * time/sys/time.h: Declare futimesat. * include/fcntl.h: Declare __atfct_seterrno. * sysdeps/unix/sysv/linux/openat.c (__atfct_seterrno): New function. Split out from openat code and called. (do_test): Allow openat to fail with ENOSYS. Handle AT_FDCWD. * sysdeps/generic/openat.c: Handle AT_FDCWD. * sysdeps/generic/openat64.c: Likewise. * io/tst-unlinkat.c: New file. * io/tst-fstatat.c: New file. * io/tst-futimesat.c: New file. * io/tst-renameat.c: New file. * io/tst-fchownat.c: New file. * io/tst-openat.c: Don't fail if openat is not implemented. * sysdeps/unix/sysv/linux/powerpc/chown.c: Don't provide backward compatibility code if new kernel is guaranteed. * time/sys/time.h: Add a few nonnull attributes.
* (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.Ulrich Drepper2004-12-221-141/+0
|
* 2.5-18.1Jakub Jelinek2007-07-121-0/+141