about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-08-02 05:27:50 +0000
committerRoland McGrath <roland@gnu.org>1996-08-02 05:27:50 +0000
commite75154a665018d5756196275634704c95476ea6b (patch)
tree0c8f889a29304e0cc86611c629f1b620d16cf8a7 /sysdeps
parent9ebb936d991a6e08da05e5a942465d64cac39f86 (diff)
downloadglibc-e75154a665018d5756196275634704c95476ea6b.tar.gz
glibc-e75154a665018d5756196275634704c95476ea6b.tar.xz
glibc-e75154a665018d5756196275634704c95476ea6b.zip
Remade for alpha-1.93 cvs/libc-960802
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/ioctl-types.h6
-rw-r--r--sysdeps/generic/sysdep.h37
-rw-r--r--sysdeps/gnu/utmpbits.h5
-rw-r--r--sysdeps/i386/dl-machine.h8
-rw-r--r--sysdeps/i386/sysdep.h91
-rw-r--r--sysdeps/stub/_exit.c8
-rw-r--r--sysdeps/stub/socket.c4
-rw-r--r--sysdeps/stub/socketpair.c4
-rw-r--r--sysdeps/stub/stdio_lim.h2
-rw-r--r--sysdeps/unix/i386/sysdep.h68
-rw-r--r--sysdeps/unix/mk-local_lim.c9
-rw-r--r--sysdeps/unix/sysdep.h19
-rw-r--r--sysdeps/unix/sysv/linux/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/sys/sysmacros.h31
14 files changed, 193 insertions, 101 deletions
diff --git a/sysdeps/generic/ioctl-types.h b/sysdeps/generic/ioctl-types.h
index 0fc0cd40e1..1116d52e33 100644
--- a/sysdeps/generic/ioctl-types.h
+++ b/sysdeps/generic/ioctl-types.h
@@ -83,6 +83,11 @@ struct winsize
 #endif
 
 #if	defined (TIOCGSIZE) || defined (TIOCSSIZE)
+/* The BSD-style ioctl constructor macros use `sizeof', which can't be used
+   in a preprocessor conditional.  Since the commands are always unique
+   regardless of the size bits, we can safely define away `sizeof' for the
+   purpose of the conditional.  */
+#  define sizeof(type) 0
 #  if defined (TIOCGWINSZ) && TIOCGSIZE == TIOCGWINSZ
 /* Many systems that have TIOCGWINSZ define TIOCGSIZE for source
    compatibility with Sun; they define `struct ttysize' to have identical
@@ -105,6 +110,7 @@ struct ttysize
   int ts_lines, ts_cols;	/* Lines and columns, in characters.  */
 };
 #  endif
+#  undef sizeof			/* See above.  */
 #endif
 
 
diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h
new file mode 100644
index 0000000000..def2d18dc2
--- /dev/null
+++ b/sysdeps/generic/sysdep.h
@@ -0,0 +1,37 @@
+/* Generic asm macros used on many machines.
+Copyright (C) 1991, 92, 93, 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
+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.  */
+
+#ifndef C_LABEL
+
+/* Define a macro we can use to construct the asm name for a C symbol.  */
+#ifdef	NO_UNDERSCORES
+#ifdef	__STDC__
+#define C_LABEL(name)		name##:
+#else
+#define C_LABEL(name)		name/**/:
+#endif
+#else
+#ifdef	__STDC__
+#define C_LABEL(name)		_##name##:
+#else
+#define C_LABEL(name)		_/**/name/**/:
+#endif
+#endif
+
+#endif
diff --git a/sysdeps/gnu/utmpbits.h b/sysdeps/gnu/utmpbits.h
index 4749fdd3fe..0dd55b59fa 100644
--- a/sysdeps/gnu/utmpbits.h
+++ b/sysdeps/gnu/utmpbits.h
@@ -71,9 +71,10 @@ struct utmp
 
 #define ut_time	ut_tv.tv_sec	/* Backwards compatibility.  */
 
-/* Tell the user that we have a modern system with UT_HOST, UT_TYPE, UT_ID
-   and UT_TV fields.  */
+/* Tell the user that we have a modern system with UT_HOST, UT_PID,
+   UT_TYPE, UT_ID and UT_TV fields.  */
 #define _HAVE_UT_TYPE	1
+#define _HAVE_UT_PID	1
 #define _HAVE_UT_ID	1
 #define _HAVE_UT_TV	1
 #define _HAVE_UT_HOST	1
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index dc88b043ea..111122e437 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -25,7 +25,7 @@ Cambridge, MA 02139, USA.  */
 #include <assert.h>
 
 /* Return nonzero iff E_MACHINE is compatible with the running host.  */
-static inline int
+static inline int __attribute__ ((unused))
 elf_machine_matches_host (Elf32_Half e_machine)
 {
   switch (e_machine)
@@ -41,7 +41,7 @@ elf_machine_matches_host (Elf32_Half e_machine)
 
 /* Return the run-time address of the _GLOBAL_OFFSET_TABLE_.
    Must be inlined in a function which uses global data.  */
-static inline Elf32_Addr *
+static inline Elf32_Addr * __attribute__ ((unused))
 elf_machine_got (void)
 {
   register Elf32_Addr *got asm ("%ebx");
@@ -50,7 +50,7 @@ elf_machine_got (void)
 
 
 /* Return the run-time load address of the shared object.  */
-static inline Elf32_Addr
+static inline Elf32_Addr __attribute__ ((unused))
 elf_machine_load_address (void)
 {
   Elf32_Addr addr;
@@ -72,7 +72,7 @@ elf_machine_load_address (void)
 /* Set up the loaded object described by L so its unrelocated PLT
    entries will jump to the on-demand fixup code in dl-runtime.c.  */
 
-static inline void
+static inline void __attribute__ ((unused))
 elf_machine_runtime_setup (struct link_map *l, int lazy)
 {
   Elf32_Addr *got;
diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h
new file mode 100644
index 0000000000..9c312b0d0c
--- /dev/null
+++ b/sysdeps/i386/sysdep.h
@@ -0,0 +1,91 @@
+/* Assembler macros for i386.
+Copyright (C) 1991, 92, 93, 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
+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 <sysdeps/generic/sysdep.h>
+
+#ifdef	ASSEMBLER
+
+/* Syntactic details of assembler.  */
+
+#ifdef HAVE_ELF
+
+/* ELF uses byte-counts for .align, most others use log2 of count of bytes.  */
+#define ALIGNARG(log2) 1<<log2
+/* For ELF we need the `.type' directive to make shared libs work right.  */
+#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
+
+/* In ELF C symbols are asm symbols.  */
+#undef	NO_UNDERSCORES
+#define NO_UNDERSCORES
+
+#else
+
+#define ALIGNARG(log2) log2
+#define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified.  */
+
+#endif
+
+
+/* Define an entry point visible from C.  */
+#define	ENTRY(name)							      \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);				      \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
+  .align ALIGNARG(4);							      \
+  C_LABEL(name)								      \
+  CALL_MCOUNT
+
+/* If compiled for profiling, call `mcount' at the start of each function.  */
+#ifdef	PROF
+/* The mcount code relies on a normal frame pointer being on the stack
+   to locate our caller, so push one just for its benefit.  */
+#define CALL_MCOUNT \
+  pushl %ebp; movl %esp, %ebp; call JUMPTARGET(mcount); popl %ebp;
+#else
+#define CALL_MCOUNT		/* Do nothing.  */
+#endif
+
+#ifdef	NO_UNDERSCORES
+/* Since C identifiers are not normally prefixed with an underscore
+   on this system, the asm identifier `syscall_error' intrudes on the
+   C name space.  Make sure we use an innocuous name.  */
+#define	syscall_error	__syscall_error
+#define mcount		_mcount
+#endif
+
+#define	PSEUDO(name, syscall_name, args)				      \
+lose: SYSCALL_PIC_SETUP							      \
+  jmp JUMPTARGET(syscall_error)						      \
+  .globl syscall_error;							      \
+  ENTRY (name)								      \
+  DO_CALL (syscall_name, args);						      \
+  jb lose
+
+#ifdef PIC
+#define JUMPTARGET(name)	name##@PLT
+#define SYSCALL_PIC_SETUP \
+    pushl %ebx;								      \
+    call 0f;								      \
+0:  popl %ebx;								      \
+    addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx;
+#else
+#define JUMPTARGET(name)	name
+#define SYSCALL_PIC_SETUP	/* Nothing.  */
+#endif
+
+#endif	/* ASSEMBLER */
diff --git a/sysdeps/stub/_exit.c b/sysdeps/stub/_exit.c
index 4b2c59a48b..c8f242b71f 100644
--- a/sysdeps/stub/_exit.c
+++ b/sysdeps/stub/_exit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 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
@@ -23,12 +23,12 @@ Cambridge, MA 02139, USA.  */
 /* The function `_exit' should take a status argument and simply
    terminate program execution, using the low-order 8 bits of the
    given integer as status.  */
-__NORETURN void
-DEFUN(_exit, (status), int status)
+void
+_exit (status)
+     int status;
 {
   status &= 0xff;
   abort ();
 }
 
-
 stub_warning (_exit)
diff --git a/sysdeps/stub/socket.c b/sysdeps/stub/socket.c
index 5012cf2cc9..26f550db87 100644
--- a/sysdeps/stub/socket.c
+++ b/sysdeps/stub/socket.c
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,7 @@ Cambridge, MA 02139, USA.  */
    Returns a file descriptor for the new socket, or -1 for errors.  */
 int
 DEFUN(socket, (domain, type, protocol),
-      int domain AND enum __socket_type type AND int protocol)
+      int domain AND int type AND int protocol)
 {
   errno = ENOSYS;
   return -1;
diff --git a/sysdeps/stub/socketpair.c b/sysdeps/stub/socketpair.c
index 77889b486d..bc9b4b50f2 100644
--- a/sysdeps/stub/socketpair.c
+++ b/sysdeps/stub/socketpair.c
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -26,7 +26,7 @@ Cambridge, MA 02139, USA.  */
    one will be chosen automatically.  Returns 0 on success, -1 for errors.  */
 int
 DEFUN(socketpair, (domain, type, protocol, fds),
-      int domain AND enum __socket_type type AND int protocol AND int fds[2])
+      int domain AND int type AND int protocol AND int fds[2])
 {
   errno = ENOSYS;
   return -1;
diff --git a/sysdeps/stub/stdio_lim.h b/sysdeps/stub/stdio_lim.h
index 1a9125b55a..59b6a40ebe 100644
--- a/sysdeps/stub/stdio_lim.h
+++ b/sysdeps/stub/stdio_lim.h
@@ -1,6 +1,4 @@
 #define	L_tmpnam	1
 #define	TMPMAX		0
-#define	L_ctermid	1
-#define	L_cuserid	1
 #define	FOPEN_MAX	16
 #define	FILENAME_MAX	14
diff --git a/sysdeps/unix/i386/sysdep.h b/sysdeps/unix/i386/sysdep.h
index 16a76b1d5f..3cb130749a 100644
--- a/sysdeps/unix/i386/sysdep.h
+++ b/sysdeps/unix/i386/sysdep.h
@@ -17,76 +17,10 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
 #include <sysdeps/unix/sysdep.h>
+#include <sysdeps/i386/sysdep.h>
 
 #ifdef	ASSEMBLER
 
-/* Syntactic details of assembler.  */
-
-#ifdef HAVE_ELF
-
-/* ELF uses byte-counts for .align, most others use log2 of count of bytes.  */
-#define ALIGNARG(log2) 1<<log2
-/* For ELF we need the `.type' directive to make shared libs work right.  */
-#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
-
-/* In ELF C symbols are asm symbols.  */
-#undef	NO_UNDERSCORES
-#define NO_UNDERSCORES
-
-#else
-
-#define ALIGNARG(log2) log2
-#define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified.  */
-
-#endif
-
-
-/* Define an entry point visible from C.  */
-#define	ENTRY(name)							      \
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);				      \
-  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
-  .align ALIGNARG(4);							      \
-  C_LABEL(name)								      \
-  CALL_MCOUNT
-
-/* If compiled for profiling, call `mcount' at the start of each function.  */
-#ifdef	PROF
-/* The mcount code relies on a normal frame pointer being on the stack
-   to locate our caller, so push one just for its benefit.  */
-#define CALL_MCOUNT \
-  pushl %ebp; movl %esp, %ebp; call JUMPTARGET(mcount); popl %ebp;
-#else
-#define CALL_MCOUNT		/* Do nothing.  */
-#endif
-
-#ifdef	NO_UNDERSCORES
-/* Since C identifiers are not normally prefixed with an underscore
-   on this system, the asm identifier `syscall_error' intrudes on the
-   C name space.  Make sure we use an innocuous name.  */
-#define	syscall_error	__syscall_error
-#define mcount		_mcount
-#endif
-
-#define	PSEUDO(name, syscall_name, args)				      \
-lose: SYSCALL_PIC_SETUP							      \
-  jmp JUMPTARGET(syscall_error)						      \
-  .globl syscall_error;							      \
-  ENTRY (name)								      \
-  DO_CALL (syscall_name, args);						      \
-  jb lose
-
-#ifdef PIC
-#define JUMPTARGET(name)	name##@PLT
-#define SYSCALL_PIC_SETUP \
-    pushl %ebx;								      \
-    call 0f;								      \
-0:  popl %ebx;								      \
-    addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx;
-#else
-#define JUMPTARGET(name)	name
-#define SYSCALL_PIC_SETUP	/* Nothing.  */
-#endif
-
 /* This is defined as a separate macro so that other sysdep.h files
    can include this one and then redefine DO_CALL.  */
 
diff --git a/sysdeps/unix/mk-local_lim.c b/sysdeps/unix/mk-local_lim.c
index c9a1d3dfb8..b2212ee46d 100644
--- a/sysdeps/unix/mk-local_lim.c
+++ b/sysdeps/unix/mk-local_lim.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 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
@@ -92,6 +92,13 @@ static struct param params[] =
     { "PATH_MAX", PATH_MAX },
 #endif
 
+#if !defined (SYMLOOP_MAX) && defined (MAXSYMLINKS)
+#define SYMLOOP_MAX MAXSYMLINKS
+#endif
+#ifdef SYMLOOP_MAX
+    { "SYMLOOP_MAX", SYMLOOP_MAX },
+#endif
+
     { NULL, 0 }
   };
 
diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h
index 24be0063e0..f5845dc7db 100644
--- a/sysdeps/unix/sysdep.h
+++ b/sysdeps/unix/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 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,6 +16,8 @@ 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 <sysdeps/generic/sysdep.h>
+
 #include <syscall.h>
 #define	HAVE_SYSCALLS
 
@@ -34,21 +36,6 @@ Cambridge, MA 02139, USA.  */
    an instruction such that "MOVE(r1, r0)" works.  ret should be defined
    as the return instruction.  */
 
-/* Define a macro we can use to construct the asm name for a C symbol.  */
-#ifdef	NO_UNDERSCORES
-#ifdef	__STDC__
-#define C_LABEL(name)		name##:
-#else
-#define C_LABEL(name)		name/**/:
-#endif
-#else
-#ifdef	__STDC__
-#define C_LABEL(name)		_##name##:
-#else
-#define C_LABEL(name)		_/**/name/**/:
-#endif
-#endif
-
 #ifdef __STDC__
 #define SYS_ify(syscall_name) SYS_##syscall_name
 #else
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 8c7f26dc81..85bab92635 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -3,7 +3,7 @@ sysdep_routines += sysctl
 
 sysdep_headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h \
 		  sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \
-		  sys/user.h syscall-list.h
+		  sys/user.h syscall-list.h sys/sysmacros.h
 
 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
 $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/syscall.h
diff --git a/sysdeps/unix/sysv/linux/sys/sysmacros.h b/sysdeps/unix/sysv/linux/sys/sysmacros.h
new file mode 100644
index 0000000000..61e55e3a8c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sys/sysmacros.h
@@ -0,0 +1,31 @@
+/* Definitions of macros to access `dev_t' values.
+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
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifndef _SYS_SYSMACROS_H
+#define _SYS_SYSMACROS_H	1
+
+/* Get definition from kernel header.  */
+#include <linux/kdev_t.h>
+
+/* For compatibility we provide alternative names.  */
+#define major(dev) MAJOR ((unsigned int) (dev))
+#define minor(dev) MINOR ((unsigned int) (dev))
+#define makedev(major, minor) MKDEV (major, minor)
+
+#endif /* sys/sysmacros.h */