mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
51
ChangeLog
51
ChangeLog
@ -1,5 +1,56 @@
|
|||||||
Wed Jan 17 11:04:58 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
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):
|
* elf/dynamic-link.h [ELF_MACHINE_NO_REL] (ELF_DYNAMIC_DO_REL):
|
||||||
Define this instead of ELF_DYNAMIC_DO_RELA.
|
Define this instead of ELF_DYNAMIC_DO_RELA.
|
||||||
|
|
||||||
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
/* In Linux the `stat' call is actually done by emulating a `xstat' system
|
/* This definition is only used if inlining fails for this function; see
|
||||||
call, which takes an additional first argument giving a version number
|
the last page of <sys/stat.h>. The real work is done by the `x'
|
||||||
for `struct stat'. Likewise for `fstat' and `lstat' there are `fxstat'
|
function which is passed a version number argument. We arrange in the
|
||||||
and `lxstat' emulations. */
|
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
|
int
|
||||||
__fstat (int fd, struct stat *buf)
|
__fstat (int fd, struct stat *buf)
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
/* In Linux the `stat' call is actually done by emulating a `xstat' system
|
/* This definition is only used if inlining fails for this function; see
|
||||||
call, which takes an additional first argument giving a version number
|
the last page of <sys/stat.h>. The real work is done by the `x'
|
||||||
for `struct stat'. Likewise for `fstat' and `lstat' there are `fxstat'
|
function which is passed a version number argument. We arrange in the
|
||||||
and `lxstat' emulations. */
|
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
|
int
|
||||||
__lstat (const char *file, struct stat *buf)
|
__lstat (const char *file, struct stat *buf)
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
/* In Linux the `stat' call is actually done by emulating a `xstat' system
|
/* This definition is only used if inlining fails for this function; see
|
||||||
call, which takes an additional first argument giving a version number
|
the last page of <sys/stat.h>. The real work is done by the `x'
|
||||||
for `struct stat'. Likewise for `fstat' and `lstat' there are `fxstat'
|
function which is passed a version number argument. We arrange in the
|
||||||
and `lxstat' emulations. */
|
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
|
int
|
||||||
__stat (const char *file, struct stat *buf)
|
__stat (const char *file, struct stat *buf)
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
SYSCALL__ (stat, 2)
|
int
|
||||||
ret
|
__lxstat (int version, const char *file, struct stat *buf)
|
||||||
|
{
|
||||||
|
return __xstat (version, file, buf);
|
||||||
|
}
|
||||||
|
|
||||||
weak_alias (__stat, stat)
|
weak_alias (__lxstat, _lxstat)
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -25,14 +24,17 @@ Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
/* Get information about the file descriptor FD in BUF. */
|
/* Get information about the file descriptor FD in BUF. */
|
||||||
int
|
int
|
||||||
DEFUN(__fstat, (fd, buf), int fd AND struct stat *buf)
|
__fxstat (int vers, int fd, struct stat *buf)
|
||||||
{
|
{
|
||||||
error_t err;
|
error_t err;
|
||||||
|
|
||||||
|
if (vers != _STAT_VER)
|
||||||
|
return __hurd_fail (EINVAL);
|
||||||
|
|
||||||
if (err = HURD_DPORT_USE (fd, __io_stat (port, buf)))
|
if (err = HURD_DPORT_USE (fd, __io_stat (port, buf)))
|
||||||
return __hurd_dfail (fd, err);
|
return __hurd_dfail (fd, err);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
weak_alias (__fstat, fstat)
|
weak_alias (__fxstat, _fxstat)
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@ -24,10 +23,15 @@ Cambridge, MA 02139, USA. */
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
DEFUN(__lstat, (file, buf), CONST char *file AND struct stat *buf)
|
__lxstat (int vers, const char *file, struct stat *buf)
|
||||||
{
|
{
|
||||||
error_t err;
|
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)
|
if (port == MACH_PORT_NULL)
|
||||||
return -1;
|
return -1;
|
||||||
err = __io_stat (port, buf);
|
err = __io_stat (port, buf);
|
||||||
@ -37,4 +41,4 @@ DEFUN(__lstat, (file, buf), CONST char *file AND struct stat *buf)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
weak_alias (__lstat, lstat)
|
weak_alias (__lxstat, _lxstat)
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
@ -34,8 +33,7 @@ Cambridge, MA 02139, USA. */
|
|||||||
and device number DEV (which can be constructed from major and minor
|
and device number DEV (which can be constructed from major and minor
|
||||||
device numbers with the `makedev' macro above). */
|
device numbers with the `makedev' macro above). */
|
||||||
int
|
int
|
||||||
DEFUN(__mknod, (file_name, mode, dev),
|
__xmknod (int vers, const char *file_name, mode_t mode, dev_t *dev)
|
||||||
CONST char *file_name AND mode_t mode AND dev_t dev)
|
|
||||||
{
|
{
|
||||||
error_t err;
|
error_t err;
|
||||||
file_t dir, node;
|
file_t dir, node;
|
||||||
@ -44,6 +42,9 @@ DEFUN(__mknod, (file_name, mode, dev),
|
|||||||
const char *translator;
|
const char *translator;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
|
if (vers != _MKNOD_VER)
|
||||||
|
return __hurd_fail (EINVAL);
|
||||||
|
|
||||||
if (S_ISCHR (mode))
|
if (S_ISCHR (mode))
|
||||||
{
|
{
|
||||||
translator = _HURD_CHRDEV;
|
translator = _HURD_CHRDEV;
|
||||||
@ -76,9 +77,9 @@ DEFUN(__mknod, (file_name, mode, dev),
|
|||||||
|
|
||||||
bp = buf + sizeof (buf);
|
bp = buf + sizeof (buf);
|
||||||
*--bp = '\0';
|
*--bp = '\0';
|
||||||
bp = _itoa (minor (dev), bp, 10, 0);
|
bp = _itoa (minor (*dev), bp, 10, 0);
|
||||||
*--bp = '\0';
|
*--bp = '\0';
|
||||||
bp = _itoa (major (dev), bp, 10, 0);
|
bp = _itoa (major (*dev), bp, 10, 0);
|
||||||
memcpy (bp - len, translator, len);
|
memcpy (bp - len, translator, len);
|
||||||
translator = bp - len;
|
translator = bp - len;
|
||||||
len = buf + sizeof (buf) - translator;
|
len = buf + sizeof (buf) - translator;
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@ -24,10 +23,15 @@ Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
/* Get file information about FILE in BUF. */
|
/* Get file information about FILE in BUF. */
|
||||||
int
|
int
|
||||||
DEFUN(__stat, (file, buf), CONST char *file AND struct stat *buf)
|
__xstat (int vers, const char *file, struct stat *buf)
|
||||||
{
|
{
|
||||||
error_t err;
|
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);
|
||||||
if (port == MACH_PORT_NULL)
|
if (port == MACH_PORT_NULL)
|
||||||
return -1;
|
return -1;
|
||||||
err = __io_stat (port, buf);
|
err = __io_stat (port, buf);
|
||||||
@ -37,4 +41,4 @@ DEFUN(__stat, (file, buf), CONST char *file AND struct stat *buf)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
weak_alias (__stat, stat)
|
weak_alias (__xstat, _xstat)
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -16,15 +16,20 @@ License along with the GNU C Library; see the file COPYING.LIB. If
|
|||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
/* Get information about the file descriptor FD in BUF. */
|
/* Get information about the file descriptor FD in BUF. */
|
||||||
int
|
int
|
||||||
DEFUN(__fstat, (fd, buf), int fd AND struct stat *buf)
|
__fxstat (int vers, int fd, struct stat *buf)
|
||||||
{
|
{
|
||||||
|
if (vers != _STAT_VER)
|
||||||
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
@ -39,6 +44,6 @@ DEFUN(__fstat, (fd, buf), int fd AND struct stat *buf)
|
|||||||
errno = ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
stub_warning (fstat)
|
stub_warning (__fxstat)
|
||||||
|
|
||||||
weak_alias (__fstat, fstat)
|
weak_alias (__fxstat, _fxstat)
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -24,9 +23,9 @@ Cambridge, MA 02139, USA. */
|
|||||||
/* Get file information about FILE in BUF.
|
/* Get file information about FILE in BUF.
|
||||||
If FILE is a symbolic link, do not follow it. */
|
If FILE is a symbolic link, do not follow it. */
|
||||||
int
|
int
|
||||||
DEFUN(__lstat, (file, buf), CONST char *file AND struct stat *buf)
|
__lxstat (int vers, const char *file, struct stat *buf)
|
||||||
{
|
{
|
||||||
if (file == NULL || buf == NULL)
|
if (vers != _STAT_VER || file == NULL || buf == NULL)
|
||||||
{
|
{
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
@ -35,6 +34,6 @@ DEFUN(__lstat, (file, buf), CONST char *file AND struct stat *buf)
|
|||||||
errno = ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
stub_warning (lstat)
|
stub_warning (__lxstat)
|
||||||
|
|
||||||
weak_alias (__lstat, lstat)
|
weak_alias (__lxstat, _lxstat)
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -25,12 +24,17 @@ Cambridge, MA 02139, USA. */
|
|||||||
and device number DEV (which can be constructed from major and minor
|
and device number DEV (which can be constructed from major and minor
|
||||||
device numbers with the `makedev' macro above). */
|
device numbers with the `makedev' macro above). */
|
||||||
int
|
int
|
||||||
DEFUN(__mknod, (path, mode, dev),
|
__xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
|
||||||
CONST char *path AND mode_t mode AND dev_t dev)
|
|
||||||
{
|
{
|
||||||
|
if (vers != _MKNOD_VER)
|
||||||
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
errno = ENOSYS;
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
stub_warning (mknod)
|
stub_warning (__xmknod)
|
||||||
|
|
||||||
weak_alias (__mknod, mknod)
|
weak_alias (__xmknod, _xmknod)
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -16,16 +16,15 @@ License along with the GNU C Library; see the file COPYING.LIB. If
|
|||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
/* Get file information about FILE in BUF. */
|
/* Get file information about FILE in BUF. */
|
||||||
int
|
int
|
||||||
DEFUN(__stat, (file, buf), CONST char *file AND struct stat *buf)
|
__xstat (int vers, const char *file, struct stat *buf)
|
||||||
{
|
{
|
||||||
if (file == NULL || buf == NULL)
|
if (vers != _STAT_VER || file == NULL || buf == NULL)
|
||||||
{
|
{
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
@ -36,4 +35,4 @@ DEFUN(__stat, (file, buf), CONST char *file AND struct stat *buf)
|
|||||||
}
|
}
|
||||||
stub_warning (stat)
|
stub_warning (stat)
|
||||||
|
|
||||||
weak_alias (__stat, stat)
|
weak_alias (__xstat, _xstat)
|
@ -1,24 +0,0 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
SYSCALL__ (lstat, 2)
|
|
||||||
ret
|
|
||||||
|
|
||||||
weak_alias (__lstat, lstat)
|
|
37
sysdeps/unix/common/lxstat.c
Normal file
37
sysdeps/unix/common/lxstat.c
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/* lxstat using old-style Unix lstat system call.
|
||||||
|
Copyright (C) 1991, 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
|
||||||
|
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., 675 Mass Ave,
|
||||||
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
extern int __syscall_lstat (const char *, struct stat *);
|
||||||
|
|
||||||
|
int
|
||||||
|
__lxstat (int vers, const char *file, struct stat *buf)
|
||||||
|
{
|
||||||
|
if (vers != _STAT_VER)
|
||||||
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return __syscall_lstat (file, buf);
|
||||||
|
}
|
||||||
|
weak_alias (__lxstat, _lxstat)
|
@ -1,24 +0,0 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
SYSCALL__ (fstat, 2)
|
|
||||||
ret
|
|
||||||
|
|
||||||
weak_alias (__fstat, fstat)
|
|
38
sysdeps/unix/fxstat.c
Normal file
38
sysdeps/unix/fxstat.c
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/* fxstat using old-style Unix fstat system call.
|
||||||
|
Copyright (C) 1991, 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
|
||||||
|
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., 675 Mass Ave,
|
||||||
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
extern int __syscall_fstat (int, struct stat *);
|
||||||
|
|
||||||
|
/* Get information about the file descriptor FD in BUF. */
|
||||||
|
int
|
||||||
|
__fxstat (int vers, int fd, struct stat *buf)
|
||||||
|
{
|
||||||
|
if (vers != _STAT_VER)
|
||||||
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return __syscall_fstat (fd, buf);
|
||||||
|
}
|
||||||
|
weak_alias (__fxstat, _fxstat)
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or modify
|
The GNU C Library is free software; you can redistribute it and/or modify
|
||||||
@ -15,7 +15,6 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with the GNU C Library; see the file COPYING. If not, write to
|
along with the GNU C Library; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -23,7 +22,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
/* Create a named pipe (FIFO) named PATH with protections MODE. */
|
/* Create a named pipe (FIFO) named PATH with protections MODE. */
|
||||||
int
|
int
|
||||||
DEFUN(mkfifo, (path, mode), CONST char *path AND mode_t mode)
|
mkfifo (const char *path, mode_t mode)
|
||||||
{
|
{
|
||||||
return __mknod (path, mode | S_IFIFO, 0);
|
dev_t dev = 0;
|
||||||
|
return __xmknod (_MKNOD_VER, path, mode | S_IFIFO, &dev);
|
||||||
}
|
}
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
SYSCALL__ (mknod, 3)
|
|
||||||
ret
|
|
||||||
|
|
||||||
weak_alias (__mknod, mknod)
|
|
@ -1,4 +0,0 @@
|
|||||||
#define __xstat __fxstat
|
|
||||||
#define _xstat _fxstat
|
|
||||||
#define stat fstat
|
|
||||||
#include "xstat.S"
|
|
@ -1,4 +0,0 @@
|
|||||||
#define __xstat __lxstat
|
|
||||||
#define _xstat _lxstat
|
|
||||||
#define stat lstat
|
|
||||||
#include "xstat.S"
|
|
@ -1,48 +0,0 @@
|
|||||||
/* Copyright (C) 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <errnos.h>
|
|
||||||
|
|
||||||
.text
|
|
||||||
SYSCALL_ERROR_HANDLER /* Error handler for PIC. */
|
|
||||||
ENTRY (__xmknod)
|
|
||||||
popl %ecx /* Pop return address into %eax. */
|
|
||||||
popl %edx /* Pop version number into %edx. */
|
|
||||||
pushl %ecx /* Push back the return address. */
|
|
||||||
|
|
||||||
cmpl $1, %edx /* Version 1 xstat call? */
|
|
||||||
je .L1 /* Yes, do syscall. */
|
|
||||||
|
|
||||||
movl $-EINVAL, %eax /* Load error code into %eax. */
|
|
||||||
jmp .L2
|
|
||||||
|
|
||||||
.L1: DO_CALL (3, mknod) /* Do the syscall. */
|
|
||||||
|
|
||||||
movl (%esp), %ecx
|
|
||||||
testl %eax, %eax /* Check for error. */
|
|
||||||
jl .L2
|
|
||||||
|
|
||||||
jmp *%ecx /* Return success. */
|
|
||||||
|
|
||||||
.L2: pushl %ecx
|
|
||||||
jmp syscall_error
|
|
||||||
/* Yes, then branch to error handling. */
|
|
||||||
|
|
||||||
/* For compatibility with Linux libc. */
|
|
||||||
weak_alias (__xmknod, _xmknod)
|
|
@ -1,48 +0,0 @@
|
|||||||
/* Copyright (C) 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
#include <errnos.h>
|
|
||||||
|
|
||||||
.text
|
|
||||||
SYSCALL_ERROR_HANDLER /* Error handler for PIC. */
|
|
||||||
ENTRY (__xstat)
|
|
||||||
popl %ecx /* Pop return address into %eax. */
|
|
||||||
popl %edx /* Pop version number into %edx. */
|
|
||||||
pushl %ecx /* Push back the return address. */
|
|
||||||
|
|
||||||
cmpl $1, %edx /* Version 1 xstat call? */
|
|
||||||
je .L1 /* Yes, do syscall. */
|
|
||||||
|
|
||||||
movl $-EINVAL, %eax /* Load error code into %eax. */
|
|
||||||
jmp .L2
|
|
||||||
|
|
||||||
.L1: DO_CALL (2, stat) /* Do the syscall. */
|
|
||||||
|
|
||||||
movl (%esp), %ecx
|
|
||||||
testl %eax, %eax /* Check for error. */
|
|
||||||
jl .L2
|
|
||||||
|
|
||||||
jmp *%ecx /* Return success. */
|
|
||||||
|
|
||||||
.L2: pushl %ecx
|
|
||||||
jmp syscall_error
|
|
||||||
/* Yes, then branch to error handling. */
|
|
||||||
|
|
||||||
/* For compatibility with Linux libc. */
|
|
||||||
weak_alias (__xstat, _xstat)
|
|
@ -1,30 +0,0 @@
|
|||||||
/* Copyright (C) 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
|
|
||||||
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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
/* In Linux the `mknod' call is actually done by emulating a `xmknod'
|
|
||||||
system call, which takes an additional first argument. */
|
|
||||||
|
|
||||||
int
|
|
||||||
__mknod (const char *path, mode_t mode, dev_t dev)
|
|
||||||
{
|
|
||||||
return __xmknod (LINUX_MKNOD_VERSION, path, mode, &dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
weak_alias (__mknod, mknod)
|
|
@ -1,37 +0,0 @@
|
|||||||
/* Copyright (C) 1994, 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
/* In SVR4 the `stat' call is actually done by the `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' system calls. This macro gives the SVR4 version number that
|
|
||||||
corresponds to the definition of `struct stat' in <statbuf.h>. */
|
|
||||||
#define _STAT_VER 2
|
|
||||||
|
|
||||||
.globl syscall_error
|
|
||||||
ENTRY (__fstat)
|
|
||||||
popl %eax /* Pop return address into %eax. */
|
|
||||||
pushl $_STAT_VER /* Push extra first arg to syscall. */
|
|
||||||
pushl %eax /* Push back the return address. */
|
|
||||||
DO_CALL (fxstat, 3) /* Do the syscall. */
|
|
||||||
jb syscall_error /* Check for error. */
|
|
||||||
ret /* Return success. */
|
|
||||||
|
|
||||||
weak_alias (__fstat, fstat)
|
|
@ -1,37 +0,0 @@
|
|||||||
/* Copyright (C) 1994, 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
/* In SVR4 the `stat' call is actually done by the `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' system calls. This macro gives the SVR4 version number that
|
|
||||||
corresponds to the definition of `struct stat' in <statbuf.h>. */
|
|
||||||
#define _STAT_VER 2
|
|
||||||
|
|
||||||
.globl syscall_error
|
|
||||||
ENTRY (__lstat)
|
|
||||||
popl %eax /* Pop return address into %eax. */
|
|
||||||
pushl $_STAT_VER /* Push extra first arg to syscall. */
|
|
||||||
pushl %eax /* Push back the return address. */
|
|
||||||
DO_CALL (lxstat, 3) /* Do the syscall. */
|
|
||||||
jb syscall_error /* Check for error. */
|
|
||||||
ret /* Return success. */
|
|
||||||
|
|
||||||
weak_alias (__lstat, lstat)
|
|
@ -1,36 +0,0 @@
|
|||||||
/* Copyright (C) 1994, 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
/* In SVR4 the `mknod' call is actually done by the `xmknod' system call,
|
|
||||||
which takes an additional first argument giving a version number for
|
|
||||||
the interface. This macro gives the SVR4 version number that
|
|
||||||
corresponds to the modern interface. */
|
|
||||||
#define _MKNOD_VER 2
|
|
||||||
|
|
||||||
.globl syscall_error
|
|
||||||
ENTRY (__mknod)
|
|
||||||
popl %eax /* Pop return address into %eax. */
|
|
||||||
pushl $_MKNOD_VER /* Push extra first arg to syscall. */
|
|
||||||
pushl %eax /* Push back the return address. */
|
|
||||||
DO_CALL (xmknod, 3) /* Do the syscall. */
|
|
||||||
jb syscall_error /* Check for error. */
|
|
||||||
ret /* Return success. */
|
|
||||||
|
|
||||||
weak_alias (__mknod, mknod)
|
|
@ -1,37 +0,0 @@
|
|||||||
/* Copyright (C) 1994, 1995 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., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
/* In SVR4 the `stat' call is actually done by the `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' system calls. This macro gives the SVR4 version number that
|
|
||||||
corresponds to the definition of `struct stat' in <statbuf.h>. */
|
|
||||||
#define _STAT_VER 2
|
|
||||||
|
|
||||||
.globl syscall_error
|
|
||||||
ENTRY (__stat)
|
|
||||||
popl %eax /* Pop return address into %eax. */
|
|
||||||
pushl $_STAT_VER /* Push extra first arg to syscall. */
|
|
||||||
pushl %eax /* Push back the return address. */
|
|
||||||
DO_CALL (xstat, 3) /* Do the syscall. */
|
|
||||||
jb syscall_error /* Check for error. */
|
|
||||||
ret /* Return success. */
|
|
||||||
|
|
||||||
weak_alias (__stat, stat)
|
|
41
sysdeps/unix/xmknod.c
Normal file
41
sysdeps/unix/xmknod.c
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/* xmknod call using old-style Unix mknod system call.
|
||||||
|
Copyright (C) 1991, 1993, 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
|
||||||
|
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., 675 Mass Ave,
|
||||||
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
extern int __syscall_mknod (const char *, mode_t, dev_t);
|
||||||
|
|
||||||
|
/* Create a device file named PATH, with permission and special bits MODE
|
||||||
|
and device number DEV (which can be constructed from major and minor
|
||||||
|
device numbers with the `makedev' macro above). */
|
||||||
|
int
|
||||||
|
__xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
|
||||||
|
{
|
||||||
|
if (vers != _MKNOD_VER)
|
||||||
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return __syscall_mknod (path, mode, *dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
weak_alias (__xmknod, _xmknod)
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
|
/* xstat using old-style Unix stat system call.
|
||||||
|
Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -16,16 +17,21 @@ License along with the GNU C Library; see the file COPYING.LIB. If
|
|||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
Cambridge, MA 02139, USA. */
|
Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include <ansidecl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
int
|
extern int __syscall_stat (const char *, struct stat *);
|
||||||
DEFUN(__lstat, (file, buf),
|
|
||||||
CONST char *file AND struct stat *buf)
|
|
||||||
{
|
|
||||||
return __stat (file, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
weak_alias (__lstat, lstat)
|
int
|
||||||
|
__xstat (int vers, const char *file, struct stat *buf)
|
||||||
|
{
|
||||||
|
if (vers != _STAT_VER)
|
||||||
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return __syscall_stat (file, buf);
|
||||||
|
}
|
||||||
|
weak_alias (__xstat, _xstat)
|
Reference in New Issue
Block a user