diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390')
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/Dist | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/Makefile | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/Versions | 28 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/alphasort64.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/chown.c | 118 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/fxstat.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/getdents64.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/getrlimit.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/getrlimit64.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/lxstat.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/oldgetrlimit64.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/readdir64.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/readdir64_r.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/scandir64.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/setrlimit.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/syscalls.list | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/versionsort64.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/xstat.c | 1 |
18 files changed, 168 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/Dist b/sysdeps/unix/sysv/linux/s390/Dist index 9178cf74ab..d0740c12f9 100644 --- a/sysdeps/unix/sysv/linux/s390/Dist +++ b/sysdeps/unix/sysv/linux/s390/Dist @@ -1,4 +1,5 @@ clone.S +oldgetrlimit64.c setresuid.c setresgid.c setfsuid.c diff --git a/sysdeps/unix/sysv/linux/s390/Makefile b/sysdeps/unix/sysv/linux/s390/Makefile index f211840444..2115e40a2a 100644 --- a/sysdeps/unix/sysv/linux/s390/Makefile +++ b/sysdeps/unix/sysv/linux/s390/Makefile @@ -6,3 +6,7 @@ endif ifeq ($(subdir),csu) CFLAGS-initfini.s += -DWEAK_GMON_START endif + +ifeq ($(subdir),resource) +sysdep_routines += oldgetrlimit64 +endif diff --git a/sysdeps/unix/sysv/linux/s390/Versions b/sysdeps/unix/sysv/linux/s390/Versions new file mode 100644 index 0000000000..5a56361b60 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/Versions @@ -0,0 +1,28 @@ +libc { + GLIBC_2.0 { + # Exception handling support functions from libgcc + __register_frame; __register_frame_table; __deregister_frame; + __register_frame_info; __deregister_frame_info; __frame_state_for; + __register_frame_info_table; + } + GLIBC_2.2 { + # functions used in other libraries + __xstat64; __fxstat64; __lxstat64; + + # a* + alphasort64; + + # New rlimit interface + getrlimit; setrlimit; getrlimit64; + + # r* + readdir64; readdir64_r; + + # s* + scandir64; + + # v* + versionsort64; + } +} + diff --git a/sysdeps/unix/sysv/linux/s390/alphasort64.c b/sysdeps/unix/sysv/linux/s390/alphasort64.c new file mode 100644 index 0000000000..0b5ae47d2f --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/alphasort64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/alphasort64.c> diff --git a/sysdeps/unix/sysv/linux/s390/chown.c b/sysdeps/unix/sysv/linux/s390/chown.c new file mode 100644 index 0000000000..0e22192858 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/chown.c @@ -0,0 +1,118 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <errno.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> +#include <shlib-compat.h> +#include <bp-checks.h> + +#include <linux/posix_types.h> +#include "kernel-features.h" + +/* + In Linux 2.1.x the chown functions have been changed. A new function lchown + was introduced. The new chown now follows symlinks - the old chown and the + new lchown do not follow symlinks. + The new lchown function has the same number as the old chown had and the + new chown has a new number. When compiling with headers from Linux > 2.1.8x + it's impossible to run this libc with older kernels. In these cases libc + has therefore to route calls to chown to the old chown function. +*/ + +extern int __syscall_chown (const char *__file, + __kernel_uid_t __owner, __kernel_gid_t __group); + +/* Running under Linux > 2.1.80. */ + +#ifdef __NR_chown32 +extern int __syscall_chown32 (const char *__file, + __kernel_uid32_t owner, __kernel_gid32_t group); +# if __ASSUME_32BITUIDS == 0 +/* This variable is shared with all files that need to check for 32bit + uids. */ +extern int __libc_missing_32bit_uids; +# endif +#endif /* __NR_chown32 */ + +int +__real_chown (const char *file, uid_t owner, gid_t group) +{ + static int __libc_old_chown; + int result; + + if (!__libc_old_chown) + { + int saved_errno = errno; +#ifdef __NR_chown32 + if (__libc_missing_32bit_uids <= 0) + { + int result; + int saved_errno = errno; + + result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); + if (result == 0 || errno != ENOSYS) + return result; + + __set_errno (saved_errno); + __libc_missing_32bit_uids = 1; + } +#endif /* __NR_chown32 */ + if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U)) + || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U))) + { + __set_errno (EINVAL); + return -1; + } + + result = INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group); + + if (result >= 0 || errno != ENOSYS) + return result; + + __set_errno (saved_errno); + __libc_old_chown = 1; + } + + return __lchown (file, owner, group); +} + + +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) +/* Compiling for compatibiity. */ +int +__chown_is_lchown (const char *file, uid_t owner, gid_t group) +{ + return __lchown (file, owner, group); +} +#endif + +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) +strong_alias (__chown_is_lchown, _chown_is_lchown) +compat_symbol (libc, __chown_is_lchown, __chown, GLIBC_2_0); +compat_symbol (libc, _chown_is_lchown, chown, GLIBC_2_0); + +strong_alias (__real_chown, _real_chown) +versioned_symbol (libc, __real_chown, __chown, GLIBC_2_1); +versioned_symbol (libc, _real_chown, chown, GLIBC_2_1); +#else +strong_alias (__real_chown, __chown) +weak_alias (__real_chown, chown) +#endif diff --git a/sysdeps/unix/sysv/linux/s390/fxstat.c b/sysdeps/unix/sysv/linux/s390/fxstat.c new file mode 100644 index 0000000000..4f219f0b9d --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/fxstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/fxstat.c> diff --git a/sysdeps/unix/sysv/linux/s390/getdents64.c b/sysdeps/unix/sysv/linux/s390/getdents64.c new file mode 100644 index 0000000000..0c75fb5a06 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/getdents64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getdents64.c> diff --git a/sysdeps/unix/sysv/linux/s390/getrlimit.c b/sysdeps/unix/sysv/linux/s390/getrlimit.c new file mode 100644 index 0000000000..fc06dbd641 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/getrlimit.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getrlimit.c> diff --git a/sysdeps/unix/sysv/linux/s390/getrlimit64.c b/sysdeps/unix/sysv/linux/s390/getrlimit64.c new file mode 100644 index 0000000000..fef018f471 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/getrlimit64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c> diff --git a/sysdeps/unix/sysv/linux/s390/lxstat.c b/sysdeps/unix/sysv/linux/s390/lxstat.c new file mode 100644 index 0000000000..0efa0aea49 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/lxstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/lxstat.c> diff --git a/sysdeps/unix/sysv/linux/s390/oldgetrlimit64.c b/sysdeps/unix/sysv/linux/s390/oldgetrlimit64.c new file mode 100644 index 0000000000..4c27e957bf --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/oldgetrlimit64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c> diff --git a/sysdeps/unix/sysv/linux/s390/readdir64.c b/sysdeps/unix/sysv/linux/s390/readdir64.c new file mode 100644 index 0000000000..2ea26dd409 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/readdir64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/readdir64.c> diff --git a/sysdeps/unix/sysv/linux/s390/readdir64_r.c b/sysdeps/unix/sysv/linux/s390/readdir64_r.c new file mode 100644 index 0000000000..9f54f897e3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/readdir64_r.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c> diff --git a/sysdeps/unix/sysv/linux/s390/scandir64.c b/sysdeps/unix/sysv/linux/s390/scandir64.c new file mode 100644 index 0000000000..506fd8877c --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/scandir64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/scandir64.c> diff --git a/sysdeps/unix/sysv/linux/s390/setrlimit.c b/sysdeps/unix/sysv/linux/s390/setrlimit.c new file mode 100644 index 0000000000..bfaef74c38 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/setrlimit.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/setrlimit.c> diff --git a/sysdeps/unix/sysv/linux/s390/syscalls.list b/sysdeps/unix/sysv/linux/s390/syscalls.list new file mode 100644 index 0000000000..913f051ff4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/syscalls.list @@ -0,0 +1,4 @@ +# File name Caller Syscall name Args Strong name Weak names + +oldgetrlimit EXTRA getrlimit i:ip __old_getrlimit getrlimit@GLIBC_2.0 +oldsetrlimit EXTRA setrlimit i:ip __old_setrlimit setrlimit@GLIBC_2.0 diff --git a/sysdeps/unix/sysv/linux/s390/versionsort64.c b/sysdeps/unix/sysv/linux/s390/versionsort64.c new file mode 100644 index 0000000000..144b691e56 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/versionsort64.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/versionsort64.c> diff --git a/sysdeps/unix/sysv/linux/s390/xstat.c b/sysdeps/unix/sysv/linux/s390/xstat.c new file mode 100644 index 0000000000..e9869f5508 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/xstat.c @@ -0,0 +1 @@ +#include <sysdeps/unix/sysv/linux/i386/xstat.c> |