aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-01-18 00:35:55 +0000
committerRoland McGrath <roland@gnu.org>1996-01-18 00:35:55 +0000
commitc43b8c4bea7980e6830d5ecfbc301fb5cd89dec5 (patch)
tree76f72fe704dc4b226fb0ff285b8c8802e88ea312
parentc59928df4dd6083a5721fc2bada6c6eb6340b74f (diff)
downloadglibc-c43b8c4bea7980e6830d5ecfbc301fb5cd89dec5.tar.xz
glibc-c43b8c4bea7980e6830d5ecfbc301fb5cd89dec5.zip
Wed Jan 17 11:04:58 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* io/sys/stat.h (_STAT_VER, _MKNOD_VER): New macros. (__xstat, __fxstat, __lxstat, __xmknod): Declare new functions. [__GNUC__] (stat, fstat, lstat, mknod): Define these (and __ names) as `extern inline's calling the `x' functions. * io/fstat.c: New file. * io/lstat.c: New file. * io/stat.c: New file. * sysdeps/generic/lstat.c: File removed. * sysdeps/generic/lxstat.c: New file. * sysdeps/mach/hurd/fstat.c: File removed. * sysdeps/mach/hurd/fxstat.c: New file. * sysdeps/mach/hurd/lstat.c: File removed. * sysdeps/mach/hurd/lxstat.c: New file. * sysdeps/mach/hurd/mknod.c: File removed. * sysdeps/mach/hurd/stat.c: File removed. * sysdeps/mach/hurd/xmknod.c: New file. * sysdeps/mach/hurd/xstat.c: New file. * sysdeps/stub/fstat.c: File removed. * sysdeps/stub/fxstat.c: New file. * sysdeps/stub/lstat.c: File removed. * sysdeps/stub/lxstat.c: New file. * sysdeps/stub/mknod.c: File removed. * sysdeps/stub/stat.c: File removed. * sysdeps/stub/xmknod.c: New file. * sysdeps/stub/xstat.c: New file. * sysdeps/unix/common/lstat.S: File removed. * sysdeps/unix/common/lxstat.c: New file. * sysdeps/unix/fstat.S: File removed. * sysdeps/unix/fxstat.c: New file. * sysdeps/unix/mknod.S: File removed. * sysdeps/unix/stat.S: File removed. * sysdeps/unix/sysv/linux/fstat.c: File removed. * sysdeps/unix/sysv/linux/i386/fxstat.S: File removed. * sysdeps/unix/sysv/linux/i386/lxstat.S: File removed. * sysdeps/unix/sysv/linux/i386/xmknod.S: File removed. * sysdeps/unix/sysv/linux/i386/xstat.S: File removed. * sysdeps/unix/sysv/linux/lstat.c: File removed. * sysdeps/unix/sysv/linux/mknod.c: File removed. * sysdeps/unix/sysv/linux/stat.c: File removed. * sysdeps/unix/sysv/sysv4/i386/fstat.S: File removed. * sysdeps/unix/sysv/sysv4/i386/lstat.S: File removed. * sysdeps/unix/sysv/sysv4/i386/mknod.S: File removed. * sysdeps/unix/sysv/sysv4/i386/stat.S: File removed. * sysdeps/unix/xmknod.c: New file. * sysdeps/unix/xstat.c: New file. * sysdeps/unix/mkfifo.c: Use __xmknod instead of __mknod. * misc/Makefile (routines): Remove mknod. * io/sys/stat.h (_STAT_VER, _MKNOD_VER): New macros. (__xstat, __fxstat, __lxstat, __xmknod): Declare new functions. [__GNUC__] (stat, fstat, lstat, mknod): Define these (and __ names) as `extern inline's calling the `x' functions. * io/fstat.c: New file. * io/lstat.c: New file. * io/stat.c: New file. * sysdeps/generic/lstat.c: File removed. * sysdeps/generic/lxstat.c: New file. * sysdeps/mach/hurd/fstat.c: File removed. * sysdeps/mach/hurd/fxstat.c: New file. * sysdeps/mach/hurd/lstat.c: File removed. * sysdeps/mach/hurd/lxstat.c: New file. * sysdeps/mach/hurd/mknod.c: File removed. * sysdeps/mach/hurd/stat.c: File removed. * sysdeps/mach/hurd/xmknod.c: New file. * sysdeps/mach/hurd/xstat.c: New file. * sysdeps/stub/fstat.c: File removed. * sysdeps/stub/fxstat.c: New file. * sysdeps/stub/lstat.c: File removed. * sysdeps/stub/lxstat.c: New file. * sysdeps/stub/mknod.c: File removed. * sysdeps/stub/stat.c: File removed. * sysdeps/stub/xmknod.c: New file. * sysdeps/stub/xstat.c: New file. * sysdeps/unix/common/lstat.S: File removed. * sysdeps/unix/common/lxstat.c: New file. * sysdeps/unix/fstat.S: File removed. * sysdeps/unix/fxstat.c: New file. * sysdeps/unix/mknod.S: File removed. * sysdeps/unix/stat.S: File removed. * sysdeps/unix/sysv/linux/fstat.c: File removed. * sysdeps/unix/sysv/linux/i386/fxstat.S: File removed. * sysdeps/unix/sysv/linux/i386/lxstat.S: File removed. * sysdeps/unix/sysv/linux/i386/xmknod.S: File removed. * sysdeps/unix/sysv/linux/i386/xstat.S: File removed. * sysdeps/unix/sysv/linux/lstat.c: File removed. * sysdeps/unix/sysv/linux/mknod.c: File removed. * sysdeps/unix/sysv/linux/stat.c: File removed. * sysdeps/unix/sysv/sysv4/i386/fstat.S: File removed. * sysdeps/unix/sysv/sysv4/i386/lstat.S: File removed. * sysdeps/unix/sysv/sysv4/i386/mknod.S: File removed. * sysdeps/unix/sysv/sysv4/i386/stat.S: File removed. * sysdeps/unix/xmknod.c: New file. * sysdeps/unix/xstat.c: New file. * sysdeps/unix/mkfifo.c: Use __xmknod instead of __mknod. * misc/Makefile (routines): Remove mknod. * sysdeps/ieee754/ieee754.h (union ieee854_long_double.ieee_nan): Add missing ; in little-endian case.
-rw-r--r--ChangeLog51
-rw-r--r--io/fstat.c (renamed from sysdeps/unix/sysv/linux/fstat.c)14
-rw-r--r--io/lstat.c (renamed from sysdeps/unix/sysv/linux/lstat.c)14
-rw-r--r--io/stat.c (renamed from sysdeps/unix/sysv/linux/stat.c)14
-rw-r--r--sysdeps/generic/lxstat.c (renamed from sysdeps/unix/stat.S)13
-rw-r--r--sysdeps/mach/hurd/fxstat.c (renamed from sysdeps/mach/hurd/fstat.c)10
-rw-r--r--sysdeps/mach/hurd/lxstat.c (renamed from sysdeps/mach/hurd/lstat.c)14
-rw-r--r--sysdeps/mach/hurd/xmknod.c (renamed from sysdeps/mach/hurd/mknod.c)19
-rw-r--r--sysdeps/mach/hurd/xstat.c (renamed from sysdeps/mach/hurd/stat.c)14
-rw-r--r--sysdeps/stub/fxstat.c (renamed from sysdeps/stub/fstat.c)15
-rw-r--r--sysdeps/stub/lxstat.c (renamed from sysdeps/stub/lstat.c)11
-rw-r--r--sysdeps/stub/xmknod.c (renamed from sysdeps/stub/mknod.c)16
-rw-r--r--sysdeps/stub/xstat.c (renamed from sysdeps/stub/stat.c)9
-rw-r--r--sysdeps/unix/common/lstat.S24
-rw-r--r--sysdeps/unix/common/lxstat.c37
-rw-r--r--sysdeps/unix/fstat.S24
-rw-r--r--sysdeps/unix/fxstat.c38
-rw-r--r--sysdeps/unix/mkfifo.c8
-rw-r--r--sysdeps/unix/mknod.S24
-rw-r--r--sysdeps/unix/sysv/linux/i386/fxstat.S4
-rw-r--r--sysdeps/unix/sysv/linux/i386/lxstat.S4
-rw-r--r--sysdeps/unix/sysv/linux/i386/xmknod.S48
-rw-r--r--sysdeps/unix/sysv/linux/i386/xstat.S48
-rw-r--r--sysdeps/unix/sysv/linux/mknod.c30
-rw-r--r--sysdeps/unix/sysv/sysv4/i386/fstat.S37
-rw-r--r--sysdeps/unix/sysv/sysv4/i386/lstat.S37
-rw-r--r--sysdeps/unix/sysv/sysv4/i386/mknod.S36
-rw-r--r--sysdeps/unix/sysv/sysv4/i386/stat.S37
-rw-r--r--sysdeps/unix/xmknod.c41
-rw-r--r--sysdeps/unix/xstat.c (renamed from sysdeps/generic/lstat.c)20
30 files changed, 282 insertions, 429 deletions
diff --git a/ChangeLog b/ChangeLog
index d21eca3b1d..ec92ce9df5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,56 @@
Wed Jan 17 11:04:58 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+ * io/sys/stat.h (_STAT_VER, _MKNOD_VER): New macros.
+ (__xstat, __fxstat, __lxstat, __xmknod): Declare new functions.
+ [__GNUC__] (stat, fstat, lstat, mknod): Define these (and __ names)
+ as `extern inline's calling the `x' functions.
+ * io/fstat.c: New file.
+ * io/lstat.c: New file.
+ * io/stat.c: New file.
+ * sysdeps/generic/lstat.c: File removed.
+ * sysdeps/generic/lxstat.c: New file.
+ * sysdeps/mach/hurd/fstat.c: File removed.
+ * sysdeps/mach/hurd/fxstat.c: New file.
+ * sysdeps/mach/hurd/lstat.c: File removed.
+ * sysdeps/mach/hurd/lxstat.c: New file.
+ * sysdeps/mach/hurd/mknod.c: File removed.
+ * sysdeps/mach/hurd/stat.c: File removed.
+ * sysdeps/mach/hurd/xmknod.c: New file.
+ * sysdeps/mach/hurd/xstat.c: New file.
+ * sysdeps/stub/fstat.c: File removed.
+ * sysdeps/stub/fxstat.c: New file.
+ * sysdeps/stub/lstat.c: File removed.
+ * sysdeps/stub/lxstat.c: New file.
+ * sysdeps/stub/mknod.c: File removed.
+ * sysdeps/stub/stat.c: File removed.
+ * sysdeps/stub/xmknod.c: New file.
+ * sysdeps/stub/xstat.c: New file.
+ * sysdeps/unix/common/lstat.S: File removed.
+ * sysdeps/unix/common/lxstat.c: New file.
+ * sysdeps/unix/fstat.S: File removed.
+ * sysdeps/unix/fxstat.c: New file.
+ * sysdeps/unix/mknod.S: File removed.
+ * sysdeps/unix/stat.S: File removed.
+ * sysdeps/unix/sysv/linux/fstat.c: File removed.
+ * sysdeps/unix/sysv/linux/i386/fxstat.S: File removed.
+ * sysdeps/unix/sysv/linux/i386/lxstat.S: File removed.
+ * sysdeps/unix/sysv/linux/i386/xmknod.S: File removed.
+ * sysdeps/unix/sysv/linux/i386/xstat.S: File removed.
+ * sysdeps/unix/sysv/linux/lstat.c: File removed.
+ * sysdeps/unix/sysv/linux/mknod.c: File removed.
+ * sysdeps/unix/sysv/linux/stat.c: File removed.
+ * sysdeps/unix/sysv/sysv4/i386/fstat.S: File removed.
+ * sysdeps/unix/sysv/sysv4/i386/lstat.S: File removed.
+ * sysdeps/unix/sysv/sysv4/i386/mknod.S: File removed.
+ * sysdeps/unix/sysv/sysv4/i386/stat.S: File removed.
+ * sysdeps/unix/xmknod.c: New file.
+ * sysdeps/unix/xstat.c: New file.
+ * sysdeps/unix/mkfifo.c: Use __xmknod instead of __mknod.
+ * misc/Makefile (routines): Remove mknod.
+
+ * sysdeps/ieee754/ieee754.h (union ieee854_long_double.ieee_nan):
+ Add missing ; in little-endian case.
+
* elf/dynamic-link.h [ELF_MACHINE_NO_REL] (ELF_DYNAMIC_DO_REL):
Define this instead of ELF_DYNAMIC_DO_RELA.
diff --git a/sysdeps/unix/sysv/linux/fstat.c b/io/fstat.c
index e6ef27094d..60dd2f002d 100644
--- a/sysdeps/unix/sysv/linux/fstat.c
+++ b/io/fstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1996 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,10 +18,14 @@ Cambridge, MA 02139, USA. */
#include <sys/stat.h>
-/* In Linux the `stat' call is actually done by emulating a `xstat' system
- call, which takes an additional first argument giving a version number
- for `struct stat'. Likewise for `fstat' and `lstat' there are `fxstat'
- and `lxstat' emulations. */
+/* This definition is only used if inlining fails for this function; see
+ the last page of <sys/stat.h>. The real work is done by the `x'
+ function which is passed a version number argument. We arrange in the
+ makefile that when not inlined this function is always statically
+ linked; that way a dynamically-linked executable always encodes the
+ version number corresponding to the data structures it uses, so the `x'
+ functions in the shared library can adapt without needing to recompile
+ all callers. */
int
__fstat (int fd, struct stat *buf)
diff --git a/sysdeps/unix/sysv/linux/lstat.c b/io/lstat.c
index 51597b8f4d..f2ab6bc7a1 100644
--- a/sysdeps/unix/sysv/linux/lstat.c
+++ b/io/lstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1996 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,10 +18,14 @@ Cambridge, MA 02139, USA. */
#include <sys/stat.h>
-/* In Linux the `stat' call is actually done by emulating a `xstat' system
- call, which takes an additional first argument giving a version number
- for `struct stat'. Likewise for `fstat' and `lstat' there are `fxstat'
- and `lxstat' emulations. */
+/* This definition is only used if inlining fails for this function; see
+ the last page of <sys/stat.h>. The real work is done by the `x'
+ function which is passed a version number argument. We arrange in the
+ makefile that when not inlined this function is always statically
+ linked; that way a dynamically-linked executable always encodes the
+ version number corresponding to the data structures it uses, so the `x'
+ functions in the shared library can adapt without needing to recompile
+ all callers. */
int
__lstat (const char *file, struct stat *buf)
diff --git a/sysdeps/unix/sysv/linux/stat.c b/io/stat.c
index cfdf46f49d..007fdf0dd6 100644
--- a/sysdeps/unix/sysv/linux/stat.c
+++ b/io/stat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1996 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,10 +18,14 @@ Cambridge, MA 02139, USA. */
#include <sys/stat.h>
-/* In Linux the `stat' call is actually done by emulating a `xstat' system
- call, which takes an additional first argument giving a version number
- for `struct stat'. Likewise for `fstat' and `lstat' there are `fxstat'
- and `lxstat' emulations. */
+/* This definition is only used if inlining fails for this function; see
+ the last page of <sys/stat.h>. The real work is done by the `x'
+ function which is passed a version number argument. We arrange in the
+ makefile that when not inlined this function is always statically
+ linked; that way a dynamically-linked executable always encodes the
+ version number corresponding to the data structures it uses, so the `x'
+ functions in the shared library can adapt without needing to recompile
+ all callers. */
int
__stat (const char *file, struct stat *buf)
diff --git a/sysdeps/unix/stat.S b/sysdeps/generic/lxstat.c
index 8ffd60a464..cf28fee5ad 100644
--- a/sysdeps/unix/stat.S
+++ b/sysdeps/generic/lxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 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
@@ -16,9 +16,12 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <sysdep.h>
+#include <sys/stat.h>
-SYSCALL__ (stat, 2)
- ret
+int
+__lxstat (int version, const char *file, struct stat *buf)
+{
+ return __xstat (version, file, buf);
+}
-weak_alias (__stat, stat)
+weak_alias (__lxstat, _lxstat)
diff --git a/sysdeps/mach/hurd/fstat.c b/sysdeps/mach/hurd/fxstat.c
index 5341e3e4a4..d228e112c9 100644
--- a/sysdeps/mach/hurd/fstat.c
+++ b/sysdeps/mach/hurd/fxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1993, 1994, 1995, 1996 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stddef.h>
#include <sys/stat.h>
@@ -25,14 +24,17 @@ Cambridge, MA 02139, USA. */
/* Get information about the file descriptor FD in BUF. */
int
-DEFUN(__fstat, (fd, buf), int fd AND struct stat *buf)
+__fxstat (int vers, int fd, struct stat *buf)
{
error_t err;
+ if (vers != _STAT_VER)
+ return __hurd_fail (EINVAL);
+
if (err = HURD_DPORT_USE (fd, __io_stat (port, buf)))
return __hurd_dfail (fd, err);
return 0;
}
-weak_alias (__fstat, fstat)
+weak_alias (__fxstat, _fxstat)
diff --git a/sysdeps/mach/hurd/lstat.c b/sysdeps/mach/hurd/lxstat.c
index 21eb448fe8..eb37552461 100644
--- a/sysdeps/mach/hurd/lstat.c
+++ b/sysdeps/mach/hurd/lxstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1993, 1994, 1995, 1996 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <sys/stat.h>
#include <stddef.h>
@@ -24,10 +23,15 @@ Cambridge, MA 02139, USA. */
#include <hurd.h>
int
-DEFUN(__lstat, (file, buf), CONST char *file AND struct stat *buf)
+__lxstat (int vers, const char *file, struct stat *buf)
{
error_t err;
- file_t port = __file_name_lookup (file, O_NOLINK, 0);
+ file_t port;
+
+ if (vers != _STAT_VER)
+ return __hurd_fail (EINVAL);
+
+ port = __file_name_lookup (file, O_NOLINK, 0);
if (port == MACH_PORT_NULL)
return -1;
err = __io_stat (port, buf);
@@ -37,4 +41,4 @@ DEFUN(__lstat, (file, buf), CONST char *file AND struct stat *buf)
return 0;
}
-weak_alias (__lstat, lstat)
+weak_alias (__lxstat, _lxstat)
diff --git a/sysdeps/mach/hurd/mknod.c b/sysdeps/mach/hurd/xmknod.c
index 1d82764ff6..68fb2249b2 100644
--- a/sysdeps/mach/hurd/mknod.c
+++ b/sysdeps/mach/hurd/xmknod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <sys/stat.h>
#include <hurd.h>
@@ -34,8 +33,7 @@ Cambridge, MA 02139, USA. */
and device number DEV (which can be constructed from major and minor
device numbers with the `makedev' macro above). */
int
-DEFUN(__mknod, (file_name, mode, dev),
- CONST char *file_name AND mode_t mode AND dev_t dev)
+__xmknod (int vers, const char *file_name, mode_t mode, dev_t *dev)
{
error_t err;
file_t dir, node;
@@ -44,6 +42,9 @@ DEFUN(__mknod, (file_name, mode, dev),
const char *translator;
size_t len;
+ if (vers != _MKNOD_VER)
+ return __hurd_fail (EINVAL);
+
if (S_ISCHR (mode))
{
translator = _HURD_CHRDEV;
@@ -64,7 +65,7 @@ DEFUN(__mknod, (file_name, mode, dev),
errno = EINVAL;
return -1;
}
-
+
if (! S_ISFIFO (mode))
{
/* We set the translator to "ifmt\0major\0minor\0", where IFMT
@@ -76,14 +77,14 @@ DEFUN(__mknod, (file_name, mode, dev),
bp = buf + sizeof (buf);
*--bp = '\0';
- bp = _itoa (minor (dev), bp, 10, 0);
+ bp = _itoa (minor (*dev), bp, 10, 0);
*--bp = '\0';
- bp = _itoa (major (dev), bp, 10, 0);
+ bp = _itoa (major (*dev), bp, 10, 0);
memcpy (bp - len, translator, len);
translator = bp - len;
len = buf + sizeof (buf) - translator;
}
-
+
dir = __file_name_split (file_name, &name);
if (dir == MACH_PORT_NULL)
return -1;
@@ -93,7 +94,7 @@ DEFUN(__mknod, (file_name, mode, dev),
if (! err)
/* Set the node's translator to make it a device. */
- err = __file_set_translator (node,
+ err = __file_set_translator (node,
FS_TRANS_EXCL | FS_TRANS_SET,
FS_TRANS_EXCL | FS_TRANS_SET, 0,
translator, len,
diff --git a/sysdeps/mach/hurd/stat.c b/sysdeps/mach/hurd/xstat.c
index e6df5e66eb..b56ca38d97 100644
--- a/sysdeps/mach/hurd/stat.c
+++ b/sysdeps/mach/hurd/xstat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1993, 1994, 1995, 1996 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <sys/stat.h>
#include <stddef.h>
@@ -24,10 +23,15 @@ Cambridge, MA 02139, USA. */
/* Get file information about FILE in BUF. */
int
-DEFUN(__stat, (file, buf), CONST char *file AND struct stat *buf)
+__xstat (int vers, const char *file, struct stat *buf)
{
error_t err;
- file_t port = __file_name_lookup (file, 0, 0);
+ file_t port;
+
+ if (vers != _STAT_VER)
+ return __hurd_fail (EINVAL);
+
+ port = __file_name_lookup (file, 0, 0);