summaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list6
-rw-r--r--sysdeps/unix/sysv/linux/ftruncate64.c9
-rw-r--r--sysdeps/unix/sysv/linux/fxstat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h8
-rw-r--r--sysdeps/unix/sysv/linux/lxstat64.c4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c74
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/fxstat64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/lxstat64.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list8
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/xstat64.c1
-rw-r--r--sysdeps/unix/sysv/linux/truncate64.c5
-rw-r--r--sysdeps/unix/sysv/linux/xstat64.c6
14 files changed, 116 insertions, 20 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 49f2b11a50..03030b6c45 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -22,9 +22,9 @@ vfork - vfork 0 __vfork vfork
getpeername - getpeername 3 __getpeername getpeername
getpriority - getpriority 2 __getpriority getpriority
mmap - mmap 6 __mmap mmap __mmap64 mmap64
-llseek EXTRA lseek 3 __llseek llseek __lseek64 lseek64
-pread - pread 4 __pread pread __pread64 pread64
-pwrite - pwrite 4 __pwrite pwrite __pwrite64 pwrite64
+llseek EXTRA lseek 3 __libc_lseek64 __llseek llseek __lseek64 lseek64
+pread - pread 4 __libc_pread __libc_pread64 __pread pread __pread64 pread64
+pwrite - pwrite 4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
fstatfs - fstatfs 2 __fstatfs fstatfs fstatfs64
statfs - statfs 2 __statfs statfs statfs64
getrlimit - getrlimit 2 __getrlimit getrlimit getrlimit64
diff --git a/sysdeps/unix/sysv/linux/ftruncate64.c b/sysdeps/unix/sysv/linux/ftruncate64.c
index 47df34ec7e..49133e8dd0 100644
--- a/sysdeps/unix/sysv/linux/ftruncate64.c
+++ b/sysdeps/unix/sysv/linux/ftruncate64.c
@@ -26,7 +26,10 @@
#include "kernel-features.h"
#ifdef __NR_ftruncate64
-static int have_no_ftruncate64;
+#ifndef __ASSUME_TRUNCATE64_SYSCALL
+/* The variable is shared between all wrappers around *truncate64 calls. */
+extern int have_no_truncate64;
+#endif
extern int __syscall_ftruncate64 (int fd, int high_length, int low_length);
@@ -38,7 +41,7 @@ ftruncate64 (fd, length)
off64_t length;
{
#ifndef __ASSUME_TRUNCATE64_SYSCALL
- if (! have_no_ftruncate64)
+ if (! have_no_truncate64)
#endif
{
unsigned int low = length & 0xffffffff;
@@ -55,7 +58,7 @@ ftruncate64 (fd, length)
#ifndef __ASSUME_TRUNCATE64_SYSCALL
__set_errno (saved_errno);
- have_no_ftruncate64 = 1;
+ have_no_truncate64 = 1;
#endif
}
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c
index e2fce6d466..a08f91526c 100644
--- a/sysdeps/unix/sysv/linux/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/fxstat64.c
@@ -45,7 +45,7 @@ int
__fxstat64 (int vers, int fd, struct stat64 *buf)
{
#if __ASSUME_STAT64_SYSCALL > 0
- return INLINE_SYSCALL (fstat64, 2, fd, &buf);
+ return INLINE_SYSCALL (fstat64, 2, fd, buf);
#else
int result;
struct kernel_stat kbuf;
@@ -53,7 +53,7 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
if (! have_no_stat64)
{
int saved_errno = errno;
- result = INLINE_SYSCALL (fstat64, 2, fd, &buf);
+ result = INLINE_SYSCALL (fstat64, 2, fd, buf);
if (result != -1 || errno != ENOSYS)
return result;
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 36cd46aa94..c22b9d101d 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -94,3 +94,11 @@
#if __LINUX_KERNEL_VERSION >= 131874 && defined __i386__
# define __ASSUME_STAT64_SYSCALL 1
#endif
+
+/* On sparc the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64
+ syscalls were introduced in 2.3.35. */
+#if __LINUX_KERNEL_VERSION >= 131875 && defined __sparc__
+# define __ASSUME_TRUNCATE64_SYSCALL 1
+# define __ASSUME_MMAP2_SYSCALL 1
+# define __ASSUME_STAT64_SYSCALL 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c
index 79a29fb894..fc7828ad4f 100644
--- a/sysdeps/unix/sysv/linux/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/lxstat64.c
@@ -45,7 +45,7 @@ int
__lxstat64 (int vers, const char *name, struct stat64 *buf)
{
#ifdef __ASSUME_STAT64_SYSCALL
- return INLINE_SYSCALL (lstat64, 2, name, &buf);
+ return INLINE_SYSCALL (lstat64, 2, name, buf);
#else
struct kernel_stat kbuf;
int result;
@@ -53,7 +53,7 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
if (! have_no_stat64)
{
int saved_errno = errno;
- result = INLINE_SYSCALL (lstat64, 2, name, &kbuf);
+ result = INLINE_SYSCALL (lstat64, 2, name, buf);
if (result != -1 || errno != ENOSYS)
return result;
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c
new file mode 100644
index 0000000000..a51c1e0098
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@redhat.com>, 1999.
+
+ 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 <sys/mman.h>
+
+#include "kernel-features.h"
+
+#ifdef __NR_mmap2
+extern int __syscall_mmap2(__ptr_t, size_t, int, int, int, off_t);
+#ifndef __ASSUME_MMAP2_SYSCALL
+static int have_no_mmap2;
+#endif
+#endif
+
+__ptr_t
+__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, off64_t offset)
+{
+#ifdef __NR_mmap2
+ if (
+#ifndef __ASSUME_MMAP2_SYSCALL
+ ! have_no_mmap2 &&
+#endif
+ ! (offset & 4095))
+ {
+#ifndef __ASSUME_TRUNCATE64_SYSCALL
+ int saved_errno = errno;
+#endif
+ /* This will be always 12, no matter what page size is. */
+ int result = INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags,
+ fd, (off_t) (offset >> 12));
+
+#ifndef __ASSUME_TRUNCATE64_SYSCALL
+ if (result != -1 || errno != ENOSYS)
+#endif
+ return result;
+
+#ifndef __ASSUME_TRUNCATE64_SYSCALL
+ __set_errno (saved_errno);
+ have_no_mmap2 = 1;
+#endif
+ }
+#endif
+ if (offset != (off_t) offset || (offset + len) != (off_t) (offset + len))
+ {
+ __set_errno (EINVAL);
+ return MAP_FAILED;
+ }
+
+ return __mmap (addr, len, prot, flags, fd, (off_t) offset);
+}
+
+weak_alias (__mmap64, mmap64)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
index c80056f003..07333a72b6 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list
@@ -23,12 +23,16 @@ rt_sigqueueinfo - rt_sigqueueinfo 3 __syscall_rt_sigqueueinfo
rt_sigsuspend - rt_sigsuspend 2 __syscall_rt_sigsuspend
rt_sigtimedwait - rt_sigtimedwait 4 __syscall_rt_sigtimedwait
s_execve execve execve 3 __syscall_execve
+s_fstat64 fxstat64 fstat64 2 __syscall_fstat64
+s_ftruncate64 ftruncate64 ftruncate64 3 __syscall_ftruncate64
s_getcwd getcwd getcwd 2 __syscall_getcwd
s_getdents getdents getdents 3 __syscall_getdents
s_getpriority getpriority getpriority 2 __syscall_getpriority
s_getresgid getresgid getresgid 3 __syscall_getresgid
s_getresuid getresuid getresuid 3 __syscall_getresuid
s_getrlimit getrlimit getrlimit 2 __syscall_getrlimit
+s_lstat64 lxstat64 lstat64 2 __syscall_lstat64
+s_mmap2 mmap64 mmap2 6 __syscall_mmap2
s_poll poll poll 3 __syscall_poll
s_pread64 pread64 pread 5 __syscall_pread
s_ptrace ptrace ptrace 4 __syscall_ptrace
@@ -38,8 +42,9 @@ s_sigaction sigaction sigaction 3 __syscall_sigaction
s_sigpending sigpending sigpending 1 __syscall_sigpending
s_sigprocmask sigprocmask sigprocmask 3 __syscall_sigprocmask
s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend
+s_stat64 xstat64 stat64 2 __syscall_stat64
s_sysctl sysctl _sysctl 1 __syscall__sysctl
-s_ugetrlimit getrlimit ugetrlimit 2 __syscall_ugetrlimit
+s_truncate64 truncate64 truncate64 3 __syscall_truncate64
s_ustat ustat ustat 2 __syscall_ustat
sys_fstat fxstat fstat 2 __syscall_fstat
sys_lstat lxstat lstat 2 __syscall_lstat
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat64.c
new file mode 100644
index 0000000000..9eff9ebeb7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/fxstat64.c
@@ -0,0 +1 @@
+/* fxstat64 is in fxstat.c */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
index dd509a7e8a..05457fc78e 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
@@ -20,3 +20,5 @@ struct kernel_stat
#define _HAVE___UNUSED1
#define _HAVE___UNUSED2
+
+#define XSTAT_IS_XSTAT64 1
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/lxstat64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/lxstat64.c
new file mode 100644
index 0000000000..bb5dbd0fff
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/lxstat64.c
@@ -0,0 +1 @@
+/* lxstat64 is in lxstat.c */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index c857cf880f..8fc6c933f4 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -1,15 +1,13 @@
# File name Caller Syscall name # args Strong name Weak names
# Whee! 64-bit systems naturally implement llseek.
-llseek EXTRA lseek 3 __llseek llseek __lseek64 lseek64
-pread - pread 4 __pread pread __pread64 pread64
-pwrite - pwrite 4 __pwrite pwrite __pwrite64 pwrite64
+llseek EXTRA lseek 3 __llseek llseek __libc_lseek64 __lseek64 lseek64
+pread - pread 4 __libc_pread __libc_pread64 __pread pread __pread64 pread64
+pwrite - pwrite 4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
fstatfs - fstatfs 2 __fstatfs fstatfs fstatfs64
statfs - statfs 2 __statfs statfs statfs64
getrlimit - getrlimit 2 __getrlimit getrlimit getrlimit64
setrlimit - setrlimit 2 setrlimit setrlimit64
-oldgetrlimit EXTRA getrlimit 2 __old_getrlimit getrlimit@GLIBC_2.0 getrlimit64@GLIBC_2.1
-oldsetrlimit EXTRA setrlimit 2 __old_setrlimit setrlimit@GLIBC_2.0 setrlimit64@GLIBC_2.1
ftruncate - ftruncate 2 __ftruncate ftruncate ftruncate64
truncate - truncate 2 truncate truncate64
mmap - mmap 6 __mmap mmap __mmap64 mmap64
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/xstat64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/xstat64.c
new file mode 100644
index 0000000000..e7acd3b45e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/xstat64.c
@@ -0,0 +1 @@
+/* xstat64 is in xstat.c */
diff --git a/sysdeps/unix/sysv/linux/truncate64.c b/sysdeps/unix/sysv/linux/truncate64.c
index 4fe446475a..d08adff5b6 100644
--- a/sysdeps/unix/sysv/linux/truncate64.c
+++ b/sysdeps/unix/sysv/linux/truncate64.c
@@ -26,7 +26,10 @@
#include "kernel-features.h"
#ifdef __NR_truncate64
-static int have_no_truncate64;
+#ifndef __ASSUME_TRUNCATE64_SYSCALL
+/* The variable is shared between all wrappers around *truncate64 calls. */
+int have_no_truncate64;
+#endif
extern int __syscall_truncate64 (int fd, int high_length, int low_length);
diff --git a/sysdeps/unix/sysv/linux/xstat64.c b/sysdeps/unix/sysv/linux/xstat64.c
index b2a83e6530..f0136db2b1 100644
--- a/sysdeps/unix/sysv/linux/xstat64.c
+++ b/sysdeps/unix/sysv/linux/xstat64.c
@@ -33,7 +33,7 @@
extern int __syscall_stat (const char *, struct kernel_stat *);
#ifdef __NR_stat64
-extern int __syscall_fstat64 (int, struct stat64 *);
+extern int __syscall_stat64 (const char *, struct stat64 *);
# if __ASSUME_STAT64_SYSCALL == 0
/* The variable is shared between all wrappers around *stat64 calls.
This is the definition. */
@@ -47,7 +47,7 @@ int
__xstat64 (int vers, const char *name, struct stat64 *buf)
{
#if __ASSUME_STAT64_SYSCALL > 0
- return INLINE_SYSCALL (stat64, 2, name, &buf);
+ return INLINE_SYSCALL (stat64, 2, name, buf);
#else
struct kernel_stat kbuf;
int result;
@@ -55,7 +55,7 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
if (! have_no_stat64)
{
int saved_errno = errno;
- result = INLINE_SYSCALL (stat64, 2, name, &buf);
+ result = INLINE_SYSCALL (stat64, 2, name, buf);
if (result != -1 || errno != ENOSYS)
return result;