From: Ulrich Drepper Date: Fri, 27 Sep 1996 03:44:39 +0000 (+0000) Subject: update from main archive X-Git-Tag: upstream/2.30~10627^2~3730 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1120c0ed1654defe3c5d9fcd5b21a68412ce5bfa;p=external%2Fglibc.git update from main archive --- diff --git a/sysdeps/m68k/fpu/s_scalbn.c b/sysdeps/m68k/fpu/s_scalbn.c index 4039bba..6d2b74a 100644 --- a/sysdeps/m68k/fpu/s_scalbn.c +++ b/sysdeps/m68k/fpu/s_scalbn.c @@ -22,7 +22,6 @@ Cambridge, MA 02139, USA. */ #ifndef FUNC #define FUNC scalbn -#include #endif #ifndef float_type #define float_type double diff --git a/sysdeps/m68k/fpu/s_scalbnf.c b/sysdeps/m68k/fpu/s_scalbnf.c index 55d64fd..3345971 100644 --- a/sysdeps/m68k/fpu/s_scalbnf.c +++ b/sysdeps/m68k/fpu/s_scalbnf.c @@ -1,6 +1,5 @@ #ifndef FUNC #define FUNC scalbnf -#include #endif #define float_type float #include diff --git a/sysdeps/m68k/fpu/s_scalbnl.c b/sysdeps/m68k/fpu/s_scalbnl.c index 8484992..c6ad950 100644 --- a/sysdeps/m68k/fpu/s_scalbnl.c +++ b/sysdeps/m68k/fpu/s_scalbnl.c @@ -1,6 +1,5 @@ #ifndef FUNC #define FUNC scalbnl -#include #endif #define float_type long double #include diff --git a/sysdeps/standalone/close.c b/sysdeps/standalone/close.c index 59b6073..7ef1a5f 100644 --- a/sysdeps/standalone/close.c +++ b/sysdeps/standalone/close.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,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 #include #include @@ -28,11 +27,12 @@ Cambridge, MA 02139, USA. */ /* Close the file descriptor FD. */ int -DEFUN(__close, (fd), int fd) +__close (fd) + int fd; { if ( !__FD_Is_valid( fd ) || !__FD_Table[ fd ].in_use ) { - errno = EBADF; + __set_errno (EBADF); return -1; } diff --git a/sysdeps/standalone/m68k/m68020/start.S b/sysdeps/standalone/m68k/m68020/start.S index cbabf5b..9d7d779 100644 --- a/sysdeps/standalone/m68k/m68020/start.S +++ b/sysdeps/standalone/m68k/m68020/start.S @@ -1,19 +1,19 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1996 Free Software Foundation, Inc. Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil), On-Line Applications Research Corporation. - + 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, @@ -43,7 +43,7 @@ _M68Kvec: | standard location for vectors .space 4088 | to avoid initial intr stack | from 135BUG on MVME13? as entry | and start code at 0x4000 -around: +around: move.w %sr,initial_sr | save initial values movec %isp,%a0 movel %a0,initial_isp @@ -53,19 +53,19 @@ around: movel %a0,initial_msp oriw #0x0700,%sr | INTERRUPTS OFF!!! - + | | zero out uninitialized data area | zerobss: - moveal #end,%a0 | find end of .bss - moveal #_bss_start,%a1 | find beginning of .bss + moveal #end,%a0 | find end of .bss + moveal #_bss_start,%a1 | find beginning of .bss movel #0,%d0 loop: movel #0,%a1@+ | to zero out uninitialized cmpal %a0,%a1 - jlt loop | loop until _end reached + jlt loop | loop until _end reached movel #heap_size,__C_heap_size | set ___C_heap_size movel #heap_memory,__C_heap_start | set ___C_heap_start @@ -77,14 +77,14 @@ loop: movel #0,%a1@+ | to zero out uninitialized movw #0x3000,%sr | SUPV MODE,INTERRUPTS ON!!! #ifdef NEED_UNDERSCORES - jsr __Board_Initialize | initialize the board + jsr __Board_Initialize | initialize the board #else - jsr _Board_Initialize | initialize the board + jsr _Board_Initialize | initialize the board #endif - move.l #0,%sp@- | envp = NULL - move.l #0,%sp@- | argv = NULL - move.l #0,%sp@- | argc = NULL + move.l #0,%sp@- | envp = NULL + move.l #0,%sp@- | argv = NULL + move.l #0,%sp@- | argc = NULL #ifdef NEED_UNDERSCORES jsr ___libc_init | initialize the library and | call main @@ -93,8 +93,8 @@ loop: movel #0,%a1@+ | to zero out uninitialized | call main #endif add.l #12,%sp - - move.l #0,%sp@- | argc = NULL + + move.l #0,%sp@- | argc = NULL jsr __exit | call the Board specific exit addq.l #4,%sp @@ -121,7 +121,7 @@ _name##: .space _space #define DECLARE_LABEL(_name) \ .globl _name ; \ -_name##: +_name##: #define DECLARE_PTR(_name) DECLARE_SPACE(_name,4,2) #define DECLARE_U32(_name) DECLARE_SPACE(_name,4,2) @@ -139,6 +139,7 @@ DECLARE_U16(initial_sr) DECLARE_LABEL(_environ) DECLARE_PTR(environ) +DECLARE_LABEL(__errno) DECLARE_LABEL(_errno) DECLARE_U32(errno) diff --git a/sysdeps/standalone/open.c b/sysdeps/standalone/open.c index 910e793..87097d9 100644 --- a/sysdeps/standalone/open.c +++ b/sysdeps/standalone/open.c @@ -1,7 +1,7 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. - + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,7 +19,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 #include #include #include @@ -36,7 +35,9 @@ Cambridge, MA 02139, USA. */ /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ int -DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS) +__open (file, oflag) + const char *file; + int oflag; { int mode; int newfd; @@ -44,7 +45,7 @@ DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS) if (file == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -69,17 +70,17 @@ DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS) } if ( newfd == -1 ) { - errno = ENFILE; + __set_errno (ENFILE); return -1; } - /* + /* * Initialize the open slot */ __FD_Table[ newfd ].in_use = 1; __FD_Table[ newfd ].flags = oflag; - + return newfd; } @@ -89,8 +90,10 @@ DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS) static #endif void -DEFUN(__NONE_init_console_io, (argc, argv, envp), - int argc AND char **argv AND char **envp) +__NONE_init_console_io (argc, argv, envp) + int argc; + char **argv; + char **envp; { int index; diff --git a/sysdeps/standalone/read.c b/sysdeps/standalone/read.c index 284321d..40322a5 100644 --- a/sysdeps/standalone/read.c +++ b/sysdeps/standalone/read.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,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 #include #include #include @@ -30,32 +29,31 @@ Cambridge, MA 02139, USA. */ /* Read NBYTES into BUF from FD. Return the number read or -1. */ ssize_t -DEFUN(__read, (fd, buf, nbytes), - int fd AND PTR buf AND size_t nbytes) +__libc_read (int fd, void *buf, size_t nbytes) { char *buffer = (char *) buf; int data; int poll; - errno = 0; + __set_errno (0); if (nbytes == 0) return 0; if ( !__FD_Is_valid( fd ) || !__FD_Table[ fd ].in_use ) { - errno = EBADF; + __set_errno (EBADF); return -1; } if (buf == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } if ( __FD_Table[ fd ].flags & O_WRONLY ) /* is it write only? */ { - errno = EBADF; + __set_errno (EBADF); return -1; } @@ -63,11 +61,11 @@ DEFUN(__read, (fd, buf, nbytes), poll = ( __FD_Table[ fd ].flags & O_NONBLOCK ) ? 1 : 0; - /* Read a single character. This is a cheap way to insure that the - upper layers get every character because _Console_Getc can't timeout + /* Read a single character. This is a cheap way to insure that the + upper layers get every character because _Console_Getc can't timeout or otherwise know when to stop. */ - + data = _Console_Getc(poll); if ( data == -1 ) /* if no data return */ @@ -84,4 +82,5 @@ DEFUN(__read, (fd, buf, nbytes), return 1; } -weak_alias (__read, read) +weak_alias (__libc_read, __read) +weak_alias (__libc_read, read) diff --git a/sysdeps/standalone/write.c b/sysdeps/standalone/write.c index f0ae388..d377dd5 100644 --- a/sysdeps/standalone/write.c +++ b/sysdeps/standalone/write.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,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 #include #include #include @@ -31,28 +30,27 @@ Cambridge, MA 02139, USA. */ /* Write NBYTES of BUF to FD. Return the number written, or -1. */ ssize_t -DEFUN(__write, (fd, buf, nbytes), - int fd AND CONST PTR buf AND size_t nbytes) +__libc_write (int fd, const void *buf, size_t nbytes) { int count; - CONST char *data = buf; + const char *data = buf; if (nbytes == 0) return 0; if ( !__FD_Is_valid( fd ) || !__FD_Table[ fd ].in_use ) { - errno = EBADF; + __set_errno (EBADF); return -1; } if (buf == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } if ( !(__FD_Table[ fd ].flags & (O_WRONLY|O_RDWR)) ) /* is it writeable? */ { - errno = EBADF; + __set_errno (EBADF); return -1; } @@ -70,5 +68,5 @@ DEFUN(__write, (fd, buf, nbytes), return count; } - -weak_alias (__write, write) +weak_alias (__libc_write, __write) +weak_alias (__libc_write, write) diff --git a/sysdeps/unix/bsd/sun/m68k/sigtramp.c b/sysdeps/unix/bsd/sun/m68k/sigtramp.c index 32a2c20..db9ffb5 100644 --- a/sysdeps/unix/bsd/sun/m68k/sigtramp.c +++ b/sysdeps/unix/bsd/sun/m68k/sigtramp.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 @@ -16,8 +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 - #ifndef __GNUC__ #error This file uses GNU C extensions; you must compile with GCC. #endif @@ -52,8 +50,8 @@ Cambridge, MA 02139, USA. */ #include /* Defined in __sigvec.S. */ -extern int EXFUN(__raw_sigvec, (int sig, CONST struct sigvec *vec, - struct sigvec *ovec)); +extern int __raw_sigvec (int sig, const struct sigvec *vec, + struct sigvec *ovec); /* User-specified signal handlers. */ #define mytramp 1 @@ -70,8 +68,11 @@ extern __sighandler_t _sigfunc[]; Saves and restores the general regs %g2-%g7, the %y register, and all the FPU regs (including %fsr), around calling the user's handler. */ static void -DEFUN(trampoline, (sig, code, context, addr), - int sig AND int code AND struct sigcontext *context AND PTR addr) +trampoline (sig, code, context, addr) + int sig; + int code; + struct sigcontext *context; + void *addr; { int save[4]; @@ -81,7 +82,7 @@ DEFUN(trampoline, (sig, code, context, addr), /* XXX should save/restore FP regs */ /* Call the user's handler. */ - (*((void EXFUN((*), (int sig, int code, struct sigcontext *context, + (*((void (*) __P ((int sig, int code, struct sigcontext *context, PTR addr))) handlers[sig])) (sig, code, context, addr); @@ -95,8 +96,10 @@ DEFUN(trampoline, (sig, code, context, addr), #endif int -DEFUN(__sigvec, (sig, vec, ovec), - int sig AND CONST struct sigvec *vec AND struct sigvec *ovec) +__sigvec (sig, vec, ovec) + int sig; + const struct sigvec *vec; + struct sigvec *ovec; { #ifndef mytramp extern void _sigtramp (int); @@ -108,7 +111,7 @@ DEFUN(__sigvec, (sig, vec, ovec), if (sig <= 0 || sig >= NSIG) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/bsd/sun/sparc/sigtramp.c b/sysdeps/unix/bsd/sun/sparc/sigtramp.c index 54f6293..11ce194 100644 --- a/sysdeps/unix/bsd/sun/sparc/sigtramp.c +++ b/sysdeps/unix/bsd/sun/sparc/sigtramp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1994, 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,8 +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 - #ifndef __GNUC__ #error This file uses GNU C extensions; you must compile with GCC. #endif @@ -52,8 +50,8 @@ Cambridge, MA 02139, USA. */ #include /* Defined in __sigvec.S. */ -extern int EXFUN(__raw_sigvec, (int sig, CONST struct sigvec *vec, - struct sigvec *ovec)); +extern int __raw_sigvec __P ((int sig, CONST struct sigvec *vec, + struct sigvec *ovec)); /* User-specified signal handlers. */ #define mytramp 1 @@ -70,7 +68,8 @@ extern __sighandler_t _sigfunc[]; Saves and restores the general regs %g2-%g7, the %y register, and all the FPU regs (including %fsr), around calling the user's handler. */ static void -DEFUN(trampoline, (sig), int sig) +trampoline (sig) + int sig; { /* We use `double' and `long long int' so `std' (store doubleword) insns, which might be faster than single-word stores, will be generated. */ @@ -97,7 +96,7 @@ DEFUN(trampoline, (sig), int sig) int code; register struct sigcontext *context asm("%i0"); /* See end of fn. */ - PTR addr; + void *addr; int y; double fpsave[16]; int fsr; @@ -147,8 +146,8 @@ DEFUN(trampoline, (sig), int sig) glsave[2] = g6; /* Call the user's handler. */ - (*((void EXFUN((*), (int sig, int code, struct sigcontext *context, - PTR addr))) handlers[sig])) + (*((void (*) __P ((int sig, int code, struct sigcontext *context, + void *addr))) handlers[sig])) (sig, code, context, addr); /* Restore the Y register. */ @@ -199,8 +198,10 @@ DEFUN(trampoline, (sig), int sig) #endif int -DEFUN(__sigvec, (sig, vec, ovec), - int sig AND CONST struct sigvec *vec AND struct sigvec *ovec) +__sigvec (sig, vec, ovec) + int sig; + const struct sigvec *vec; + struct sigvec *ovec; { #ifndef mytramp extern void _sigtramp (int); @@ -212,11 +213,11 @@ DEFUN(__sigvec, (sig, vec, ovec), if (sig <= 0 || sig >= NSIG) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } - mask = __sigblock(sigmask(sig)); + mask = __sigblock (sigmask(sig)); ohandler = handlers[sig]; @@ -240,7 +241,7 @@ DEFUN(__sigvec, (sig, vec, ovec), if (ovec != NULL && ovec->sv_handler == trampoline) ovec->sv_handler = ohandler; - (void) __sigsetmask(mask); + (void) __sigsetmask (mask); return 0; } diff --git a/sysdeps/unix/bsd/sun/sunos4/speed.c b/sysdeps/unix/bsd/sun/sunos4/speed.c index 1c09d55..de6870a 100644 --- a/sysdeps/unix/bsd/sun/sunos4/speed.c +++ b/sysdeps/unix/bsd/sun/sunos4/speed.c @@ -1,5 +1,5 @@ /* `struct termios' speed frobnication functions. SunOS 4 version. -Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +Copyright (C) 1991, 1992, 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 @@ -17,12 +17,11 @@ 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 #include #include #include -static CONST speed_t speeds[] = +static const speed_t speeds[] = { 0, 50, @@ -45,28 +44,31 @@ static CONST speed_t speeds[] = /* Return the output baud rate stored in *TERMIOS_P. */ speed_t -DEFUN(cfgetospeed, (termios_p), CONST struct termios *termios_p) +cfgetospeed (termios_p) + const struct termios *termios_p; { return termios_p->c_cflag & CBAUD; } /* Return the input baud rate stored in *TERMIOS_P. */ speed_t -DEFUN(cfgetispeed, (termios_p), CONST struct termios *termios_p) +cfgetispeed (termios_p) + const struct termios *termios_p; { return (termios_p->c_cflag & CIBAUD) >> IBSHIFT; } /* Set the output baud rate stored in *TERMIOS_P to SPEED. */ int -DEFUN(cfsetospeed, (termios_p, speed), - struct termios *termios_p AND speed_t speed) +cfsetospeed (termios_p, speed) + struct termios *termios_p; + speed_t speed; { register unsigned int i; if (termios_p == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -82,20 +84,21 @@ DEFUN(cfsetospeed, (termios_p, speed), return 0; } - errno = EINVAL; + __set_errno (EINVAL); return -1; } /* Set the input baud rate stored in *TERMIOS_P to SPEED. */ int -DEFUN(cfsetispeed, (termios_p, speed), - struct termios *termios_p AND speed_t speed) +cfsetispeed (termios_p, speed) + struct termios *termios_p; + speed_t speed; { register unsigned int i; if (termios_p == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -108,6 +111,6 @@ DEFUN(cfsetispeed, (termios_p, speed), return 0; } - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c b/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c index f88951f..f825d41 100644 --- a/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c +++ b/sysdeps/unix/bsd/sun/sunos4/tcsetattr.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 @@ -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 #include #include #include @@ -24,8 +23,10 @@ Cambridge, MA 02139, USA. */ /* Set the state of FD to *TERMIOS_P. */ int -DEFUN(tcsetattr, (fd, optional_actions, termios_p), - int fd AND int optional_actions AND CONST struct termios *termios_p) +tcsetattr (fd, optional_actions, termios_p) + int fd; + int optional_actions; + const struct termios *termios_p; { unsigned long cmd; @@ -41,7 +42,7 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p), cmd = TCSETSF; break; default: - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/bsd/ultrix4/mips/start.S b/sysdeps/unix/bsd/ultrix4/mips/start.S index 24bcbb4..aec5885 100644 --- a/sysdeps/unix/bsd/ultrix4/mips/start.S +++ b/sysdeps/unix/bsd/ultrix4/mips/start.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@zen.org). The GNU C Library is free software; you can redistribute it and/or @@ -18,6 +18,7 @@ Cambridge, MA 02139, USA. */ #include +__errno: .comm errno, 4 ENTRY(__start) diff --git a/sysdeps/unix/bsd/ultrix4/sysconf.c b/sysdeps/unix/bsd/ultrix4/sysconf.c index a9f3c5b..a24c1c5 100644 --- a/sysdeps/unix/bsd/ultrix4/sysconf.c +++ b/sysdeps/unix/bsd/ultrix4/sysconf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc. Contributed by Ian Lance Taylor (ian@airs.com). The GNU C Library is free software; you can redistribute it and/or @@ -20,20 +20,19 @@ Cambridge, MA 02139, USA. */ value for _SC_CHILD_MAX. Everything else is from , which the default sysconf already knows how to handle. */ -#include #include #include /* This is an Ultrix header file. */ #include -extern int EXFUN(__getsysinfo, (unsigned int op, void *buffer, - size_t nbytes, int *start, - void *arg)); -extern long int EXFUN(__default_sysconf, (int name)); +extern int __getsysinfo __P ((unsigned int op, void *buffer, + size_t nbytes, int *start, void *arg)); +extern long int __default_sysconf __P ((int name)); long int -DEFUN(__sysconf, (name), int name) +__sysconf (name) + int name; { if (name == _SC_CHILD_MAX) { @@ -46,11 +45,11 @@ DEFUN(__sysconf, (name), int name) if (__getsysinfo (GSI_MAX_UPROCS, &ret, sizeof (ret), &start, (void *) 0) > 0) { - errno = save; + __set_errno (save); return ret; } - errno = save; + __set_errno (save); } return __default_sysconf (name); diff --git a/sysdeps/unix/sysv/irix4/getpriority.c b/sysdeps/unix/sysv/irix4/getpriority.c index 70a9431..6ba6219 100644 --- a/sysdeps/unix/sysv/irix4/getpriority.c +++ b/sysdeps/unix/sysv/irix4/getpriority.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 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 #include #include #include @@ -28,8 +27,9 @@ extern int __sysmp __P ((int, ...)); or user (as specified by WHO) is used. A lower priority number means higher priority. Priorities range from PRIO_MIN to PRIO_MAX. */ int -DEFUN(getpriority, (which, who), - enum __priority_which which AND int who) +getpriority (which, who) + enum __priority_which which; + int who; { switch (which) { @@ -41,6 +41,6 @@ DEFUN(getpriority, (which, who), return __sysmp (MP_SCHED, MPTS_GTNICE_USER, who); } - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/sysv/irix4/setpriority.c b/sysdeps/unix/sysv/irix4/setpriority.c index a632953..322813a 100644 --- a/sysdeps/unix/sysv/irix4/setpriority.c +++ b/sysdeps/unix/sysv/irix4/setpriority.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 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,14 +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, Cambridge, MA 02139, USA. */ -#include #include #include #include int -DEFUN(setpriority, (which, who, prio), - enum __priority_which which AND int who AND int prio) +setpriority (which, who, prio) + enum __priority_which which; + int who; + int prio; { switch (which) { @@ -35,7 +36,6 @@ DEFUN(setpriority, (which, who, prio), return __sysmp (MP_SCHED, MPTS_RENICE_USER, who, prio); } - errno = EINVAL; + __set_errno (EINVAL); return -1; } - diff --git a/sysdeps/unix/sysv/irix4/start.c b/sysdeps/unix/sysv/irix4/start.c index cd86f85..b11d27b 100644 --- a/sysdeps/unix/sysv/irix4/start.c +++ b/sysdeps/unix/sysv/irix4/start.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 @@ -28,7 +28,8 @@ Cambridge, MA 02139, USA. */ /* The first piece of initialized data. */ int __data_start = 0; -VOLATILE int errno = 0; +VOLATILE int __errno = 0; +strong_alias (__errno, errno) extern void EXFUN(__libc_init, (int argc, char **argv, char **envp)); extern int EXFUN(main, (int argc, char **argv, char **envp)); diff --git a/sysdeps/unix/sysv/linux/alpha/ioperm.c b/sysdeps/unix/sysv/linux/alpha/ioperm.c index 731059e..924fc47 100644 --- a/sysdeps/unix/sysv/linux/alpha/ioperm.c +++ b/sysdeps/unix/sysv/linux/alpha/ioperm.c @@ -326,7 +326,7 @@ init_iosys (void) fprintf(stderr, "ioperm.init_iosys(): Unable to determine system type.\n" "\t(May need " PATH_ALPHA_SYSTYPE " symlink?)\n"); - errno = ENODEV; + __set_errno (ENODEV); return -1; } } @@ -349,7 +349,7 @@ init_iosys (void) } /* systype is not a know platform name... */ - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -366,7 +366,7 @@ _ioperm (unsigned long from, unsigned long num, int turn_on) /* this test isn't as silly as it may look like; consider overflows! */ if (from >= MAX_PORT || from + num > MAX_PORT) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -391,7 +391,7 @@ _ioperm (unsigned long from, unsigned long num, int turn_on) case IOSYS_APECS: base = APECS_IO_BASE; break; case IOSYS_CIA: base = CIA_IO_BASE; break; default: - errno = ENODEV; + __set_errno (ENODEV); return -1; } addr = port_to_cpu_addr (from, io.sys, 1); @@ -425,7 +425,7 @@ _iopl (unsigned int level) { if (level > 3) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } if (level) diff --git a/sysdeps/unix/sysv/linux/m68k/brk.c b/sysdeps/unix/sysv/linux/m68k/brk.c index 3fd5475..402dfc5 100644 --- a/sysdeps/unix/sysv/linux/m68k/brk.c +++ b/sysdeps/unix/sysv/linux/m68k/brk.c @@ -42,11 +42,10 @@ __brk (void *addr) if (newbrk < addr) { - errno = ENOMEM; + __set_errno (ENOMEM); return -1; } return 0; } weak_alias (__brk, brk) - diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.S b/sysdeps/unix/sysv/linux/m68k/sysdep.S index b47e167..407c2d3 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.S +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.S @@ -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 + /* Because the Linux version is in fact m68k/ELF and the start.? file for this system (sysdeps/m68k/elf/start.S) is also used by The Hurd and therefore this files must not contain the definition of the @@ -31,6 +33,9 @@ errno: .space 4 .globl _errno .type _errno,@object _errno = errno /* This name is expected by hj libc.so.5 startup code. */ + .globl __errno + .type __errno,@object +__errno = errno /* This name is expected by the MT code. */ .text /* The following code is only used in the shared library when we @@ -39,14 +44,9 @@ _errno = errno /* This name is expected by hj libc.so.5 startup code. */ #ifndef PIC -#include -#define _ERRNO_H -#include - /* The syscall stubs jump here when they detect an error. */ -.globl __syscall_error -__syscall_error: +ENTRY(__syscall_error) neg.l %d0 move.l %d0, errno #ifdef _LIBC_REENTRANT @@ -62,9 +62,7 @@ __syscall_error: .size __syscall_error, . - __syscall_error #endif /* PIC */ - .globl __errno_location - .type __errno_location, @function -__errno_location: +ERRNO(__errno_location) #ifdef PIC move.l (%pc, errno@GOTPC), %a0 #else diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index 9de750c..cfc9b04 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -86,7 +86,7 @@ syscall_error: \ neg.l %d0; \ move.l %d0, (%a0); \ move.l %d0, -(%sp); \ - jbsr __errno_location@PLTPC \ + jbsr __errno_location@PLTPC; \ move.l (%sp)+, (%a0); \ move.l POUND -1, %d0; \ /* Copy return value to %a0 for syscalls that are declared to return \ diff --git a/sysdeps/unix/sysv/sysv4/sigaction.c b/sysdeps/unix/sysv/sysv4/sigaction.c index 68fd7a1..37893fa 100644 --- a/sysdeps/unix/sysv/sysv4/sigaction.c +++ b/sysdeps/unix/sysv/sysv4/sigaction.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 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 #include #include #include @@ -38,15 +37,17 @@ trampoline (int sig, int code, struct sigcontext *context) /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ int -DEFUN(__sigaction, (sig, act, oact), - int sig AND CONST struct sigaction *act AND struct sigaction *oact) +__sigaction (sig, act, oact) + int sig; + const struct sigaction *act; + struct sigaction *oact; { struct sigaction myact; __sighandler_t ohandler; if (sig <= 0 || sig >= NSIG) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/sysv/sysv4/sysconf.c b/sysdeps/unix/sysv/sysv4/sysconf.c index 81d660f..cd0e844 100644 --- a/sysdeps/unix/sysv/sysv4/sysconf.c +++ b/sysdeps/unix/sysv/sysv4/sysconf.c @@ -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 #include #include #include @@ -24,16 +23,17 @@ Cambridge, MA 02139, USA. */ #include #include -extern int EXFUN(__sysconfig, (int)); +extern int __sysconfig __P ((int)); /* Get the value of the system variable NAME. */ long int -DEFUN(__sysconf, (name), int name) +__sysconf (name) + int name; { switch (name) { default: - errno = EINVAL; + __set_errno (EINVAL); return -1; case _SC_ARG_MAX: diff --git a/sysdeps/unix/sysv/sysv4/waitpid.c b/sysdeps/unix/sysv/sysv4/waitpid.c index f54df4b..586a374 100644 --- a/sysdeps/unix/sysv/sysv4/waitpid.c +++ b/sysdeps/unix/sysv/sysv4/waitpid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@zen.org). 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 #include #include #include @@ -53,8 +52,7 @@ extern int __waitid __P ((__idtype_t idtype, __pid_t id, return status for stopped children; otherwise don't. */ __pid_t -DEFUN(__waitpid, (pid, stat_loc, options), - __pid_t pid AND int *stat_loc AND int options) +__libc_waitpid (__pid_t pid, int *stat_loc, int options) { __idtype_t idtype; __pid_t tmp_pid = pid; @@ -117,4 +115,5 @@ DEFUN(__waitpid, (pid, stat_loc, options), return infop.__pid; } -weak_alias (__waitpid, waitpid) +weak_alias (__libc_waitpid, __waitpid) +weak_alias (__libc_waitpid, waitpid)