diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/generic')
78 files changed, 137 insertions, 1352 deletions
diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile index c1daee2396..7e27e79772 100644 --- a/sysdeps/unix/sysv/linux/generic/Makefile +++ b/sysdeps/unix/sysv/linux/generic/Makefile @@ -1,3 +1,3 @@ ifeq ($(subdir),misc) -sysdep_routines += epoll_create epoll_wait inotify_init +sysdep_routines += epoll_create inotify_init endif diff --git a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c b/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c index 112d629b68..f8251b811a 100644 --- a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/access.c b/sysdeps/unix/sysv/linux/generic/access.c deleted file mode 100644 index 586aa93757..0000000000 --- a/sysdeps/unix/sysv/linux/generic/access.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <stddef.h> -#include <unistd.h> -#include <fcntl.h> -#include <sysdep-cancel.h> - -/* Test for access to FILE. */ -int -__access (const char *file, int type) -{ - return INLINE_SYSCALL (faccessat, 3, AT_FDCWD, file, type); -} -weak_alias (__access, access) diff --git a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h b/sysdeps/unix/sysv/linux/generic/bits/fcntl.h index 7161890d9c..cdc1f32fa2 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/generic/bits/fcntl.h @@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for the generic Linux ABI. - Copyright (C) 2011-2016 Free Software Foundation, Inc. + Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/bits/msq.h b/sysdeps/unix/sysv/linux/generic/bits/msq.h index 2f3b7b2331..fe2bff6b12 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/msq.h +++ b/sysdeps/unix/sysv/linux/generic/bits/msq.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -67,6 +67,7 @@ struct msqid_ds /* ipcs ctl commands */ # define MSG_STAT 11 # define MSG_INFO 12 +# define MSG_STAT_ANY 13 /* buffer for msgctl calls IPC_INFO, MSG_INFO */ struct msginfo diff --git a/sysdeps/unix/sysv/linux/generic/bits/sem.h b/sysdeps/unix/sysv/linux/generic/bits/sem.h index c8437b7753..9c8b318efb 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/sem.h +++ b/sysdeps/unix/sysv/linux/generic/bits/sem.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -74,6 +74,7 @@ struct semid_ds /* ipcs ctl cmds */ # define SEM_STAT 18 # define SEM_INFO 19 +# define SEM_STAT_ANY 20 struct seminfo { diff --git a/sysdeps/unix/sysv/linux/generic/bits/shm.h b/sysdeps/unix/sysv/linux/generic/bits/shm.h index 81918c8961..30d0097b02 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/shm.h +++ b/sysdeps/unix/sysv/linux/generic/bits/shm.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -76,6 +76,7 @@ struct shmid_ds /* ipcs ctl commands */ # define SHM_STAT 13 # define SHM_INFO 14 +# define SHM_STAT_ANY 15 /* shm_mode upper byte flags */ # define SHM_DEST 01000 /* segment will be destroyed on last detach */ diff --git a/sysdeps/unix/sysv/linux/generic/bits/stat.h b/sysdeps/unix/sysv/linux/generic/bits/stat.h index dd8d799dd3..08e86ef086 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/stat.h +++ b/sysdeps/unix/sysv/linux/generic/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/bits/statfs.h b/sysdeps/unix/sysv/linux/generic/bits/statfs.h index 7d5aa2df6a..846dd5f618 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/statfs.h +++ b/sysdeps/unix/sysv/linux/generic/bits/statfs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h index c31bba2f7c..a2cb3433bf 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h @@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2016 Free Software Foundation, Inc. + Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -70,6 +70,11 @@ /* Same for ino_t and ino64_t. */ # define __INO_T_MATCHES_INO64_T 1 + +/* And for __rlim_t and __rlim64_t. */ +# define __RLIM_T_MATCHES_RLIM64_T 1 +#else +# define __RLIM_T_MATCHES_RLIM64_T 0 #endif /* Number of descriptors that can fit in an `fd_set'. */ diff --git a/sysdeps/unix/sysv/linux/generic/brk.c b/sysdeps/unix/sysv/linux/generic/brk.c index 1b84004da5..ed47915cba 100644 --- a/sysdeps/unix/sysv/linux/generic/brk.c +++ b/sysdeps/unix/sysv/linux/generic/brk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/chmod.c b/sysdeps/unix/sysv/linux/generic/chmod.c index f1efa247d6..d598c8ae85 100644 --- a/sysdeps/unix/sysv/linux/generic/chmod.c +++ b/sysdeps/unix/sysv/linux/generic/chmod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -28,4 +28,6 @@ __chmod (const char *file, mode_t mode) { return INLINE_SYSCALL (fchmodat, 3, AT_FDCWD, file, mode); } + +libc_hidden_def (__chmod) weak_alias (__chmod, chmod) diff --git a/sysdeps/unix/sysv/linux/generic/chown.c b/sysdeps/unix/sysv/linux/generic/chown.c index 3453b5197b..5d2ddb192f 100644 --- a/sysdeps/unix/sysv/linux/generic/chown.c +++ b/sysdeps/unix/sysv/linux/generic/chown.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/dl-origin.c b/sysdeps/unix/sysv/linux/generic/dl-origin.c index 3ad2a85095..d07c863c2c 100644 --- a/sysdeps/unix/sysv/linux/generic/dl-origin.c +++ b/sysdeps/unix/sysv/linux/generic/dl-origin.c @@ -1,5 +1,5 @@ /* Find path of executable. - Copyright (C) 1998-2016 Free Software Foundation, Inc. + Copyright (C) 1998-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. diff --git a/sysdeps/unix/sysv/linux/generic/dup2.c b/sysdeps/unix/sysv/linux/generic/dup2.c index d5afb5e9a3..294908ef2c 100644 --- a/sysdeps/unix/sysv/linux/generic/dup2.c +++ b/sysdeps/unix/sysv/linux/generic/dup2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/epoll_create.c b/sysdeps/unix/sysv/linux/generic/epoll_create.c index 9c863ef52d..bb5f77d1bf 100644 --- a/sysdeps/unix/sysv/linux/generic/epoll_create.c +++ b/sysdeps/unix/sysv/linux/generic/epoll_create.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/epoll_wait.c b/sysdeps/unix/sysv/linux/generic/epoll_wait.c deleted file mode 100644 index 9f2bec9b5e..0000000000 --- a/sysdeps/unix/sysv/linux/generic/epoll_wait.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <stddef.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/epoll.h> - -int -epoll_wait (int epfd, struct epoll_event *events, int maxevents, int timeout) -{ - return epoll_pwait (epfd, events, maxevents, timeout, NULL); -} diff --git a/sysdeps/unix/sysv/linux/generic/futimesat.c b/sysdeps/unix/sysv/linux/generic/futimesat.c index b04efb934b..64058edd18 100644 --- a/sysdeps/unix/sysv/linux/generic/futimesat.c +++ b/sysdeps/unix/sysv/linux/generic/futimesat.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2005-2016 Free Software Foundation, Inc. +/* futimesat -- Change access and modification times of file. Linux version. + Copyright (C) 2005-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/getdents.c b/sysdeps/unix/sysv/linux/generic/getdents.c deleted file mode 100644 index 14dbbc71a0..0000000000 --- a/sysdeps/unix/sysv/linux/generic/getdents.c +++ /dev/null @@ -1 +0,0 @@ -/* Defined in getdents64.c */ diff --git a/sysdeps/unix/sysv/linux/generic/getdents64.c b/sysdeps/unix/sysv/linux/generic/getdents64.c deleted file mode 100644 index 3e4469931a..0000000000 --- a/sysdeps/unix/sysv/linux/generic/getdents64.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <stddef.h> -#include <stdint.h> -#include <unistd.h> -#include <sys/types.h> -#include <bits/wordsize.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -/* The kernel struct linux_dirent64 matches the 'struct getdents64' type. */ -ssize_t -__getdents64 (int fd, char *buf, size_t nbytes) -{ - return INLINE_SYSCALL (getdents64, 3, fd, buf, nbytes); -} - -#if __WORDSIZE == 64 -strong_alias (__getdents64, __getdents) -#endif diff --git a/sysdeps/unix/sysv/linux/generic/inotify_init.c b/sysdeps/unix/sysv/linux/generic/inotify_init.c index da9c71501f..ab49fb835c 100644 --- a/sysdeps/unix/sysv/linux/generic/inotify_init.c +++ b/sysdeps/unix/sysv/linux/generic/inotify_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/kernel_stat.h b/sysdeps/unix/sysv/linux/generic/kernel_stat.h index be12819d36..2f36a51576 100644 --- a/sysdeps/unix/sysv/linux/generic/kernel_stat.h +++ b/sysdeps/unix/sysv/linux/generic/kernel_stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -23,4 +23,8 @@ /* We provide separate 32-bit API versions that check for EOVERFLOW. */ #if __WORDSIZE == 64 # define XSTAT_IS_XSTAT64 1 +#else +# define XSTAT_IS_XSTAT64 0 #endif + +#define STATFS_IS_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/generic/lchown.c b/sysdeps/unix/sysv/linux/generic/lchown.c index 5e77c82736..8e503f54b2 100644 --- a/sysdeps/unix/sysv/linux/generic/lchown.c +++ b/sysdeps/unix/sysv/linux/generic/lchown.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/link.c b/sysdeps/unix/sysv/linux/generic/link.c index e3294f5ee6..6f0ec63108 100644 --- a/sysdeps/unix/sysv/linux/generic/link.c +++ b/sysdeps/unix/sysv/linux/generic/link.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/lxstat.c b/sysdeps/unix/sysv/linux/generic/lxstat.c index f97c2d5fe1..b175c85bea 100644 --- a/sysdeps/unix/sysv/linux/generic/lxstat.c +++ b/sysdeps/unix/sysv/linux/generic/lxstat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -41,7 +41,7 @@ __lxstat (int vers, const char *name, struct stat *buf) hidden_def (__lxstat) weak_alias (__lxstat, _lxstat); -#ifdef XSTAT_IS_XSTAT64 +#if XSTAT_IS_XSTAT64 #undef __lxstat64 strong_alias (__lxstat, __lxstat64); hidden_ver (__lxstat, __lxstat64) diff --git a/sysdeps/unix/sysv/linux/generic/mkdir.c b/sysdeps/unix/sysv/linux/generic/mkdir.c index 91cd53c4f6..a597622d7d 100644 --- a/sysdeps/unix/sysv/linux/generic/mkdir.c +++ b/sysdeps/unix/sysv/linux/generic/mkdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -30,4 +30,6 @@ __mkdir (const char *path, mode_t mode) { return INLINE_SYSCALL (mkdirat, 3, AT_FDCWD, path, mode); } + +libc_hidden_def (__mkdir) weak_alias (__mkdir, mkdir) diff --git a/sysdeps/unix/sysv/linux/generic/open.c b/sysdeps/unix/sysv/linux/generic/open.c deleted file mode 100644 index 931ba237b8..0000000000 --- a/sysdeps/unix/sysv/linux/generic/open.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <sysdep-cancel.h> - -/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, - a third argument is the file protection. */ -int -__libc_open (const char *file, int oflag, ...) -{ - int mode = 0; - - if (__OPEN_NEEDS_MODE (oflag)) - { - va_list arg; - va_start (arg, oflag); - mode = va_arg (arg, int); - va_end (arg); - } - - return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag, mode); -} -libc_hidden_def (__libc_open) - -weak_alias (__libc_open, __open) -libc_hidden_weak (__open) -weak_alias (__libc_open, open) - -int -__open_nocancel (const char *file, int oflag, ...) -{ - int mode = 0; - - if (__OPEN_NEEDS_MODE (oflag)) - { - va_list arg; - va_start (arg, oflag); - mode = va_arg (arg, int); - va_end (arg); - } - - return INLINE_SYSCALL (openat, 4, AT_FDCWD, file, oflag, mode); -} diff --git a/sysdeps/unix/sysv/linux/generic/open64.c b/sysdeps/unix/sysv/linux/generic/open64.c deleted file mode 100644 index 4c1e3a30e4..0000000000 --- a/sysdeps/unix/sysv/linux/generic/open64.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <sysdep-cancel.h> - -/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG, - a third argument is the file protection. */ -int -__libc_open64 (const char *file, int oflag, ...) -{ - int mode = 0; - - if (__OPEN_NEEDS_MODE (oflag)) - { - va_list arg; - va_start (arg, oflag); - mode = va_arg (arg, int); - va_end (arg); - } - - return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag | O_LARGEFILE, mode); -} -weak_alias (__libc_open64, __open64) -libc_hidden_weak (__open64) -weak_alias (__libc_open64, open64) diff --git a/sysdeps/unix/sysv/linux/generic/pause.c b/sysdeps/unix/sysv/linux/generic/pause.c deleted file mode 100644 index 9864ca007a..0000000000 --- a/sysdeps/unix/sysv/linux/generic/pause.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <signal.h> -#include <unistd.h> -#include <sysdep-cancel.h> - -/* Suspend the process until a signal arrives. - This always returns -1 and sets errno to EINTR. */ - -int -__libc_pause (void) -{ - sigset_t set; - - int rc = - SYSCALL_CANCEL (rt_sigprocmask, SIG_BLOCK, NULL, &set, _NSIG / 8); - if (rc == 0) - rc = SYSCALL_CANCEL (rt_sigsuspend, &set, _NSIG / 8); - - return rc; -} - -weak_alias (__libc_pause, pause) diff --git a/sysdeps/unix/sysv/linux/generic/pipe.c b/sysdeps/unix/sysv/linux/generic/pipe.c index 1efa2c196e..d33052cad0 100644 --- a/sysdeps/unix/sysv/linux/generic/pipe.c +++ b/sysdeps/unix/sysv/linux/generic/pipe.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/poll.c b/sysdeps/unix/sysv/linux/generic/poll.c deleted file mode 100644 index ce99044b87..0000000000 --- a/sysdeps/unix/sysv/linux/generic/poll.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <sys/poll.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -int -__poll (struct pollfd *fds, nfds_t nfds, int timeout) -{ - struct timespec timeout_ts; - struct timespec *timeout_ts_p = NULL; - - if (timeout >= 0) - { - timeout_ts.tv_sec = timeout / 1000; - timeout_ts.tv_nsec = (timeout % 1000) * 1000000; - timeout_ts_p = &timeout_ts; - } - - return SYSCALL_CANCEL (ppoll, fds, nfds, timeout_ts_p, NULL, 0); -} -libc_hidden_def (__poll) -weak_alias (__poll, poll) -strong_alias (__poll, __libc_poll) diff --git a/sysdeps/unix/sysv/linux/generic/readlink.c b/sysdeps/unix/sysv/linux/generic/readlink.c index 93878344b3..6c7b62af3f 100644 --- a/sysdeps/unix/sysv/linux/generic/readlink.c +++ b/sysdeps/unix/sysv/linux/generic/readlink.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/readlink_chk.c b/sysdeps/unix/sysv/linux/generic/readlink_chk.c index 82a2ca5fc4..9240408a6b 100644 --- a/sysdeps/unix/sysv/linux/generic/readlink_chk.c +++ b/sysdeps/unix/sysv/linux/generic/readlink_chk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/recv.c b/sysdeps/unix/sysv/linux/generic/recv.c deleted file mode 100644 index 7adebf201e..0000000000 --- a/sysdeps/unix/sysv/linux/generic/recv.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <stdlib.h> -#include <sys/types.h> -#include <sysdep-cancel.h> -#include <libc-symbols.h> - -ssize_t -__libc_recv (int sockfd, void *buffer, size_t len, int flags) -{ - return SYSCALL_CANCEL (recvfrom, sockfd, buffer, len, flags, - NULL, NULL); -} -strong_alias (__libc_recv, __recv) -libc_hidden_def (__recv) -weak_alias (__libc_recv, recv) diff --git a/sysdeps/unix/sysv/linux/generic/rename.c b/sysdeps/unix/sysv/linux/generic/rename.c deleted file mode 100644 index 174c147eb4..0000000000 --- a/sysdeps/unix/sysv/linux/generic/rename.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <stdio.h> -#include <unistd.h> -#include <fcntl.h> -#include <sysdep.h> - -/* Rename the file OLD to NEW. */ -int -rename (const char *old, const char *new) -{ - return INLINE_SYSCALL (renameat, 4, AT_FDCWD, old, AT_FDCWD, new); -} diff --git a/sysdeps/unix/sysv/linux/generic/rmdir.c b/sysdeps/unix/sysv/linux/generic/rmdir.c index 0c37354782..8c6ffa0c5d 100644 --- a/sysdeps/unix/sysv/linux/generic/rmdir.c +++ b/sysdeps/unix/sysv/linux/generic/rmdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/select.c b/sysdeps/unix/sysv/linux/generic/select.c deleted file mode 100644 index 6b63cfc9a7..0000000000 --- a/sysdeps/unix/sysv/linux/generic/select.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <sys/time.h> -#include <sys/types.h> -#include <sys/select.h> -#include <errno.h> -#include <sysdep-cancel.h> - -/* Check the first NFDS descriptors each in READFDS (if not NULL) for read - readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS - (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out - after waiting the interval specified therein. Returns the number of ready - descriptors, or -1 for errors. */ - -int -__select(int nfds, fd_set *readfds, - fd_set *writefds, fd_set *exceptfds, - struct timeval *timeout) -{ - int result; - struct timespec ts, *tsp = NULL; - - if (timeout) - { - TIMEVAL_TO_TIMESPEC (timeout, &ts); - tsp = &ts; - } - - result = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, tsp, - NULL); - - if (timeout) - { - /* Linux by default will update the timeout after a pselect6 syscall - (though the pselect() glibc call suppresses this behavior). - Since select() on Linux has the same behavior as the pselect6 - syscall, we update the timeout here. */ - TIMESPEC_TO_TIMEVAL (timeout, &ts); - } - - return result; -} -libc_hidden_def (__select) - -weak_alias (__select, select) -weak_alias (__select, __libc_select) diff --git a/sysdeps/unix/sysv/linux/generic/send.c b/sysdeps/unix/sysv/linux/generic/send.c deleted file mode 100644 index 2399f207e1..0000000000 --- a/sysdeps/unix/sysv/linux/generic/send.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <stdlib.h> -#include <sys/types.h> -#include <sysdep-cancel.h> -#include <libc-symbols.h> - -ssize_t -__libc_send (int sockfd, const void *buffer, size_t len, int flags) -{ - return SYSCALL_CANCEL (sendto, sockfd, buffer, len, flags, NULL, 0); -} -strong_alias (__libc_send, __send) -weak_alias (__libc_send, send) diff --git a/sysdeps/unix/sysv/linux/generic/symlink.c b/sysdeps/unix/sysv/linux/generic/symlink.c index e350734972..db991c81d8 100644 --- a/sysdeps/unix/sysv/linux/generic/symlink.c +++ b/sysdeps/unix/sysv/linux/generic/symlink.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 4b2e74762f..ed8b216d47 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -1,32 +1,12 @@ # File name Caller Syscall name # args Strong name Weak names -# SysV APIs -msgget - msgget i:ii __msgget msgget -msgctl - msgctl i:iip __msgctl msgctl -msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd -semget - semget i:iii __semget semget -semctl - semctl i:iiii __semctl semctl -semtimedop - semtimedop i:ipip semtimedop -semop - semop i:ipi __semop semop -shmget - shmget i:iii __shmget shmget -shmctl - shmctl i:iip __shmctl shmctl -shmat - shmat i:ipi __shmat shmat -shmdt - shmdt i:s __shmdt shmdt - # Socket APIs socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair bind - bind i:ipi __bind bind listen - listen i:ii __listen listen -accept - accept Ci:iBN __libc_accept __accept accept -connect - connect Ci:ipi __libc_connect __connect connect getsockname - getsockname i:ipp __getsockname getsockname getpeername - getpeername i:ipp __getpeername getpeername -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom setsockopt - setsockopt i:iiibn __setsockopt setsockopt getsockopt - getsockopt i:iiiBN __getsockopt getsockopt shutdown - shutdown i:ii __shutdown shutdown -sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg -recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg diff --git a/sysdeps/unix/sysv/linux/generic/sysctl.c b/sysdeps/unix/sysv/linux/generic/sysctl.c index 7c08874668..61e7fa8149 100644 --- a/sysdeps/unix/sysv/linux/generic/sysctl.c +++ b/sysdeps/unix/sysv/linux/generic/sysctl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h index 4f2c65d074..81a1011f46 100644 --- a/sysdeps/unix/sysv/linux/generic/sysdep.h +++ b/sysdeps/unix/sysv/linux/generic/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -22,7 +22,9 @@ #include <sysdeps/unix/sysv/linux/sysdep.h> /* Provide the common name to allow more code reuse. */ -#define __NR__llseek __NR_llseek +#ifdef __NR_llseek +# define __NR__llseek __NR_llseek +#endif #if __WORDSIZE == 64 /* By defining the older names, glibc will build syscall wrappers for @@ -31,13 +33,3 @@ #define __NR_pread __NR_pread64 #define __NR_pwrite __NR_pwrite64 #endif - -/* Provide a dummy argument that can be used to force register - alignment for register pairs if required by the syscall ABI. */ -#ifdef __ASSUME_ALIGNED_REGISTER_PAIRS -#define __ALIGNMENT_ARG 0, -#define __ALIGNMENT_COUNT(a,b) b -#else -#define __ALIGNMENT_ARG -#define __ALIGNMENT_COUNT(a,b) a -#endif diff --git a/sysdeps/unix/sysv/linux/generic/umount.c b/sysdeps/unix/sysv/linux/generic/umount.c deleted file mode 100644 index df0a5f71c3..0000000000 --- a/sysdeps/unix/sysv/linux/generic/umount.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -/* Since the generic Linux syscall ABI doesn't have an oldumount system call, - do what the kernel does down here. */ - -extern long int __umount2 (const char *name, int flags); - -long int -__umount (const char *name) -{ - return __umount2 (name, 0); -} - -weak_alias (__umount, umount); diff --git a/sysdeps/unix/sysv/linux/generic/unlink.c b/sysdeps/unix/sysv/linux/generic/unlink.c index a6d5ca834d..f07712f8a8 100644 --- a/sysdeps/unix/sysv/linux/generic/unlink.c +++ b/sysdeps/unix/sysv/linux/generic/unlink.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/ustat.c b/sysdeps/unix/sysv/linux/generic/ustat.c deleted file mode 100644 index 62ec623fb8..0000000000 --- a/sysdeps/unix/sysv/linux/generic/ustat.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <sys/ustat.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -/* This deprecated syscall is no longer used (replaced with fstat). */ -int -ustat (dev_t dev, struct ustat *ubuf) -{ - __set_errno (ENOSYS); - return -1; -} -stub_warning (ustat) diff --git a/sysdeps/unix/sysv/linux/generic/utimes.c b/sysdeps/unix/sysv/linux/generic/utimes.c index 9d8ece4b7a..b8227fc4ef 100644 --- a/sysdeps/unix/sysv/linux/generic/utimes.c +++ b/sysdeps/unix/sysv/linux/generic/utimes.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* utimes -- Change access and modification times of file. Linux version. + Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c deleted file mode 100644 index e2c87e7ef6..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <assert.h> -#include <errno.h> -#include <sysdep-cancel.h> /* Must come before <fcntl.h>. */ -#include <fcntl.h> -#include <stdarg.h> - -#include <sys/syscall.h> - - -static int -do_fcntl (int fd, int cmd, void *arg) -{ - if (cmd != F_GETOWN) - return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg); - - INTERNAL_SYSCALL_DECL (err); - struct f_owner_ex fex; - int res = INTERNAL_SYSCALL (fcntl64, err, 3, fd, F_GETOWN_EX, &fex); - if (!INTERNAL_SYSCALL_ERROR_P (res, err)) - return fex.type == F_OWNER_GID ? -fex.pid : fex.pid; - - __set_errno (INTERNAL_SYSCALL_ERRNO (res, err)); - return -1; -} - - -#ifndef NO_CANCELLATION -int -__fcntl_nocancel (int fd, int cmd, ...) -{ - va_list ap; - void *arg; - - va_start (ap, cmd); - arg = va_arg (ap, void *); - va_end (ap); - - return do_fcntl (fd, cmd, arg); -} -#endif - - -int -__libc_fcntl (int fd, int cmd, ...) -{ - va_list ap; - void *arg; - - va_start (ap, cmd); - arg = va_arg (ap, void *); - va_end (ap); - - if (SINGLE_THREAD_P || cmd != F_SETLKW) - return do_fcntl (fd, cmd, arg); - - int oldtype = LIBC_CANCEL_ASYNC (); - - int result = do_fcntl (fd, cmd, arg); - - LIBC_CANCEL_RESET (oldtype); - - return result; -} -libc_hidden_def (__libc_fcntl) - -weak_alias (__libc_fcntl, __fcntl) -libc_hidden_weak (__fcntl) -weak_alias (__libc_fcntl, fcntl) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c index be9599a3eb..5aebf2334c 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -18,8 +18,10 @@ #include <errno.h> #include <sys/statfs.h> +#include <kernel_stat.h> #include <stddef.h> +#if !STATFS_IS_STATFS64 #include "overflow.h" /* Return information about the filesystem on which FD resides. */ @@ -30,3 +32,4 @@ __fstatfs (int fd, struct statfs *buf) return rc ?: statfs_overflow (buf); } weak_alias (__fstatfs, fstatfs) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c deleted file mode 100644 index e1b500d434..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <sys/types.h> -#include <unistd.h> - -/* Truncate the file FD refers to to LENGTH bytes. */ -int -__ftruncate (int fd, off_t length) -{ - return INLINE_SYSCALL (ftruncate64, __ALIGNMENT_COUNT (3, 4), fd, - __ALIGNMENT_ARG - __LONG_LONG_PAIR (length >> 31, length)); -} -weak_alias (__ftruncate, ftruncate) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c deleted file mode 100644 index 946f05a80c..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/ftruncate64.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <sys/types.h> -#include <unistd.h> - -/* Truncate the file FD refers to to LENGTH bytes. */ -int -__ftruncate64 (int fd, off64_t length) -{ - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; - return INLINE_SYSCALL (ftruncate64, __ALIGNMENT_COUNT (3, 4), fd, - __ALIGNMENT_ARG __LONG_LONG_PAIR (high, low)); -} -weak_alias (__ftruncate64, ftruncate64) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c index dd5201192c..b5c766ddf3 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -25,6 +25,7 @@ #include <sysdep.h> #include <sys/syscall.h> +#if !XSTAT_IS_XSTAT64 #include "overflow.h" /* Get information about the file FD in BUF. */ @@ -43,3 +44,4 @@ __fxstat (int vers, int fd, struct stat *buf) hidden_def (__fxstat) weak_alias (__fxstat, _fxstat); +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c index 6d294a428e..c558388b8c 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat64.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* __fxstat64 () implementation. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -16,25 +17,20 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include <sys/mman.h> -#include <errno.h> -#include <sysdep.h> +/* Hide the prototypes for __fxstat and _fxstat so that GCC will not + complain about the different function signatures if they are aliased + to __fxstat64. If XSTAT_IS_XSTAT64 is set to non-zero then the stat and + stat64 structures have an identical layout but different type names. */ -#ifndef MMAP_PAGE_UNIT -# define MMAP_PAGE_UNIT 4096UL -#endif +#define __fxstat __fxstat_disable +#define _fxstat _fxstat_disable -__ptr_t -__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) -{ - if (offset & (MMAP_PAGE_UNIT - 1)) - { - __set_errno (EINVAL); - return MAP_FAILED; - } - return (__ptr_t) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, fd, - offset / MMAP_PAGE_UNIT); -} +#include <sysdeps/unix/sysv/linux/fxstat64.c> -weak_alias (__mmap, mmap) +#undef __fxstat +#undef _fxstat +#if XSTAT_IS_XSTAT64 +weak_alias (__fxstat64, __fxstat) +weak_alias (__fxstat64, _fxstat) +hidden_ver (__fxstat64, __fxstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c index dc7f934908..0bda8f7ac4 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -26,6 +26,7 @@ #include <sysdep.h> #include <sys/syscall.h> +#if !XSTAT_IS_XSTAT64 #include "overflow.h" /* Get information about the file NAME in BUF. */ @@ -42,3 +43,4 @@ __fxstatat (int vers, int fd, const char *file, struct stat *buf, int flag) return -1; } libc_hidden_def (__fxstatat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/creat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c index 33aee64a5f..602bf4b28a 100644 --- a/sysdeps/unix/sysv/linux/generic/creat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat64.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* __fxstatat64 () implementation. + Copyright (C) 2016-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -16,22 +17,21 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ -#include <fcntl.h> -#include <sys/types.h> -#include <sysdep-cancel.h> +/* Hide the prototype for __fxstatat so that GCC will not complain about + the different function signature if it is aliased to __fxstatat64. + If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64 structures + have an identical layout but different type names. */ -#undef creat +#define __fxstatat __fxstatat_disable -/* Create FILE with protections MODE. */ -int -creat (const char *file, mode_t mode) -{ - return __open (file, O_WRONLY | O_CREAT | O_TRUNC, mode); -} +#include <sys/stat.h> +#undef _STAT_VER_LINUX +#define _STAT_VER_LINUX _STAT_VER_KERNEL -/* __open handles cancellation. */ -LIBC_CANCEL_HANDLED (); +#include <sysdeps/unix/sysv/linux/fxstatat64.c> -#if __WORDSIZE == 64 -weak_alias (creat, creat64) +#undef __fxstatat +#if XSTAT_IS_XSTAT64 +weak_alias (__fxstatat64, __fxstatat) +libc_hidden_ver (__fxstatat64, __fxstatat) #endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c deleted file mode 100644 index bc3a80ec30..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 1993-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Simplified from sysdeps/unix/sysv/linux/getdents.c. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <alloca.h> -#include <assert.h> -#include <errno.h> -#include <dirent.h> -#include <stddef.h> -#include <stdint.h> -#include <string.h> -#include <unistd.h> -#include <sys/param.h> -#include <sys/types.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -/* Pack the dirent64 struct down into 32-bit offset/inode fields, and - ensure that no overflow occurs. */ -ssize_t -__getdents (int fd, char *buf, size_t nbytes) -{ - union - { - struct dirent64 k; /* Kernel structure. */ - struct dirent u; - char b[1]; - } *kbuf = (void *) buf, *outp, *inp; - size_t kbytes = nbytes; - off64_t last_offset = -1; - ssize_t retval; - - const size_t size_diff = (offsetof (struct dirent64, d_name) - - offsetof (struct dirent, d_name)); - if (nbytes <= sizeof (struct dirent)) - { - kbytes = nbytes + offsetof (struct dirent64, d_name) - - offsetof (struct dirent, d_name); - kbuf = __alloca(kbytes); - } - - retval = INLINE_SYSCALL (getdents64, 3, fd, kbuf, kbytes); - if (retval == -1) - return -1; - - /* These two pointers might alias the same memory buffer. - Standard C requires that we always use the same type for them, - so we must use the union type. */ - inp = kbuf; - outp = (void *) buf; - - while (&inp->b < &kbuf->b + retval) - { - const size_t alignment = __alignof__ (struct dirent); - /* Since inp->k.d_reclen is already aligned for the kernel - structure this may compute a value that is bigger - than necessary. */ - size_t old_reclen = inp->k.d_reclen; - size_t new_reclen = ((old_reclen - size_diff + alignment - 1) - & ~(alignment - 1)); - - /* Copy the data out of the old structure into temporary space. - Then copy the name, which may overlap if BUF == KBUF. */ - const uint64_t d_ino = inp->k.d_ino; - const int64_t d_off = inp->k.d_off; - const uint8_t d_type = inp->k.d_type; - - memmove (outp->u.d_name, inp->k.d_name, - old_reclen - offsetof (struct dirent64, d_name)); - - /* Now we have copied the data from INP and access only OUTP. */ - - outp->u.d_ino = d_ino; - outp->u.d_off = d_off; - if ((sizeof (outp->u.d_ino) != sizeof (inp->k.d_ino) - && outp->u.d_ino != d_ino) - || (sizeof (outp->u.d_off) != sizeof (inp->k.d_off) - && outp->u.d_off != d_off)) - { - /* Overflow. If there was at least one entry before this one, - return them without error, otherwise signal overflow. */ - if (last_offset != -1) - { - __lseek64 (fd, last_offset, SEEK_SET); - return outp->b - buf; - } - __set_errno (EOVERFLOW); - return -1; - } - - last_offset = d_off; - outp->u.d_reclen = new_reclen; - outp->u.d_type = d_type; - - inp = (void *) inp + old_reclen; - outp = (void *) outp + new_reclen; - } - - return outp->b - buf; -} diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c deleted file mode 100644 index 458964c53f..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/llseek.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <sys/types.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -/* Seek to OFFSET on FD, starting from WHENCE. */ -extern loff_t __llseek (int fd, loff_t offset, int whence); - -loff_t -__llseek (int fd, loff_t offset, int whence) -{ - loff_t retval; - - return (loff_t) (INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff), - &retval, whence) ?: retval); -} -weak_alias (__llseek, llseek) -strong_alias (__llseek, __libc_lseek64) -strong_alias (__llseek, __lseek64) -weak_alias (__llseek, lseek64) - -/* llseek doesn't have a prototype. Since the second parameter is a - 64bit type, this results in wrong behaviour if no prototype is - provided. */ -link_warning (llseek, "\ -the `llseek' function may be dangerous; use `lseek64' instead.") diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c deleted file mode 100644 index dbf0b2652b..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lseek.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <unistd.h> -#include <sys/types.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include "overflow.h" - -off_t -__lseek (int fd, off_t offset, int whence) -{ - loff_t res; - int rc = INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 31), - (off_t) offset, &res, whence); - return rc ?: lseek_overflow (res); -} -libc_hidden_def (__lseek) -weak_alias (__lseek, lseek) -strong_alias (__lseek, __libc_lseek) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c index 395f98b06f..c278a4dbce 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -25,6 +25,7 @@ #include <sysdep.h> #include <sys/syscall.h> +#if !XSTAT_IS_XSTAT64 #include "overflow.h" /* Get information about the file NAME in BUF. */ @@ -41,3 +42,4 @@ __lxstat (int vers, const char *name, struct stat *buf) return -1; } hidden_def (__lxstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c index e1c15a8cc2..761dd16233 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -16,6 +16,13 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ +/* Hide the prototype for __lxstat so that GCC will not complain about + the different function signature if it is aliased to __lxstat64. + If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64 + structures have an identical layout but different type names. */ + +#define __lxstat __lxstat_disable + #include <errno.h> #include <stddef.h> #include <fcntl.h> @@ -36,3 +43,9 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf) return -1; } hidden_def (__lxstat64) + +#undef __lxstat +#if XSTAT_IS_XSTAT64 +strong_alias (__lxstat64, __lxstat) +hidden_ver (__lxstat64, __lxstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h index 452cf55875..9d70532150 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h @@ -1,5 +1,5 @@ /* Overflow tests for stat, statfs, and lseek functions. - Copyright (C) 2011-2016 Free Software Foundation, Inc. + Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c deleted file mode 100644 index 7c93a8f375..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/posix_fadvise.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <fcntl.h> -#include <sysdep.h> - -/* Advice the system about the expected behaviour of the application with - respect to the file associated with FD. */ - -int -posix_fadvise (int fd, off_t offset, off_t len, int advise) -{ - INTERNAL_SYSCALL_DECL (err); - int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, - __LONG_LONG_PAIR (offset >> 31, offset), - __LONG_LONG_PAIR (len >> 31, len), - advise); - if (INTERNAL_SYSCALL_ERROR_P (ret, err)) - return INTERNAL_SYSCALL_ERRNO (ret, err); - return 0; -} diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c deleted file mode 100644 index 0dff648111..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <assert.h> -#include <errno.h> -#include <endian.h> -#include <unistd.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -ssize_t -__libc_pread (int fd, void *buf, size_t count, off_t offset) -{ - assert (sizeof (offset) == 4); - return SYSCALL_CANCEL (pread64, fd, - buf, count, __ALIGNMENT_ARG - __LONG_LONG_PAIR (offset >> 31, offset)); -} -strong_alias (__libc_pread, __pread) -weak_alias (__libc_pread, pread) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c deleted file mode 100644 index 8931900007..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <endian.h> -#include <unistd.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -ssize_t -__libc_pread64 (int fd, void *buf, size_t count, off64_t offset) -{ - return SYSCALL_CANCEL (pread64, fd, buf, count, __ALIGNMENT_ARG - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -} -weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c deleted file mode 100644 index ec30d4c0b7..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <assert.h> -#include <errno.h> -#include <endian.h> -#include <unistd.h> -#include <sys/uio.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -ssize_t -__libc_preadv (int fd, const struct iovec *vector, int count, off_t offset) -{ - assert (sizeof (offset) == 4); - return SYSCALL_CANCEL (preadv, fd, - vector, count, __ALIGNMENT_ARG - __LONG_LONG_PAIR (offset >> 31, offset)); -} -strong_alias (__libc_preadv, __preadv) -weak_alias (__libc_preadv, preadv) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c deleted file mode 100644 index fc008c67c5..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <endian.h> -#include <unistd.h> -#include <sys/uio.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -ssize_t -__libc_preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) -{ - return SYSCALL_CANCEL (preadv, fd, - vector, count, __ALIGNMENT_ARG - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -} - -strong_alias (__libc_preadv64, __preadv64) -weak_alias (__libc_preadv64, preadv64) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c deleted file mode 100644 index f9f1e0da36..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <assert.h> -#include <errno.h> -#include <endian.h> -#include <unistd.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -ssize_t -__libc_pwrite (int fd, const void *buf, size_t count, off_t offset) -{ - assert (sizeof (offset) == 4); - return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG - __LONG_LONG_PAIR (offset >> 31, offset)); -} -strong_alias (__libc_pwrite, __pwrite) -weak_alias (__libc_pwrite, pwrite) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c deleted file mode 100644 index 53aaa47fbd..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <endian.h> -#include <unistd.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -ssize_t -__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) -{ - return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -} -weak_alias (__libc_pwrite64, __pwrite64) -libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c deleted file mode 100644 index 9ef11b564c..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <assert.h> -#include <errno.h> -#include <endian.h> -#include <unistd.h> -#include <sys/uio.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -ssize_t -__libc_pwritev (int fd, const struct iovec *vector, int count, off_t offset) -{ - assert (sizeof (offset) == 4); - return SYSCALL_CANCEL (pwritev, fd, vector, count, __ALIGNMENT_ARG - __LONG_LONG_PAIR (offset >> 31, offset)); -} -strong_alias (__libc_pwritev, __pwritev) -weak_alias (__libc_pwritev, pwritev) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c deleted file mode 100644 index 49b723dffe..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <endian.h> -#include <unistd.h> -#include <sys/uio.h> - -#include <sysdep-cancel.h> -#include <sys/syscall.h> - -ssize_t -__libc_pwritev64 (int fd, const struct iovec *vector, int count, - off64_t offset) -{ - return SYSCALL_CANCEL (pwritev, fd, - vector, count, __ALIGNMENT_ARG - __LONG_LONG_PAIR ((off_t) (offset >> 32), - (off_t) (offset & 0xffffffff))); -} -strong_alias (__libc_pwritev64, pwritev64) -weak_alias (__libc_pwritev64, __pwritev64) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c index 51050c0971..5860f28844 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/sendfile.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c index 1937f0555f..4e1ba15885 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -18,8 +18,10 @@ #include <errno.h> #include <sys/statfs.h> +#include <kernel_stat.h> #include <stddef.h> +#if !STATFS_IS_STATFS64 #include "overflow.h" /* Return information about the filesystem on which FILE resides. */ @@ -31,3 +33,4 @@ __statfs (const char *file, struct statfs *buf) } libc_hidden_def (__statfs) weak_alias (__statfs, statfs) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list b/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list index f055c68519..b775008a37 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list @@ -1,7 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names # rlimit APIs -getrlimit - getrlimit i:ip __getrlimit getrlimit -setrlimit - setrlimit i:ip __setrlimit setrlimit prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c deleted file mode 100644 index 25799517da..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <sys/types.h> -#include <unistd.h> - -/* Truncate PATH to LENGTH bytes. */ -int -__truncate (const char *path, off_t length) -{ - return INLINE_SYSCALL (truncate64, __ALIGNMENT_COUNT (3, 4), path, - __ALIGNMENT_ARG - __LONG_LONG_PAIR (length >> 31, length)); -} -weak_alias (__truncate, truncate) diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c deleted file mode 100644 index f2927ea857..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/truncate64.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <errno.h> -#include <sys/types.h> -#include <unistd.h> - -/* Truncate the file PATH to LENGTH bytes. */ -int -truncate64 (const char *path, off64_t length) -{ - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; - return INLINE_SYSCALL (truncate64, __ALIGNMENT_COUNT (3, 4), path, - __ALIGNMENT_ARG __LONG_LONG_PAIR (high, low)); -} diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c index fdd2cb0ed8..1fd57ff9ed 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -25,6 +25,7 @@ #include <sysdep.h> #include <sys/syscall.h> +#if !XSTAT_IS_XSTAT64 #include "overflow.h" /* Get information about the file NAME in BUF. */ @@ -41,3 +42,4 @@ __xstat (int vers, const char *name, struct stat *buf) return -1; } hidden_def (__xstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c index 225233780b..ae704958ba 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -16,6 +16,13 @@ License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ +/* Hide the prototype for __xstat so that GCC will not complain about + the different function signature if it is aliased to __xstat64. + If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64 + structures have an identical layout but different type names. */ + +#define __xstat __xstat_disable + #include <errno.h> #include <stddef.h> #include <fcntl.h> @@ -36,3 +43,9 @@ __xstat64 (int vers, const char *name, struct stat64 *buf) return -1; } hidden_def (__xstat64) + +#undef __xstat +#if XSTAT_IS_XSTAT64 +strong_alias (__xstat64, __xstat) +hidden_ver (__xstat64, __xstat) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/xmknod.c b/sysdeps/unix/sysv/linux/generic/xmknod.c index 76b197f50a..9c9e634e41 100644 --- a/sysdeps/unix/sysv/linux/generic/xmknod.c +++ b/sysdeps/unix/sysv/linux/generic/xmknod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. diff --git a/sysdeps/unix/sysv/linux/generic/xstat.c b/sysdeps/unix/sysv/linux/generic/xstat.c index 3d82b87e4a..39acac633e 100644 --- a/sysdeps/unix/sysv/linux/generic/xstat.c +++ b/sysdeps/unix/sysv/linux/generic/xstat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2016 Free Software Foundation, Inc. +/* Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -41,7 +41,7 @@ __xstat (int vers, const char *name, struct stat *buf) hidden_def (__xstat) weak_alias (__xstat, _xstat); -#ifdef XSTAT_IS_XSTAT64 +#if XSTAT_IS_XSTAT64 #undef __xstat64 strong_alias (__xstat, __xstat64); hidden_ver (__xstat, __xstat64) |