linamh/sys-libs/glibc/files/2.3.4/glibc234-alpha-xstat.patch
2009-09-12 08:46:08 +00:00

232 lines
7.5 KiB
Diff

diff -u -p -r1.83 kernel-features.h
--- sysdeps/unix/sysv/linux/kernel-features.h 26 Jan 2005 20:01:10 -0000 1.83
+++ sysdeps/unix/sysv/linux/kernel-features.h 18 Feb 2005 06:21:10 -0000
@@ -413,6 +413,11 @@
# define __ASSUME_GETDENTS32_D_TYPE 1
#endif
+/* Starting with version 2.6.4, alpha stat64 syscalls are available. */
+#if __LINUX_KERNEL_VERSION >= 0x020604 && defined __alpha__
+# define __ASSUME_STAT64_SYSCALL 1
+#endif
+
/* Starting with version 2.5.3, the initial location returned by `brk'
after exec is always rounded up to the next page. */
#if __LINUX_KERNEL_VERSION >= 132355
diff -u -p -r1.1 fxstat.c
--- sysdeps/unix/sysv/linux/alpha/fxstat.c 11 Mar 2004 02:58:44 -0000 1.1
+++ sysdeps/unix/sysv/linux/alpha/fxstat.c 18 Feb 2005 06:21:10 -0000
@@ -1,5 +1,5 @@
/* fxstat using old-style Unix stat system call.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 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,27 +35,39 @@ int
__fxstat (int vers, int fd, struct stat *buf)
{
INTERNAL_SYSCALL_DECL (err);
- int result, errno_out;
+ int result;
struct kernel_stat kbuf;
+#if __ASSUME_STAT64_SYSCALL > 0
+ if (vers == _STAT_VER_KERNEL64)
+ {
+ result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+ return result;
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+ return -1;
+ }
+#elif defined __NR_fstat64
if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
{
+ int errno_out;
result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return result;
errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
if (errno_out != ENOSYS)
- goto fail;
+ {
+ __set_errno (errno_out);
+ return -1;
+ }
__libc_missing_axp_stat64 = 1;
}
+#endif
result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat_conv (vers, &kbuf, buf);
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-
- fail:
- __set_errno (errno_out);
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
return -1;
}
hidden_def (__fxstat)
diff -u -p -r1.1 lxstat.c
--- sysdeps/unix/sysv/linux/alpha/lxstat.c 11 Mar 2004 02:58:44 -0000 1.1
+++ sysdeps/unix/sysv/linux/alpha/lxstat.c 18 Feb 2005 06:21:10 -0000
@@ -1,5 +1,5 @@
/* lxstat using old-style Unix stat system call.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 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,27 +35,39 @@ int
__lxstat (int vers, const char *name, struct stat *buf)
{
INTERNAL_SYSCALL_DECL (err);
- int result, errno_out;
+ int result;
struct kernel_stat kbuf;
+#if __ASSUME_STAT64_SYSCALL > 0
+ if (vers == _STAT_VER_KERNEL64)
+ {
+ result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+ return result;
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+ return -1;
+ }
+#elif defined __NR_lstat64
if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
{
+ int errno_out;
result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return result;
errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
if (errno_out != ENOSYS)
- goto fail;
+ {
+ __set_errno (errno_out);
+ return -1;
+ }
__libc_missing_axp_stat64 = 1;
}
+#endif
result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat_conv (vers, &kbuf, buf);
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-
- fail:
- __set_errno (errno_out);
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
return -1;
}
hidden_def (__lxstat)
diff -u -p -r1.1 xstat.c
--- sysdeps/unix/sysv/linux/alpha/xstat.c 11 Mar 2004 02:58:44 -0000 1.1
+++ sysdeps/unix/sysv/linux/alpha/xstat.c 18 Feb 2005 06:21:10 -0000
@@ -1,5 +1,5 @@
/* xstat using old-style Unix stat system call.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 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,27 +35,39 @@ int
__xstat (int vers, const char *name, struct stat *buf)
{
INTERNAL_SYSCALL_DECL (err);
- int result, errno_out;
+ int result;
struct kernel_stat kbuf;
+#if __ASSUME_STAT64_SYSCALL > 0
+ if (vers == _STAT_VER_KERNEL64)
+ {
+ result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
+ if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
+ return result;
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
+ return -1;
+ }
+#elif defined __NR_stat64
if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
{
+ int errno_out;
result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return result;
errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
if (errno_out != ENOSYS)
- goto fail;
+ {
+ __set_errno (errno_out);
+ return -1;
+ }
__libc_missing_axp_stat64 = 1;
}
+#endif
result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat_conv (vers, &kbuf, buf);
- errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
-
- fail:
- __set_errno (errno_out);
+ __set_errno (INTERNAL_SYSCALL_ERRNO (result, err));
return -1;
}
hidden_def (__xstat)
diff -u -p -r1.6 xstatconv.c
--- sysdeps/unix/sysv/linux/alpha/xstatconv.c 11 Mar 2004 02:58:44 -0000 1.6
+++ sysdeps/unix/sysv/linux/alpha/xstatconv.c 26 Feb 2005 13:58:07 -0000
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2003, 2004, 2005 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
@@ -22,9 +22,14 @@
#include <sys/stat.h>
#include <kernel_stat.h>
#include <xstatconv.h>
+#include <sys/syscall.h>
+#ifdef __NR_stat64
+# if __ASSUME_STAT64_SYSCALL == 0
int __libc_missing_axp_stat64;
+# endif
+#endif
int
__xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
diff -u -p -r1.1 xstatconv.h
--- sysdeps/unix/sysv/linux/alpha/xstatconv.h 11 Mar 2004 02:58:44 -0000 1.1
+++ sysdeps/unix/sysv/linux/alpha/xstatconv.h 26 Feb 2005 13:58:07 -0000
@@ -1,5 +1,5 @@
/* Convert between the kernel's `struct stat' format, and libc's.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 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
@@ -18,7 +18,12 @@
02111-1307 USA. */
#include "kernel-features.h"
+#include <sys/syscall.h>
+#ifdef __NR_stat64
+# if __ASSUME_STAT64_SYSCALL == 0
extern int __libc_missing_axp_stat64 attribute_hidden;
+# endif
+#endif
extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
attribute_hidden;