about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
Commit message (Collapse)AuthorAgeFilesLines
* Linux: Move mq_notify from librt to libcFlorian Weimer2021-06-2563-66/+87
| | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. An explicit call from fork into the mq_notify implementation replaces the previous use of pthread_atfork. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_getattr from librt to libcFlorian Weimer2021-06-2563-31/+71
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_setattr from librt to libcFlorian Weimer2021-06-2564-32/+97
| | | | | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. To introduce the proper symbol versioning, the implementation of the system call wrapper us moved to a C file. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move mq_close from librt to libcFlorian Weimer2021-06-2563-31/+70
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move lio_listio, lio_listio64 from librt to libcFlorian Weimer2021-06-2562-94/+194
| | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Placeholder symbols are needed on some architectures, to keep the GLIBC_2.1 and GLIBC_2.4 symbol versions around. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* rt: Rework lio_listio implementationFlorian Weimer2021-06-252-14/+0
| | | | | | | | Move the common code into rt/lio_listio-common.c and include the file in both rt/lio_listio.c and rt/lio_listio64.c. The common code automatically defines both public symbols for __WORDSIZE == 64. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_write, aio_write64 into libcFlorian Weimer2021-06-2564-68/+128
| | | | | | | | | | | Both symbols have to be moved at the same time because they are intertwined for __WORDSIZE == 64. The treatment of this case is also changed to match more closely how the other files suppress the declaration of the *64 identifier. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_suspend, aio_suspend64, __aio_suspend_time64 to libcFlorian Weimer2021-06-2563-78/+148
| | | | | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. There is a minor oddity here: This is generic code shared with Hurd, and Hurd does not have time64 support. This is why the versioned_symbol export for __aio_suspend_time64 is restricted to the PTHREAD_IN_LIBC code. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_return, aio_return64 into libcFlorian Weimer2021-06-2562-60/+128
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_read, aio_read64 into libcFlorian Weimer2021-06-2564-68/+128
| | | | | | | | | | | Both symbols have to be moved at the same time because they are intertwined for __WORDSIZE == 64. The treatment of this case is also changed to match more closely how the other files suppress the declaration of the *64 identifier. The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_fsync, aio_fsync64 into libcFlorian Weimer2021-06-2562-60/+128
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_error, aio_error64 into libcFlorian Weimer2021-06-2562-60/+128
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Linux: Move aio_cancel, aio_cancel64 into libcFlorian Weimer2021-06-2568-93/+226
| | | | | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. A version placeholder symbol is needed on alpha and sparc because of the additional symbols formerly at version GLIBC_2.3. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>:
* Linux: Move aio_init from librt into libcFlorian Weimer2021-06-2564-36/+71
| | | | | | | | | This commit also moves the aio_misc and aio_sigquue helper, so GLIBC_PRIVATE exports need to be added. The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* posix: Consolidate fork implementationAdhemerval Zanella2021-06-241-0/+3
| | | | | | | | | | | | | | | | The Linux nptl implementation is used as base for generic fork implementation to handle the internal locks and mutexes. The system specific bits are moved a new internal _Fork symbol. (This new implementation will be used to provide a async-signal-safe _Fork now that POSIX has clarified that fork might not be async-signal-safe [1]). For Hurd it means that the __nss_database_fork_prepare_parent and __nss_database_fork_subprocess will be run in a slight different order. [1] https://austingroupbugs.net/view.php?id=62
* linux: Only use 64-bit syscall if required for clock_nanosleepAdhemerval Zanella2021-06-221-21/+25
| | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for utimensat familyAdhemerval Zanella2021-06-221-13/+18
| | | | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. The large timeout are already tests by io/tst-utimensat-skeleton.c. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for sigtimedwaitAdhemerval Zanella2021-06-223-9/+36
| | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for mq_timedsendAdhemerval Zanella2021-06-221-16/+19
| | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for mq_timedreceiveAdhemerval Zanella2021-06-221-16/+19
| | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for timerfd_settimeAdhemerval Zanella2021-06-223-13/+48
| | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for semtimedopAdhemerval Zanella2021-06-221-23/+30
| | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: timerfd_gettime minor cleanupAdhemerval Zanella2021-06-221-5/+4
| | | | | | The __NR_timerfd_gettime64 is always defined. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Remove time64-supportAdhemerval Zanella2021-06-223-94/+1
| | | | | | | | | | | | It breaks the usage case of live migration like CRIU or similar and most usages can be optimized away by either building glibc with a minimum 5.1 kernel or by using the 32-bit syscall for the common case. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Remove supports_time64 () from clock_gettimeAdhemerval Zanella2021-06-221-10/+4
| | | | | | | | | | | It breaks the usage case of live migration like CRIU or similar. The performance drawback is it would require an extra syscall on older kernels without 64-bit time support. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Remove supports_time64 () from clock_getresAdhemerval Zanella2021-06-221-11/+5
| | | | | | | | | | | It breaks the usage case of live migration like CRIU or similar. The performance drawback is it would require an extra syscall on older kernels without 64-bit time support. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for selectAdhemerval Zanella2021-06-221-35/+37
| | | | | | | | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. This also avoids the need to use supports_time64() (which breaks the usage case of live migration like CRIU or similar). It also fixes an issue on 32-bit select call for !__ASSUME_PSELECT (microblase with older kernels only) where the expected timeout is a 'struct timeval' instead of 'struct timespec'. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for pselectAdhemerval Zanella2021-06-223-27/+29
| | | | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. This also avoids the need to use supports_time64() (which breaks the usage case of live migration like CRIU or similar). Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Only use 64-bit syscall if required for ppollAdhemerval Zanella2021-06-223-25/+39
| | | | | | | | | | | | | For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. This also avoids the need to use supports_time64() (which breaks the usage case of live migration like CRIU or similar). Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* Use 64 bit time_t stat internallyAdhemerval Zanella2021-06-226-25/+21
| | | | | | | | | | 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>
* Add hidden prototypes for fsync, fdatasyncFlorian Weimer2021-06-222-0/+2
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthreadP.h into sysdeps directoryFlorian Weimer2021-06-229-9/+9
| | | | | | | | This mirrors the situation on Hurd. These directories are on the include search part, so #include <pthreadP.h> works after this change on both Hurd and nptl. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* rt: Move generic implementation from sysdeps/pthread to rtFlorian Weimer2021-06-225-7/+7
| | | | | | | | | | | | | | | | | | The pthread-based implementation is the generic one. Replacing the stubs makes it clear that they do not have to be adjusted for the libpthread move. Result of: git mv -f sysdeps/pthread/aio_misc.h sysdeps/generic/ git mv sysdeps/pthread/timer_routines.c sysdeps/htl/ git mv -f sysdeps/pthread/{aio,lio,timer}_*.c rt/ Followed by manual adjustment of the #include paths in sysdeps/unix/sysv/linux/wordsize-64, and a move of the version definitions formerly in sysdeps/pthread/Versions. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* rt: Move shm_unlink into libcFlorian Weimer2021-06-2162-30/+64
| | | | | | | | | This function has no dependency on libpthread, so the move is also applied to Hurd. The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* rt: Move shm_open into libcFlorian Weimer2021-06-2162-30/+64
| | | | | | | | | | | | This function has no dependency on libpthread, so the move is also applied to Hurd. To avoid localplt failures, use __open64_nocancel instead of pthread_setcancelstate and open. The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Export _pthread_cleanup_push, _pthread_cleanup_pop againFlorian Weimer2021-06-1532-0/+64
| | | | | | | | | | These were turned into compat symbols as part of the libpthread move. It turns out they are used by language run-time libraries (e.g., the GCC D front end), so it makes to preserve them as external symbols even though they are not declared in any header file. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* s390x: Align child stack while clone. [BZ #27968]Stefan Liebler2021-06-152-6/+10
| | | | | | | | | Starting with recent commit 92a7d1343991897f77afe01041f3b77712445e47 "x86-64: Align child stack to 16 bytes [BZ #27902]" the new test misc/tst-misalign-clone has failed on s390x/s390. This patch is now aligning the stack to a double word boundary as also done in start.S files.
* y2038: Add test coverageAdhemerval Zanella2021-06-159-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1520-0/+40
| | | | | | | | | | | 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-1520-0/+100
| | | | | | | | | | | 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>
* posix: Add glob64 with 64-bit time_t supportAdhemerval Zanella2021-06-1527-16/+146
| | | | | | | | | | | The glob might pass a different stat struct for gl_stat and gl_lstat when GLOB_ALTDIRFUNC is used. This requires add a new 64-bit time version that also uses 64-bit time stat functions. Checked on i686-linux-gnu and x86_64-linux-gnu. 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-1581-18/+1604
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 socket-constants.hAdhemerval Zanella2021-06-155-16/+175
| | | | | | | | | | | | | | It is only used for !__USE_MISC, the default way uses the kernel headers. The patch also adds the SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING which uses new values for 64-bit time_t kernel interfaces. The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* y2038: Use a common definition for shmid_dsAdhemerval Zanella2021-06-158-26/+68
| | | | | | | | | | | | Instead of replicate the same definitions from struct_shmid64_ds.h on the multiple struct_shmid_ds.h, use a common header which is included when required (struct_shmid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit semctl implementation. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* y2038: Use a common definition for semid_dsAdhemerval Zanella2021-06-159-14/+61
| | | | | | | | | | | | Instead of replicate the same definitions from struct_semid64_ds.h on the multiple struct_semid_ds.h, use a common header which is included when required (struct_semid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit semctl implementation. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* y2038: Use a common definition for msqid_dsLukasz Majewski2021-06-158-28/+81
| | | | | | | | | | | | Instead of replicate the same definitions from struct_msqid64_ds.h on the multiple struct_msqid_ds.h, use a common header which is included when required (struct_msqid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* y2038: Use a common definition for statLukasz Majewski2021-06-1510-243/+320
| | | | | | | | | | | | | Instead of replicate the same definitions from struct_stat_time64.h on the multiple struct_stat.h, use a common header which is included when required (struct_stat_time64_helper.h). The 64-bit time support is added only for LFS support. The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* y2038: linux: Add __USE_TIME_BITS64 support for struct timexAdhemerval Zanella2021-06-151-0/+31
| | | | | | | | 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>
* linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS}Adhemerval Zanella2021-06-151-2/+15
| | | | | | | | | | | | | | | | | | | | | | Handle the SO_TIMESTAMP{NS} similar to recvmsg: for !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer if has extra space or returns MSG_CTRUNC otherwise. The 32-bit time field is kept as-is. Also for !__ASSUME_TIME64_SYSCALLS it limits the maximum number of 'struct mmsghdr *' to IOV_MAX (and also increases the stack size requirement to IOV_MAX times sizeof (socklen_t)). The Linux imposes a similar limit to sendmmsg, so bound the array size on recvmmsg is not unreasonable. And this will be used only on older when building with 32-bit time support. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}Adhemerval Zanella2021-06-1510-7/+162
| | | | | | | | | | | | | | | | | | | | | | The recvmsg handling is more complicated because it requires check the returned kernel control message and make some convertions. For !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer if has extra space or returns MSG_CTRUNC otherwise. The 32-bit time field is kept as-is. Calls with __TIMESIZE=32 will see the converted 64-bit time control messages as spurious control message of unknown type. Calls with __TIMESIZE=64 running on pre-time64 kernels will see the original message as a spurious control ones of unknown typ while running on kernel with native 64-bit time support will only see the time64 version of the control message. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>