glibc/sysdeps/unix/sysv/linux
Adhemerval Zanella 456b3c08b6 io: Refactor close_range and closefrom
Now that Hurd implementis both close_range and closefrom (f2c996597d),
we can make close_range() a base ABI, and make the default closefrom()
implementation on top of close_range().

The generic closefrom() implementation based on __getdtablesize() is
moved to generic close_range().  On Linux it will be overriden by
the auto-generation syscall while on Hurd it will be a system specific
implementation.

The closefrom() now calls close_range() and __closefrom_fallback().
Since on Hurd close_range() does not fail, __closefrom_fallback() is an
empty static inline function set by__ASSUME_CLOSE_RANGE.

The __ASSUME_CLOSE_RANGE also allows optimize Linux
__closefrom_fallback() implementation when --enable-kernel=5.9 or
higher is used.

Finally the Linux specific tst-close_range.c is moved to io and
enabled as default.  The Linuxism and CLOSE_RANGE_UNSHARE are
guarded so it can be built for Hurd (I have not actually test it).

Checked on x86_64-linux-gnu, i686-linux-gnu, and with a i686-gnu
build.
2021-11-24 09:09:37 -03:00
..
aarch64 setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
alpha setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
arc setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
arm setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
bits io: Refactor close_range and closefrom 2021-11-24 09:09:37 -03:00
csky setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
generic Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
hppa setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
i386 setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
ia64 setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
include Reduce <limits.h> pollution due to dynamic PTHREAD_STACK_MIN 2021-07-12 18:43:32 +02:00
m68k setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
microblaze setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
mips setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
net Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
netash
netatalk
netax25
neteconet
netinet
netipx
netiucv
netpacket
netrom
netrose
nfs
nios2 setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
powerpc setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
riscv setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
s390 setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
scsi
sh setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
sparc setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
sys Add PTRACE_GET_RSEQ_CONFIGURATION from Linux 5.13 to sys/ptrace.h 2021-08-09 16:51:38 +00:00
wordsize-64
x86 setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
x86_64 setjmp: Replace jmp_buf-macros.h with jmp_buf-macros.sym 2021-11-22 13:43:22 -03:00
Implies
Makefile io: Refactor close_range and closefrom 2021-11-24 09:09:37 -03:00
Versions socket: Add time64 alias for setsockopt 2021-07-22 19:16:26 +02:00
_G_config.h
_exit.c
a.out.h
accept.c
accept4.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
access.c
adjtime.c
adjtimex.c
aio_misc.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
aio_sigqueue.c
alphasort64.c
arch-fd_to_filename.h
arch-fork.h
bind.c
brk.c
check_native.c
check_pf.c
clock.c
clock_adjtime.c
clock_getcpuclockid.c
clock_getres.c
clock_gettime.c Linux: Use 32-bit vDSO for clock_gettime, gettimeofday, time (BZ# 28071) 2021-07-12 17:37:56 -03:00
clock_nanosleep.c
clock_settime.c
clone-internal.c Typo: Rename HAVE_CLONE3_WAPPER to HAVE_CLONE3_WRAPPER 2021-07-28 10:19:08 -07:00
clone3.c Add an internal wrapper for clone, clone2 and clone3 2021-07-14 06:33:58 -07:00
clone3.h Add an internal wrapper for clone, clone2 and clone3 2021-07-14 06:33:58 -07:00
close.c
close_nocancel.c
closedir.c
closefrom_fallback.c io: Refactor close_range and closefrom 2021-11-24 09:09:37 -03:00
cmsg_nxthdr.c
cnd_timedwait.c
configure
configure.ac
connect.c
convert_scm_timestamps.c linux: Use the expected size for SO_TIMESTAMP{NS} convertion 2021-07-06 11:45:35 -03:00
copy_file_range.c
creat.c
creat64.c
default-sched.h
device-nrs.h
dirfd.c
dirstream.h
dl-diagnostics-kernel.c
dl-execstack.c
dl-fxstatat64.c
dl-getcwd.c
dl-librecon.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
dl-openat64.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
dl-opendir.c
dl-origin.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
dl-osinfo.h
dl-sbrk.c
dl-sysdep.c
dl-sysdep.h
dl-vdso-setup.c powerpc: Remove backtrace implementation 2021-10-20 10:40:53 -03:00
dl-vdso-setup.h powerpc: Remove backtrace implementation 2021-10-20 10:40:53 -03:00
dl-vdso.h
dl-write.c
dl-writev.h
epoll_pwait.c
epoll_wait.c
errlist-compat.c
errlist-compat.h
errqueue.h
eventfd_read.c
eventfd_write.c
execveat.c
faccessat.c
fallocate.c
fallocate64.c
fatal-prepare.h
fchmodat.c
fcntl.c
fcntl64.c io: Add time64 alias for fcntl 2021-07-21 11:58:16 +02:00
fcntl_nocancel.c
fdatasync.c
fdopendir.c
features-time64.h
fexecve.c
filter-nr-syscalls.awk Update syscall lists for Linux 5.15 2021-11-10 15:21:19 +00:00
fips-private.h
fixup-asm-unistd.h
fpathconf.c
fstat.c
fstat64.c
fstatat.c
fstatat64.c
fstatfs.c
fstatfs64.c
fstatvfs.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fstatvfs64.c
fsync.c
ftime.c
ftruncate.c
ftruncate64.c
futimens.c
futimes.c
futimesat.c
fxstat.c
fxstat64.c
fxstatat.c
fxstatat64.c
gai_sigqueue.c
gen-syscall-h.awk
gentempfd.c
getclktck.c
getcpu.c
getcwd.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
getdents.c
getdents64.c
getdirentries.c
getdirentries64.c
getdtsz.c
getentropy.c
gethostid.c
getipv4sourcefilter.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
getitimer.c
getloadavg.c Linux: implement getloadavg(3) using sysinfo(2) 2021-10-08 09:52:19 -03:00
getlogin.c
getlogin_r.c
getpagesize.c
getpeername.c
getpriority.c
getpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
getrandom.c
getrlimit.c
getrlimit64.c
getrusage.c
getsockname.c
getsockopt.c socket: Add time64 alias for getsockopt 2021-07-22 19:16:25 +02:00
getsourcefilter.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
getsourcefilter.h
getsysstats.c linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310) 2021-09-27 09:18:43 -03:00
gettimeofday.c
glibcsyscalls.py Update syscall lists for Linux 5.15 2021-11-10 15:21:19 +00:00
glob-lstat-compat.c
glob.c
glob64-lstat-compat.c
glob64-time64.c
glob64.c
globfree.c
globfree64-time64.c
globfree64.c
grantpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
if_index.c
ifaddrs.c
ifreq.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
internal-signals.h
internal_statvfs.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
internal_statvfs.h
ipc_ops.h
ipc_priv.h
kernel-features.h io: Refactor close_range and closefrom 2021-11-24 09:09:37 -03:00
kernel-posix-cpu-timers.h
kernel-posix-timers.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
kernel_sigaction.h
kernel_stat.h
kernel_termios.h
kstat_cp.h
ldd-rewrite.sed
lddlibc4.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ldsodefs.h
libc-vdso.h
libc_fatal.c
libc_sigaction.c
librt-compat.c
linux_fsinfo.h
listen.c
local-setxid.h
lseek.c
lseek64.c
lstat.c
lstat64.c
lutimes.c
lxstat.c
lxstat64.c
malloc-sysdep.h
mknodat.c
mlock2.c
mmap.c
mmap64.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
mmap_internal.h Fix compiler issue with mmap_internal 2021-10-29 09:21:37 -03:00
mq_close.c
mq_getattr.c
mq_notify.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
mq_open.c
mq_receive.c
mq_send.c
mq_setattr.c
mq_timedreceive.c
mq_timedsend.c
mq_unlink.c
msgctl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
msgget.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
msgrcv.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
msgsnd.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
msync.c
mtx_timedlock.c
nanosleep.c
netlink_assert_response.c
netlinkaccess.h
nice.c
not-cancel.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
not-errno.h
nscd_setup_thread.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ntp_gettime.c
ntp_gettimex.c
olddirent.h
oldglob.c
open.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
open64.c
open64_nocancel.c
open_by_handle_at.c
open_nocancel.c
openat.c
openat64.c
openat64_nocancel.c
openat_nocancel.c
opendir.c linux: Fix a possibly non-constant expression in _Static_assert 2021-10-20 14:22:43 -07:00
pathconf.c
pathconf.h
paths.h
pause.c
personality.c
pkey_get.c
pkey_mprotect.c
pkey_set.c
poll.c
posix_fadvise.c
posix_fadvise64.c
posix_fallocate.c
posix_fallocate64.c
posix_madvise.c
ppoll.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
prctl.c Linux: Add time64 alias for prctl 2021-07-21 11:58:16 +02:00
pread.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
pread64.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
pread64_nocancel.c
preadv.c
preadv2.c
preadv64.c
preadv64v2.c
prlimit.c
process_vm_readv.c
process_vm_writev.c
prof-freq.c
profil-counter.h
profil.c
pselect.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
pselect32.c
ptrace.c
ptsname.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
pwrite.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
pwrite64.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
pwritev.c
pwritev2.c
pwritev64.c
pwritev64v2.c
read.c
read_nocancel.c
readahead.c
readdir.c
readdir64.c
readdir64_r.c
readdir_r.c
readonly-area.c libio: Replace internal _IO_getdelim symbol with __getdelim 2021-07-07 18:33:52 +02:00
readv.c
reboot.c
recv.c
recvfrom.c
recvmmsg.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
recvmsg.c socket: Add time64 alias for recvmsg 2021-07-21 11:58:16 +02:00
remove.c
rename.c
renameat.c
renameat2.c
rewinddir.c
sa_len.c
safe-fatal.h
scandir64.c
sched_getaffinity.c
sched_getcpu.c
sched_rr_gi.c
sched_setaffinity.c
seekdir.c
segfault.c
select.c
semctl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
semget.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
semop.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
semtimedop.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
send.c
sendmmsg.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
sendmsg.c socket: Add time64 alias for sendmsg 2021-07-21 11:58:16 +02:00
sendto.c
setegid.c
seteuid.c
setgid.c
setgroups.c
sethostid.c
setipv4sourcefilter.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
setitimer.c
setregid.c
setresgid.c
setresuid.c
setreuid.c
setrlimit.c
setrlimit64.c
setsockopt.c socket: Add time64 alias for setsockopt 2021-07-22 19:16:26 +02:00
setsourcefilter.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
settimeofday.c
settimezone.c
setuid.c
shlib-versions
shmat.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
shmctl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
shmdt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
shmget.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
shutdown.c
siglist-compat.c
signal.c
signalfd.c
sigpending.c
sigprocmask.c
sigqueue.c
sigreturn.c
sigset-cvt-mask.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
sigsetops.h
sigstack.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
sigsuspend.c
sigtimedwait.c
sigwait.c
sigwaitinfo.c
single-thread.h
sizes.h
socket-constants-time64.h
socket.c
socketcall.h
socketpair.c
spawn_int_def.h posix: Add posix_spawn_file_actions_addclosefrom_np 2021-07-08 14:08:15 -03:00
spawni.c Add an internal wrapper for clone, clone2 and clone3 2021-07-14 06:33:58 -07:00
speed.c
splice.c
stat.c
stat64.c
stat_t64_cp.c
stat_t64_cp.h
statfs.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
statfs64.c
statvfs.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
statvfs64.c
statx.c
statx_cp.c
statx_cp.h
struct_kernel_msqid64_ds.h
struct_kernel_semid64_ds.h
struct_kernel_shmid64_ds.h
struct_stat_time64.h
sync_file_range.c
syscall-names.list Update syscall lists for Linux 5.15 2021-11-10 15:21:19 +00:00
syscalls.list io: Refactor close_range and closefrom 2021-11-24 09:09:37 -03:00
sysconf-pthread_stack_min.h Define PTHREAD_STACK_MIN to sysconf(_SC_THREAD_STACK_MIN) 2021-07-09 15:10:35 -07:00
sysconf-sigstksz.h
sysconf.c
sysctl.c
sysdep-cancel.h
sysdep-vdso.h
sysdep.h
tcdrain.c
tcflow.c
tcflush.c
tcgetattr.c
tcgetpgrp.c
tcsendbrk.c
tcsetattr.c
tcsetpgrp.c
tee.c
telldir.c
termio.h
test-errno-linux.c
thrd_priv.h
thrd_sleep.c
time-clockid.h
time.c
timer_create.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
timer_delete.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
timer_getoverr.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
timer_gettime.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
timer_routines.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
timer_settime.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
timer_t_was_int_compat.h
timerfd_gettime.c
timerfd_settime.c
times.c
timespec_get.c
timespec_getres.c
tls-internal.c
tls-internal.h
truncate.c
truncate64.c
tst-adjtimex-time64.c
tst-adjtimex.c
tst-affinity-pid.c
tst-affinity-static.c
tst-affinity.c
tst-align-clone-internal.c Add static tests for __clone_internal 2021-07-14 06:55:04 -07:00
tst-align-clone.c
tst-clock_adjtime-time64.c
tst-clock_adjtime.c
tst-clock_gettime-clobber.c Linux: Use 32-bit vDSO for clock_gettime, gettimeofday, time (BZ# 28071) 2021-07-12 17:37:56 -03:00
tst-clone.c
tst-clone2-internal.c Add static tests for __clone_internal 2021-07-14 06:55:04 -07:00
tst-clone2.c
tst-clone3-internal.c Add static tests for __clone_internal 2021-07-14 06:55:04 -07:00
tst-clone3.c
tst-fallocate-common.c
tst-fallocate.c
tst-fallocate64.c
tst-fanotify.c
tst-getdents64.c
tst-getpid1-internal.c Add static tests for __clone_internal 2021-07-14 06:55:04 -07:00
tst-getpid1.c
tst-gettid-kill.c
tst-gettid.c
tst-gettimeofday-clobber.c Linux: Use 32-bit vDSO for clock_gettime, gettimeofday, time (BZ# 28071) 2021-07-12 17:37:56 -03:00
tst-glibcsyscalls.py
tst-memfd_create.c
tst-misalign-clone-internal.c Add static tests for __clone_internal 2021-07-14 06:55:04 -07:00
tst-misalign-clone.c
tst-mlock2.c
tst-mman-consts.py Update kernel version to 5.15 in tst-mman-consts.py 2021-11-22 15:30:12 +00:00
tst-ntp_adjtime-time64.c
tst-ntp_adjtime.c
tst-ntp_gettime-time64.c
tst-ntp_gettime.c
tst-ntp_gettimex-time64.c
tst-ntp_gettimex.c
tst-o_path-locks.c
tst-ofdlocks-compat.c
tst-ofdlocks.c
tst-personality.c
tst-pkey.c
tst-ppoll-time64.c
tst-ppoll.c
tst-prctl-time64.c Linux: Add time64 alias for prctl 2021-07-21 11:58:16 +02:00
tst-prctl.c Linux: Add time64 alias for prctl 2021-07-21 11:58:16 +02:00
tst-quota.c
tst-readdir64-compat.c
tst-rlimit-infinity.c
tst-scm_rights-time64.c socket: Add time64 alias for sendmmsg 2021-07-21 11:58:16 +02:00
tst-scm_rights.c socket: Add time64 alias for sendmmsg 2021-07-21 11:58:16 +02:00
tst-sigcontext-get_pc.c
tst-signal-numbers.py
tst-sigtimedwait-time64.c
tst-sigtimedwait.c
tst-skeleton-affinity.c
tst-skeleton-thread-affinity.c
tst-socket-consts.py
tst-sync_file_range.c
tst-syscall-list.sh
tst-sysconf-iov_max-uapi.c
tst-sysconf-iov_max.c
tst-sysvmsg-linux.c
tst-sysvsem-linux.c
tst-sysvshm-linux.c
tst-tgkill.c
tst-time-clobber.c Linux: Use 32-bit vDSO for clock_gettime, gettimeofday, time (BZ# 28071) 2021-07-12 17:37:56 -03:00
tst-timerfd-time64.c
tst-timerfd.c
tst-ttyname.c
ttyname.c
ttyname.h
ttyname_r.c
tv32-compat.h
ualarm.c
umount.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
umount2.c
unlockpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
update-syscall-lists.py
updwtmp.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ustat.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
utime.c
utimensat.c
utimes.c
utmp_file.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
versionsort64.c
vfork.c
vmsplice.c
wait3.c
wait4.c
waitid.c
write.c
write_nocancel.c
writev.c
xmknod.c
xmknodat.c
xstat.c
xstat64.c
xstatconv.c
xstatconv.h
xstatover.h
xstatver.h