summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix/sysv/linux/i386
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux/i386')
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fxstat.c41
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fxstatat.c46
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/lxstat.c40
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/mmap.S23
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/mmap64.S44
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S69
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/xstat.c39
7 files changed, 5 insertions, 297 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fxstat.c b/libc/sysdeps/unix/sysv/linux/i386/fxstat.c
index 5077780f0..a1a950ee7 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fxstat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fxstat.c
@@ -1,6 +1,5 @@
/* fxstat using old-style Unix fstat system call.
- Copyright (C) 1991,1995-1998,2000,2002,2003,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1991-2012 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
@@ -34,26 +33,15 @@
#include <xstatconv.h>
-#ifdef __NR_stat64
-# if __ASSUME_STAT64_SYSCALL == 0
-/* The variable is shared between all wrappers around *stat64 calls. */
-extern int __have_no_stat64;
-# endif
-#endif
-
/* Get information about the file FD in BUF. */
int
__fxstat (int vers, int fd, struct stat *buf)
{
-#if __ASSUME_STAT64_SYSCALL == 0
- struct kernel_stat kbuf;
-#endif
int result;
if (vers == _STAT_VER_KERNEL)
return INLINE_SYSCALL (fstat, 2, fd, CHECK_1 ((struct kernel_stat *) buf));
-#if __ASSUME_STAT64_SYSCALL > 0
{
struct stat64 buf64;
@@ -62,33 +50,6 @@ __fxstat (int vers, int fd, struct stat *buf)
result = __xstat32_conv (vers, &buf64, buf);
return result;
}
-#else
-
-# if defined __NR_stat64
- /* To support 32 bit UIDs, we have to use stat64. The normal stat call only returns
- 16 bit UIDs. */
- if (! __have_no_stat64)
- {
- struct stat64 buf64;
-
- result = INLINE_SYSCALL (fstat64, 2, fd, __ptrvalue (&buf64));
-
- if (result == 0)
- result = __xstat32_conv (vers, &buf64, buf);
-
- if (result != -1 || errno != ENOSYS)
- return result;
-
- __have_no_stat64 = 1;
- }
-# endif
-
- result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf));
- if (result == 0)
- result = __xstat_conv (vers, &kbuf, buf);
-
- return result;
-#endif /* __ASSUME_STAT64_SYSCALL */
}
hidden_def (__fxstat)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c b/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c
index 7aae336e0..d1e81e081 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fxstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2012 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
@@ -35,13 +35,6 @@
#include <xstatconv.h>
-#ifdef __NR_stat64
-# if __ASSUME_STAT64_SYSCALL == 0
-/* The variable is shared between all wrappers around *stat64 calls. */
-extern int __have_no_stat64;
-# endif
-#endif
-
/* Get information about the file NAME relative to FD in ST. */
int
@@ -106,9 +99,6 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
file = buf;
}
-# if __ASSUME_STAT64_SYSCALL == 0
- struct kernel_stat kst;
-# endif
if (vers == _STAT_VER_KERNEL)
{
if (flag & AT_SYMLINK_NOFOLLOW)
@@ -120,8 +110,6 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
goto out;
}
-# if __ASSUME_STAT64_SYSCALL > 0
-
if (flag & AT_SYMLINK_NOFOLLOW)
result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
__ptrvalue (&st64));
@@ -130,38 +118,6 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
__ptrvalue (&st64));
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat32_conv (vers, &st64, st);
-# else
-# if defined __NR_stat64
- /* To support 32 bit UIDs, we have to use stat64. The normal stat
- call only returns 16 bit UIDs. */
- if (! __have_no_stat64)
- {
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
- __ptrvalue (&st64));
- else
- result = INTERNAL_SYSCALL (stat64, err, 2, CHECK_STRING (file),
- __ptrvalue (&st64));
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- result = __xstat32_conv (vers, &st64, st);
-
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)
- || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
- goto out;
-
- __have_no_stat64 = 1;
- }
-# endif
- if (flag & AT_SYMLINK_NOFOLLOW)
- result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
- else
- result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
- __ptrvalue (&kst));
- if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
- return __xstat_conv (vers, &kst, st);
-# endif /* __ASSUME_STAT64_SYSCALL */
out:
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 0))
diff --git a/libc/sysdeps/unix/sysv/linux/i386/lxstat.c b/libc/sysdeps/unix/sysv/linux/i386/lxstat.c
index 8994e1700..2b1ecaa0d 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/lxstat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/lxstat.c
@@ -1,6 +1,5 @@
/* lxstat using old-style Unix lstat system call.
- Copyright (C) 1991,1995,1996,1997,1998,2000,2002,2003,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1991-2012 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
@@ -34,27 +33,16 @@
#include <xstatconv.h>
-#ifdef __NR_stat64
-# if __ASSUME_STAT64_SYSCALL == 0
-/* The variable is shared between all wrappers around *stat64 calls. */
-extern int __have_no_stat64;
-# endif
-#endif
-
/* Get information about the file NAME in BUF. */
int
__lxstat (int vers, const char *name, struct stat *buf)
{
-#if __ASSUME_STAT64_SYSCALL == 0
- struct kernel_stat kbuf;
-#endif
int result;
if (vers == _STAT_VER_KERNEL)
return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), CHECK_1 ((struct kernel_stat *) buf));
-#if __ASSUME_STAT64_SYSCALL > 0
{
struct stat64 buf64;
@@ -63,32 +51,6 @@ __lxstat (int vers, const char *name, struct stat *buf)
result = __xstat32_conv (vers, &buf64, buf);
return result;
}
-#else
-
-# if defined __NR_stat64
- /* To support 32 bit UIDs, we have to use stat64. The normal stat call only returns
- 16 bit UIDs. */
- if (! __have_no_stat64)
- {
- struct stat64 buf64;
- result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), __ptrvalue (&buf64));
-
- if (result == 0)
- result = __xstat32_conv (vers, &buf64, buf);
-
- if (result != -1 || errno != ENOSYS)
- return result;
-
- __have_no_stat64 = 1;
- }
-# endif
-
- result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
- if (result == 0)
- result = __xstat_conv (vers, &kbuf, buf);
-
- return result;
-#endif
}
hidden_def (__lxstat)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/mmap.S b/libc/sysdeps/unix/sysv/linux/i386/mmap.S
index c8bf3e108..1f79bde28 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/mmap.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/mmap.S
@@ -25,10 +25,6 @@
ENTRY (__mmap)
-/* I don't think it is worthwhile trying to use mmap2 whenever it
- is available. Only use it when we are sure the syscall exists. */
-#ifdef __ASSUME_MMAP2_SYSCALL
-
/* Save registers. */
pushl %ebp
cfi_adjust_cfa_offset (4)
@@ -73,25 +69,6 @@ L(skip):
cfi_adjust_cfa_offset (-4)
cfi_restore (ebp)
-#else
-
- /* Save registers. */
- movl %ebx, %edx
- cfi_register (ebx, edx)
-
- movl $SYS_ify(mmap), %eax /* System call number in %eax. */
-
- lea 4(%esp), %ebx /* Address of args is 1st arg. */
-
- /* Do the system call trap. */
- int $0x80
-
- /* Restore registers. */
- movl %edx, %ebx
- cfi_restore (ebx)
-
-#endif
-
/* If 0 > %eax > -4096 there was an error. */
cmpl $-4096, %eax
ja SYSCALL_ERROR_LABEL
diff --git a/libc/sysdeps/unix/sysv/linux/i386/mmap64.S b/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
index 7599b8544..8855109ff 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/mmap64.S
@@ -37,8 +37,6 @@
.text
ENTRY (BP_SYM (__mmap64))
-#ifdef __NR_mmap2
-
/* Save registers. */
pushl %ebp
cfi_adjust_cfa_offset (4)
@@ -88,12 +86,6 @@ L(do_syscall):
cfi_adjust_cfa_offset (-4)
cfi_restore (ebp)
-#ifndef __ASSUME_MMAP2_SYSCALL
-2:
- cmp $-ENOSYS, %eax
- je 3f
-#endif
-
/* If 0 > %eax > -4096 there was an error. */
cmpl $-4096, %eax
ja SYSCALL_ERROR_LABEL
@@ -122,42 +114,6 @@ L(einval):
cfi_restore (ebp)
movl $-EINVAL, %eax
jmp SYSCALL_ERROR_LABEL
-#endif
-
-#if !defined __ASSUME_MMAP2_SYSCALL || !defined __NR_mmap2
-3:
- /* Save registers. */
- movl %ebx, %edx
- cfi_register (ebx, edx)
-
- cmpl $0, OFFHI-SVRSP(%esp)
- jne L(einval2)
-
- movl $SYS_ify(mmap), %eax /* System call number in %eax. */
-
- lea ADDR-SVRSP(%esp), %ebx /* Address of args is 1st arg. */
-
- /* Do the system call trap. */
- ENTER_KERNEL
-
- /* Restore registers. */
- movl %edx, %ebx
- cfi_restore (ebx)
-
- /* If 0 > %eax > -4096 there was an error. */
- cmpl $-4096, %eax
- ja SYSCALL_ERROR_LABEL
-
- /* Successful; return the syscall's value. */
- ret
-
- cfi_register (ebx, edx)
-L(einval2):
- movl %edx, %ebx
- cfi_restore (ebx)
- movl $-EINVAL, %eax
- jmp SYSCALL_ERROR_LABEL
-#endif
PSEUDO_END (BP_SYM (__mmap64))
diff --git a/libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S b/libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
index 79fc071d2..00e6a4194 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
+++ b/libc/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995-2000,2002,2003,2004,2005,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 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
@@ -20,8 +19,6 @@
#include <bp-sym.h>
#include <bp-asm.h>
-#include <kernel-features.h>
-
#define EINVAL 22
#define ENOSYS 38
#define EOVERFLOW 75
@@ -38,8 +35,6 @@
.text
ENTRY (BP_SYM (__posix_fadvise64_l64))
-#ifdef __NR_fadvise64_64
-
/* Save registers. */
pushl %ebp
cfi_adjust_cfa_offset (4)
@@ -78,11 +73,6 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
cfi_adjust_cfa_offset (-4)
cfi_restore (ebp)
-#ifndef __ASSUME_FADVISE64_64_SYSCALL
- cmpl $-ENOSYS, %eax
- je 1f
-#endif
-
/* The function returns zero, or the error number. So all we
have to do is negate the value passed back from the kernel. */
/* If 0 > %eax > -4096 there was an error. */
@@ -90,72 +80,15 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
/* Successful; return the syscall's value. */
ret
-#endif
-
-#if defined __NR_fadvise64 \
- && (!defined __ASSUME_FADVISE64_64_SYSCALL || !defined __NR_fadvise64_64)
-1: /* Save registers. */
- pushl %ebx
- cfi_adjust_cfa_offset (4)
- pushl %esi
- cfi_adjust_cfa_offset (4)
- pushl %edi
- cfi_adjust_cfa_offset (4)
-
- /* Overflow check. */
- cmpl $0, LENHI(%esp)
- movl $-EOVERFLOW, %eax
- jne L(overflow)
-
- movl FD(%esp), %ebx
- cfi_rel_offset (ebx, 8)
- movl OFFLO(%esp), %ecx
- movl OFFHI(%esp), %edx
- movl LENLO(%esp), %esi
- cfi_rel_offset (esi, 4)
- movl FLAGS(%esp), %edi
- cfi_rel_offset (edi, 0)
-
- movl $SYS_ify(fadvise64), %eax
- ENTER_KERNEL
-
- /* Restore registers. */
-L(overflow):
- popl %edi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (edi)
- popl %esi
- cfi_adjust_cfa_offset (-4)
- cfi_restore (esi)
- popl %ebx
- cfi_adjust_cfa_offset (-4)
- cfi_restore (ebx)
-
- /* If 0 > %eax > -4096 there was an error. */
- negl %eax
-
- /* Successful; return the syscall's value. */
- ret
-#else
- movl $ENOSYS, %eax
- ret
-#endif
END (BP_SYM (__posix_fadvise64_l64))
-#ifdef __NR_fadvise64
.section .text.compat, "ax"
ENTRY (__posix_fadvise64_l32)
DO_CALL (fadvise64, 5)
negl %eax
ret
PSEUDO_END_ERRVAL (__posix_fadvise64_l32)
-#else
-ENTRY (BP_SYM (__posix_fadvise64_l32))
- movl $ENOSYS, %eax
- ret
-END (BP_SYM (__posix_fadvise64_l32))
-#endif
default_symbol_version (__posix_fadvise64_l64, posix_fadvise64, GLIBC_2.3.3)
symbol_version (__posix_fadvise64_l32, posix_fadvise64, GLIBC_2.2)
diff --git a/libc/sysdeps/unix/sysv/linux/i386/xstat.c b/libc/sysdeps/unix/sysv/linux/i386/xstat.c
index 236ec748f..0fe7a9dcd 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/xstat.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/xstat.c
@@ -1,6 +1,5 @@
/* xstat using old-style Unix stat system call.
- Copyright (C) 1991,95,96,97,98,2000,2002,2003,2006
- Free Software Foundation, Inc.
+ Copyright (C) 1991-2012 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
@@ -34,27 +33,16 @@
#include <xstatconv.h>
-#ifdef __NR_stat64
-# if __ASSUME_STAT64_SYSCALL == 0
-/* The variable is shared between all wrappers around *stat64 calls. */
-extern int __have_no_stat64;
-# endif
-#endif
-
/* Get information about the file NAME in BUF. */
int
__xstat (int vers, const char *name, struct stat *buf)
{
-#if __ASSUME_STAT64_SYSCALL == 0
- struct kernel_stat kbuf;
-#endif
int result;
if (vers == _STAT_VER_KERNEL)
return INLINE_SYSCALL (stat, 2, CHECK_STRING (name), CHECK_1 ((struct kernel_stat *) buf));
-#if __ASSUME_STAT64_SYSCALL > 0
{
struct stat64 buf64;
@@ -63,31 +51,6 @@ __xstat (int vers, const char *name, struct stat *buf)
result = __xstat32_conv (vers, &buf64, buf);
return result;
}
-#else
-# if defined __NR_stat64
- /* To support 32 bit UIDs, we have to use stat64. The normal stat call only returns
- 16 bit UIDs. */
- if (! __have_no_stat64)
- {
- struct stat64 buf64;
-
- result = INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), __ptrvalue (&buf64));
-
- if (result == 0)
- result = __xstat32_conv (vers, &buf64, buf);
-
- if (result != -1 || errno != ENOSYS)
- return result;
-
- __have_no_stat64 = 1;
- }
-# endif
- result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
- if (result == 0)
- result = __xstat_conv (vers, &kbuf, buf);
-
- return result;
-#endif /* __ASSUME_STAT64_SYSCALL */
}
hidden_def (__xstat)
weak_alias (__xstat, _xstat);