summary refs log tree commit diff
path: root/io
Commit message (Collapse)AuthorAgeFilesLines
* io: Add time64 alias for fcntlFlorian Weimer2021-07-213-7/+23
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* io: Add closefrom [BZ #10353]Adhemerval Zanella2021-07-084-1/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function closes all open file descriptors greater than or equal to input argument. Negative values are clamped to 0, i.e, it will close all file descriptors. As indicated by the bug report, this is a common symbol provided by different systems (Solaris, OpenBSD, NetBSD, FreeBSD) and, although its has inherent issues with not taking in consideration internal libc file descriptors (such as syslog), this is also a common feature used in multiple projects [1][2][3][4][5]. The Linux fallback implementation iterates over /proc and close all file descriptors sequentially. Although it was raised the questioning whether getdents on /proc/self/fd might return disjointed entries when file descriptor are closed; it does not seems the case on my testing on multiple kernel (v4.18, v5.4, v5.9) and the same strategy is used on different projects [1][2][3][5]. Also, the interface is set a fail-safe meaning that a failure in the fallback results in a process abort. Checked on x86_64-linux-gnu and i686-linux-gnu on kernel 5.11 and 4.15. [1] https://github.com/systemd/systemd/blob/5238e9575906297608ff802a27e2ff9effa3b338/src/basic/fd-util.c#L217 [2] https://github.com/lxc/lxc/blob/ddf4b77e11a4d08f09b7b9cd13e593f8c047edc5/src/lxc/start.c#L236 [3] https://github.com/python/cpython/blob/9e4f2f3a6b8ee995c365e86d976937c141d867f8/Modules/_posixsubprocess.c#L220 [4] https://github.com/rust-lang/rust/blob/5f47c0613ed4eb46fca3633c1297364c09e5e451/src/libstd/sys/unix/process2.rs#L303-L308 [5] https://github.com/openjdk/jdk/blob/master/src/java.base/unix/native/libjava/childproc.c#L82
* hurd: Fix build after 52a5fe70a2Adhemerval Zanella2021-06-231-2/+4
| | | | Hurd does not support 64-bit time_t internally.
* Use 64 bit time_t stat internallyAdhemerval Zanella2021-06-223-10/+10
| | | | | | | | | | For the legacy ABI with supports 32-bit time_t it calls the 64-bit time directly, since the LFS symbols calls the 64-bit time_t ones internally. Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* y2038: Add test coverageAdhemerval Zanella2021-06-1518-26/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is enabled through a new rule, tests-y2038, which is built only when the ABI supports the comapt 64-bit time_t (defined by the header time64-compat.h, which also enables the creation of the symbol Version for Linux). It means the tests are not built for ABI which already provide default 64-bit time_t. The new rule already adds the required LFS and 64-bit time_t compiler flags. The current coverage is: * libc: - adjtime tst-adjtime-time64 - adjtimex tst-adjtimex-time64 - clock_adjtime tst-clock_adjtime-time64 - clock_getres tst-clock-time64, tst-cpuclock1-time64 - clock_gettime tst-clock-time64, tst-clock2-time64, tst-cpuclock1-time64 - clock_nanosleep tst-clock_nanosleep-time64, tst-cpuclock1-time64 - clock_settime tst-clock2-time64 - cnd_timedwait tst-cnd-timedwait-time64 - ctime tst-ctime-time64 - ctime_r tst-ctime-time64 - difftime tst-difftime-time64 - fstat tst-stat-time64 - fstatat tst-stat-time64 - futimens tst-futimens-time64 - futimes tst-futimes-time64 - futimesat tst-futimesat-time64 - fts_* tst-fts-time64 - getitimer tst-itimer-timer64 - getrusage - gettimeofday tst-clock_nanosleep-time64 - glob / globfree tst-gnuglob64-time64 - gmtime tst-gmtime-time64 - gmtime_r tst-gmtime-time64 - lstat tst-stat-time64 - localtime tst-y2039-time64 - localtime_t tst-y2039-time64 - lutimes tst-lutimes-time64 - mktime tst-mktime4-time64 - mq_timedreceive tst-mqueue{1248}-time64 - mq_timedsend tst-mqueue{1248}-time64 - msgctl test-sysvmsg-time64 - mtx_timedlock tst-mtx-timedlock-time64 - nanosleep tst-cpuclock{12}-time64, tst-mqueue8-time64, tst-clock-time64 - nftw / ftw ftwtest-time64 - ntp_adjtime tst-ntp_adjtime-time64 - ntp_gettime tst-ntp_gettime-time64 - ntp_gettimex tst-ntp_gettimex-time64 - ppoll tst-ppoll-time64 - pselect tst-pselect-time64 - pthread_clockjoin_np tst-join14-time64 - pthread_cond_clockwait tst-cond11-time64 - pthread_cond_timedwait tst-abstime-time64 - pthread_mutex_clocklock tst-abstime-time64 - pthread_mutex_timedlock tst-abstime-time64 - pthread_rwlock_clockrdlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_clockwrlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_timedrdlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_timedwrlock tst-abstime-time64, tst-rwlock14-time64 - pthread_timedjoin_np tst-join14-time64 - recvmmsg tst-cancel4_2-time64 - sched_rr_get_interval tst-sched_rr_get_interval-time64 - select tst-select-time64 - sem_clockwait tst-sem5-time64 - sem_timedwait tst-sem5-time64 - semctl test-sysvsem-time64 - semtimedop test-sysvsem-time64 - setitimer tst-mqueue2-time64, tst-itimer-timer64 - settimeofday tst-settimeofday-time64 - shmctl test-sysvshm-time64 - sigtimedwait tst-sigtimedwait-time64 - stat tst-stat-time64 - thrd_sleep tst-thrd-sleep-time64 - time tst-mqueue{1248}-time64 - timegm tst-timegm-time64 - timer_gettime tst-timer4-time64 - timer_settime tst-timer4-time64 - timerfd_gettime tst-timerfd-time64 - timerfd_settime tst-timerfd-time64 - timespec_get tst-timespec_get-time64 - timespec_getres tst-timespec_getres-time64 - utime tst-utime-time64 - utimensat tst-utimensat-time64 - utimes tst-utimes-time64 - wait3 tst-wait3-time64 - wait4 tst-wait4-time64 * librt: - aio_suspend tst-aio6-time64 - mq_timedreceive tst-mqueue{1248}-time64 - mq_timedsend tst-mqueue{1248}-time64 - timer_gettime tst-timer4-time64 - timer_settime tst-timer4-time64 * libanl: - gai_suspend Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* io: Add ftw64 with 64-bit time_t supportAdhemerval Zanella2021-06-154-6/+83
| | | | | | | | | | | Similar to fts, ftw routines passes a stat pointer that might differ of size and layout when 64-bit time API is used. Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* io: Add fts64 with 64-bit time_t supportAdhemerval Zanella2021-06-153-6/+76
| | | | | | | | | | | Similar to glob, fts routines passes a stat pointer that might differ of size and layout when 64-bit time API is used. Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* y2038: Add support for 64-bit time on legacy ABIsAdhemerval Zanella2021-06-153-10/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new build flag, _TIME_BITS, enables the usage of the newer 64-bit time symbols for legacy ABI (where 32-bit time_t is default). The 64 bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is also used. Different than LFS support, the y2038 symbols are added only for the required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32, mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh). The ABIs with 64-bit time support are unchanged, both for symbol and types redirection. On Linux the full 64-bit time support requires a minimum of kernel version v5.1. Otherwise, the 32-bit fallbacks are used and might results in error with overflow return code (EOVERFLOW). The i686-gnu does not yet support 64-bit time. This patch exports following rediretions to support 64-bit time: * libc: adjtime adjtimex clock_adjtime clock_getres clock_gettime clock_nanosleep clock_settime cnd_timedwait ctime ctime_r difftime fstat fstatat futimens futimes futimesat getitimer getrusage gettimeofday gmtime gmtime_r localtime localtime_r lstat_time lutimes mktime msgctl mtx_timedlock nanosleep nanosleep ntp_gettime ntp_gettimex ppoll pselec pselect pthread_clockjoin_np pthread_cond_clockwait pthread_cond_timedwait pthread_mutex_clocklock pthread_mutex_timedlock pthread_rwlock_clockrdlock pthread_rwlock_clockwrlock pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock pthread_timedjoin_np recvmmsg sched_rr_get_interval select sem_clockwait semctl semtimedop sem_timedwait setitimer settimeofday shmctl sigtimedwait stat thrd_sleep time timegm timerfd_gettime timerfd_settime timespec_get utime utimensat utimes utimes wait3 wait4 * librt: aio_suspend mq_timedreceive mq_timedsend timer_gettime timer_settime * libanl: gai_suspend Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* y2038: Add __USE_TIME_BITS64 support for struct utimbufAdhemerval Zanella2021-06-151-0/+5
| | | | | | | | The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* io: Fix sporadic test failures in io/tst-statFlorian Weimer2021-06-101-4/+4
| | | | | | | | support_stat_nanoseconds cannot restore the ctime time, and this may lead to sporadic test failures. Therefore, probe for nanoseconds support before the initial statx call. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Add missing symbols to Version filesFlorian Weimer2021-06-021-0/+1
| | | | | | | | | Some symbols have explicit versioned_symbol or compat_symbol markers in the sources, but no corresponding entry in the Versions files. This presently works because the local: * directive is only applied to the base version. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Annotate additional APIs with GCC attribute access.Martin Sebor2021-05-062-6/+11
| | | | | | | | | | | | | | | | This change continues the improvements to compile-time out of bounds checking by decorating more APIs with either attribute access, or by explicitly providing the array bound in APIs such as tmpnam() that expect arrays of some minimum size as arguments. (The latter feature is new in GCC 11.) The only effects of the attribute and/or the array bound is to check and diagnose calls to the functions that fail to provide a sufficient number of elements, and the definitions of the functions that access elements outside the specified bounds. (There is no interplay with _FORTIFY_SOURCE here yet.) Tested with GCC 7 through 11 on x86_64-linux.
* io: Use temporary directory and file for ftwtest-shAdhemerval Zanella2021-04-151-123/+119
| | | | | | | | It allows run it in parallel. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* io: Add basic tests for utimensatAdhemerval Zanella2021-04-152-0/+71
| | | | | | Checked on x86_64-linux-gnu and i686-linux-gnu Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Add lutimes testAdhemerval Zanella2021-04-157-5/+64
| | | | | | | | It uses stat to compare against the values set by lutimes. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Add futimes testAdhemerval Zanella2021-04-152-0/+47
| | | | | | | | It uses stat to compare against the values set by futimes. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* io: Move file timestamps tests out of LinuxAdhemerval Zanella2021-04-155-1/+232
| | | | | | | | | | | | Now that libsupport abstract Linux possible missing support (either due FS limitation that can't handle 64 bit timestamp or architectures that do not handle values larger than unsigned 32 bit values) the tests can be turned generic. Checked on x86_64-linux-gnu and i686-linux-gnu. I also built the tests for i686-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* sys: Fixes possible typo in comment: statfs -> statvfsHugo Gabriel Eyherabide2021-04-071-1/+1
|
* socket: Add CFLAGS-accept.c and CFLAGS-connect.cAdhemerval Zanella2021-04-011-2/+0
| | | | | | | | The c59f716993 (accept) and 3ddf9bc185 (connect) added on io/Makefile instead of socket/Makefile. Checked on arm-linux-gnueabihf (where without the flags both the tst-cancelx4 and tst-cancelx5 fails).
* io: fix spelling typo in diagnosticPaul Eggert2021-03-311-1/+1
|
* io: Check at runtime if timestamp supports nanosecondsAdhemerval Zanella2021-03-311-1/+6
| | | | | | | | Now that non-LFS stat function is implemented on to on LFS, it will use statx when available. It allows to check for nanosecond timestamp if the kernel supports __NR_statx. Checked on s390-linux-gnu with 4.12.14 kernel.
* S390: Don't test nanoseconds in io/tst-stat.cStefan Liebler2021-03-261-2/+5
| | | | | | | | | | | Both new tests io/tst-stat and io/tst-stat-lfs (_FILE_OFFSET_BITS=64) are comparing the nanosecond fields with the statx result. Unfortunately on s390(31bit) those fields are always zero if old KABI with non-LFS support is used. With _FILE_OFFSET_BITS=64 stat is using statx internally. As suggested by Adhemerval this patch disables the nanosecond check for s390(31bit). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Remove connect from libpthreadAdhemerval Zanella2021-03-181-0/+1
| | | | | | The libc version is identical and built with same flags. Checked on x86_64-linux-gnu.
* nptl: Remove accept from libpthreadAdhemerval Zanella2021-03-181-0/+1
| | | | | | The libc version is identical and built with same flags. Checked on x86_64-linux-gnu.
* nptl: Remove close from libpthreadAdhemerval Zanella2021-03-181-0/+1
| | | | | | The libc version is identical and built with same flags. Checked on x86_64-linux-gnu.
* nptl: Remove read from libpthreadAdhemerval Zanella2021-03-181-1/+1
| | | | | | The libc version is identical and built with same flags. Checked on x86_64-linux-gnu.
* nptl: Remove write from libpthreadAdhemerval Zanella2021-03-181-1/+1
| | | | | | The libc version is identical and built with same flags. Checked on x86_64-linux-gnu.
* io: Return EBAFD for negative file descriptor on fstat (BZ #27559)Adhemerval Zanella2021-03-115-1/+117
| | | | | | | | Now that fstat is implemented on top fstatat we need to handle negative inputs. The implementation now rejects AT_FDCWD, which would otherwise be accepted by the kernel. Checked on x86_64-linux-gnu and on i686-linux-gnu.
* Update STATX_ATTR_DAX value from Linux 5.10.Joseph Myers2021-01-111-1/+1
| | | | | | | | This patch updates the value of STATX_ATTR_DAX in bits/statx-generic.h for a change made in Linux 5.10. (As with previous such changes, this only does anything if glibc is being used with old kernel headers.) Tested for x86_64.
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-02135-135/+135
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* nonstring: Enable __FORTIFY_LEVEL=3Siddhesh Poyarekar2020-12-311-8/+10
| | | | | Use __builtin_dynamic_object_size in the remaining functions that don't have compiler builtins as is the case for string functions.
* io: Remove xmknod{at} implementationsAdhemerval Zanella2020-12-295-106/+7
| | | | | | | | | | With xmknod wrapper functions removed (589260cef8), the mknod functions are now properly exported, and version is done using symbols versioning instead of the extra _MKNOD_* argument. It also allows us to consolidate Linux and Hurd mknod implementation. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* io: Remove xstat implementationsAdhemerval Zanella2020-12-2917-339/+39
| | | | | | | | With xstat wrapper functions removed (8ed005daf0), the stat functions are now properly exported, and version is done using symbols versioning instead of the extra _STAT_* argument. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* io: nftw/ftw: Fix stack overflow with large nopenfd [BZ #26353]Xiaoming Ni2020-11-263-8/+81
| | | | | | | | | | | The nopenfd value is used as argument for the internal buffer on ftw_statup, which is allocated with alloca and might trigger a stack overflow for large values. This patch replaces the memory allocation to use malloc instead. Checked on x86_64-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Remove tls.h inclusion from internal errno.hAdhemerval Zanella2020-11-131-3/+1
| | | | | | | | | | | | The tls.h inclusion is not really required and limits possible definition on more arch specific headers. This is a cleanup to allow inline functions on sysdep.h, more specifically on i386 and ia64 which requires to access some tls definitions its own. No semantic changes expected, checked with a build against all affected ABIs.
* Remove mknod wrapper functions, move them to symbolsAdhemerval Zanella2020-10-095-96/+6
| | | | | | | | | | | | | | | | | | | This patch removes the mknod and mknodat static wrapper and add the symbols on the libc with the expected names. Both the prototypes of the internal symbol linked by the static wrappers and the inline redirectors are also removed from the installed sys/stat.h header file. The wrapper implementation license LGPL exception is also removed since it is no longer statically linked to binaries. Internally the _STAT_VER* definitions are moved to the arch-specific xstatver.h file. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* Remove stat wrapper functions, move them to exported symbolsAdhemerval Zanella2020-10-0911-363/+30
| | | | | | | | | | | | | | | | | | | | | | | | This patch removes the stat, stat64, lstat, lstat64, fstat, fstat64, fstatat, and fstatat64 static wrapper and add the symbol on the libc with the expected names. Both the prototypes of the internal symbol linked by the static wrappers and the inline redirectors are also removed from the installed sys/stat.h header file. The wrapper implementation license LGPL exception is also removed since it is no longer statically linked to binaries. Internally the _STAT_VER* definitions are moved to a arch-specific xstatver.h file. The internal defines that redirects internals {f}stat{at} to their {f}xstat{at} counterparts are removed for Linux (!NO_RTLD_HIDDEN). Hurd still requires them since {f}stat{at} pulls extra objects that makes the loader build fail otherwise (I haven't dig into why exactly). Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* nptl: Add missing cancellation flags on lockfAdhemerval Zanella2020-10-081-2/+2
| | | | | It also removes CFLAGS-lockf.c duplicate rule. It fixes nptl/tst-cancelx16 on mips64-linux-gnu.
* Remove internal usage of extensible stat functionsAdhemerval Zanella2020-09-1111-45/+47
| | | | | | | | | | | | It replaces the internal usage of __{f,l}xstat{at}{64} with the __{f,l}stat{at}{64}. It should not change the generate code since sys/stat.h explicit defines redirections to internal calls back to xstat* symbols. Checked with a build for all affected ABIs. I also check on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Remove __ASSUME_ATFCTSAdhemerval Zanella2020-09-021-5/+0
| | | | | | The __have_atfcts is not used anywhere. Checked on x86_64-linux-gnu.
* io/lockf: Include bits/types.h before __OFF_T_MATCHES_OFF64_T checkAlistair Francis2020-08-271-0/+2
| | | | | | | | | It's possible that although __OFF_T_MATCHES_OFF64_T is defined the included the relevent header file. This results in a io/tst-lockf failure for RV32 by calling the non 64-bit version of lockf. This patch fixes the failure by including bits/types.h. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Fix namespace violation in stdio.h and sys/stat.h if build with ↵Stefan Liebler2020-08-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimization. [BZ #26376] If build with optimization, stdio.h and sys/stat.h are defining some inlining functions. This leads to test fails if glibc is build with the following commands. (Note that the conformtests usually builds without optimization or other CFLAGS): <glibc>/configure CC="gcc -O3" --prefix=/usr make make subdirs=conform check - FAIL: conform/XPG4/stdio.h/conform - FAIL: conform/XPG42/stdio.h/conform out-files: ... PASSCOMBINED: Availability of variable optopt PASSCOMBINED: Type of variable optopt Namespace violation: "getc_unlocked" Namespace violation: "getchar_unlocked" Namespace violation: "putc_unlocked" Namespace violation: "putchar_unlocked" FAIL: Namespace of <stdio.h> ---------------------------------------------------------------------------- Total number of tests : 168 Number of failed tests : 1 Number of xfailed tests : 0 Number of skipped tests : 0 - FAIL: conform/POSIX2008/sys/stat.h/conform out-file: ... PASSCOMBINED: Availability of function utimensat PASSCOMBINED: Type of function utimensat Namespace violation: "mknodat" FAIL: Namespace of <sys/stat.h> ---------------------------------------------------------------------------- Total number of tests : 97 Number of failed tests : 1 Number of xfailed tests : 0 Number of skipped tests : 0 For getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked in stdio.h, those are defined "# ifdef __USE_POSIX" instead of "#ifdef __USE_POSIX199506" for the non-inlining declaration. See also "Bug 20014 - stdio.h namespace for pre-threads POSIX" (https://sourceware.org/bugzilla/show_bug.cgi?id=20014). For mknodat in sys/stat.h, those are defined "# ifdef __USE_ATFILE" instead of the additional guard "# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED".
* Add new STATX_* constants from Linux 5.8 to bits/statx-generic.h.Joseph Myers2020-08-191-0/+3
| | | | | | | | | | | | This patch adds the new STATX_MNT_ID, STATX_ATTR_MOUNT_ROOT and STATX_ATTR_DAX macros from Linux 5.8 to glibc's bits/statx-generic.h. (As with previous such changes, this only does anything if glibc is being used with old kernel headers.) A comment in the Linux kernel headers indicates that STATX_ALL is deliberately not being changed. Tested for x86_64.
* Suppress GCC 10 true positive warnings [BZ #25967]Martin Sebor2020-05-111-2/+19
| | | | | | | | | Suppress or avoid warnings in tests that exercise failure modes by making calls with invalid arguments. Reviewed-by: DJ Delorie <dj@redhat.com> Reviewed-by: Florian Weimer <fweimer@redhat.com> Reviewed-by: Joseph Myers <joseph@codesourcery.com>
* Linux: Work around kernel bugs in chmod on /proc/self/fd paths [BZ #14578]Florian Weimer2020-02-181-59/+21
| | | | | | | | | | It appears that the ability to change symbolic link modes through such paths is unintended. On several file systems, the operation fails with EOPNOTSUPP, even though the symbolic link permissions are updated. The expected behavior is a failure to update the permissions, without file system changes. Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
* Move implementation of <file_change_detection.h> into a C fileFlorian Weimer2020-02-184-31/+150
| | | | | | | | | | | file_change_detection_for_stat partially initialize struct file_change_detection in some cases, when the size member alone determines the outcome of all comparisons. This results in maybe-uninitialized compiler warnings in case of sufficiently aggressive inlining. Once the implementation is moved into a separate C file, this kind of inlining is no longer possible, so the compiler warnings are gone.
* Add STATX_ATTR_VERITY from Linux 5.5 to bits/statx-generic.h.Joseph Myers2020-02-131-0/+1
| | | | | | | | This patch adds the new STATX_ATTR_VERITY macro from Linux 5.5 to glibc's bits/statx-generic.h. (This only does anything if glibc is being used with old kernel headers.) Tested for x86_64.
* io: Add io/tst-lchmod covering lchmod and fchmodatFlorian Weimer2020-02-122-1/+315
|
* io: Implement lchmod using fchmodat [BZ #14578]Florian Weimer2020-02-122-6/+5
|
* Add internal <file_change_detection.h> header fileFlorian Weimer2020-02-122-1/+207
| | | | | | | | | | | The code started out with bits form resolv/resolv_conf.c, but it was enhanced to deal with directories and FIFOs in a more predictable manner. A test case is included as well. This will be used to implement the /etc/resolv.conf change detection. This currently lives in a header file only. Once there are multiple users, the implementations should be moved into C files.