update from main archive cvs/libc-960927
authorUlrich Drepper <drepper@redhat.com>
Fri, 27 Sep 1996 03:45:24 +0000 (03:45 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 27 Sep 1996 03:45:24 +0000 (03:45 +0000)
Mon Sep 23 15:31:04 1996  Thomas Bushnell, n/BSG  <thomas@gnu.ai.mit.edu>

* hurd/Makefile ($(includedir)/rpc/netdb.h): There is no make
variable `top_srcdir' in libc; use $(..) instead.

* sysdeps/mach/hurd/Makefile (rtld-installed-name): Delete special
definition.  It was a *Mistake*.  (With a capital M.)

* sysdeps/mach/getsysstats.c (__get_nprocs): Renamed from
__get_nproc.
(__get_nprocs_conf): Renamed from __get_nproc_conf.

Fri Sep 27 03:49:56 1996  Ulrich Drepper  <drepper@cygnus.com>

Add support for cancelable system calls.

* csu/initfini.c: Make in crti.o reference to symbol
  __libc_force_cancel_wrapper when compiling reentrant version.
* misc/Makefile (routines): Add force-wrapper.
* misc/force-wrapper.c: New file.

* posix/system.c: Rename function to __libc_system and make system
  a weak alias.
* sysdeps/stub/system.c: Likewise.
* posix/wait.c: Rename function to __libc_wait and make __wait a
weak alias.  De-ANSI-fy.
* sysdeps/standalone/read.c: Rename function to __libc_read and
make __read a weak alias.
* sysdeps/stub/read.c: Likewise.
* sysdeps/standalone/write.c: Rename function to __libc_write and
make __write a weak alias.
* sysdeps/stub/write.c: Likewise.
* sysdeps/stub/tcdrain.c: Rename function to __libc_tcdrain and
  make tcdrain a weak alias.
* sysdeps/unix/bsd/tcdrain.c: Likewise.
* sysdeps/unix/bsd/bsd4.4/tcdrain.c: Likewise.
* sysdeps/unix/sysv/tcdrain.c: Likewise.
* sysdeps/unix/sysv/linux/tcdrain.c: Likewise.
* sysdeps/unix/bsd/bsd4.4/wait.c: Rename function to __libc_wait
and make __wait a weak alias.
* sysdeps/stub/waitpid.c: Rename function to __libc_waitpid and
make __waitpid a weak alias.
* sysdeps/unix/bsd/bsd4.4/waitpid.c: Likewise.
* sysdeps/unix/sysv/linux/waitpid.c: Likewise.
* sysdeps/unix/sysv/sysv4/waitpid.c: Likewise.
* sysdeps/unix/common/pause.c: Rename function to __libc_pause
and make pause a weak alias.  De-ANSI-fy.

* sysdeps/unix/syscalls.list: Change name for close, fcntl, fsync,
  lseek, open, read, and write to have __libc_ prefix and make old
  names a weak alias.
* sysdeps/unix/mman/syscalls.list: Likewise for msync.
* sysdeps/unix/sysv/linux/syscalls.list: Likewise for nanosleep.

* io/creat.c: De-ANSI-fy.

* sysdeps/unix/sysv/linux/syscalls.list: Add pause.

Thu Sep 26 19:15:55 1996  Ulrich Drepper  <drepper@cygnus.com>

* misc/mntent.h: Add MNTTYPE_* and MNTOPT_* macros.
Reported by Hans Grobler <grobh@nolian.ee.sun.ac.za>.

Thu Sep 26 14:40:10 1996  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/posix/pathconf.c: Pass descriptor for just opened file
  to fpathconf.
Reported by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.

Thu Sep 26 04:02:43 1996  Ulrich Drepper  <drepper@cygnus.com>

* locale/programs/locfile.c (write_locale_data): Allocate room
even for file name for LC_MESSAGES locale.
(locafile_read): `tok_era' must be handled as a string list.
* locale/programs/ld-time.c: Finish correction of handling `era'.
* locale/C-time.c (_nl_C_LC_TIME): Add initializer for new fields.
* locale/categories.def: Add postload function for LC_TIME.
* locale/setlocale.c: Make lock global and rename to
  __libc_setlocale_lock.
* locale/localeinfo.h (struct era_entry): New type.  Used in strftime.
Add prototypes for _nl_get_era_entry and _nl_get_alt_digit.
* locale/lc-time.c (_nl_postload_time): New function.  Initialize
lazy intialization.
(_nl_get_era_entry): New function.  Return era entry which corresponds
to given year.
(_nl_get_alt_digit): New function.  Return string with alternate
digit representation for given number.

* time/strftime.c (strftime): Use _nl_get_alt_digit to get
string representing alternate digit notation.

Wed Sep 25 17:31:55 1996  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/generic/waitstatus.h (union wait): Add w_status field.
Reported by Hans Grobler <grobh@nolian.ee.sun.ac.za>.

* elf/rtld.c (dl_main): Process LD_PRELOAD before loading
  ld.so.preload.  Suggested by David Engel <david@elo.ods.com>.

Wed Sep 25 13:10:57 1996  Ulrich Drepper  <drepper@cygnus.com>

* catgets/gencat.c (main): Change --version again because RMS wants
the package name in parentheses.
* db/makedb.c: Likewise.
* locale/programs/locale.c: Likewise.
* locale/programs/localedef.c: Likewise.

Tue Sep 24 01:28:05 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* Makefile ($(objpfx)sysd-dirs): Depend on Subdirs files, command
rewritten.
($(objpfx)version-info.h): Depend on Banner files, command
rewritten.

Wed Sep 25 02:44:41 1996  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/unix/sysv/linux/sleep.c: New file.  Based on nanosleep.

Tue Sep 24 21:46:02 1996  Ulrich Drepper  <drepper@cygnus.com>

* shadow/lckpwdf.c (PWD_LOCKFILE): Change to /etc/lock.pwd to be
  on the same device as the password file.
* shadow/shadow.h (struct spwd): Change type of numeric fields
to `long int' since there value are days, not seconds.
* shadow/putspent.c: Change casts from time_t to `long int'.
* shadow/sgetspent_r.c (LINE_READER): Likewise.

Mon Sep 23 23:05:24 1996  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/unix/sysv/linux/errnos.h: Define __set_errno to make
sure the thread specific variable is set as well as the global
variable.
* sysdeps/mach/hurd/errnos.awk: Define macro for source code
compatibility.
* sysdeps/stub/errnos.h: Likewise.
* sysdeps/unix/bsd/bsd4.4/errnos.h: Likewise.

* shadow/putspent.c: Don't include <errno.h>.

* dirent/scandir.c (scandir): Use __set_errno to set errno
  variable.
* elf/dl-load.c (open_path): Likewise.
* inet/rcmd.c (rcmd): Likewise.
(rresvport): Likewise.
* intl/dcgettext.c [!__set_errno]: Define __set_errno.
(DCGETTEXT): Use __set_errno to set errno variable.
* io/fts.c (fts_open): Likewise.
(fts_close): Likewise.
(fts_read): Likewise.
(fts_set): Likewise.
(fts_children): Likewise.
(fts_build): Likewise.
(fts_stat): Likewise.
* io/ftw.c (ftw_dir): Likewise.
(ftw): Likewise.
* io/getwd.c (getwd): Likewise.
* io/lockf.c (lockf): Likewise.
* libio/libioP.h [EINVAL]: Use __set_errno to define MAYBE_SET_EINVAL.
* libio/iofdopen.c (_IO_fdopen): Use MAYBE_SET_EINVAL to errno.
* libio/iogetdelim.c (_IO_getdelim): Likewise.
* libio/fileops.c (_IO_file_open): Use __set_errno to set errno
variable.
* libio/iofgetpos.c (_IO_fgetpos): Likewise.
* libio/iofsetpos.c (_IO_fsetpos): Likewise.
* libio/ioftell.c (_IO_ftell): Likewise.
* locale/loadlocale.c (_nl_load_locale): Likewise.
* locale/nl_langinfo.c (nl_langinfo): Likewise.
* locale/setlocale.c (ERROR_RETURN): Likewise.
* login/getutid_r (__getutid_r): Likewise.
* login/getutline_r (__getutline_r): Likewise.
* login/login.c (tty_name): Likewise.
* login/oututline_r.c (__pututline_r): Likewise.
* malloc/malloc.c (morecore): Likewise.
* misc/efgcvt_r.c (fcvt_r): Likewise.
* misc/hsearch_r.c (hcreate_r): Likewise.
(hdestroy_r): Likewise.
(hsearch_r): Likewise.
* nss/nsswitch.c (__nss_configure_lookup): Likewise.
* nss/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Likewise.
(_nss_dns_gethostbyaddr_r): Likewise.
* nss/nss_files/files-XXX.c (internal_getent): Likewise.
* nss/nss_files/files-parse.c (parse_list): Likewise.
* posix/confstr.c (confstr): Likewise.  De-ANSI-fy.
* posix/execvp.c (execvp): Likewise.
* posix/glob.c: Define __set_errno.
(glob): Use __set_errno to set errno variable.
(glob_in_dir): Likewise.
* pwd/getpw.c: Likewise. De-ANSI-fy.
* pwd/putpwent.c: Likewise.
* resolv/inet_net_ntop.c: Likewise.
* resolv/inet_net_pton.c: Likewise.
* resolv/inet_neta.c: Likewise.
* resolv/inet_ntop.c: Likewise.
* resolv/inet_pton.c: Likewise.
* resolv/res_query.c (res_search): Likewise.
* resolv/res_send.c (Aerror): Likewise.
(Perror): Likewise.
(res_send): Likewise.
* signal/sigaddset.c: Likewise.  De-ANSI-fy.
* signal/sigdelset.c: Likewise.
* signal/sigempty.c: Likewise.
* signal/sigfillset.c: Likewise.
* signal/sigismem.c: Likewise.
* stdio/fclose.c: Likewise.
* stdio/feof.c: Likewise.
* stdio/ferror.c: Likewise.
* stdio/fflush.c: Likewise.
* stdio/fgetc.c: Likewise.
* stdio/fgetpos.c: Likewise.
* stdio/fgets.c: Likewise.
* stdio/fileno.c: Likewise.
* stdio/fmemopen.c: Likewise.
* stdio/fopen.c: Likewise.
* stdio/fputc.c: Likewise.
* stdio/fread.c: Likewise.
* stdio/freopen.c: Likewise.
* stdio/fseek.c: Likewise.
* stdio/fsetpos.c: Likewise.
* stdio/ftell.c: Likewise.
* stdio/fwrite.c: Likewise.
* stdio/getdelim.c: Likewise.
* stdio/gets.c: Likewise.
* stdio/glue.c: Likewise.
* stdio/internals.c: Likewise.
* stdio/memstream.c: Likewise.
* stdio/setvbuf.c: Likewise.
* stdio/ungetc.c: Likewise.
* stdio/vsscanf.c: Likewise.
* stdio-common/reg-printf.c: Likewise.
* stdio-common/vfprintf.c: Likewise.
* stdio-common/vfscanf.c: Likewise.
* stdlib/canonicalize.c: Likewise.
* stdlib/msort.c: Likewise.
* stdlib/random_r.c: Likewise.
* stdlib/strfmon.c: Likewise.
* stdlib/strtod.c: Likewise.
* stdlib/strtol.c: Likewise.
* sunrpc/bindrsvprt.c: Likewise.
* time/asctime.c: Likewise.
* time/localtime.c: Likewise.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wcstok.c: Likewise.
* sysdeps/generic/ftime.c: Likewise.
* sysdeps/generic/pty.c: Likewise.
* sysdeps/generic/setenv.c: Likewise.
* sysdeps/generic/speed.c: Likewise.
* sysdeps/generic/sysd-stdio.c: Likewise.
* sysdeps/generic/uname.c: Likewise.
* sysdeps/generic/vlimit.c: Likewise.
* sysdeps/libm-ieee754/k_standard.c: Likewise.
* sysdeps/libm-ieee754/s_ldexp.c: Likewise.
* sysdeps/libm-ieee754/s_ldexpf.c: Likewise.
* sysdeps/libm-ieee754/s_ldexpl.c: Likewise.
* sysdeps/libm-ieee754/w_scalb.c: Likewise.
* sysdeps/libm-ieee754/w_scalbf.c: Likewise.
* sysdeps/libm-ieee754/w_scalbl.c: Likewise.
* sysdeps/posix/dup2.c: Likewise.
* sysdeps/posix/euidaccess.c: Likewise.
* sysdeps/posix/fdopen.c: Likewise.
* sysdeps/posix/flock.c: Likewise.
* sysdeps/posix/fpathconf.c: Likewise.
* sysdeps/posix/getcwd.c: Likewise.
* sysdeps/posix/gettimeofday.c: Likewise.
* sysdeps/posix/isatty.c: Likewise.
* sysdeps/posix/isfdtype.c: Likewise.
* sysdeps/posix/killpg.c: Likewise.
* sysdeps/posix/mkstemp.c: Likewise.
* sysdeps/posix/mktemp.c: Likewise.
* sysdeps/posix/pathconf.c: Likewise.
* sysdeps/posix/pipestream.c: Likewise.
* sysdeps/posix/remove.c: Likewise.
* sysdeps/posix/rename.c: Likewise.
* sysdeps/posix/sigintr.c: Likewise.
* sysdeps/posix/signal.c: Likewise.
* sysdeps/posix/sigsuspend.c: Likewise.
* sysdeps/posix/sigvec.c: Likewise.
* sysdeps/posix/sleep.c: Likewise.
* sysdeps/posix/sysconf.c: Likewise.
* sysdeps/posix/system.c: Likewise.
* sysdeps/posix/tempname.c: Likewise.
* sysdeps/posix/truncate.c: Likewise.
* sysdeps/posix/ttyname.c: Likewise.
* sysdeps/posix/ttyname_r.c: Likewise.
* sysdeps/posix/wait3.c: Likewise.
* sysdeps/standalone/close.c: Likewise.
* sysdeps/standalone/open.c: Likewise.
* sysdeps/standalone/read.c: Likewise.
* sysdeps/standalone/write.c: Likewise.
* sysdeps/stub/__longjmp.c: Likewise.
* sysdeps/stub/accept.c: Likewise.
* sysdeps/stub/access.c: Likewise.
* sysdeps/stub/acct.c: Likewise.
* sysdeps/stub/adjtime.c: Likewise.
* sysdeps/stub/alarm.c: Likewise.
* sysdeps/stub/bind.c: Likewise.
* sysdeps/stub/brk.c: Likewise.
* sysdeps/stub/chdir.c: Likewise.
* sysdeps/stub/chflags.c: Likewise.
* sysdeps/stub/chmod.c: Likewise.
* sysdeps/stub/chown.c: Likewise.
* sysdeps/stub/chroot.c: Likewise.
* sysdeps/stub/clock.c: Likewise.
* sysdeps/stub/close.c: Likewise.
* sysdeps/stub/closedir.c: Likewise.
* sysdeps/stub/connect.c: Likewise.
* sysdeps/stub/ctermid.c: Likewise.
* sysdeps/stub/cuserid.c: Likewise.
* sysdeps/stub/dirfd.c: Likewise.
* sysdeps/stub/dup.c: Likewise.
* sysdeps/stub/dup2.c: Likewise.
* sysdeps/stub/euidaccess.c: Likewise.
* sysdeps/stub/execve.c: Likewise.
* sysdeps/stub/fchdir.c: Likewise.
* sysdeps/stub/fchflags.c: Likewise.
* sysdeps/stub/fchmod.c: Likewise.
* sysdeps/stub/fchown.c: Likewise.
* sysdeps/stub/fcntl.c: Likewise.
* sysdeps/stub/fdopen.c: Likewise.
* sysdeps/stub/fexecve.c: Likewise.
* sysdeps/stub/flock.c: Likewise.
* sysdeps/stub/fork.c: Likewise.
* sysdeps/stub/fpathconf.c: Likewise.
* sysdeps/stub/fstatfs.c: Likewise.
* sysdeps/stub/fsync.c: Likewise.
* sysdeps/stub/ftruncate.c: Likewise.
* sysdeps/stub/fxstat.c: Likewise.
* sysdeps/stub/getcwd.c: Likewise.
* sysdeps/stub/getdents.c: Likewise.
* sysdeps/stub/getdomain.c: Likewise.
* sysdeps/stub/getdtsz.c: Likewise.
* sysdeps/stub/getegid.c: Likewise.
* sysdeps/stub/getenv.c: Likewise.
* sysdeps/stub/geteuid.c: Likewise.
* sysdeps/stub/getgid.c: Likewise.
* sysdeps/stub/getgroups.c: Likewise.
* sysdeps/stub/gethostid.c: Likewise.
* sysdeps/stub/gethostname.c: Likewise.
* sysdeps/stub/getitimer.c: Likewise.
* sysdeps/stub/getlogin.c: Likewise.
* sysdeps/stub/getlogin_r.c: Likewise.
* sysdeps/stub/getpagesize.c: Likewise.
* sysdeps/stub/getpeername.c: Likewise.
* sysdeps/stub/getpid.c: Likewise.
* sysdeps/stub/getppid.c: Likewise.
* sysdeps/stub/getpriority.c: Likewise.
* sysdeps/stub/getrlimit.c: Likewise.
* sysdeps/stub/getrusage.c: Likewise.
* sysdeps/stub/getsid.c: Likewise.
* sysdeps/stub/getsockname.c: Likewise.
* sysdeps/stub/getsockopt.c: Likewise.
* sysdeps/stub/getsysstats.c: Likewise.
* sysdeps/stub/gettimeofday.c: Likewise.
* sysdeps/stub/getuid.c: Likewise.
* sysdeps/stub/gtty.c: Likewise.
* sysdeps/stub/ioctl.c: Likewise.
* sysdeps/stub/isatty.c: Likewise.
* sysdeps/stub/isfdtype.c: Likewise.
* sysdeps/stub/kill.c: Likewise.
* sysdeps/stub/killpg.c: Likewise.
* sysdeps/stub/link.c: Likewise.
* sysdeps/stub/listen.c: Likewise.
* sysdeps/stub/lseek.c: Likewise.
* sysdeps/stub/lxstat.c: Likewise.
* sysdeps/stub/madvice.c: Likewise.
* sysdeps/stub/mkdir.c: Likewise.
* sysdeps/stub/mkfifo.c: Likewise.
* sysdeps/stub/mkstemp.c: Likewise.
* sysdeps/stub/mktemp.c: Likewise.
* sysdeps/stub/mmap.c: Likewise.
* sysdeps/stub/morecore.c: Likewise.
* sysdeps/stub/mprotect.c: Likewise.
* sysdeps/stub/msgctl.c: Likewise.
* sysdeps/stub/msgget.c: Likewise.
* sysdeps/stub/msgrcv.c: Likewise.
* sysdeps/stub/msgsnd.c: Likewise.
* sysdeps/stub/msync.c: Likewise.
* sysdeps/stub/munmap.c: Likewise.
* sysdeps/stub/nanosleep.c: Likewise.
* sysdeps/stub/nice.c: Likewise.
* sysdeps/stub/nlist.c: Likewise.
* sysdeps/stub/open.c: Likewise.
* sysdeps/stub/opendir.c: Likewise.
* sysdeps/stub/pathconf.c: Likewise.
* sysdeps/stub/pause.c: Likewise.
* sysdeps/stub/pipe.c: Likewise.
* sysdeps/stub/pipestream.c: Likewise.
* sysdeps/stub/poll.c: Likewise.
* sysdeps/stub/profil.c: Likewise.
* sysdeps/stub/ptrace.c: Likewise.
* sysdeps/stub/putenv.c: Likewise.
* sysdeps/stub/raise.c: Likewise.
* sysdeps/stub/read.c: Likewise.
* sysdeps/stub/readdir.c: Likewise.
* sysdeps/stub/readlink.c: Likewise.
* sysdeps/stub/readv.c: Likewise.
* sysdeps/stub/reboot.c: Likewise.
* sysdeps/stub/recv.c: Likewise.
* sysdeps/stub/recvfrom.c: Likewise.
* sysdeps/stub/recvmsg.c: Likewise.
* sysdeps/stub/remove.c: Likewise.
* sysdeps/stub/rename.c: Likewise.
* sysdeps/stub/revoke.c: Likewise.
* sysdeps/stub/rewinddir.c: Likewise.
* sysdeps/stub/rmdir.c: Likewise.
* sysdeps/stub/sbrk.c: Likewise.
* sysdeps/stub/sched_getp.c: Likewise.
* sysdeps/stub/sched_gets.c: Likewise.
* sysdeps/stub/sched_primax.c: Likewise.
* sysdeps/stub/sched_primin.c: Likewise.
* sysdeps/stub/sched_rr_gi.c: Likewise.
* sysdeps/stub/sched_setp.c: Likewise.
* sysdeps/stub/sched_sets.c: Likewise.
* sysdeps/stub/sched_yield.c: Likewise.
* sysdeps/stub/seekdir.c: Likewise.
* sysdeps/stub/select.c: Likewise.
* sysdeps/stub/semctl.c: Likewise.
* sysdeps/stub/semget.c: Likewise.
* sysdeps/stub/semop.c: Likewise.
* sysdeps/stub/send.c: Likewise.
* sysdeps/stub/sendmsg.c: Likewise.
* sysdeps/stub/sendto.c: Likewise.
* sysdeps/stub/setdomain.c: Likewise.
* sysdeps/stub/setegid.c: Likewise.
* sysdeps/stub/setenv.c: Likewise.
* sysdeps/stub/seteuid.c: Likewise.
* sysdeps/stub/setgid.c: Likewise.
* sysdeps/stub/setgroups.c: Likewise.
* sysdeps/stub/sethostid.c: Likewise.
* sysdeps/stub/sethostname.c: Likewise.
* sysdeps/stub/setitimer.c: Likewise.
* sysdeps/stub/setjmp.c: Likewise.
* sysdeps/stub/setlogin.c: Likewise.
* sysdeps/stub/setpgid.c: Likewise.
* sysdeps/stub/setpriority.c: Likewise.
* sysdeps/stub/setregid.c: Likewise.
* sysdeps/stub/setreuid.c: Likewise.
* sysdeps/stub/setrlimit.c: Likewise.
* sysdeps/stub/setsid.c: Likewise.
* sysdeps/stub/setsockopt.c: Likewise.
* sysdeps/stub/settimeofday.c: Likewise.
* sysdeps/stub/setuid.c: Likewise.
* sysdeps/stub/shmat.c: Likewise.
* sysdeps/stub/shmctl.c: Likewise.
* sysdeps/stub/shmdt.c: Likewise.
* sysdeps/stub/shmget.c: Likewise.
* sysdeps/stub/shutdown.c: Likewise.
* sysdeps/stub/sigaction.c: Likewise.
* sysdeps/stub/sigaltstack.c: Likewise.
* sysdeps/stub/sigblock.c: Likewise.
* sysdeps/stub/sigintr.c: Likewise.
* sysdeps/stub/signal.c: Likewise.
* sysdeps/stub/sigpause.c: Likewise.
* sysdeps/stub/sigpending.c: Likewise.
* sysdeps/stub/sigprocmask.c: Likewise.
* sysdeps/stub/sigreturn.c: Likewise.
* sysdeps/stub/sigsetmask.c: Likewise.
* sysdeps/stub/sigstack.c: Likewise.
* sysdeps/stub/sigsuspend.c: Likewise.
* sysdeps/stub/sigvec.c: Likewise.
* sysdeps/stub/sleep.c: Likewise.
* sysdeps/stub/socket.c: Likewise.
* sysdeps/stub/socketpair.c: Likewise.
* sysdeps/stub/sstk.c: Likewise.
* sysdeps/stub/statfs.c: Likewise.
* sysdeps/stub/stime.c: Likewise.
* sysdeps/stub/stty.c: Likewise.
* sysdeps/stub/swapoff.c: Likewise.
* sysdeps/stub/swapon.c: Likewise.
* sysdeps/stub/symlink.c: Likewise.
* sysdeps/stub/sync.c: Likewise.
* sysdeps/stub/syscall.c: Likewise.
* sysdeps/stub/sysconf.c: Likewise.
* sysdeps/stub/sysd-stdio.c: Likewise.
* sysdeps/stub/system.c: Likewise.
* sysdeps/stub/tcdrain.c: Likewise.
* sysdeps/stub/tcflow.c: Likewise.
* sysdeps/stub/tcflush.c: Likewise.
* sysdeps/stub/tcgetattr.c: Likewise.
* sysdeps/stub/tcgetpgrp.c: Likewise.
* sysdeps/stub/tcsendbrk.c: Likewise.
* sysdeps/stub/tcsetattr.c: Likewise.
* sysdeps/stub/tcsetpgrp.c: Likewise.
* sysdeps/stub/telldir.c: Likewise.
* sysdeps/stub/tempname.c: Likewise.
* sysdeps/stub/time.c: Likewise.
* sysdeps/stub/times.c: Likewise.
* sysdeps/stub/truncate.c: Likewise.
* sysdeps/stub/ttyname.c: Likewise.
* sysdeps/stub/ttyname_r.c: Likewise.
* sysdeps/stub/ualarm.c: Likewise.
* sysdeps/stub/ulimit.c: Likewise.
* sysdeps/stub/umask.c: Likewise.
* sysdeps/stub/unlink.c: Likewise.
* sysdeps/stub/usleep.c: Likewise.
* sysdeps/stub/ustat.c: Likewise.
* sysdeps/stub/utime.c: Likewise.
* sysdeps/stub/utimes.c: Likewise.
* sysdeps/stub/vhangup.c: Likewise.
* sysdeps/stub/wait.c: Likewise.
* sysdeps/stub/wait3.c: Likewise.
* sysdeps/stub/wait4.c: Likewise.
* sysdeps/stub/waitpid.c: Likewise.
* sysdeps/stub/write.c: Likewise.
* sysdeps/stub/writev.c: Likewise.
* sysdeps/stub/xmknod.c: Likewise.
* sysdeps/stub/xstat.c: Likewise.
* sysdeps/unix/closedir.c: Likewise.
* sysdeps/unix/fxstat.c: Likewise.
* sysdeps/unix/getlogin.c: Likewise.
* sysdeps/unix/getlogin_r.c: Likewise.
* sysdeps/unix/mkdir.c: Likewise.
* sysdeps/unix/nice.c: Likewise.
* sysdeps/unix/nlist.c: Likewise.
* sysdeps/unix/opendir.c: Likewise.
* sysdeps/unix/readdir.c: Likewise.
* sysdeps/unix/rmdir.c: Likewise.
* sysdeps/unix/stime.c: Likewise.
* sysdeps/unix/xmknod.c: Likewise.
* sysdeps/unix/xstat.c: Likewise.
* sysdeps/unix/bsd/isatty.c: Likewise.
* sysdeps/unix/bsd/setegid.c: Likewise.
* sysdeps/unix/bsd/seteuid.c: Likewise.
* sysdeps/unix/bsd/setsid.c: Likewise.
* sysdeps/unix/bsd/sigaction.c: Likewise.
* sysdeps/unix/bsd/sigprocmask.c: Likewise.
* sysdeps/unix/bsd/sigsuspend.c: Likewise.
* sysdeps/unix/bsd/tcflow.c: Likewise.
* sysdeps/unix/bsd/tcflush.c: Likewise.
* sysdeps/unix/bsd/tcgetattr.c: Likewise.
* sysdeps/unix/bsd/tcsetattr.c: Likewise.
* sysdeps/unix/bsd/times.c: Likewise.
* sysdeps/unix/bsd/ulimit.c: Likewise.
* sysdeps/unix/common/lxstat.c: Likewise.
* sysdeps/unix/common/tcsendbrk.c: Likewise.
* sysdeps/unix/sysv/setrlimit.c: Likewise.
* sysdeps/unix/sysv/settimeofday.c: Likewise.
* sysdeps/unix/sysv/sigaction.c: Likewise.
* sysdeps/unix/sysv/tcflow.c: Likewise.
* sysdeps/unix/sysv/tcflush.c: Likewise.
* sysdeps/unix/sysv/tcgetattr.c: Likewise.
* sysdeps/unix/sysv/tcsendbrk.c: Likewise.
* sysdeps/unix/sysv/tcsetattr.c: Likewise.
* sysdeps/unix/bsd/ultrix4/sysconf.c: Likewise.
* sysdeps/unix/sysv/irix4/getpriority.c: Likewise.
* sysdeps/unix/sysv/irix4/setpriority.c: Likewise.
* sysdeps/unix/sysv/linux/adjtime.c: Likewise.
* sysdeps/unix/sysv/linux/gethostid.c: Likewise.
* sysdeps/unix/sysv/linux/gethostname.c: Likewise.
* sysdeps/unix/sysv/linux/getsysstats.c: Likewise.
* sysdeps/unix/sysv/linux/ptrace.c: Likewise.
* sysdeps/unix/sysv/linux/speed.c: Likewise.
* sysdeps/unix/sysv/linux/ulimit.c: Likewise.
* sysdeps/unix/sysv/sysv4/sigaction.c: Likewise.
* sysdeps/unix/sysv/sysv4/sysconf.c: Likewise.
* sysdeps/unix/bsd/sun/m68k/sigtramp.c: Likewise.
* sysdeps/unix/bsd/sun/sparc/sigtramp.c: Likewise.
* sysdeps/unix/bsd/sun/sunos4/speed.c: Likewise.
* sysdeps/unix/bsd/sun/sunos4/tcsetattr.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/ioperm.c: Likewise.
* sysdeps/unix/sysv/linux/i386/brk.c: Likewise.
* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
* sysdeps/unix/sysv/linux/m68k/brk.c: Likewise.

* sunrpc/clnt_tcp.c: Protect declaration of errno by #ifndef.
* sunrpc/clnt_udp.c: Likewise.
* sunrpc/bindrsvprt.c: Likewise.
* sunrpc/pm_getmaps.c: Likewise.
* sunrpc/pmap_rmt.c: Likewise.
* sunrpc/svc.c: Likewise.
* sunrpc/svc_run.c: Likewise.
* sunrpc/svc_tcp.c: Likewise.
* sunrpc/svc_udp.c: Likewise.

* sysdeps/generic/strtok.c: Don't check argument, just crash.
* sysdeps/generic/strtok_r.c: Likewise.

* sysdeps/stub/start.c: Make __errno a strong alias of errno.
* sysdeps/unix/start.c: Likewise.  De-ANSI-fy.
* sysdeps/unix/sparc/start.c: Likewise.
* sysdeps/standalone/m68k/m68020/start.S: Likewise.
* sysdeps/unix/sysv/irix4/start.c: Likewise.
* sysdeps/unix/bsd/ultrix4/mips/start.S: Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise.

Mon Sep 23 17:54:57 1996  Ulrich Drepper  <drepper@cygnus.com>

* catgets/gencat.c (main): Put package name in --version message
in parantheses.  Reported by Jim Meyering.
* db/makedb.c: Likewise.
* locale/programs/locale.c: Likewise.
* locale/programs/localedef.c: Likewise.

* sysdeps/i386/fpu/__math.h (tan): Make sure gcc knows we use
two registers.  Patch by John Bowman.

Sat Sep 21 15:08:25 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* sysdeps/mach/libc-lock.h: Fix comment.
* sysdeps/stubs/libc-lock.h: Likewise.

Sat Sep 21 13:50:40 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* libio/genops.c (_IO_init) [_IO_MTSAFE_IO]: Dereference pointer
  to lock when passing it to __libc_lock_init macro.
(_IO_default_finish) [_IO_MTSAFE_IO]: Dereference pointer to lock
when passing it to __libc_lock_fini macro.

Sat Sep 21 14:35:40 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER)
[_LIBC_REENTRANT]: Add missing semicolon.

* sysdeps/unix/sysv/linux/m68k/sysdep.S: Move inclusion of
  sysdep.h to the top outside of #ifndef PIC.  Don't include errnos.h.
   Use the ENTRY macro.

Sat Sep 21 14:33:41 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* libio/Makefile: Make `all' the default target.
* po/Makefile: Likewise.

Mon Sep 23 15:49:47 1996  Ulrich Drepper  <drepper@cygnus.com>

* stdlib/test-canon.c: Correct patch from Thu Sep 12 23:01:16 1996.
I applied it incorrectly.
* sysdeps/m68k/fpu/s_scalbn.c: Likewise.
* sysdeps/m68k/fpu/s_scalbnf.c: Likewise.
* sysdeps/m68k/fpu/s_scalbnl.c: Likewise.

Mon Sep 23 03:00:10 1996  Ulrich Drepper  <drepper@cygnus.com>

* shadow/sgetspent_r.c (LINE_PARSER): Accept empty 9th field.
Patch by NIIBE Yutaka <gniibe@mri.co.jp>.

* shadow/sgetspent_r.c (LINE_PARSER): Don't accept any chars after
  9th field.

* sysdeps/unix/sysv/linux/Makefile [$(subdir)==misc]
(sysdep_headers): Add sys/debugreg.h, sys/kd.h, sys/soundcard.h,
  and sys/vt.h.
* sysdeps/unix/sysv/linux/sys/debugreg.h: New file.
* sysdeps/unix/sysv/linux/sys/kd.h: New file.
* sysdeps/unix/sysv/linux/sys/soundcard.h: New file.
* sysdeps/unix/sysv/linux/sys/vt.h: New file.
Reported by NIIBE Yutaka <gniibe@mri.co.jp>.

491 files changed:
ChangeLog
FAQ
Makefile
catgets/gencat.c
csu/initfini.c
db/makedb.c
dirent/scandir.c
elf/dl-load.c
elf/rtld.c
inet/rcmd.c
intl/dcgettext.c
io/creat.c
io/fts.c
io/ftw.c
io/getwd.c
io/lockf.c
libio/Makefile
libio/fileops.c
libio/genops.c
libio/iofdopen.c
libio/iofgetpos.c
libio/iofsetpos.c
libio/ioftell.c
libio/iogetdelim.c
libio/libioP.h
locale/C-time.c
locale/categories.def
locale/langinfo.h
locale/lc-time.c
locale/loadlocale.c
locale/localeinfo.h
locale/nl_langinfo.c
locale/programs/ld-time.c
locale/programs/locale.c
locale/programs/localedef.c
locale/programs/locfile.c
locale/setlocale.c
login/getutid_r.c
login/getutline_r.c
login/login.c
login/pututline_r.c
misc/Makefile
misc/efgcvt_r.c
misc/force-wrapper.c [new file with mode: 0644]
misc/hsearch_r.c
misc/mntent.h
nss/nss_dns/dns-host.c
nss/nss_files/files-XXX.c
nss/nss_files/files-parse.c
nss/nsswitch.c
po/Makefile
posix/confstr.c
posix/execvp.c
posix/glob.c
pwd/getpw.c
pwd/putpwent.c
resolv/inet_net_ntop.c
resolv/inet_net_pton.c
resolv/inet_neta.c
resolv/inet_ntop.c
resolv/inet_pton.c
resolv/res_query.c
resolv/res_send.c
shadow/lckpwdf.c
shadow/putspent.c
shadow/sgetspent_r.c
shadow/shadow.h
signal/sigaddset.c
signal/sigdelset.c
signal/sigempty.c
signal/sigfillset.c
signal/sigismem.c
stdio-common/reg-printf.c
stdio-common/vfprintf.c
stdio-common/vfscanf.c
stdio/fclose.c
stdio/feof.c
stdio/ferror.c
stdio/fflush.c
stdio/fgetc.c
stdio/fgetpos.c
stdio/fgets.c
stdio/fileno.c
stdio/fmemopen.c
stdio/fopen.c
stdio/fputc.c
stdio/fread.c
stdio/freopen.c
stdio/fseek.c
stdio/fsetpos.c
stdio/ftell.c
stdio/fwrite.c
stdio/getdelim.c
stdio/gets.c
stdio/glue.c
stdio/internals.c
stdio/memstream.c
stdio/setvbuf.c
stdio/ungetc.c
stdio/vsscanf.c
stdlib/canonicalize.c
stdlib/msort.c
stdlib/random_r.c
stdlib/strfmon.c
stdlib/strtod.c
stdlib/strtol.c
stdlib/test-canon.c
sunrpc/bindrsvprt.c
sunrpc/clnt_tcp.c
sunrpc/clnt_udp.c
sunrpc/pm_getmaps.c
sunrpc/pmap_rmt.c
sunrpc/svc.c
sunrpc/svc_run.c
sunrpc/svc_tcp.c
sunrpc/svc_udp.c
sysdeps/generic/ftime.c
sysdeps/generic/pty.c
sysdeps/generic/setenv.c
sysdeps/generic/speed.c
sysdeps/generic/strtok.c
sysdeps/generic/strtok_r.c
sysdeps/generic/sysd-stdio.c
sysdeps/generic/uname.c
sysdeps/generic/vlimit.c
sysdeps/generic/waitstatus.h
sysdeps/i386/fpu/__math.h
sysdeps/libm-ieee754/k_standard.c
sysdeps/libm-ieee754/s_ldexp.c
sysdeps/libm-ieee754/s_ldexpf.c
sysdeps/libm-ieee754/s_ldexpl.c
sysdeps/libm-ieee754/w_scalb.c
sysdeps/libm-ieee754/w_scalbf.c
sysdeps/libm-ieee754/w_scalbl.c
sysdeps/m68k/fpu/s_scalbn.c
sysdeps/m68k/fpu/s_scalbnf.c
sysdeps/m68k/fpu/s_scalbnl.c
sysdeps/mach/hurd/errnos.awk
sysdeps/mach/libc-lock.h
sysdeps/posix/dup2.c
sysdeps/posix/euidaccess.c
sysdeps/posix/fdopen.c
sysdeps/posix/flock.c
sysdeps/posix/fpathconf.c
sysdeps/posix/getcwd.c
sysdeps/posix/gettimeofday.c
sysdeps/posix/isatty.c
sysdeps/posix/isfdtype.c
sysdeps/posix/killpg.c
sysdeps/posix/mkstemp.c
sysdeps/posix/mktemp.c
sysdeps/posix/pathconf.c
sysdeps/posix/pipestream.c
sysdeps/posix/remove.c
sysdeps/posix/rename.c
sysdeps/posix/sigintr.c
sysdeps/posix/signal.c
sysdeps/posix/sigsuspend.c
sysdeps/posix/sigvec.c
sysdeps/posix/sleep.c
sysdeps/posix/sysconf.c
sysdeps/posix/system.c
sysdeps/posix/tempname.c
sysdeps/posix/truncate.c
sysdeps/posix/ttyname.c
sysdeps/posix/ttyname_r.c
sysdeps/posix/wait.c
sysdeps/posix/wait3.c
sysdeps/standalone/close.c
sysdeps/standalone/m68k/m68020/start.S
sysdeps/standalone/open.c
sysdeps/standalone/read.c
sysdeps/standalone/write.c
sysdeps/stub/__longjmp.c
sysdeps/stub/accept.c
sysdeps/stub/access.c
sysdeps/stub/acct.c
sysdeps/stub/adjtime.c
sysdeps/stub/alarm.c
sysdeps/stub/bind.c
sysdeps/stub/brk.c
sysdeps/stub/chdir.c
sysdeps/stub/chflags.c
sysdeps/stub/chmod.c
sysdeps/stub/chown.c
sysdeps/stub/chroot.c
sysdeps/stub/clock.c
sysdeps/stub/close.c
sysdeps/stub/closedir.c
sysdeps/stub/connect.c
sysdeps/stub/ctermid.c
sysdeps/stub/cuserid.c
sysdeps/stub/dirfd.c
sysdeps/stub/dup.c
sysdeps/stub/dup2.c
sysdeps/stub/errnos.h
sysdeps/stub/euidaccess.c
sysdeps/stub/execve.c
sysdeps/stub/fchdir.c
sysdeps/stub/fchflags.c
sysdeps/stub/fchmod.c
sysdeps/stub/fchown.c
sysdeps/stub/fcntl.c
sysdeps/stub/fdopen.c
sysdeps/stub/fexecve.c
sysdeps/stub/flock.c
sysdeps/stub/fork.c
sysdeps/stub/fpathconf.c
sysdeps/stub/fstatfs.c
sysdeps/stub/fsync.c
sysdeps/stub/ftruncate.c
sysdeps/stub/fxstat.c
sysdeps/stub/getcwd.c
sysdeps/stub/getdents.c
sysdeps/stub/getdomain.c
sysdeps/stub/getdtsz.c
sysdeps/stub/getegid.c
sysdeps/stub/getenv.c
sysdeps/stub/geteuid.c
sysdeps/stub/getgid.c
sysdeps/stub/getgroups.c
sysdeps/stub/gethostid.c
sysdeps/stub/gethostname.c
sysdeps/stub/getitimer.c
sysdeps/stub/getlogin.c
sysdeps/stub/getlogin_r.c
sysdeps/stub/getpagesize.c
sysdeps/stub/getpeername.c
sysdeps/stub/getpgid.c
sysdeps/stub/getpid.c
sysdeps/stub/getppid.c
sysdeps/stub/getpriority.c
sysdeps/stub/getrlimit.c
sysdeps/stub/getrusage.c
sysdeps/stub/getsid.c
sysdeps/stub/getsockname.c
sysdeps/stub/getsockopt.c
sysdeps/stub/getsysstats.c
sysdeps/stub/gettimeofday.c
sysdeps/stub/getuid.c
sysdeps/stub/gtty.c
sysdeps/stub/ioctl.c
sysdeps/stub/isatty.c
sysdeps/stub/isfdtype.c
sysdeps/stub/kill.c
sysdeps/stub/killpg.c
sysdeps/stub/libc-lock.h
sysdeps/stub/link.c
sysdeps/stub/listen.c
sysdeps/stub/lseek.c
sysdeps/stub/lxstat.c
sysdeps/stub/madvise.c
sysdeps/stub/mkdir.c
sysdeps/stub/mkfifo.c
sysdeps/stub/mkstemp.c
sysdeps/stub/mktemp.c
sysdeps/stub/mmap.c
sysdeps/stub/morecore.c
sysdeps/stub/mprotect.c
sysdeps/stub/msgctl.c
sysdeps/stub/msgget.c
sysdeps/stub/msgrcv.c
sysdeps/stub/msgsnd.c
sysdeps/stub/msync.c
sysdeps/stub/munmap.c
sysdeps/stub/nanosleep.c
sysdeps/stub/nice.c
sysdeps/stub/nlist.c
sysdeps/stub/open.c
sysdeps/stub/opendir.c
sysdeps/stub/pathconf.c
sysdeps/stub/pause.c
sysdeps/stub/pipe.c
sysdeps/stub/pipestream.c
sysdeps/stub/poll.c
sysdeps/stub/profil.c
sysdeps/stub/ptrace.c
sysdeps/stub/putenv.c
sysdeps/stub/raise.c
sysdeps/stub/read.c
sysdeps/stub/readdir.c
sysdeps/stub/readlink.c
sysdeps/stub/readv.c
sysdeps/stub/reboot.c
sysdeps/stub/recv.c
sysdeps/stub/recvfrom.c
sysdeps/stub/recvmsg.c
sysdeps/stub/remove.c
sysdeps/stub/rename.c
sysdeps/stub/revoke.c
sysdeps/stub/rewinddir.c
sysdeps/stub/rmdir.c
sysdeps/stub/sbrk.c
sysdeps/stub/sched_getp.c
sysdeps/stub/sched_gets.c
sysdeps/stub/sched_primax.c
sysdeps/stub/sched_primin.c
sysdeps/stub/sched_rr_gi.c
sysdeps/stub/sched_setp.c
sysdeps/stub/sched_sets.c
sysdeps/stub/sched_yield.c
sysdeps/stub/seekdir.c
sysdeps/stub/select.c
sysdeps/stub/semctl.c
sysdeps/stub/semget.c
sysdeps/stub/semop.c
sysdeps/stub/send.c
sysdeps/stub/sendmsg.c
sysdeps/stub/sendto.c
sysdeps/stub/setdomain.c
sysdeps/stub/setegid.c
sysdeps/stub/setenv.c
sysdeps/stub/seteuid.c
sysdeps/stub/setgid.c
sysdeps/stub/setgroups.c
sysdeps/stub/sethostid.c
sysdeps/stub/sethostname.c
sysdeps/stub/setitimer.c
sysdeps/stub/setjmp.c
sysdeps/stub/setlogin.c
sysdeps/stub/setpgid.c
sysdeps/stub/setpriority.c
sysdeps/stub/setregid.c
sysdeps/stub/setreuid.c
sysdeps/stub/setrlimit.c
sysdeps/stub/setsid.c
sysdeps/stub/setsockopt.c
sysdeps/stub/settimeofday.c
sysdeps/stub/setuid.c
sysdeps/stub/shmat.c
sysdeps/stub/shmctl.c
sysdeps/stub/shmdt.c
sysdeps/stub/shmget.c
sysdeps/stub/shutdown.c
sysdeps/stub/sigaction.c
sysdeps/stub/sigaltstack.c
sysdeps/stub/sigblock.c
sysdeps/stub/sigintr.c
sysdeps/stub/signal.c
sysdeps/stub/sigpause.c
sysdeps/stub/sigpending.c
sysdeps/stub/sigprocmask.c
sysdeps/stub/sigreturn.c
sysdeps/stub/sigsetmask.c
sysdeps/stub/sigstack.c
sysdeps/stub/sigsuspend.c
sysdeps/stub/sigvec.c
sysdeps/stub/sleep.c
sysdeps/stub/socket.c
sysdeps/stub/socketpair.c
sysdeps/stub/sstk.c
sysdeps/stub/start.c
sysdeps/stub/statfs.c
sysdeps/stub/stime.c
sysdeps/stub/stty.c
sysdeps/stub/swapoff.c
sysdeps/stub/swapon.c
sysdeps/stub/symlink.c
sysdeps/stub/sync.c
sysdeps/stub/syscall.c
sysdeps/stub/sysconf.c
sysdeps/stub/sysd-stdio.c
sysdeps/stub/system.c
sysdeps/stub/tcdrain.c
sysdeps/stub/tcflow.c
sysdeps/stub/tcflush.c
sysdeps/stub/tcgetattr.c
sysdeps/stub/tcgetpgrp.c
sysdeps/stub/tcsendbrk.c
sysdeps/stub/tcsetattr.c
sysdeps/stub/tcsetpgrp.c
sysdeps/stub/telldir.c
sysdeps/stub/tempname.c
sysdeps/stub/time.c
sysdeps/stub/times.c
sysdeps/stub/truncate.c
sysdeps/stub/ttyname.c
sysdeps/stub/ttyname_r.c
sysdeps/stub/ualarm.c
sysdeps/stub/ulimit.c
sysdeps/stub/umask.c
sysdeps/stub/unlink.c
sysdeps/stub/usleep.c
sysdeps/stub/ustat.c
sysdeps/stub/utime.c
sysdeps/stub/utimes.c
sysdeps/stub/vhangup.c
sysdeps/stub/wait.c
sysdeps/stub/wait3.c
sysdeps/stub/wait4.c
sysdeps/stub/waitpid.c
sysdeps/stub/write.c
sysdeps/stub/writev.c
sysdeps/stub/xmknod.c
sysdeps/stub/xstat.c
sysdeps/unix/bsd/bsd4.4/errnos.h
sysdeps/unix/bsd/bsd4.4/tcdrain.c
sysdeps/unix/bsd/bsd4.4/wait.c
sysdeps/unix/bsd/bsd4.4/waitpid.c
sysdeps/unix/bsd/isatty.c
sysdeps/unix/bsd/setegid.c
sysdeps/unix/bsd/seteuid.c
sysdeps/unix/bsd/setsid.c
sysdeps/unix/bsd/sigaction.c
sysdeps/unix/bsd/sigprocmask.c
sysdeps/unix/bsd/sigsuspend.c
sysdeps/unix/bsd/sun/m68k/sigtramp.c
sysdeps/unix/bsd/sun/sparc/sigtramp.c
sysdeps/unix/bsd/sun/sunos4/speed.c
sysdeps/unix/bsd/sun/sunos4/tcsetattr.c
sysdeps/unix/bsd/tcdrain.c
sysdeps/unix/bsd/tcflow.c
sysdeps/unix/bsd/tcflush.c
sysdeps/unix/bsd/tcgetattr.c
sysdeps/unix/bsd/tcsetattr.c
sysdeps/unix/bsd/times.c
sysdeps/unix/bsd/ulimit.c
sysdeps/unix/bsd/ultrix4/mips/start.S
sysdeps/unix/bsd/ultrix4/sysconf.c
sysdeps/unix/closedir.c
sysdeps/unix/common/lxstat.c
sysdeps/unix/common/pause.c
sysdeps/unix/common/tcsendbrk.c
sysdeps/unix/fxstat.c
sysdeps/unix/getdents.c
sysdeps/unix/getlogin.c
sysdeps/unix/getlogin_r.c
sysdeps/unix/mkdir.c
sysdeps/unix/mman/syscalls.list
sysdeps/unix/nice.c
sysdeps/unix/nlist.c
sysdeps/unix/opendir.c
sysdeps/unix/readdir.c
sysdeps/unix/rmdir.c
sysdeps/unix/sparc/start.c
sysdeps/unix/start.c
sysdeps/unix/stime.c
sysdeps/unix/syscalls.list
sysdeps/unix/sysv/irix4/getpriority.c
sysdeps/unix/sysv/irix4/setpriority.c
sysdeps/unix/sysv/irix4/start.c
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/adjtime.c
sysdeps/unix/sysv/linux/alpha/ioperm.c
sysdeps/unix/sysv/linux/errnos.h
sysdeps/unix/sysv/linux/gethostid.c
sysdeps/unix/sysv/linux/gethostname.c
sysdeps/unix/sysv/linux/getsysstats.c
sysdeps/unix/sysv/linux/i386/brk.c
sysdeps/unix/sysv/linux/i386/sigaction.c
sysdeps/unix/sysv/linux/i386/sysdep.S
sysdeps/unix/sysv/linux/i386/sysdep.h
sysdeps/unix/sysv/linux/m68k/brk.c
sysdeps/unix/sysv/linux/m68k/sysdep.S
sysdeps/unix/sysv/linux/m68k/sysdep.h
sysdeps/unix/sysv/linux/ptrace.c
sysdeps/unix/sysv/linux/sigsuspend.c
sysdeps/unix/sysv/linux/sleep.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/speed.c
sysdeps/unix/sysv/linux/sys/debugreg.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sys/kd.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sys/soundcard.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sys/vt.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/syscalls.list
sysdeps/unix/sysv/linux/tcdrain.c
sysdeps/unix/sysv/linux/ulimit.c
sysdeps/unix/sysv/linux/waitpid.c
sysdeps/unix/sysv/setrlimit.c
sysdeps/unix/sysv/settimeofday.c
sysdeps/unix/sysv/sigaction.c
sysdeps/unix/sysv/sysv4/sigaction.c
sysdeps/unix/sysv/sysv4/sysconf.c
sysdeps/unix/sysv/sysv4/waitpid.c
sysdeps/unix/sysv/tcdrain.c
sysdeps/unix/sysv/tcflow.c
sysdeps/unix/sysv/tcflush.c
sysdeps/unix/sysv/tcgetattr.c
sysdeps/unix/sysv/tcsendbrk.c
sysdeps/unix/sysv/tcsetattr.c
sysdeps/unix/xmknod.c
sysdeps/unix/xstat.c
time/asctime.c
time/localtime.c
time/strftime.c
wcsmbs/mbrtowc.c
wcsmbs/mbsnrtowcs.c
wcsmbs/mbsrtowcs.c
wcsmbs/wcrtomb.c
wcsmbs/wcsnrtombs.c
wcsmbs/wcsrtombs.c
wcsmbs/wcstok.c

index 0f1d87a..d28ec2d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,655 @@
+Mon Sep 23 15:31:04 1996  Thomas Bushnell, n/BSG  <thomas@gnu.ai.mit.edu>
+
+       * hurd/Makefile ($(includedir)/rpc/netdb.h): There is no make
+       variable `top_srcdir' in libc; use $(..) instead.
+
+       * sysdeps/mach/hurd/Makefile (rtld-installed-name): Delete special
+       definition.  It was a *Mistake*.  (With a capital M.)
+
+       * sysdeps/mach/getsysstats.c (__get_nprocs): Renamed from
+       __get_nproc.
+       (__get_nprocs_conf): Renamed from __get_nproc_conf.
+
+Fri Sep 27 03:49:56 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       Add support for cancelable system calls.
+
+       * csu/initfini.c: Make in crti.o reference to symbol
+       __libc_force_cancel_wrapper when compiling reentrant version.
+       * misc/Makefile (routines): Add force-wrapper.
+       * misc/force-wrapper.c: New file.
+
+       * posix/system.c: Rename function to __libc_system and make system
+       a weak alias.
+       * sysdeps/stub/system.c: Likewise.
+       * posix/wait.c: Rename function to __libc_wait and make __wait a
+       weak alias.  De-ANSI-fy.
+       * sysdeps/standalone/read.c: Rename function to __libc_read and
+       make __read a weak alias.
+       * sysdeps/stub/read.c: Likewise.
+       * sysdeps/standalone/write.c: Rename function to __libc_write and
+       make __write a weak alias.
+       * sysdeps/stub/write.c: Likewise.
+       * sysdeps/stub/tcdrain.c: Rename function to __libc_tcdrain and
+       make tcdrain a weak alias.
+       * sysdeps/unix/bsd/tcdrain.c: Likewise.
+       * sysdeps/unix/bsd/bsd4.4/tcdrain.c: Likewise.
+       * sysdeps/unix/sysv/tcdrain.c: Likewise.
+       * sysdeps/unix/sysv/linux/tcdrain.c: Likewise.
+       * sysdeps/unix/bsd/bsd4.4/wait.c: Rename function to __libc_wait
+       and make __wait a weak alias.
+       * sysdeps/stub/waitpid.c: Rename function to __libc_waitpid and
+       make __waitpid a weak alias.
+       * sysdeps/unix/bsd/bsd4.4/waitpid.c: Likewise.
+       * sysdeps/unix/sysv/linux/waitpid.c: Likewise.
+       * sysdeps/unix/sysv/sysv4/waitpid.c: Likewise.
+       * sysdeps/unix/common/pause.c: Rename function to __libc_pause
+       and make pause a weak alias.  De-ANSI-fy.
+
+       * sysdeps/unix/syscalls.list: Change name for close, fcntl, fsync,
+       lseek, open, read, and write to have __libc_ prefix and make old
+       names a weak alias.
+       * sysdeps/unix/mman/syscalls.list: Likewise for msync.
+       * sysdeps/unix/sysv/linux/syscalls.list: Likewise for nanosleep.
+
+       * io/creat.c: De-ANSI-fy.
+
+       * sysdeps/unix/sysv/linux/syscalls.list: Add pause.
+
+Thu Sep 26 19:15:55 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * misc/mntent.h: Add MNTTYPE_* and MNTOPT_* macros.
+       Reported by Hans Grobler <grobh@nolian.ee.sun.ac.za>.
+
+Thu Sep 26 14:40:10 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/posix/pathconf.c: Pass descriptor for just opened file
+       to fpathconf.
+       Reported by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.
+
+Thu Sep 26 04:02:43 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * locale/programs/locfile.c (write_locale_data): Allocate room
+       even for file name for LC_MESSAGES locale.
+       (locafile_read): `tok_era' must be handled as a string list.
+       * locale/programs/ld-time.c: Finish correction of handling `era'.
+       * locale/C-time.c (_nl_C_LC_TIME): Add initializer for new fields.
+       * locale/categories.def: Add postload function for LC_TIME.
+       * locale/setlocale.c: Make lock global and rename to
+       __libc_setlocale_lock.
+       * locale/localeinfo.h (struct era_entry): New type.  Used in strftime.
+       Add prototypes for _nl_get_era_entry and _nl_get_alt_digit.
+       * locale/lc-time.c (_nl_postload_time): New function.  Initialize
+       lazy intialization.
+       (_nl_get_era_entry): New function.  Return era entry which corresponds
+       to given year.
+       (_nl_get_alt_digit): New function.  Return string with alternate
+       digit representation for given number.
+
+       * time/strftime.c (strftime): Use _nl_get_alt_digit to get
+       string representing alternate digit notation.
+
+Wed Sep 25 17:31:55 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/generic/waitstatus.h (union wait): Add w_status field.
+       Reported by Hans Grobler <grobh@nolian.ee.sun.ac.za>.
+
+       * elf/rtld.c (dl_main): Process LD_PRELOAD before loading
+       ld.so.preload.  Suggested by David Engel <david@elo.ods.com>.
+
+Wed Sep 25 13:10:57 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * catgets/gencat.c (main): Change --version again because RMS wants
+       the package name in parentheses.
+       * db/makedb.c: Likewise.
+       * locale/programs/locale.c: Likewise.
+       * locale/programs/localedef.c: Likewise.
+
+Tue Sep 24 01:28:05 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * Makefile ($(objpfx)sysd-dirs): Depend on Subdirs files, command
+       rewritten.
+       ($(objpfx)version-info.h): Depend on Banner files, command
+       rewritten.
+
+Wed Sep 25 02:44:41 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/unix/sysv/linux/sleep.c: New file.  Based on nanosleep.
+
+Tue Sep 24 21:46:02 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * shadow/lckpwdf.c (PWD_LOCKFILE): Change to /etc/lock.pwd to be
+       on the same device as the password file.
+       * shadow/shadow.h (struct spwd): Change type of numeric fields
+       to `long int' since there value are days, not seconds.
+       * shadow/putspent.c: Change casts from time_t to `long int'.
+       * shadow/sgetspent_r.c (LINE_READER): Likewise.
+
+Mon Sep 23 23:05:24 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/unix/sysv/linux/errnos.h: Define __set_errno to make
+       sure the thread specific variable is set as well as the global
+       variable.
+       * sysdeps/mach/hurd/errnos.awk: Define macro for source code
+       compatibility.
+       * sysdeps/stub/errnos.h: Likewise.
+       * sysdeps/unix/bsd/bsd4.4/errnos.h: Likewise.
+
+       * shadow/putspent.c: Don't include <errno.h>.
+
+       * dirent/scandir.c (scandir): Use __set_errno to set errno
+       variable.
+       * elf/dl-load.c (open_path): Likewise.
+       * inet/rcmd.c (rcmd): Likewise.
+       (rresvport): Likewise.
+       * intl/dcgettext.c [!__set_errno]: Define __set_errno.
+       (DCGETTEXT): Use __set_errno to set errno variable.
+       * io/fts.c (fts_open): Likewise.
+       (fts_close): Likewise.
+       (fts_read): Likewise.
+       (fts_set): Likewise.
+       (fts_children): Likewise.
+       (fts_build): Likewise.
+       (fts_stat): Likewise.
+       * io/ftw.c (ftw_dir): Likewise.
+       (ftw): Likewise.
+       * io/getwd.c (getwd): Likewise.
+       * io/lockf.c (lockf): Likewise.
+       * libio/libioP.h [EINVAL]: Use __set_errno to define MAYBE_SET_EINVAL.
+       * libio/iofdopen.c (_IO_fdopen): Use MAYBE_SET_EINVAL to errno.
+       * libio/iogetdelim.c (_IO_getdelim): Likewise.
+       * libio/fileops.c (_IO_file_open): Use __set_errno to set errno
+       variable.
+       * libio/iofgetpos.c (_IO_fgetpos): Likewise.
+       * libio/iofsetpos.c (_IO_fsetpos): Likewise.
+       * libio/ioftell.c (_IO_ftell): Likewise.
+       * locale/loadlocale.c (_nl_load_locale): Likewise.
+       * locale/nl_langinfo.c (nl_langinfo): Likewise.
+       * locale/setlocale.c (ERROR_RETURN): Likewise.
+       * login/getutid_r (__getutid_r): Likewise.
+       * login/getutline_r (__getutline_r): Likewise.
+       * login/login.c (tty_name): Likewise.
+       * login/oututline_r.c (__pututline_r): Likewise.
+       * malloc/malloc.c (morecore): Likewise.
+       * misc/efgcvt_r.c (fcvt_r): Likewise.
+       * misc/hsearch_r.c (hcreate_r): Likewise.
+       (hdestroy_r): Likewise.
+       (hsearch_r): Likewise.
+       * nss/nsswitch.c (__nss_configure_lookup): Likewise.
+       * nss/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Likewise.
+       (_nss_dns_gethostbyaddr_r): Likewise.
+       * nss/nss_files/files-XXX.c (internal_getent): Likewise.
+       * nss/nss_files/files-parse.c (parse_list): Likewise.
+       * posix/confstr.c (confstr): Likewise.  De-ANSI-fy.
+       * posix/execvp.c (execvp): Likewise.
+       * posix/glob.c: Define __set_errno.
+       (glob): Use __set_errno to set errno variable.
+       (glob_in_dir): Likewise.
+       * pwd/getpw.c: Likewise. De-ANSI-fy.
+       * pwd/putpwent.c: Likewise.
+       * resolv/inet_net_ntop.c: Likewise.
+       * resolv/inet_net_pton.c: Likewise.
+       * resolv/inet_neta.c: Likewise.
+       * resolv/inet_ntop.c: Likewise.
+       * resolv/inet_pton.c: Likewise.
+       * resolv/res_query.c (res_search): Likewise.
+       * resolv/res_send.c (Aerror): Likewise.
+       (Perror): Likewise.
+       (res_send): Likewise.
+       * signal/sigaddset.c: Likewise.  De-ANSI-fy.
+       * signal/sigdelset.c: Likewise.
+       * signal/sigempty.c: Likewise.
+       * signal/sigfillset.c: Likewise.
+       * signal/sigismem.c: Likewise.
+       * stdio/fclose.c: Likewise.
+       * stdio/feof.c: Likewise.
+       * stdio/ferror.c: Likewise.
+       * stdio/fflush.c: Likewise.
+       * stdio/fgetc.c: Likewise.
+       * stdio/fgetpos.c: Likewise.
+       * stdio/fgets.c: Likewise.
+       * stdio/fileno.c: Likewise.
+       * stdio/fmemopen.c: Likewise.
+       * stdio/fopen.c: Likewise.
+       * stdio/fputc.c: Likewise.
+       * stdio/fread.c: Likewise.
+       * stdio/freopen.c: Likewise.
+       * stdio/fseek.c: Likewise.
+       * stdio/fsetpos.c: Likewise.
+       * stdio/ftell.c: Likewise.
+       * stdio/fwrite.c: Likewise.
+       * stdio/getdelim.c: Likewise.
+       * stdio/gets.c: Likewise.
+       * stdio/glue.c: Likewise.
+       * stdio/internals.c: Likewise.
+       * stdio/memstream.c: Likewise.
+       * stdio/setvbuf.c: Likewise.
+       * stdio/ungetc.c: Likewise.
+       * stdio/vsscanf.c: Likewise.
+       * stdio-common/reg-printf.c: Likewise.
+       * stdio-common/vfprintf.c: Likewise.
+       * stdio-common/vfscanf.c: Likewise.
+       * stdlib/canonicalize.c: Likewise.
+       * stdlib/msort.c: Likewise.
+       * stdlib/random_r.c: Likewise.
+       * stdlib/strfmon.c: Likewise.
+       * stdlib/strtod.c: Likewise.
+       * stdlib/strtol.c: Likewise.
+       * sunrpc/bindrsvprt.c: Likewise.
+       * time/asctime.c: Likewise.
+       * time/localtime.c: Likewise.
+       * wcsmbs/mbrtowc.c: Likewise.
+       * wcsmbs/mbsnrtowcs.c: Likewise.
+       * wcsmbs/mbsrtowcs.c: Likewise.
+       * wcsmbs/wcrtomb.c: Likewise.
+       * wcsmbs/wcsnrtombs.c: Likewise.
+       * wcsmbs/wcsrtombs.c: Likewise.
+       * wcsmbs/wcstok.c: Likewise.
+       * sysdeps/generic/ftime.c: Likewise.
+       * sysdeps/generic/pty.c: Likewise.
+       * sysdeps/generic/setenv.c: Likewise.
+       * sysdeps/generic/speed.c: Likewise.
+       * sysdeps/generic/sysd-stdio.c: Likewise.
+       * sysdeps/generic/uname.c: Likewise.
+       * sysdeps/generic/vlimit.c: Likewise.
+       * sysdeps/libm-ieee754/k_standard.c: Likewise.
+       * sysdeps/libm-ieee754/s_ldexp.c: Likewise.
+       * sysdeps/libm-ieee754/s_ldexpf.c: Likewise.
+       * sysdeps/libm-ieee754/s_ldexpl.c: Likewise.
+       * sysdeps/libm-ieee754/w_scalb.c: Likewise.
+       * sysdeps/libm-ieee754/w_scalbf.c: Likewise.
+       * sysdeps/libm-ieee754/w_scalbl.c: Likewise.
+       * sysdeps/posix/dup2.c: Likewise.
+       * sysdeps/posix/euidaccess.c: Likewise.
+       * sysdeps/posix/fdopen.c: Likewise.
+       * sysdeps/posix/flock.c: Likewise.
+       * sysdeps/posix/fpathconf.c: Likewise.
+       * sysdeps/posix/getcwd.c: Likewise.
+       * sysdeps/posix/gettimeofday.c: Likewise.
+       * sysdeps/posix/isatty.c: Likewise.
+       * sysdeps/posix/isfdtype.c: Likewise.
+       * sysdeps/posix/killpg.c: Likewise.
+       * sysdeps/posix/mkstemp.c: Likewise.
+       * sysdeps/posix/mktemp.c: Likewise.
+       * sysdeps/posix/pathconf.c: Likewise.
+       * sysdeps/posix/pipestream.c: Likewise.
+       * sysdeps/posix/remove.c: Likewise.
+       * sysdeps/posix/rename.c: Likewise.
+       * sysdeps/posix/sigintr.c: Likewise.
+       * sysdeps/posix/signal.c: Likewise.
+       * sysdeps/posix/sigsuspend.c: Likewise.
+       * sysdeps/posix/sigvec.c: Likewise.
+       * sysdeps/posix/sleep.c: Likewise.
+       * sysdeps/posix/sysconf.c: Likewise.
+       * sysdeps/posix/system.c: Likewise.
+       * sysdeps/posix/tempname.c: Likewise.
+       * sysdeps/posix/truncate.c: Likewise.
+       * sysdeps/posix/ttyname.c: Likewise.
+       * sysdeps/posix/ttyname_r.c: Likewise.
+       * sysdeps/posix/wait3.c: Likewise.
+       * sysdeps/standalone/close.c: Likewise.
+       * sysdeps/standalone/open.c: Likewise.
+       * sysdeps/standalone/read.c: Likewise.
+       * sysdeps/standalone/write.c: Likewise.
+       * sysdeps/stub/__longjmp.c: Likewise.
+       * sysdeps/stub/accept.c: Likewise.
+       * sysdeps/stub/access.c: Likewise.
+       * sysdeps/stub/acct.c: Likewise.
+       * sysdeps/stub/adjtime.c: Likewise.
+       * sysdeps/stub/alarm.c: Likewise.
+       * sysdeps/stub/bind.c: Likewise.
+       * sysdeps/stub/brk.c: Likewise.
+       * sysdeps/stub/chdir.c: Likewise.
+       * sysdeps/stub/chflags.c: Likewise.
+       * sysdeps/stub/chmod.c: Likewise.
+       * sysdeps/stub/chown.c: Likewise.
+       * sysdeps/stub/chroot.c: Likewise.
+       * sysdeps/stub/clock.c: Likewise.
+       * sysdeps/stub/close.c: Likewise.
+       * sysdeps/stub/closedir.c: Likewise.
+       * sysdeps/stub/connect.c: Likewise.
+       * sysdeps/stub/ctermid.c: Likewise.
+       * sysdeps/stub/cuserid.c: Likewise.
+       * sysdeps/stub/dirfd.c: Likewise.
+       * sysdeps/stub/dup.c: Likewise.
+       * sysdeps/stub/dup2.c: Likewise.
+       * sysdeps/stub/euidaccess.c: Likewise.
+       * sysdeps/stub/execve.c: Likewise.
+       * sysdeps/stub/fchdir.c: Likewise.
+       * sysdeps/stub/fchflags.c: Likewise.
+       * sysdeps/stub/fchmod.c: Likewise.
+       * sysdeps/stub/fchown.c: Likewise.
+       * sysdeps/stub/fcntl.c: Likewise.
+       * sysdeps/stub/fdopen.c: Likewise.
+       * sysdeps/stub/fexecve.c: Likewise.
+       * sysdeps/stub/flock.c: Likewise.
+       * sysdeps/stub/fork.c: Likewise.
+       * sysdeps/stub/fpathconf.c: Likewise.
+       * sysdeps/stub/fstatfs.c: Likewise.
+       * sysdeps/stub/fsync.c: Likewise.
+       * sysdeps/stub/ftruncate.c: Likewise.
+       * sysdeps/stub/fxstat.c: Likewise.
+       * sysdeps/stub/getcwd.c: Likewise.
+       * sysdeps/stub/getdents.c: Likewise.
+       * sysdeps/stub/getdomain.c: Likewise.
+       * sysdeps/stub/getdtsz.c: Likewise.
+       * sysdeps/stub/getegid.c: Likewise.
+       * sysdeps/stub/getenv.c: Likewise.
+       * sysdeps/stub/geteuid.c: Likewise.
+       * sysdeps/stub/getgid.c: Likewise.
+       * sysdeps/stub/getgroups.c: Likewise.
+       * sysdeps/stub/gethostid.c: Likewise.
+       * sysdeps/stub/gethostname.c: Likewise.
+       * sysdeps/stub/getitimer.c: Likewise.
+       * sysdeps/stub/getlogin.c: Likewise.
+       * sysdeps/stub/getlogin_r.c: Likewise.
+       * sysdeps/stub/getpagesize.c: Likewise.
+       * sysdeps/stub/getpeername.c: Likewise.
+       * sysdeps/stub/getpid.c: Likewise.
+       * sysdeps/stub/getppid.c: Likewise.
+       * sysdeps/stub/getpriority.c: Likewise.
+       * sysdeps/stub/getrlimit.c: Likewise.
+       * sysdeps/stub/getrusage.c: Likewise.
+       * sysdeps/stub/getsid.c: Likewise.
+       * sysdeps/stub/getsockname.c: Likewise.
+       * sysdeps/stub/getsockopt.c: Likewise.
+       * sysdeps/stub/getsysstats.c: Likewise.
+       * sysdeps/stub/gettimeofday.c: Likewise.
+       * sysdeps/stub/getuid.c: Likewise.
+       * sysdeps/stub/gtty.c: Likewise.
+       * sysdeps/stub/ioctl.c: Likewise.
+       * sysdeps/stub/isatty.c: Likewise.
+       * sysdeps/stub/isfdtype.c: Likewise.
+       * sysdeps/stub/kill.c: Likewise.
+       * sysdeps/stub/killpg.c: Likewise.
+       * sysdeps/stub/link.c: Likewise.
+       * sysdeps/stub/listen.c: Likewise.
+       * sysdeps/stub/lseek.c: Likewise.
+       * sysdeps/stub/lxstat.c: Likewise.
+       * sysdeps/stub/madvice.c: Likewise.
+       * sysdeps/stub/mkdir.c: Likewise.
+       * sysdeps/stub/mkfifo.c: Likewise.
+       * sysdeps/stub/mkstemp.c: Likewise.
+       * sysdeps/stub/mktemp.c: Likewise.
+       * sysdeps/stub/mmap.c: Likewise.
+       * sysdeps/stub/morecore.c: Likewise.
+       * sysdeps/stub/mprotect.c: Likewise.
+       * sysdeps/stub/msgctl.c: Likewise.
+       * sysdeps/stub/msgget.c: Likewise.
+       * sysdeps/stub/msgrcv.c: Likewise.
+       * sysdeps/stub/msgsnd.c: Likewise.
+       * sysdeps/stub/msync.c: Likewise.
+       * sysdeps/stub/munmap.c: Likewise.
+       * sysdeps/stub/nanosleep.c: Likewise.
+       * sysdeps/stub/nice.c: Likewise.
+       * sysdeps/stub/nlist.c: Likewise.
+       * sysdeps/stub/open.c: Likewise.
+       * sysdeps/stub/opendir.c: Likewise.
+       * sysdeps/stub/pathconf.c: Likewise.
+       * sysdeps/stub/pause.c: Likewise.
+       * sysdeps/stub/pipe.c: Likewise.
+       * sysdeps/stub/pipestream.c: Likewise.
+       * sysdeps/stub/poll.c: Likewise.
+       * sysdeps/stub/profil.c: Likewise.
+       * sysdeps/stub/ptrace.c: Likewise.
+       * sysdeps/stub/putenv.c: Likewise.
+       * sysdeps/stub/raise.c: Likewise.
+       * sysdeps/stub/read.c: Likewise.
+       * sysdeps/stub/readdir.c: Likewise.
+       * sysdeps/stub/readlink.c: Likewise.
+       * sysdeps/stub/readv.c: Likewise.
+       * sysdeps/stub/reboot.c: Likewise.
+       * sysdeps/stub/recv.c: Likewise.
+       * sysdeps/stub/recvfrom.c: Likewise.
+       * sysdeps/stub/recvmsg.c: Likewise.
+       * sysdeps/stub/remove.c: Likewise.
+       * sysdeps/stub/rename.c: Likewise.
+       * sysdeps/stub/revoke.c: Likewise.
+       * sysdeps/stub/rewinddir.c: Likewise.
+       * sysdeps/stub/rmdir.c: Likewise.
+       * sysdeps/stub/sbrk.c: Likewise.
+       * sysdeps/stub/sched_getp.c: Likewise.
+       * sysdeps/stub/sched_gets.c: Likewise.
+       * sysdeps/stub/sched_primax.c: Likewise.
+       * sysdeps/stub/sched_primin.c: Likewise.
+       * sysdeps/stub/sched_rr_gi.c: Likewise.
+       * sysdeps/stub/sched_setp.c: Likewise.
+       * sysdeps/stub/sched_sets.c: Likewise.
+       * sysdeps/stub/sched_yield.c: Likewise.
+       * sysdeps/stub/seekdir.c: Likewise.
+       * sysdeps/stub/select.c: Likewise.
+       * sysdeps/stub/semctl.c: Likewise.
+       * sysdeps/stub/semget.c: Likewise.
+       * sysdeps/stub/semop.c: Likewise.
+       * sysdeps/stub/send.c: Likewise.
+       * sysdeps/stub/sendmsg.c: Likewise.
+       * sysdeps/stub/sendto.c: Likewise.
+       * sysdeps/stub/setdomain.c: Likewise.
+       * sysdeps/stub/setegid.c: Likewise.
+       * sysdeps/stub/setenv.c: Likewise.
+       * sysdeps/stub/seteuid.c: Likewise.
+       * sysdeps/stub/setgid.c: Likewise.
+       * sysdeps/stub/setgroups.c: Likewise.
+       * sysdeps/stub/sethostid.c: Likewise.
+       * sysdeps/stub/sethostname.c: Likewise.
+       * sysdeps/stub/setitimer.c: Likewise.
+       * sysdeps/stub/setjmp.c: Likewise.
+       * sysdeps/stub/setlogin.c: Likewise.
+       * sysdeps/stub/setpgid.c: Likewise.
+       * sysdeps/stub/setpriority.c: Likewise.
+       * sysdeps/stub/setregid.c: Likewise.
+       * sysdeps/stub/setreuid.c: Likewise.
+       * sysdeps/stub/setrlimit.c: Likewise.
+       * sysdeps/stub/setsid.c: Likewise.
+       * sysdeps/stub/setsockopt.c: Likewise.
+       * sysdeps/stub/settimeofday.c: Likewise.
+       * sysdeps/stub/setuid.c: Likewise.
+       * sysdeps/stub/shmat.c: Likewise.
+       * sysdeps/stub/shmctl.c: Likewise.
+       * sysdeps/stub/shmdt.c: Likewise.
+       * sysdeps/stub/shmget.c: Likewise.
+       * sysdeps/stub/shutdown.c: Likewise.
+       * sysdeps/stub/sigaction.c: Likewise.
+       * sysdeps/stub/sigaltstack.c: Likewise.
+       * sysdeps/stub/sigblock.c: Likewise.
+       * sysdeps/stub/sigintr.c: Likewise.
+       * sysdeps/stub/signal.c: Likewise.
+       * sysdeps/stub/sigpause.c: Likewise.
+       * sysdeps/stub/sigpending.c: Likewise.
+       * sysdeps/stub/sigprocmask.c: Likewise.
+       * sysdeps/stub/sigreturn.c: Likewise.
+       * sysdeps/stub/sigsetmask.c: Likewise.
+       * sysdeps/stub/sigstack.c: Likewise.
+       * sysdeps/stub/sigsuspend.c: Likewise.
+       * sysdeps/stub/sigvec.c: Likewise.
+       * sysdeps/stub/sleep.c: Likewise.
+       * sysdeps/stub/socket.c: Likewise.
+       * sysdeps/stub/socketpair.c: Likewise.
+       * sysdeps/stub/sstk.c: Likewise.
+       * sysdeps/stub/statfs.c: Likewise.
+       * sysdeps/stub/stime.c: Likewise.
+       * sysdeps/stub/stty.c: Likewise.
+       * sysdeps/stub/swapoff.c: Likewise.
+       * sysdeps/stub/swapon.c: Likewise.
+       * sysdeps/stub/symlink.c: Likewise.
+       * sysdeps/stub/sync.c: Likewise.
+       * sysdeps/stub/syscall.c: Likewise.
+       * sysdeps/stub/sysconf.c: Likewise.
+       * sysdeps/stub/sysd-stdio.c: Likewise.
+       * sysdeps/stub/system.c: Likewise.
+       * sysdeps/stub/tcdrain.c: Likewise.
+       * sysdeps/stub/tcflow.c: Likewise.
+       * sysdeps/stub/tcflush.c: Likewise.
+       * sysdeps/stub/tcgetattr.c: Likewise.
+       * sysdeps/stub/tcgetpgrp.c: Likewise.
+       * sysdeps/stub/tcsendbrk.c: Likewise.
+       * sysdeps/stub/tcsetattr.c: Likewise.
+       * sysdeps/stub/tcsetpgrp.c: Likewise.
+       * sysdeps/stub/telldir.c: Likewise.
+       * sysdeps/stub/tempname.c: Likewise.
+       * sysdeps/stub/time.c: Likewise.
+       * sysdeps/stub/times.c: Likewise.
+       * sysdeps/stub/truncate.c: Likewise.
+       * sysdeps/stub/ttyname.c: Likewise.
+       * sysdeps/stub/ttyname_r.c: Likewise.
+       * sysdeps/stub/ualarm.c: Likewise.
+       * sysdeps/stub/ulimit.c: Likewise.
+       * sysdeps/stub/umask.c: Likewise.
+       * sysdeps/stub/unlink.c: Likewise.
+       * sysdeps/stub/usleep.c: Likewise.
+       * sysdeps/stub/ustat.c: Likewise.
+       * sysdeps/stub/utime.c: Likewise.
+       * sysdeps/stub/utimes.c: Likewise.
+       * sysdeps/stub/vhangup.c: Likewise.
+       * sysdeps/stub/wait.c: Likewise.
+       * sysdeps/stub/wait3.c: Likewise.
+       * sysdeps/stub/wait4.c: Likewise.
+       * sysdeps/stub/waitpid.c: Likewise.
+       * sysdeps/stub/write.c: Likewise.
+       * sysdeps/stub/writev.c: Likewise.
+       * sysdeps/stub/xmknod.c: Likewise.
+       * sysdeps/stub/xstat.c: Likewise.
+       * sysdeps/unix/closedir.c: Likewise.
+       * sysdeps/unix/fxstat.c: Likewise.
+       * sysdeps/unix/getlogin.c: Likewise.
+       * sysdeps/unix/getlogin_r.c: Likewise.
+       * sysdeps/unix/mkdir.c: Likewise.
+       * sysdeps/unix/nice.c: Likewise.
+       * sysdeps/unix/nlist.c: Likewise.
+       * sysdeps/unix/opendir.c: Likewise.
+       * sysdeps/unix/readdir.c: Likewise.
+       * sysdeps/unix/rmdir.c: Likewise.
+       * sysdeps/unix/stime.c: Likewise.
+       * sysdeps/unix/xmknod.c: Likewise.
+       * sysdeps/unix/xstat.c: Likewise.
+       * sysdeps/unix/bsd/isatty.c: Likewise.
+       * sysdeps/unix/bsd/setegid.c: Likewise.
+       * sysdeps/unix/bsd/seteuid.c: Likewise.
+       * sysdeps/unix/bsd/setsid.c: Likewise.
+       * sysdeps/unix/bsd/sigaction.c: Likewise.
+       * sysdeps/unix/bsd/sigprocmask.c: Likewise.
+       * sysdeps/unix/bsd/sigsuspend.c: Likewise.
+       * sysdeps/unix/bsd/tcflow.c: Likewise.
+       * sysdeps/unix/bsd/tcflush.c: Likewise.
+       * sysdeps/unix/bsd/tcgetattr.c: Likewise.
+       * sysdeps/unix/bsd/tcsetattr.c: Likewise.
+       * sysdeps/unix/bsd/times.c: Likewise.
+       * sysdeps/unix/bsd/ulimit.c: Likewise.
+       * sysdeps/unix/common/lxstat.c: Likewise.
+       * sysdeps/unix/common/tcsendbrk.c: Likewise.
+       * sysdeps/unix/sysv/setrlimit.c: Likewise.
+       * sysdeps/unix/sysv/settimeofday.c: Likewise.
+       * sysdeps/unix/sysv/sigaction.c: Likewise.
+       * sysdeps/unix/sysv/tcflow.c: Likewise.
+       * sysdeps/unix/sysv/tcflush.c: Likewise.
+       * sysdeps/unix/sysv/tcgetattr.c: Likewise.
+       * sysdeps/unix/sysv/tcsendbrk.c: Likewise.
+       * sysdeps/unix/sysv/tcsetattr.c: Likewise.
+       * sysdeps/unix/bsd/ultrix4/sysconf.c: Likewise.
+       * sysdeps/unix/sysv/irix4/getpriority.c: Likewise.
+       * sysdeps/unix/sysv/irix4/setpriority.c: Likewise.
+       * sysdeps/unix/sysv/linux/adjtime.c: Likewise.
+       * sysdeps/unix/sysv/linux/gethostid.c: Likewise.
+       * sysdeps/unix/sysv/linux/gethostname.c: Likewise.
+       * sysdeps/unix/sysv/linux/getsysstats.c: Likewise.
+       * sysdeps/unix/sysv/linux/ptrace.c: Likewise.
+       * sysdeps/unix/sysv/linux/speed.c: Likewise.
+       * sysdeps/unix/sysv/linux/ulimit.c: Likewise.
+       * sysdeps/unix/sysv/sysv4/sigaction.c: Likewise.
+       * sysdeps/unix/sysv/sysv4/sysconf.c: Likewise.
+       * sysdeps/unix/bsd/sun/m68k/sigtramp.c: Likewise.
+       * sysdeps/unix/bsd/sun/sparc/sigtramp.c: Likewise.
+       * sysdeps/unix/bsd/sun/sunos4/speed.c: Likewise.
+       * sysdeps/unix/bsd/sun/sunos4/tcsetattr.c: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/ioperm.c: Likewise.
+       * sysdeps/unix/sysv/linux/i386/brk.c: Likewise.
+       * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
+       * sysdeps/unix/sysv/linux/m68k/brk.c: Likewise.
+
+       * sunrpc/clnt_tcp.c: Protect declaration of errno by #ifndef.
+       * sunrpc/clnt_udp.c: Likewise.
+       * sunrpc/bindrsvprt.c: Likewise.
+       * sunrpc/pm_getmaps.c: Likewise.
+       * sunrpc/pmap_rmt.c: Likewise.
+       * sunrpc/svc.c: Likewise.
+       * sunrpc/svc_run.c: Likewise.
+       * sunrpc/svc_tcp.c: Likewise.
+       * sunrpc/svc_udp.c: Likewise.
+
+       * sysdeps/generic/strtok.c: Don't check argument, just crash.
+       * sysdeps/generic/strtok_r.c: Likewise.
+
+       * sysdeps/stub/start.c: Make __errno a strong alias of errno.
+       * sysdeps/unix/start.c: Likewise.  De-ANSI-fy.
+       * sysdeps/unix/sparc/start.c: Likewise.
+       * sysdeps/standalone/m68k/m68020/start.S: Likewise.
+       * sysdeps/unix/sysv/irix4/start.c: Likewise.
+       * sysdeps/unix/bsd/ultrix4/mips/start.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/sysdep.S: Likewise.
+       * sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise.
+
+Mon Sep 23 17:54:57 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * catgets/gencat.c (main): Put package name in --version message
+       in parantheses.  Reported by Jim Meyering.
+       * db/makedb.c: Likewise.
+       * locale/programs/locale.c: Likewise.
+       * locale/programs/localedef.c: Likewise.
+
+       * sysdeps/i386/fpu/__math.h (tan): Make sure gcc knows we use
+       two registers.  Patch by John Bowman.
+
+Sat Sep 21 15:08:25 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * sysdeps/mach/libc-lock.h: Fix comment.
+       * sysdeps/stubs/libc-lock.h: Likewise.
+
+Sat Sep 21 13:50:40 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * libio/genops.c (_IO_init) [_IO_MTSAFE_IO]: Dereference pointer
+       to lock when passing it to __libc_lock_init macro.
+       (_IO_default_finish) [_IO_MTSAFE_IO]: Dereference pointer to lock
+       when passing it to __libc_lock_fini macro.
+
+Sat Sep 21 14:35:40 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER)
+       [_LIBC_REENTRANT]: Add missing semicolon.
+
+       * sysdeps/unix/sysv/linux/m68k/sysdep.S: Move inclusion of
+       sysdep.h to the top outside of #ifndef PIC.  Don't include errnos.h.
+       Use the ENTRY macro.
+
+Sat Sep 21 14:33:41 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * libio/Makefile: Make `all' the default target.
+       * po/Makefile: Likewise.
+
+Mon Sep 23 15:49:47 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * stdlib/test-canon.c: Correct patch from Thu Sep 12 23:01:16 1996.
+       I applied it incorrectly.
+       * sysdeps/m68k/fpu/s_scalbn.c: Likewise.
+       * sysdeps/m68k/fpu/s_scalbnf.c: Likewise.
+       * sysdeps/m68k/fpu/s_scalbnl.c: Likewise.
+
+Mon Sep 23 03:00:10 1996  Ulrich Drepper  <drepper@cygnus.com>
+
+       * shadow/sgetspent_r.c (LINE_PARSER): Accept empty 9th field.
+       Patch by NIIBE Yutaka <gniibe@mri.co.jp>.
+
+       * shadow/sgetspent_r.c (LINE_PARSER): Don't accept any chars after
+       9th field.
+
+       * sysdeps/unix/sysv/linux/Makefile [$(subdir)==misc]
+       (sysdep_headers): Add sys/debugreg.h, sys/kd.h, sys/soundcard.h,
+       and sys/vt.h.
+       * sysdeps/unix/sysv/linux/sys/debugreg.h: New file.
+       * sysdeps/unix/sysv/linux/sys/kd.h: New file.
+       * sysdeps/unix/sysv/linux/sys/soundcard.h: New file.
+       * sysdeps/unix/sysv/linux/sys/vt.h: New file.
+       Reported by NIIBE Yutaka <gniibe@mri.co.jp>.
+
 Thu Sep 26 13:44:29 1996  Thomas Bushnell, n/BSG  <thomas@gnu.ai.mit.edu>
 
        * hurd/Makefile (installed-sunrpc-headers): New variable.
diff --git a/FAQ b/FAQ
index b5789a4..5cf093e 100644 (file)
--- a/FAQ
+++ b/FAQ
@@ -55,6 +55,14 @@ please let me know.
          libc anymore?''
 
 [Q15]  ``What are these `add-ons'?''
+
+[Q16]  ``When I use GNU libc on my Linux system by linking against
+         to libc.so which comes with glibc all I get is a core dump.''
+
+[Q17]  ``Looking through the shared libc file I haven't found the
+         functions `stat', `lstat', `fstat', and `mknod' and while
+         linking on my Linux system I get error messages.  How is
+         this supposed to work?''
 \f
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
 [Q1]   ``What systems does the GNU C Library run on?''
@@ -425,12 +433,119 @@ to use this feature.
 
 
 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+[Q16]  ``When I use GNU libc on my Linux system by linking against
+         to libc.so which comes with glibc all I get is a core dump.''
+
+[A16] {UD} It is not enough to simply link against the GNU libc
+library itself.  The GNU C library comes with its own dynamic linker
+which really conforms to the ELF API standard.  This dynamic linker
+must be used.
+
+Normally this is done by the compiler.  The gcc will use
+
+       -dynamic-linker /lib/ld-linux.so.1
+
+unless the user specifies her/himself a -dynamic-linker argument.  But
+this is not the correct name for the GNU dynamic linker.  The correct
+name is /lib/ld.so.1 which is the name specified in the SVr4 ABi.
+
+To change your environment to use GNU libc for compiling you need to
+change the `specs' file of your gcc.  This file is normally found at
+
+       /usr/lib/gcc-lib/<arch>/<version>/specs
+
+In this file you have to change a few things:
+
+- change `ld-linux.so.1' to `ld.so.1'
+
+- remove all expression `%{...:-lgmon}';  there is no libgmon in glibc
+
+
+Things are getting a bit more complicated if you have GNU libc
+installed in some other place than /usr, i.e., if you do not want to
+use it instead of the old libc.  In this case the needed startup files
+and libraries are not found in the regular places.  So the specs file
+must tell the compiler and linker exactly what to use.  Here is for
+example the gcc-2.7.2 specs file when GNU libc is installed at
+/home/gnu:
+
+-----------------------------------------------------------------------
+*asm:
+%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
+
+*asm_final:
+%{pipe:-}
+
+*cpp:
+%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} -I/home/gnu/include
+
+*cc1:
+
+
+*cc1plus:
+
+
+*endfile:
+%{!shared:crtend.o%s} %{shared:crtendS.o%s} /home/gnu/lib/crtn.o%s
+
+*link:
+-m elf_i386 -rpath=/home/gnu/lib -L/home/gnu/lib %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:  %{rdynamic:-export-dynamic}     %{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld.so.1}}       %{static:-static}}}
+
+*lib:
+%{!shared: %{mieee-fp:-lieee} %{p:-lc_p} %{!p:%{pg:-lc_p} %{!pg:-lc}}}
+
+*libgcc:
+%{!shared:-lgcc}
+
+*startfile:
+%{!shared: %{pg:/home/gnu/lib/gcrt1.o%s} %{!pg:%{p:/home/gnu/lib/gcrt1.o} %{!p:/home/gnu/lib/crt1.o%s}}} /home/gnu/lib/crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
+
+*switches_need_spaces:
+
+
+*signed_char:
+%{funsigned-char:-D__CHAR_UNSIGNED__}
+
+*predefines:
+-D__ELF__ -Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386)
+
+*cross_compile:
+0
+
+*multilib:
+. ;
+
+-----------------------------------------------------------------------
+
+Future versions of GCC will automatically provide the correct specs.
+
+
+~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+[Q17]  ``Looking through the shared libc file I haven't found the
+         functions `stat', `lstat', `fstat', and `mknod' and while
+         linking on my Linux system I get error messages.  How is
+         this supposed to work?''
+
+[A17] {RM} Believe it or not, stat and lstat (and fstat, and mknod)
+are supposed to be undefined references in libc.so.6!  Your problem is
+probably a missing or incorrect /usr/lib/libc.so file; note that this
+is a small text file now, not a symlink to libc.so.6.  It should look
+something like this:
+
+GROUP ( libc.so.6 ld.so.1 libc.a )
+
+
+{UD} The Linux ldconfig file probably generates a link libc.so ->
+libc.so.6 in /lib.  This is not correct.  There must not be such a
+link.  The linker script with the above contents is placed in
+/usr/lib which is enough for the linker.
+
+
+~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
 \f
 Answers were given by:
 {UD} Ulrich Drepper, <drepper@cygnus.com>
 {DMT} David Mosberger-Tang, <davidm@AZStarNet.com>
-
-Amended by:
 {RM} Roland McGrath, <roland@gnu.ai.mit.edu>
 \f
 Local Variables:
index 791d788..87a66ee 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -115,34 +115,22 @@ ifeq (yes,$(build-shared))
 lib: $(common-objpfx)libc.so
 endif
 
-$(objpfx)sysd-dirs: $(+sysdir_pfx)config.make
-       (echo define sysdep-subdirs;                                          \
-        for sysdir in $(config-sysdirs); do                                  \
-          case $$sysdir in                                                   \
-            /*) dir=$$sysdir ;;                                              \
-            *)  dir=$(..)$$sysdir ;;                                         \
-          esac;                                                              \
-          if [ -r $$dir/Subdirs ]; then                                      \
-            sed 's/#.*$$//' $$dir/Subdirs;                                   \
-          else true;                                                         \
-          fi;                                                                \
-        done;                                                                \
+all-Subdirs-files = $(wildcard $(addsuffix /Subdirs, $(config-sysdirs)))
+$(objpfx)sysd-dirs: $(+sysdir_pfx)config.make $(all-Subdirs-files)
+       (echo define sysdep-subdirs;                            \
+        sed 's/#.*$$//' $(all-Subdirs-files) /dev/null;        \
         echo endef) > $@-tmp
-        mv -f $@-tmp $@
+       mv -f $@-tmp $@
 \f
-$(objpfx)version-info.h: $(..)Makefile $(+sysdir_pfx)config.make
-       (first=yes;                                                           \
-        for dir in $(subdirs); do                                            \
-          if [ -r $$dir/Banner ]; then                                       \
-            if [ $$first = yes ]; then                                       \
-              echo "\"Available extensions:";                                \
-              first=no;                                                      \
-            fi;                                                              \
-            sed -e '/^#/d' -e 's/^[[:space:]]*/        /' $$dir/Banner;    \
-          fi;                                                                \
-        done;                                                                \
-        [ $$first = yes ] || echo "\"") > $@-tmp
-        mv -f $@-tmp $@
+all-Banner-files = $(wildcard $(addsuffix /Banner, $(subdirs)))
+$(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
+       (files="$(all-Banner-files)";                           \
+        if [ test -n "$$files" ]; then                         \
+          echo "\"Available extensions:";                      \
+          sed -e '/^#/d' -e 's/^[[:space:]]*/  /' $$files;     \
+          echo "\"";                                           \
+        fi) > $@-tmp
+       mv -f $@-tmp $@
 
 version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes))
 $(version.c-objects): $(objpfx)version-info.h
index 7ba9258..7fe159e 100644 (file)
@@ -165,14 +165,14 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      fprintf (stderr, "gencat - GNU %s %s\n", PACKAGE, VERSION);
+      fprintf (stderr, "gencat (GNU %s) %s\n", PACKAGE, VERSION);
       fprintf (stderr, _("\
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 "), "1996");
-      fprintf (stderr, _("Written by %s\n"),
-              "Ulrich Drepper <drepper@cygnus.com>");
+      fprintf (stderr, _("Written by %s.\n"),
+              "Ulrich Drepper");
 
       exit (EXIT_SUCCESS);
     }
@@ -222,7 +222,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\
 If INPUT-FILE is -, input is read from standard input.  If OUTPUT-FILE\n\
 is -, output is written to standard output.\n"),
           program_invocation_name, program_invocation_name);
-      printf (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"));
+      fputs (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"),
+            stdout);
     }
 
   exit (status);
index f816e08..cb2ba53 100644 (file)
@@ -94,6 +94,18 @@ _init (void)
   if (__gmon_start__)
     __gmon_start__ ();
 
+#ifdef _LIBC_REENTRANT
+  {
+    /* This is a trick to generate a reference for the symbol
+       __libc_force_cancel_wrapper which can be used to force parts of
+       the thread library to be used where some functions and system
+       calls are overwritten.  The value of this variable is always 0.  */
+    extern const int __libc_force_cancel_wrapper;
+    if (__libc_force_cancel_wrapper)
+      _init ();
+  }
+#endif
+
   /* End the here document containing the .init prologue code.
      Then fetch the .section directive just written and append that
      to crtn.s-new, followed by the function epilogue.  */
index cfe6aed..5c0d659 100644 (file)
@@ -115,14 +115,14 @@ main (argc, argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      fprintf (stderr, "makedb - GNU %s %s\n", PACKAGE, VERSION);
+      fprintf (stderr, "makedb (GNU %s) %s\n", PACKAGE, VERSION);
       fprintf (stderr, _("\
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 "), "1996");
-      fprintf (stderr, _("Written by %s\n"),
-              "Ulrich Drepper <drepper@cygnus.com>");
+      fprintf (stderr, _("Written by %s.\n"),
+              "Ulrich Drepper");
 
       exit (EXIT_SUCCESS);
     }
@@ -224,7 +224,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\
 If INPUT-FILE is -, input is read from standard input.\n"),
              program_invocation_name, program_invocation_name,
              program_invocation_name);
-      printf (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"));
+      fputs (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"),
+            stdout);
     }
 
   exit (status);
index 6907f08..cffe505 100644 (file)
@@ -16,18 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <dirent.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 
 int
-DEFUN(scandir, (dir, namelist, select, cmp),
-      CONST char *dir AND
-      struct dirent ***namelist AND
-      int EXFUN((*select), (struct dirent *)) AND
-      int EXFUN((*cmp), (CONST PTR, CONST PTR)))
+scandir (dir, namelist, select, cmp)
+     const char *dir;
+     struct dirent ***namelist;
+     int (*select) __P ((struct dirent *));
+     int (*cmp) __P ((const void *, const void *));
 {
   DIR *dp = opendir (dir);
   struct dirent **v = NULL;
@@ -39,7 +38,7 @@ DEFUN(scandir, (dir, namelist, select, cmp),
     return -1;
 
   save = errno;
-  errno = 0;
+  __set_errno (0);
 
   i = 0;
   while ((d = readdir (dp)) != NULL)
@@ -58,7 +57,7 @@ DEFUN(scandir, (dir, namelist, select, cmp),
            if (new == NULL)
              {
              lose:
-               errno = ENOMEM;
+               __set_errno (ENOMEM);
                break;
              }
            v = new;
@@ -79,12 +78,12 @@ DEFUN(scandir, (dir, namelist, select, cmp),
       while (i > 0)
        free (v[--i]);
       free (v);
-      errno = save;
+      __set_errno (save);
       return -1;
     }
 
   (void) closedir (dp);
-  errno = save;
+  __set_errno (save);
 
   /* Sort the list if we have a comparison function to sort with.  */
   if (cmp != NULL)
index b56303f..9dfc961 100644 (file)
@@ -418,7 +418,7 @@ open_path (const char *name, size_t namelen,
   p = dirpath;
   if (p == NULL || *p == '\0')
     {
-      errno = ENOENT;
+      __set_errno (ENOENT);
       return -1;
     }
 
index 0736218..5867692 100644 (file)
@@ -310,6 +310,24 @@ of this helper program; chances are you did not intend to run this program.\n",
   preloads = NULL;
   npreloads = 0;
 
+  if (! __libc_enable_secure)
+    {
+      const char *preloadlist = getenv ("LD_PRELOAD");
+      if (preloadlist)
+       {
+         /* The LD_PRELOAD environment variable gives a colon-separated
+            list of libraries that are loaded before the executable's
+            dependencies and prepended to the global scope list.  */
+         char *list = strdupa (preloadlist);
+         char *p;
+         while ((p = strsep (&list, ":")) != NULL)
+           {
+             (void) _dl_map_object (NULL, p, lt_library);
+             ++npreloads;
+           }
+       }
+    }
+
   /* Read the contents of the file.  */
   file = _dl_sysdep_read_whole_file ("/etc/ld.so.preload", &file_size,
                                     PROT_READ | PROT_WRITE);
@@ -375,24 +393,6 @@ of this helper program; chances are you did not intend to run this program.\n",
       __munmap (file, file_size);
     }
 
-  if (! __libc_enable_secure)
-    {
-      const char *preloadlist = getenv ("LD_PRELOAD");
-      if (preloadlist)
-       {
-         /* The LD_PRELOAD environment variable gives a colon-separated
-            list of libraries that are loaded before the executable's
-            dependencies and prepended to the global scope list.  */
-         char *list = strdupa (preloadlist);
-         char *p;
-         while ((p = strsep (&list, ":")) != NULL)
-           {
-             (void) _dl_map_object (NULL, p, lt_library);
-             ++npreloads;
-           }
-       }
-    }
-
   if (npreloads != 0)
     {
       /* Set up PRELOADS with a vector of the preloaded libraries.  */
index 00fa965..1c63e95 100644 (file)
@@ -111,7 +111,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 
                        (void)fprintf(stderr, _("connect to address %s: "),
                            inet_ntoa(sin.sin_addr));
-                       errno = oerrno;
+                       __set_errno (oerrno);
                        perror(0);
                        hp->h_addr_list++;
                        bcopy(hp->h_addr_list[0], &sin.sin_addr, hp->h_length);
@@ -146,7 +146,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
                FD_ZERO(&reads);
                FD_SET(s, &reads);
                FD_SET(s2, &reads);
-               errno = 0;
+               __set_errno (0);
                if (select(1 + (s > s2 ? s : s2), &reads, 0, 0, 0) < 1 ||
                    !FD_ISSET(s2, &reads)) {
                        if (errno != 0)
@@ -227,7 +227,7 @@ rresvport(alport)
                (*alport)--;
                if (*alport == IPPORT_RESERVED/2) {
                        (void)close(s);
-                       errno = EAGAIN;         /* close */
+                       __set_errno (EAGAIN);           /* close */
                        return (-1);
                }
        }
index 7bbe170..592f724 100644 (file)
@@ -46,6 +46,9 @@ char *alloca ();
 #ifndef errno
 extern int errno;
 #endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
 
 #if defined STDC_HEADERS || defined _LIBC
 # include <stdlib.h>
@@ -277,13 +280,13 @@ DCGETTEXT (domainname, msgid, category)
       dirname = (char *) alloca (path_max + dirname_len);
       ADD_BLOCK (block_list, dirname);
 
-      errno = 0;
+      __set_errno (0);
       while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
        {
          path_max += PATH_INCR;
          dirname = (char *) alloca (path_max + dirname_len);
          ADD_BLOCK (block_list, dirname);
-         errno = 0;
+         __set_errno (0);
        }
 
       if (ret == NULL)
@@ -291,7 +294,7 @@ DCGETTEXT (domainname, msgid, category)
          /* We cannot get the current working directory.  Don't signal an
             error but simply return the default string.  */
          FREE_BLOCKS (block_list);
-         errno = saved_errno;
+         __set_errno (saved_errno);
          return (char *) msgid;
        }
 
@@ -352,7 +355,7 @@ DCGETTEXT (domainname, msgid, category)
          || strcmp (single_locale, "POSIX") == 0)
        {
          FREE_BLOCKS (block_list);
-         errno = saved_errno;
+         __set_errno (saved_errno);
          return (char *) msgid;
        }
 
@@ -381,7 +384,7 @@ DCGETTEXT (domainname, msgid, category)
          if (retval != NULL)
            {
              FREE_BLOCKS (block_list);
-             errno = saved_errno;
+             __set_errno (saved_errno);
              return retval;
            }
        }
index ee935c8..1e1717b 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <fcntl.h>
 #include <sys/types.h>
 
@@ -24,7 +23,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Create FILE with protections MODE.  */
 int
-DEFUN(creat, (file, mode), CONST char *file AND mode_t mode)
+creat (file, mode)
+     const char *file;
+     mode_t mode;
 {
-  return __open(file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+  return __open (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
 }
index fe5750a..5e57eaf 100644 (file)
--- a/io/fts.c
+++ b/io/fts.c
@@ -100,7 +100,7 @@ fts_open(argv, options, compar)
 
        /* Options check. */
        if (options & ~FTS_OPTIONMASK) {
-               errno = EINVAL;
+               __set_errno (EINVAL);
                return (NULL);
        }
 
@@ -134,7 +134,7 @@ fts_open(argv, options, compar)
        for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
                /* Don't allow zero-length paths. */
                if ((len = strlen(*argv)) == 0) {
-                       errno = ENOENT;
+                       __set_errno (ENOENT);
                        goto mem3;
                }
 
@@ -262,7 +262,7 @@ fts_close(sp)
 
        /* Set errno and return. */
        if (!ISSET(FTS_NOCHDIR) && saved_errno) {
-               errno = saved_errno;
+               __set_errno (saved_errno);
                return (-1);
        }
        return (0);
@@ -425,7 +425,7 @@ name:               t = sp->fts_path + NAPPEND(p->fts_parent);
                 * can distinguish between error and EOF.
                 */
                free(p);
-               errno = 0;
+               __set_errno (0);
                return (sp->fts_cur = NULL);
        }
 
@@ -446,7 +446,7 @@ name:               t = sp->fts_path + NAPPEND(p->fts_parent);
                if (FCHDIR(sp, p->fts_symfd)) {
                        saved_errno = errno;
                        (void)close(p->fts_symfd);
-                       errno = saved_errno;
+                       __set_errno (saved_errno);
                        SET(FTS_STOP);
                        return (NULL);
                }
@@ -476,7 +476,7 @@ fts_set(sp, p, instr)
 {
        if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
            instr != FTS_NOINSTR && instr != FTS_SKIP) {
-               errno = EINVAL;
+               __set_errno (EINVAL);
                return (1);
        }
        p->fts_instr = instr;
@@ -492,7 +492,7 @@ fts_children(sp, instr)
        int fd;
 
        if (instr && instr != FTS_NAMEONLY) {
-               errno = EINVAL;
+               __set_errno (EINVAL);
                return (NULL);
        }
 
@@ -503,7 +503,7 @@ fts_children(sp, instr)
         * Errno set to 0 so user can distinguish empty directory from
         * an error.
         */
-       errno = 0;
+       __set_errno (0);
 
        /* Fatal errors stop here. */
        if (ISSET(FTS_STOP))
@@ -681,7 +681,7 @@ mem1:                               saved_errno = errno;
                                        free(p);
                                fts_lfree(head);
                                (void)closedir(dirp);
-                               errno = saved_errno;
+                               __set_errno (saved_errno);
                                cur->fts_info = FTS_ERR;
                                SET(FTS_STOP);
                                return (NULL);
@@ -803,7 +803,7 @@ fts_stat(sp, p, follow)
                if (stat(p->fts_accpath, sbp)) {
                        saved_errno = errno;
                        if (!lstat(p->fts_accpath, sbp)) {
-                               errno = 0;
+                               __set_errno (0);
                                return (FTS_SLNONE);
                        }
                        p->fts_errno = saved_errno;
index ff2e2b1..b8d745b 100644 (file)
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -47,7 +47,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
 
   got = 0;
 
-  errno = 0;
+  __set_errno (0);
 
   while ((entry = readdir (dirs[level])) != NULL)
     {
@@ -61,7 +61,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
          && (entry->d_name[1] == '\0' ||
              (entry->d_name[1] == '.' && entry->d_name[2] == '\0')))
        {
-         errno = 0;
+         __set_errno (0);
          continue;
        }
 
@@ -70,9 +70,9 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
       if (namlen + len + 1 > PATH_MAX)
        {
 #ifdef ENAMETOOLONG
-         errno = ENAMETOOLONG;
+         __set_errno (ENAMETOOLONG);
 #else
-         errno = ENOMEM;
+         __set_errno (ENOMEM);
 #endif
          return -1;
        }
@@ -120,7 +120,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
 
              save = errno;
              closedir (dirs[newlev]);
-             errno = save;
+             __set_errno (save);
              dirs[newlev] = NULL;
            }
        }
@@ -139,13 +139,13 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
          skip = got;
          while (skip-- != 0)
            {
-             errno = 0;
+             __set_errno (0);
              if (readdir (dirs[level]) == NULL)
                return errno == 0 ? 0 : -1;
            }
        }
 
-      errno = 0;
+      __set_errno (0);
     }
 
   return errno == 0 ? 0 : -1;
@@ -211,7 +211,7 @@ DEFUN(ftw, (dir, func, descriptors),
 
          save = errno;
          closedir (dirs[0]);
-         errno = save;
+         __set_errno (save);
        }
     }
 
index 8a8d01a..00825ee 100644 (file)
@@ -37,7 +37,7 @@ getwd (buf)
 
   if (buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 9166419..c391243 100644 (file)
@@ -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
@@ -37,7 +37,7 @@ lockf (int fd, int cmd, off_t len)
        return -1;
       if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
        return 0;
-      errno = EACCES;
+      __set_errno (EACCES);
       return -1;
 
     case F_ULOCK:
@@ -54,7 +54,7 @@ lockf (int fd, int cmd, off_t len)
       break;
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 902d63f..ba64fc7 100644 (file)
@@ -36,6 +36,8 @@ routines      :=                                                            \
                                                                              \
        libc_fatal
 
+all: # Make this the default target; it will be defined in Rules.
+
 include ../Makeconfig
 
 ifneq (,$(filter %REENTRANT, $(defines)))
index a3138af..b4bd5ce 100644 (file)
@@ -165,7 +165,7 @@ DEFUN(_IO_file_fopen, (fp, filename, mode),
     read_write = _IO_NO_READS|_IO_IS_APPENDING;
     break;
   default:
-    errno = EINVAL;
+    __set_errno (EINVAL);
     return NULL;
   }
   if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+')) {
index 818e740..7c2dcba 100644 (file)
@@ -466,7 +466,7 @@ DEFUN(_IO_init, (fp, flags),
   fp->_markers = NULL;
   fp->_cur_column = 0;
 #ifdef _IO_MTSAFE_IO
-  __libc_lock_init (fp->_lock);
+  __libc_lock_init (*fp->_lock);
 #endif
 }
 
@@ -501,7 +501,7 @@ DEFUN(_IO_default_finish, (fp),
     }
 
 #ifdef _IO_MTSAFE_IO
-  __libc_lock_fini (fp->_lock);
+  __libc_lock_fini (*fp->_lock);
 #endif
 
   _IO_un_link(fp);
index 797192e..67c629c 100644 (file)
@@ -61,9 +61,7 @@ _IO_fdopen (fd, mode)
       read_write = _IO_NO_READS|_IO_IS_APPENDING;
       break;
     default:
-#ifdef EINVAL
-      errno = EINVAL;
-#endif
+      MAYBE_SET_EINVAL;
       return NULL;
   }
   if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
index c45cfac..4cec7a7 100644 (file)
@@ -41,7 +41,7 @@ _IO_fgetpos (fp, posp)
     {
 #ifdef EIO
       if (errno == 0)
-       errno = EIO;
+       __set_errno (EIO);
 #endif
       return EOF;
     }
index 96c3a7a..9013606 100644 (file)
@@ -39,7 +39,7 @@ _IO_fsetpos (fp, posp)
       /*ANSI explicily requires setting errno to a positive value on failure.*/
 #ifdef EIO
       if (errno == 0)
-       errno = EIO;
+       __set_errno (EIO);
 #endif
       result = EOF;
     }
index 12b90b3..ec3b1a2 100644 (file)
@@ -40,7 +40,7 @@ _IO_ftell (fp)
     {
 #ifdef EIO
       if (errno == 0)
-       errno = EIO;
+       __set_errno (EIO);
 #endif
       return -1L;
     }
index 0acd76e..da6efa4 100644 (file)
@@ -48,9 +48,7 @@ _IO_getdelim (lineptr, n, delimiter, fp)
 
   if (lineptr == NULL || n == NULL)
     {
-#ifdef EINVAL
-      errno = EINVAL;
-#endif
+      MAYBE_SET_EINVAL;
       return -1;
     }
   CHECK_FILE (fp, -1);
index f5e6dc5..d3c871f 100644 (file)
@@ -397,7 +397,7 @@ extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf;
 #endif
 
 #ifdef EINVAL
-#define MAYBE_SET_EINVAL errno = EINVAL
+#define MAYBE_SET_EINVAL __set_errno (EINVAL)
 #else
 #define MAYBE_SET_EINVAL /* nothing */
 #endif
index b03ff49..dbb51f3 100644 (file)
@@ -26,7 +26,7 @@ const struct locale_data _nl_C_LC_TIME =
 {
   _nl_C_name,
   NULL, 0, /* no file mapped */
-  45,
+  53,
   {
     { string: "Sun" },
     { string: "Mon" },
@@ -72,6 +72,14 @@ const struct locale_data _nl_C_LC_TIME =
     { string: "%m/%d/%y" },
     { string: "%H:%M:%S" },
     { string: "%I:%M:%S %p" },
-    { string: NULL }
+    { string: NULL },
+    { string: NULL },
+    { string: NULL },
+    { string: NULL },
+    { string: NULL },
+    { string: NULL },
+    { word: 0 },
+    { string: NULL },
+    { string: NULL },
   }
 };
index 5e72319..664fc90 100644 (file)
@@ -137,16 +137,17 @@ DEFINE_CATEGORY
   DEFINE_ELEMENT (D_FMT,       "d_fmt",       std, string)
   DEFINE_ELEMENT (T_FMT,       "t_fmt",       std, string)
   DEFINE_ELEMENT (T_FMT_AMPM,  "t_fmt_ampm",  std, string)
-  DEFINE_ELEMENT (ERA,         "era",         opt, stringarray,  0, 100)/*XXX*/
+  DEFINE_ELEMENT (ERA,         "era",         opt, stringarray)
   DEFINE_ELEMENT (ERA_YEAR,    "era_year",    opt, string)
   DEFINE_ELEMENT (ERA_D_FMT,   "era_d_fmt",   opt, string)
   DEFINE_ELEMENT (ALT_DIGITS,  "alt_digits",  opt, stringarray,  0, 100)
   DEFINE_ELEMENT (ERA_D_T_FMT, "era_d_t_fmt", opt, string)
   DEFINE_ELEMENT (ERA_T_FMT,   "era_t_fmt",   opt, string)
+  DEFINE_ELEMENT (_NL_TIME_NUM_ALT_DIGITS,  "time-num-alt-digits", opt, word)
   DEFINE_ELEMENT (_NL_TIME_ERA_NUM_ENTRIES, "time-era-num-entries", opt, word)
-  DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES_EB, "time-era-entries-eb", opt, string)
-  DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES_EL, "time-era-entries-el", opt, string)
-  ), NO_POSTLOAD, NULL, NULL, NULL)
+  DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES_EB,  "time-era-entries-eb", opt, string)
+  DEFINE_ELEMENT (_NL_TIME_ERA_ENTRIES_EL,  "time-era-entries-el", opt, string)
+  ), _nl_postload_time, NULL, NULL, NULL)
 
 
 DEFINE_CATEGORY
index 82bd510..4df8df7 100644 (file)
@@ -101,6 +101,8 @@ typedef enum
   ERA_D_T_FMT,                 /* Date and time in alternate era format.  */
   ERA_T_FMT,                   /* Time in alternate era format.  */
 
+  _NL_TIME_NUM_ALT_DIGITS,     /* Number entries in the alt_digits arrays.  */
+
   _NL_TIME_ERA_NUM_ENTRIES,    /* Number entries in the era arrays.  */
   _NL_TIME_ERA_ENTRIES_EB,     /* Structure with era entries in usable form.*/
   _NL_TIME_ERA_ENTRIES_EL,
index 7b84f99..f4fe561 100644 (file)
@@ -1,5 +1,5 @@
 /* Define current locale data for LC_TIME category.
-Copyright (C) 1995 Free Software Foundation, Inc.
+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
@@ -17,6 +17,160 @@ 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 <libc-lock.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
 #include "localeinfo.h"
 
 _NL_CURRENT_DEFINE (LC_TIME);
+
+/* Some of the functions here must not be used while setlocale is called.  */
+__libc_lock_define (extern, __libc_setlocale_lock)
+
+
+static int era_initialized;
+static struct era_entry **eras;
+static size_t num_eras;
+
+
+static int alt_digits_initialized;
+static const char **alt_digits;
+static size_t num_alt_digits;
+
+
+void
+_nl_postload_time (void)
+{
+  /* Prepare lazy initialization of `era' and `alt_digits' array.  */
+  era_initialized = 0;
+  alt_digits_initialized = 0;
+}
+
+
+struct era_entry *
+_nl_get_era_entry (const struct tm *tp)
+{
+  struct era_entry *result;
+  size_t cnt;
+
+  __libc_lock_lock (__libc_setlocale_lock);
+
+  if (era_initialized == 0)
+    {
+      size_t new_num_eras = _NL_CURRENT_WORD (LC_TIME,
+                                             _NL_TIME_ERA_NUM_ENTRIES);
+
+      if (eras != NULL && new_num_eras == 0)
+       {
+         free (eras);
+         eras = NULL;
+       }
+      else if (new_num_eras != 0)
+       {
+         if (num_eras != new_num_eras)
+           eras = realloc (eras, new_num_eras * sizeof (struct era_entry *));
+
+         if (eras == NULL)
+           num_eras = 0;
+         else
+           {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+             const char *ptr = _NL_CURRENT (LC_TIME, _NL_TIME_ERA_ENTRIES_EL);
+#else
+             const char *ptr = _NL_CURRENT (LC_TIME, _NL_TIME_ERA_ENTRIES_EB);
+#endif
+             num_eras = new_num_eras;
+
+             for (cnt = 0; cnt < num_eras; ++cnt)
+               {
+                 eras[cnt] = (struct era_entry *) ptr;
+
+                 /* Skip numeric values.  */
+                 ptr += sizeof (struct era_entry);
+                 /* Skip era name. */
+                 ptr = strchr (ptr, '\0') + 1;
+                 /* Skip era format. */
+                 ptr = strchr (ptr, '\0') + 1;
+
+                 ptr += 3 - (((ptr - (const char *) eras[cnt]) + 3) & 3);
+               }
+           }
+       }
+
+      era_initialized = 1;
+    }
+
+  /* Now compare date with the available eras.  */
+  for (cnt = 0; cnt < num_eras; ++cnt)
+    if ((eras[cnt]->start_date[0] < tp->tm_year
+        || (eras[cnt]->start_date[0] == tp->tm_year
+            && (eras[cnt]->start_date[1] < tp->tm_mon
+                || (eras[cnt]->start_date[1] == tp->tm_mon
+                    && eras[cnt]->start_date[2] <= tp->tm_mday))))
+       && (eras[cnt]->stop_date[0] > tp->tm_year
+           || (eras[cnt]->stop_date[0] == tp->tm_year
+               && (eras[cnt]->stop_date[1] > tp->tm_mon
+                   || (eras[cnt]->stop_date[1] == tp->tm_mon
+                       && eras[cnt]->stop_date[2] >= tp->tm_mday)))))
+      break;
+
+  result = cnt < num_eras ? eras[cnt] : NULL;
+
+  __libc_lock_unlock (__libc_setlocale_lock);
+
+  return result;
+}
+
+
+const char *
+_nl_get_alt_digit (unsigned int number)
+{
+  const char *result;
+
+  __libc_lock_lock (__libc_setlocale_lock);
+
+  if (alt_digits_initialized == 0)
+    {
+      size_t new_num_alt_digits = _NL_CURRENT_WORD (LC_TIME,
+                                                   _NL_TIME_NUM_ALT_DIGITS);
+
+      if (alt_digits != NULL && new_num_alt_digits == 0)
+       {
+         free (alt_digits);
+         alt_digits = NULL;
+       }
+      else if (new_num_alt_digits != 0)
+       {
+         if (num_alt_digits != new_num_alt_digits)
+           alt_digits = realloc (alt_digits, (new_num_alt_digits
+                                              * sizeof (const char *)));
+
+         if (alt_digits == NULL)
+           num_alt_digits = 0;
+         else
+           {
+             const char *ptr = _NL_CURRENT (LC_TIME, ALT_DIGITS);
+             size_t cnt;
+
+             num_alt_digits = new_num_alt_digits;
+
+             for (cnt = 0; cnt < num_alt_digits; ++cnt)
+               {
+                 alt_digits[cnt] = ptr;
+
+                 /* Skip digit format. */
+                 ptr = strchr (ptr, '\0') + 1;
+               }
+           }
+       }
+
+      alt_digits_initialized = 1;
+    }
+
+  result = number < num_alt_digits ? alt_digits[number] : NULL;
+
+  __libc_lock_unlock (__libc_setlocale_lock);
+
+  return result;
+}
index 5894b07..474a73c 100644 (file)
@@ -144,7 +144,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
                    {
                      free (filedata);
                      if (nread == 0)
-                       errno = EINVAL; /* Bizarreness going on.  */
+                       __set_errno (EINVAL); /* Bizarreness going on.  */
                      goto puntfd;
                    }
                  p += nread;
@@ -153,7 +153,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
            }
          else
            goto puntfd;
-         errno = save_err;
+         __set_errno (save_err);
        }
       else
        goto puntfd;
@@ -184,7 +184,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
        >= (size_t) st.st_size))
     {
       /* Insufficient data.  */
-      errno = EINVAL;
+      __set_errno (EINVAL);
       goto puntmap;
     }
 
@@ -204,7 +204,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
       if (idx >= newdata->filesize)
        {
          free (newdata);
-         errno = EINVAL;
+         __set_errno (EINVAL);
          goto puntmap;
        }
       if (_nl_value_types[category][cnt] == word)
index 0646f0e..335e866 100644 (file)
@@ -22,6 +22,7 @@ Cambridge, MA 02139, USA.  */
 
 #include <stddef.h>
 #include <langinfo.h>
+#include <time.h>
 #include <sys/types.h>
 
 #include "../intl/loadinfo.h"  /* For loaded_l10nfile definition.  */
@@ -76,6 +77,17 @@ enum value_type
 };
 
 
+/* Structure to access `era' information from LC_TIME.  */
+struct era_entry
+{
+  u_int32_t direction;         /* Contains '+' or '-'.  */
+  int32_t offset;
+  int32_t start_date[3];
+  int32_t stop_date[3];
+  const char name_fmt[0];
+};
+
+
 /* For each category declare the variable for the current locale data.  */
 #define DEFINE_CATEGORY(category, category_name, items, a, b, c, d) \
 extern const struct locale_data *_nl_current_##category;
@@ -114,6 +126,13 @@ extern const struct locale_data *_nl_find_locale (const char *locale_path,
 extern void _nl_load_locale (struct loaded_l10nfile *file, int category);
 
 
+/* Return `era' entry which corresponds to TP.  Used in strftime.  */
+struct era_entry *_nl_get_era_entry (const struct tm *tp);
+
+/* Return `alt_digit' which corresponds to NUMBER.  Used in strftime.  */
+const char *_nl_get_alt_digit (unsigned int number);
+
+
 /* Global variables for LC_COLLATE category data.  */
 extern const u_int32_t *__collate_table;
 extern const u_int32_t *__collate_extra;
index a9fa423..1c42e14 100644 (file)
@@ -48,7 +48,7 @@ nl_langinfo (item)
   if (category < 0 || category >= LC_ALL)
     {
       /* Bogus category: bogus item.  */
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
@@ -57,7 +57,7 @@ nl_langinfo (item)
   if (index >= data->nstrings)
     {
       /* Bogus index for this category: bogus item.  */
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 75f6021..1b118ae 100644 (file)
@@ -27,16 +27,32 @@ Boston, MA 02111-1307, USA.  */
 /* Undefine following line in production version.  */
 /* #define NDEBUG 1 */
 #include <assert.h>
+#include <stdlib.h>
 
 #include "locales.h"
 #include "localeinfo.h"
 #include "stringtrans.h"
 
+#define SWAPU32(w) \
+  (((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24))
+
 
 void *xmalloc (size_t __n);
 void *xrealloc (void *__p, size_t __n);
 
 
+/* Entry describing an entry of the era specification.  */
+struct era_data
+{
+  int32_t direction;
+  int32_t offset;
+  int32_t start_date[3];
+  int32_t stop_date[3];
+  const char *name;
+  const char *format;
+};
+
+
 /* The real definition of the struct for the LC_TIME locale.  */
 struct locale_time_t
 {
@@ -55,13 +71,16 @@ struct locale_time_t
   const char *t_fmt;
   const char *t_fmt_ampm;
   const char **era;
-  size_t era_num;
+  u_int32_t cur_num_era;
   const char *era_year;
   const char *era_d_t_fmt;
   const char *era_t_fmt;
   const char *era_d_fmt;
   const char *alt_digits[100];
-  size_t cur_num_alt_digits;
+  u_int32_t cur_num_alt_digits;
+
+  struct era_data *era_entries;
+  struct era_data *era_entries_ob;
 };
 
 
@@ -109,6 +128,263 @@ time_finish (struct localedef_t *locale)
   TEST_ELEM (d_fmt);
   TEST_ELEM (t_fmt);
   TEST_ELEM (t_fmt_ampm);
+
+  /* Now process the era entries.  */
+  if (time->cur_num_era != 0)
+    {
+      const int days_per_month[12] = { 31, 29, 31, 30, 31, 30,
+                                      31, 31, 30, 31 ,30, 31 };
+      size_t idx;
+
+      time->era_entries =
+       (struct era_data *) xmalloc (time->cur_num_era
+                                    * sizeof (struct era_data));
+
+      for (idx = 0; idx < time->cur_num_era; ++idx)
+       {
+         size_t era_len = strlen (time->era[idx]);
+         char *str = xmalloc ((era_len + 1 + 3) & ~3);
+         char *endp;
+
+         memcpy (str, time->era[idx], era_len + 1);
+
+         /* First character must be + or - for the direction.  */
+         if (*str != '+' && *str != '-')
+           {
+             error (0, 0, _("direction flag in string %d in `era' field"
+                            " in category `%s' is not '+' nor '-'"),
+                    idx + 1, "LC_TIME");
+             /* Default arbitrarily to '+'.  */
+             time->era_entries[idx].direction = '+';
+           }
+         else
+           time->era_entries[idx].direction = *str;
+         if (*++str != ':')
+           {
+             error (0, 0, _("direction flag in string %d in `era' field"
+                            " in category `%s' is not a single character"),
+                    idx + 1, "LC_TIME");
+             (void) strsep (&str, ":");
+           }
+         else
+           ++str;
+
+         /* Now the offset year.  */
+         time->era_entries[idx].offset = strtol (str, &endp, 10);
+         if (endp == str)
+           {
+             error (0, 0, _("illegal number for offset in string %d in"
+                            " `era' field in category `%s'"),
+                    idx + 1, "LC_TIME");
+             (void) strsep (&str, ":");
+           }
+         else if (*endp != ':')
+           {
+             error (0, 0, _("garbage at end of offset value in string %d in"
+                            " `era' field in category `%s'"),
+                    idx + 1, "LC_TIME");
+             (void) strsep (&str, ":");
+           }
+         else
+           str = endp + 1;
+
+         /* Next is the starting date in ISO format.  */
+         if (strncmp (str, "-*", 2) == 0)
+           {
+             time->era_entries[idx].start_date[0] =
+               time->era_entries[idx].start_date[1] =
+               time->era_entries[idx].start_date[2] = 0x80000000;
+             if (str[2] != ':')
+               goto garbage_start_date;
+             str += 3;
+           }
+         else if (strncmp (str, "+*", 2) == 0)
+           {
+             time->era_entries[idx].start_date[0] =
+               time->era_entries[idx].start_date[1] =
+               time->era_entries[idx].start_date[2] = 0x7fffffff;
+             if (str[2] != ':')
+               goto garbage_start_date;
+             str += 3;
+           }
+         else
+           {
+             time->era_entries[idx].start_date[0] = strtol (str, &endp, 10);
+             if (endp == str || *endp != '/')
+               goto invalid_start_date;
+             else
+               str = endp + 1;
+             time->era_entries[idx].start_date[0] -= 1900;
+
+             time->era_entries[idx].start_date[1] = strtol (str, &endp, 10);
+             if (endp == str || *endp != '/')
+               goto invalid_start_date;
+             else
+               str = endp + 1;
+             time->era_entries[idx].start_date[1] -= 1;
+
+             time->era_entries[idx].start_date[2] = strtol (str, &endp, 10);
+             if (endp == str)
+               {
+               invalid_start_date:
+                 error (0, 0, _("illegal starting date in string %d in"
+                                " `era' field in category `%s'"),
+                        idx + 1, "LC_TIME");
+                 (void) strsep (&str, ":");
+               }
+             else if (*endp != ':')
+               {
+               garbage_start_date:
+                 error (0, 0, _("garbage at end of starting date in string %d"
+                                " in `era' field in category `%s'"),
+                        idx + 1, "LC_TIME");
+                 (void) strsep (&str, ":");
+               }
+             else
+               {
+                 str = endp + 1;
+
+                 /* Check for valid value.  */
+                 if (time->era_entries[idx].start_date[1] < 0
+                     || time->era_entries[idx].start_date[1] >= 12
+                     || time->era_entries[idx].start_date[2] < 0
+                     || (time->era_entries[idx].start_date[2]
+                         > days_per_month[time->era_entries[idx].start_date[1]])
+                     || (time->era_entries[idx].start_date[1] == 2
+                         && time->era_entries[idx].start_date[2] == 29
+                         && !__isleap (time->era_entries[idx].start_date[0])))
+                         error (0, 0, _("starting date is illegal in"
+                                        " string %d in `era' field in"
+                                        " category `%s'"),
+                                idx + 1, "LC_TIME");
+               }
+           }
+
+         /* Next is the stoping date in ISO format.  */
+         if (strncmp (str, "-*", 2) == 0)
+           {
+             time->era_entries[idx].stop_date[0] =
+               time->era_entries[idx].stop_date[1] =
+               time->era_entries[idx].stop_date[2] = 0x80000000;
+             if (str[2] != ':')
+               goto garbage_stop_date;
+             str += 3;
+           }
+         else if (strncmp (str, "+*", 2) == 0)
+           {
+             time->era_entries[idx].stop_date[0] =
+               time->era_entries[idx].stop_date[1] =
+               time->era_entries[idx].stop_date[2] = 0x7fffffff;
+             if (str[2] != ':')
+               goto garbage_stop_date;
+             str += 3;
+           }
+         else
+           {
+             time->era_entries[idx].stop_date[0] = strtol (str, &endp, 10);
+             if (endp == str || *endp != '/')
+               goto invalid_stop_date;
+             else
+               str = endp + 1;
+             time->era_entries[idx].stop_date[0] -= 1900;
+
+             time->era_entries[idx].stop_date[1] = strtol (str, &endp, 10);
+             if (endp == str || *endp != '/')
+               goto invalid_stop_date;
+             else
+               str = endp + 1;
+             time->era_entries[idx].stop_date[1] -= 1;
+
+             time->era_entries[idx].stop_date[2] = strtol (str, &endp, 10);
+             if (endp == str)
+               {
+               invalid_stop_date:
+                 error (0, 0, _("illegal stopping date in string %d in"
+                                " `era' field in category `%s'"),
+                        idx + 1, "LC_TIME");
+                 (void) strsep (&str, ":");
+               }
+             else if (*endp != ':')
+               {
+               garbage_stop_date:
+                 error (0, 0, _("garbage at end of stopping date in string %d"
+                                " in `era' field in category `%s'"),
+                        idx + 1, "LC_TIME");
+                 (void) strsep (&str, ":");
+               }
+             else
+               {
+                 str = endp + 1;
+
+                 /* Check for valid value.  */
+                 if (time->era_entries[idx].stop_date[1] < 0
+                     || time->era_entries[idx].stop_date[1] >= 12
+                     || time->era_entries[idx].stop_date[2] < 0
+                     || (time->era_entries[idx].stop_date[2]
+                         > days_per_month[time->era_entries[idx].stop_date[1]])
+                     || (time->era_entries[idx].stop_date[1] == 2
+                         && time->era_entries[idx].stop_date[2] == 29
+                         && !__isleap (time->era_entries[idx].stop_date[0])))
+                         error (0, 0, _("stopping date is illegal in"
+                                        " string %d in `era' field in"
+                                        " category `%s'"),
+                                idx + 1, "LC_TIME");
+               }
+           }
+
+         if (str == NULL || *str == '\0')
+           {
+             error (0, 0, _("missing era name in string %d in `era' field"
+                            "in category `%s'"), idx + 1, "LC_TIME");
+             time->era_entries[idx].name =
+               time->era_entries[idx].format = "";
+           }
+         else
+           {
+             time->era_entries[idx].name = strsep (&str, ":");
+
+             if (str == NULL || *str == '\0')
+               {
+                 error (0, 0, _("missing era format in string %d in `era'"
+                                " field in category `%s'"),
+                        idx + 1, "LC_TIME");
+                 time->era_entries[idx].name =
+                   time->era_entries[idx].format = "";
+               }
+             else
+               time->era_entries[idx].format = str;
+           }
+       }
+
+      /* Construct the array for the other byte order.  */
+      time->era_entries_ob =
+       (struct era_data *) xmalloc (time->cur_num_era
+                                     * sizeof (struct era_data));
+
+      for (idx = 0; idx < time->cur_num_era; ++idx)
+       {
+         time->era_entries_ob[idx].direction =
+           SWAPU32 (time->era_entries[idx].direction);
+         time->era_entries_ob[idx].offset =
+           SWAPU32 (time->era_entries[idx].offset);
+         time->era_entries_ob[idx].start_date[0] =
+           SWAPU32 (time->era_entries[idx].start_date[0]);
+         time->era_entries_ob[idx].start_date[1] =
+           SWAPU32 (time->era_entries[idx].start_date[1]);
+         time->era_entries_ob[idx].start_date[2] =
+           SWAPU32 (time->era_entries[idx].stop_date[2]);
+         time->era_entries_ob[idx].stop_date[0] =
+           SWAPU32 (time->era_entries[idx].stop_date[0]);
+         time->era_entries_ob[idx].stop_date[1] =
+           SWAPU32 (time->era_entries[idx].stop_date[1]);
+         time->era_entries_ob[idx].stop_date[2] =
+           SWAPU32 (time->era_entries[idx].stop_date[2]);
+         time->era_entries_ob[idx].name =
+           time->era_entries[idx].name;
+         time->era_entries_ob[idx].format =
+           time->era_entries[idx].format;
+       }
+    }
 }
 
 
@@ -117,8 +393,9 @@ time_output (struct localedef_t *locale, const char *output_path)
 {
   struct locale_time_t *time = locale->categories[LC_TIME].time;
   struct iovec iov[2 + _NL_ITEM_INDEX (_NL_NUM_LC_TIME)
-                 + (time->era_num > 0 ? time->era_num - 1 : 0)
-                 + time->cur_num_alt_digits];
+                 + time->cur_num_era - 1
+                 + time->cur_num_alt_digits - 1
+                 + 1 + (time->cur_num_era * 9 - 1) * 2];
   struct locale_file data;
   u_int32_t idx[_NL_ITEM_INDEX (_NL_NUM_LC_TIME)];
   size_t cnt, last_idx, num;
@@ -209,10 +486,11 @@ time_output (struct localedef_t *locale, const char *output_path)
   last_idx = ++cnt;
 
   idx[1 + last_idx] = idx[last_idx];
-  for (num = 0; num < time->era_num; ++num, ++cnt)
+  for (num = 0; num < time->cur_num_era; ++num, ++cnt)
     {
       iov[2 + cnt].iov_base = (void *) time->era[num];
       iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
+      idx[1 + last_idx] += iov[2 + cnt].iov_len;
     }
   ++last_idx;
 
@@ -241,13 +519,128 @@ time_output (struct localedef_t *locale, const char *output_path)
   iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
   idx[1 + last_idx] = idx[last_idx] + iov[2 + cnt].iov_len;
   ++cnt;
+  ++last_idx;
 
-  iov[2 + cnt].iov_base = (void *) (time->era_d_fmt ?: "");
+  iov[2 + cnt].iov_base = (void *) (time->era_t_fmt ?: "");
   iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
+  idx[1 + last_idx] = idx[last_idx] + iov[2 + cnt].iov_len;
   ++cnt;
+  ++last_idx;
+
+
+  /* We must align the following data.  */
+  iov[2 + cnt].iov_base = (void *) "\0\0";
+  iov[2 + cnt].iov_len = ((idx[last_idx] + 3) & ~3) - idx[last_idx];
+  idx[last_idx] = (idx[last_idx] + 3) & ~3;
+  ++cnt;
+
+  iov[2 + cnt].iov_base = (void *) &time->cur_num_alt_digits;
+  iov[2 + cnt].iov_len = sizeof (u_int32_t);
+  idx[1 + last_idx] = idx[last_idx] + iov[2 + cnt].iov_len;
+  ++cnt;
+  ++last_idx;
+
+  /* The `era' data in usable form.  */
+  iov[2 + cnt].iov_base = (void *) &time->cur_num_era;
+  iov[2 + cnt].iov_len = sizeof (u_int32_t);
+  idx[1 + last_idx] = idx[last_idx] + iov[2 + cnt].iov_len;
+  ++cnt;
+  ++last_idx;
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# define ERA_B1 time->era_entries
+# define ERA_B2 time->era_entries_ob
+#else
+# define ERA_B1 time->era_entries_ob
+# define ERA_B2 time->era_entries
+#endif
+  idx[1 + last_idx] = idx[last_idx];
+  for (num = 0; num < time->cur_num_era; ++num)
+    {
+      size_t l;
+
+      iov[2 + cnt].iov_base = (void *) &ERA_B1[num].direction;
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B1[num].offset;
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B1[num].start_date[0];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B1[num].start_date[1];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B1[num].start_date[2];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B1[num].stop_date[0];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B1[num].stop_date[1];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B1[num].stop_date[2];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+
+      l = (strchr (ERA_B1[num].format, '\0') - ERA_B1[num].name) + 1;
+      l = (l + 3) & ~3;
+      iov[2 + cnt].iov_base = (void *) ERA_B1[num].name;
+      iov[2 + cnt].iov_len = l;
+      ++cnt;
+
+      idx[1 + last_idx] += 8 * sizeof (int32_t) + l;
+
+      assert (idx[1 + last_idx] % 4 == 0);
+    }
+  ++last_idx;
+
+  /* idx[1 + last_idx] = idx[last_idx]; */
+  for (num = 0; num < time->cur_num_era; ++num)
+    {
+      size_t l;
+
+      iov[2 + cnt].iov_base = (void *) &ERA_B2[num].direction;
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B2[num].offset;
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B2[num].start_date[0];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B2[num].start_date[1];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B2[num].start_date[2];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B2[num].stop_date[0];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B2[num].stop_date[1];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+      iov[2 + cnt].iov_base = (void *) &ERA_B2[num].stop_date[2];
+      iov[2 + cnt].iov_len = sizeof (int32_t);
+      ++cnt;
+
+      l = (strchr (ERA_B2[num].format, '\0') - ERA_B2[num].name) + 1;
+      l = (l + 3) & ~3;
+      iov[2 + cnt].iov_base = (void *) ERA_B2[num].name;
+      iov[2 + cnt].iov_len = l;
+      ++cnt;
+
+      /* idx[1 + last_idx] += 8 * sizeof (int32_t) + l; */
+    }
+
 
-  assert (cnt == (_NL_ITEM_INDEX (_NL_NUM_LC_TIME) - 1
-                 + time->cur_num_alt_digits));
+  assert (cnt == (_NL_ITEM_INDEX (_NL_NUM_LC_TIME)
+                 + time->cur_num_era - 1
+                 + time->cur_num_alt_digits - 1
+                 + 1 + (time->cur_num_era * 9 - 1) * 2)
+         && last_idx + 1 == _NL_ITEM_INDEX (_NL_NUM_LC_TIME));
 
   write_locale_data (output_path, "LC_TIME", 2 + cnt, iov);
 }
@@ -291,9 +684,10 @@ too many values for field `%s' in category `LC_TIME'"),                          \
                  "era", "LC_TIME");
       else
        {
-         ++time->era_num;
-         time->era = xrealloc (time->era, time->era_num * sizeof (char *));
-         time->era[time->era_num - 1] = code->val.str.start;
+         ++time->cur_num_era;
+         time->era = xrealloc (time->era,
+                               time->cur_num_era * sizeof (char *));
+         time->era[time->cur_num_era - 1] = code->val.str.start;
        }
       break;
 
index ea15c87..667afbd 100644 (file)
@@ -183,14 +183,14 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      fprintf (stderr, "locale - GNU %s %s\n", PACKAGE, VERSION);
+      fprintf (stderr, "locale (GNU %s) %s\n", PACKAGE, VERSION);
       fprintf (stderr, _("\
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 "), "1995, 1996");
-      fprintf (stderr, _("Written by %s\n"),
-              "Ulrich Drepper <drepper@cygnus.com>");
+      fprintf (stderr, _("Written by %s.\n"),
+              "Ulrich Drepper");
 
       exit (EXIT_SUCCESS);
     }
@@ -255,7 +255,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\
   -c, --category-name   write names of selected categories\n\
   -k, --keyword-name    write names of selected keywords\n"),
              __progname);
-      printf (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"));
+      fputs (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"),
+            stdout);
     }
 
   exit (status);
index 1eae6e7..ff9248e 100644 (file)
@@ -173,14 +173,14 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      fprintf (stderr, "localedef - GNU %s %s\n", PACKAGE, VERSION);
+      fprintf (stderr, "localedef (GNU %s) %s\n", PACKAGE, VERSION);
       fprintf (stderr, _("\
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 "), "1995, 1996");
-      fprintf (stderr, _("Written by %s\n"),
-              "Ulrich Drepper <drepper@cygnus.com>");
+      fprintf (stderr, _("Written by %s.\n"),
+              "Ulrich Drepper");
 
       exit (0);
     }
@@ -406,7 +406,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\
 System's directory for character maps: %s\n\
                        locale files  : %s\n"),
              program_invocation_name, CHARMAP_PATH, LOCALE_PATH);
-      printf (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"));
+      fputs (gettext ("Report bugs to <bug-glibc@prep.ai.mit.edu>.\n"),
+            stdout);
     }
 
   exit (status);
@@ -429,7 +430,7 @@ error_print ()
 static const char *
 construct_output_path (char *path)
 {
-  char *normal = NULL;
+  const char *normal = NULL;
   char *result;
 
   if (strchr (path, '/') == NULL)
@@ -455,6 +456,9 @@ construct_output_path (char *path)
          if (endp > startp)
            normal = _nl_normalize_codeset (startp, endp - startp);
        }
+      else
+       /* This is to keep gcc quiet.  */
+       endp = NULL;
 
       /* We put an additional '\0' at the end of the string because at
         the end of the function we need another byte for the trailing
index 63ebc4b..97629e5 100644 (file)
@@ -829,6 +829,7 @@ syntax error in collating order definition"));
            case tok_mon:
            case tok_am_pm:
            case tok_alt_digits:
+           case tok_era:
              READ_STRING_LIST (time_add, bad_time);
              continue;
 
@@ -836,7 +837,6 @@ syntax error in collating order definition"));
            case tok_d_fmt:
            case tok_t_fmt:
            case tok_t_fmt_ampm:
-           case tok_era:
            case tok_era_year:
            case tok_era_d_t_fmt:
            case tok_era_d_fmt:
@@ -935,7 +935,7 @@ write_locale_data (const char *output_path, const char *category,
   int fd;
   char *fname;
 
-  fname = malloc (strlen (output_path) + strlen (category) + 6);
+  fname = malloc (strlen (output_path) + 2 * strlen (category) + 6);
   if (fname == NULL)
     error (5, errno, _("memory exhausted"));
 
index d0d9223..76320f8 100644 (file)
@@ -116,13 +116,13 @@ static const char *_nl_current_names[] =
 
 
 /* Lock for protecting global data.  */
-__libc_lock_define_initialized (static, lock)
+__libc_lock_define_initialized (, __libc_setlocale_lock)
 
 
 /* Use this when we come along an error.  */
 #define ERROR_RETURN                                                         \
   do {                                                                       \
-    errno = EINVAL;                                                          \
+    __set_errno (EINVAL);                                                    \
     return NULL;                                                             \
   } while (0)
 
@@ -314,7 +314,7 @@ setlocale (int category, const char *locale)
        }
 
       /* Protect global data.  */
-      __libc_lock_lock (lock);
+      __libc_lock_lock (__libc_setlocale_lock);
 
       /* Load the new data for each category.  */
       while (category-- > 0)
@@ -354,7 +354,7 @@ setlocale (int category, const char *locale)
        }
 
       /* Critical section left.  */
-      __libc_lock_unlock (lock);
+      __libc_lock_unlock (__libc_setlocale_lock);
 
       return composite;
     }
@@ -364,7 +364,7 @@ setlocale (int category, const char *locale)
       char *newname = (char *) locale;
 
       /* Protect global data.  */
-      __libc_lock_lock (lock);
+      __libc_lock_lock (__libc_setlocale_lock);
 
       if (_nl_current[category] != NULL)
        {
@@ -393,7 +393,7 @@ setlocale (int category, const char *locale)
        }
 
       /* Critical section left.  */
-      __libc_lock_unlock (lock);
+      __libc_lock_unlock (__libc_setlocale_lock);
 
       return newname;
     }
index 00dbec4..8107015 100644 (file)
@@ -37,7 +37,7 @@ __getutid_r (const struct utmp *id, struct utmp **utmp,
       && id->ut_type != USER_PROCESS && id->ut_type != DEAD_PROCESS)
     /* No, using '<' and '>' for the test is not possible.  */
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -66,7 +66,7 @@ __getutid_r (const struct utmp *id, struct utmp **utmp,
              != sizeof (struct utmp))
            {
              utmp_data->loc_utmp = 0; /* Mark loc_utmp invalid. */
-             errno = ESRCH;
+             __set_errno (ESRCH);
              return -1;
            }
 
@@ -89,7 +89,7 @@ __getutid_r (const struct utmp *id, struct utmp **utmp,
              != sizeof (struct utmp))
            {
              utmp_data->loc_utmp = 0; /* Mark loc_utmp invalid. */
-             errno = ESRCH;
+             __set_errno (ESRCH);
              return -1;
            }
 
@@ -110,7 +110,7 @@ __getutid_r (const struct utmp *id, struct utmp **utmp,
 
   return 0;
 #else  /* !_HAVE_UT_ID && !_HAVE_UT_TYPE */
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 #endif
 }
index e5c4196..e88267d 100644 (file)
@@ -48,7 +48,7 @@ __getutline_r (const struct utmp *line, struct utmp **utmp,
          != sizeof (struct utmp))
        {
          utmp_data->loc_utmp = 0; /* Mark UTMP_DATA->ubuf invalid.  */
-         errno = ESRCH;
+         __set_errno (ESRCH);
          return -1;
        }
 
index a53613f..00b176a 100644 (file)
@@ -62,7 +62,7 @@ tty_name (int fd, char **tty, size_t buf_len)
       if (! new_buf)
        {
          rv = -1;
-         errno = ENOMEM;
+         __set_errno (ENOMEM);
          break;
        }
     }
index 55436bf..42ea3cd 100644 (file)
@@ -45,7 +45,7 @@ __pututline_r (const struct utmp *id, struct utmp_data *utmp_data)
       && id->ut_type != USER_PROCESS && id->ut_type != DEAD_PROCESS)
     /* No, using '<' and '>' for the test is not possible.  */
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 #endif
index 343cc3e..00f5f78 100644 (file)
@@ -55,7 +55,7 @@ routines := brk sbrk sstk ioctl \
            efgcvt efgcvt_r qefgcvt qefgcvt_r \
            hsearch hsearch_r tsearch lsearch \
            err error ustat \
-           getsysstats
+           getsysstats force-wrapper
 aux := init-misc
 distribute := bsd-compat.c
 extra-objs := bsd-compat.o
index cbd5c27..7f80242 100644 (file)
@@ -51,7 +51,7 @@ APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len)
 
   if (buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
diff --git a/misc/force-wrapper.c b/misc/force-wrapper.c
new file mode 100644 (file)
index 0000000..d8676a8
--- /dev/null
@@ -0,0 +1,25 @@
+/* force-wrapper - Default definition of hook for wrapper
+Copyright (C) 1996 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+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.  */
+
+/* The startup code for the reentrant version of GNU libc requires the
+   symbol `__libc_force_canceled_wrapper' to be defined.  When
+   libpthread is used the symbol is defined there.  Otherwise the
+   definition in this file is used.  */
+const int __libc_force_cancel_wrapper = 0;
index 151bb31..95813e4 100644 (file)
@@ -70,7 +70,7 @@ hcreate_r (nel, htab)
   /* Test for correct arguments.  */
   if (htab == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return 0;
     }
 
@@ -105,7 +105,7 @@ hdestroy_r (htab)
   /* Test for correct arguments.  */
   if (htab == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return;
     }
 
@@ -147,7 +147,7 @@ hsearch_r (item, action, retval, htab)
      error.  */
   if (action == ENTER && htab->filled == htab->size)
     {
-      errno = ENOMEM;
+      __set_errno (ENOMEM);
       *retval = NULL;
       return 0;
     }
@@ -222,7 +222,7 @@ hsearch_r (item, action, retval, htab)
       return 1;
     }
 
-  errno = ESRCH;
+  __set_errno (ESRCH);
   *retval = NULL;
   return 0;
 }
index 8fa93f7..150ad6d 100644 (file)
@@ -27,11 +27,26 @@ Cambridge, MA 02139, USA.  */
 
 /* File listing canonical interesting mount points.  */
 #define        _PATH_MNTTAB    "/etc/fstab"
-#define        MNTTAB          _PATH_MNTTAB /* Deprecated alias.  */
+#define        MNTTAB          _PATH_MNTTAB    /* Deprecated alias.  */
 
 /* File listing currently active mount points.  */
 #define        _PATH_MOUNTED   "/var/run/mtab"
-#define        MOUNTED         _PATH_MOUNTED /* Deprecated alias.  */
+#define        MOUNTED         _PATH_MOUNTED   /* Deprecated alias.  */
+
+
+/* General filesystem types.  */
+#define MNTTYPE_IGNORE "ignore"        /* Ignore this entry.  */
+#define MNTTYPE_NFS    "nfs"           /* Network file system.  */
+#define MNTTYPE_SWAP   "swap"          /* Swap device.  */
+
+
+/* Generic mount options.  */
+#define MNTOPT_DEFAULTS        "defaults"      /* Use all default options.  */
+#define MNTOPT_RO      "ro"            /* Read only.  */
+#define MNTOPT_RW      "rw"            /* Read/write.  */
+#define MNTOPT_SUID    "suid"          /* Set uid allowed.  */
+#define MNTOPT_NOSUID  "nosuid"        /* No set uid allowed.  */
+#define MNTOPT_NOAUTO  "noauto"        /* Do not auto mount.  */
 
 
 __BEGIN_DECLS
@@ -50,10 +65,8 @@ struct mntent
 
 /* Prepare to begin reading and/or writing mount table entries from the
    beginning of FILE.  MODE is as for `fopen'.  */
-extern FILE *__setmntent __P ((__const char *__file,
-                              __const char *__mode));
-extern FILE *setmntent __P ((__const char *__file,
-                            __const char *__mode));
+extern FILE *__setmntent __P ((__const char *__file, __const char *__mode));
+extern FILE *setmntent __P ((__const char *__file, __const char *__mode));
 
 /* Read one mount table entry from STREAM.  Returns a pointer to storage
    reused on the next call, or null for EOF or error (use feof/ferror to
@@ -72,10 +85,8 @@ extern struct mntent *getmntent_r __P ((FILE *__stream,
 
 /* Write the mount table entry described by MNT to STREAM.
    Return zero on success, nonzero on failure.  */
-extern int __addmntent __P ((FILE *__stream,
-                            __const struct mntent *__mnt));
-extern int addmntent __P ((FILE *__stream,
-                          __const struct mntent *__mnt));
+extern int __addmntent __P ((FILE *__stream, __const struct mntent *__mnt));
+extern int addmntent __P ((FILE *__stream, __const struct mntent *__mnt));
 
 /* Close a stream opened with `setmntent'.  */
 extern int __endmntent __P ((FILE *__stream));
index d9bf4d7..9a01c9f 100644 (file)
@@ -149,7 +149,7 @@ _nss_dns_gethostbyname2_r (const char *name, int af, struct hostent *result,
     break;
   default:
     *h_errnop = NETDB_INTERNAL;
-    errno = EAFNOSUPPORT;
+    __set_errno (EAFNOSUPPORT);
     return NSS_STATUS_UNAVAIL;
   }
 
@@ -310,13 +310,13 @@ _nss_dns_gethostbyaddr_r (const char *addr, int len, int af,
       size = IN6ADDRSZ;
       break;
     default:
-      errno = EAFNOSUPPORT;
+      __set_errno (EAFNOSUPPORT);
       *h_errnop = NETDB_INTERNAL;
       return NSS_STATUS_UNAVAIL;
     }
   if (size != len)
     {
-      errno = EAFNOSUPPORT;
+      __set_errno (EAFNOSUPPORT);
       *h_errnop = NETDB_INTERNAL;
       return NSS_STATUS_UNAVAIL;
     }
index da4ad1f..404a9f9 100644 (file)
@@ -146,7 +146,7 @@ internal_getent (struct STRUCTURE *result,
 
   if (buflen < (int) sizeof *data + 1)
     {
-      errno = ERANGE;
+      __set_errno (ERANGE);
       return NSS_STATUS_TRYAGAIN;
     }
 
index ece253d..9cfa579 100644 (file)
@@ -183,7 +183,7 @@ parse_list (char *line, struct parser_data *data, int datalen)
       if ((char *) &p[1] - (char *) data > datalen)
        {
          /* We cannot fit another pointer in the buffer.  */
-         errno = ERANGE;
+         __set_errno (ERANGE);
          return NULL;
        }
       if (*line == '\0')
index 79c9d27..f49ddb9 100644 (file)
@@ -195,14 +195,14 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
        break;
       if (cmp > 0)
        {
-         errno = EINVAL;
+         __set_errno (EINVAL);
          return -1;
        }
     }
 
   if (cnt == sizeof databases)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -216,7 +216,7 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
   if (new_db == NULL)
     {
       /* Illegal service specification.  */
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 30721d1..2b12628 100644 (file)
@@ -34,6 +34,8 @@ endif
 # Text domain name to install under; must match ../locale/SYS_libc.c string.
 domainname = libc
 
+all: # Make this the default target; it will be defined in Rules.
+
 # Get $(version) defined.
 include ../Makeconfig
 -include $(common-objpfx)version.mk
index 5b4a7be..b511ea0 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 #include <unistd.h>
@@ -27,28 +26,30 @@ Cambridge, MA 02139, USA.  */
    with the value corresponding to NAME.  Return the number
    of characters required to hold NAME's entire value.  */
 size_t
-DEFUN(confstr, (name, buf, len),
-      int name AND char *buf AND size_t len)
+confstr (name, buf, len)
+     int name;
+     char *buf;
+     size_t len;
 {
-  CONST char *string;
+  const char *string;
   size_t string_len;
 
   switch (name)
     {
     case _CS_PATH:
       {
-       static CONST char cs_path[] = CS_PATH;
+       static const char cs_path[] = CS_PATH;
        string = cs_path;
-       string_len = sizeof(cs_path);
+       string_len = sizeof (cs_path);
       }
       break;
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return 0;
     }
 
   if (buf != NULL)
-    (void) strncpy(buf, string, len);
+    (void) strncpy (buf, string, len);
   return string_len;
 }
index a1fcb79..400e082 100644 (file)
@@ -135,7 +135,7 @@ execvp (file, argv)
 
   if (got_eacces)
     /* At least one failure was due to permissions, so report that error.  */
-    errno = EACCES;
+    __set_errno (EACCES);
 
   /* Return the error from the last attempt (probably ENOENT).  */
   return -1;
index 76060e1..b8820ce 100644 (file)
@@ -72,6 +72,9 @@ Cambridge, MA 02139, USA.  */
 #if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
 extern int errno;
 #endif
+#ifndef __set_errno
+#define __set_errno(val) errno = (val)
+#endif
 
 #ifndef        NULL
 #define        NULL    0
@@ -274,7 +277,7 @@ glob (pattern, flags, errfunc, pglob)
 
   if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -880,7 +883,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
        (*pglob->gl_closedir) (stream);
       else
        closedir ((DIR *) stream);
-      errno = save;
+      __set_errno (save);
     }
   return nfound == 0 ? GLOB_NOMATCH : 0;
 
@@ -891,7 +894,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
       (*pglob->gl_closedir) (stream);
     else
       closedir ((DIR *) stream);
-    errno = save;
+    __set_errno (save);
   }
   while (names != NULL)
     {
@@ -903,4 +906,3 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
 }
 
 #endif /* Not ELIDE_CODE.  */
-
index 5bd5c82..0bd2ab9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <pwd.h>
@@ -26,13 +25,15 @@ Cambridge, MA 02139, USA.  */
    in the given buffer.  This knows the format that the caller
    will expect, but this need not be the format of the password file.  */
 int
-DEFUN(getpw, (uid, buf), __uid_t uid AND register char *buf)
+getpw (uid, buf)
+     __uid_t uid;
+     register char *buf;
 {
   register struct passwd *p;
 
   if (buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index ad8a81b..2761cf8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <pwd.h>
@@ -25,11 +24,13 @@ Cambridge, MA 02139, USA.  */
 /* Write an entry to the given stream.
    This must know the format of the password file.  */
 int
-DEFUN(putpwent, (p, stream), register CONST struct passwd *p AND FILE *stream)
+putpwent (p, stream)
+     register const struct passwd *p;
+     FILE *stream;
 {
   if (p == NULL || stream == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 80abefc..497b0af 100644 (file)
@@ -60,7 +60,7 @@ inet_net_ntop(af, src, bits, dst, size)
        case AF_INET:
                return (inet_net_ntop_ipv4(src, bits, dst, size));
        default:
-               errno = EAFNOSUPPORT;
+               __set_errno (EAFNOSUPPORT);
                return (NULL);
        }
 }
@@ -91,7 +91,7 @@ inet_net_ntop_ipv4(src, bits, dst, size)
        int b;
 
        if (bits < 0 || bits > 32) {
-               errno = EINVAL;
+               __set_errno (EINVAL);
                return (NULL);
        }
        if (bits == 0) {
@@ -134,6 +134,6 @@ inet_net_ntop_ipv4(src, bits, dst, size)
        return (odst);
 
  emsgsize:
-       errno = EMSGSIZE;
+       __set_errno (EMSGSIZE);
        return (NULL);
 }
index ea9b2d4..7c86349 100644 (file)
@@ -64,7 +64,7 @@ inet_net_pton(af, src, dst, size)
        case AF_INET:
                return (inet_net_pton_ipv4(src, dst, size));
        default:
-               errno = EAFNOSUPPORT;
+               __set_errno (EAFNOSUPPORT);
                return (-1);
        }
 }
@@ -192,10 +192,10 @@ inet_net_pton_ipv4(src, dst, size)
        return (bits);
 
  enoent:
-       errno = ENOENT;
+       __set_errno (ENOENT);
        return (-1);
 
  emsgsize:
-       errno = EMSGSIZE;
+       __set_errno (EMSGSIZE);
        return (-1);
 }
index ff92d5f..27908d4 100644 (file)
@@ -77,6 +77,6 @@ inet_neta(src, dst, size)
        return (odst);
 
  emsgsize:
-       errno = EMSGSIZE;
+       __set_errno (EMSGSIZE);
        return (NULL);
 }
index a378f3a..bbdabd0 100644 (file)
@@ -64,7 +64,7 @@ inet_ntop(af, src, dst, size)
        case AF_INET6:
                return (inet_ntop6(src, dst, size));
        default:
-               errno = EAFNOSUPPORT;
+               __set_errno (EAFNOSUPPORT);
                return (NULL);
        }
        /* NOTREACHED */
@@ -91,7 +91,7 @@ inet_ntop4(src, dst, size)
        char tmp[sizeof "255.255.255.255"];
 
        if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
-               errno = ENOSPC;
+               __set_errno (ENOSPC);
                return (NULL);
        }
        strcpy(dst, tmp);
@@ -187,7 +187,7 @@ inet_ntop6(src, dst, size)
         * Check for overflow, copy, and we're done.
         */
        if ((size_t)(tp - tmp) > size) {
-               errno = ENOSPC;
+               __set_errno (ENOSPC);
                return (NULL);
        }
        strcpy(dst, tmp);
index 2315de5..3593da2 100644 (file)
@@ -59,7 +59,7 @@ inet_pton(af, src, dst)
        case AF_INET6:
                return (inet_pton6(src, dst));
        default:
-               errno = EAFNOSUPPORT;
+               __set_errno (EAFNOSUPPORT);
                return (-1);
        }
        /* NOTREACHED */
index 2d191d0..e989802 100644 (file)
@@ -192,7 +192,7 @@ res_search(name, class, type, answer, anslen)
                h_errno = NETDB_INTERNAL;
                return (-1);
        }
-       errno = 0;
+       __set_errno (0);
        h_errno = HOST_NOT_FOUND;       /* default, if we never query */
        dots = 0;
        for (cp = name; *cp; cp++)
index 4c258b9..3efc6cf 100644 (file)
@@ -144,7 +144,7 @@ static int vc = 0;  /* is the socket a virtual ciruit? */
                        ntohs(address.sin_port),
                        strerror(error));
        }
-       errno = save;
+       __set_errno (save);
     }
     static void
     Perror(file, string, error)
@@ -158,7 +158,7 @@ static int vc = 0;  /* is the socket a virtual ciruit? */
                fprintf(file, "res_send: %s: %s\n",
                        string, strerror(error));
        }
-       errno = save;
+       __set_errno (save);
     }
 #endif
 
@@ -380,7 +380,7 @@ res_send(buf, buflen, ans, anssiz)
                                        Perror(stderr, "socket(vc)", errno);
                                        return (-1);
                                }
-                               errno = 0;
+                               __set_errno (0);
                                if (connect(s, (struct sockaddr *)nsap,
                                            sizeof(struct sockaddr)) < 0) {
                                        terrno = errno;
@@ -581,7 +581,7 @@ read_len:
                                               (stdout, ";; new DG socket\n"))
 #endif
                                        connected = 0;
-                                       errno = 0;
+                                       __set_errno (0);
                                }
                                if (sendto(s, (char*)buf, buflen, 0,
                                           (struct sockaddr *)nsap,
@@ -625,7 +625,7 @@ read_len:
                                _res_close();
                                goto next_ns;
                        }
-                       errno = 0;
+                       __set_errno (0);
                        fromlen = sizeof(struct sockaddr_in);
                        resplen = recvfrom(s, (char*)ans, anssiz, 0,
                                           (struct sockaddr *)&from, &fromlen);
@@ -756,11 +756,11 @@ read_len:
        _res_close();
        if (!v_circuit)
                if (!gotsomewhere)
-                       errno = ECONNREFUSED;   /* no nameservers found */
+                       __set_errno (ECONNREFUSED); /* no nameservers found */
                else
-                       errno = ETIMEDOUT;      /* no answer obtained */
+                       __set_errno (ETIMEDOUT);    /* no answer obtained */
        else
-               errno = terrno;
+               __set_errno (terrno);
        return (-1);
 }
 
index 60cf2ee..707c009 100644 (file)
@@ -28,7 +28,7 @@ Boston, MA 02111-1307, USA.  */
 
 
 /* Name of the lock file.  */
-#define PWD_LOCKFILE "/var/lock/lock.pwd"
+#define PWD_LOCKFILE "/etc/lock.pwd"
 
 /* How long to wait for getting the lock before returning with an
    error.  */
index b638057..8c8bd2a 100644 (file)
@@ -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 <errno.h>
 #include <stdio.h>
 #include <shadow.h>
 
@@ -31,39 +30,39 @@ putspent (const struct spwd *p, FILE *stream)
   if (fprintf (stream, "%s:%s:", p->sp_namp, p->sp_pwdp) < 0)
     ++errors;
 
-  if ((p->sp_lstchg != (time_t) -1
+  if ((p->sp_lstchg != (long int) -1
        && fprintf (stream, "%ld:", p->sp_lstchg) < 0)
-      || (p->sp_lstchg == (time_t) -1
+      || (p->sp_lstchg == (long int) -1
          && putc (':', stream) == EOF))
     ++errors;
 
-  if ((p->sp_min != (time_t) -1
+  if ((p->sp_min != (long int) -1
        && fprintf (stream, "%ld:", p->sp_min) < 0)
-      || (p->sp_min == (time_t) -1
+      || (p->sp_min == (long int) -1
          && putc (':', stream) == EOF))
     ++errors;
 
-  if ((p->sp_max != (time_t) -1
+  if ((p->sp_max != (long int) -1
        && fprintf (stream, "%ld:", p->sp_max) < 0)
-      || (p->sp_max == (time_t) -1
+      || (p->sp_max == (long int) -1
          && putc (':', stream) == EOF))
     ++errors;
 
-  if ((p->sp_warn != (time_t) -1
+  if ((p->sp_warn != (long int) -1
        && fprintf (stream, "%ld:", p->sp_warn) < 0)
-      || (p->sp_warn == (time_t) -1
+      || (p->sp_warn == (long int) -1
          && putc (':', stream) == EOF))
     ++errors;
 
-  if ((p->sp_inact != (time_t) -1
+  if ((p->sp_inact != (long int) -1
        && fprintf (stream, "%ld:", p->sp_inact) < 0)
-      || (p->sp_inact == (time_t) -1
+      || (p->sp_inact == (long int) -1
          && putc (':', stream) == EOF))
     ++errors;
 
-  if ((p->sp_expire != (time_t) -1
+  if ((p->sp_expire != (long int) -1
        && fprintf (stream, "%ld:", p->sp_expire) < 0)
-      || (p->sp_expire == (time_t) -1
+      || (p->sp_expire == (long int) -1
          && putc (':', stream) == EOF))
     ++errors;
 
index 03c96b5..407886e 100644 (file)
@@ -28,34 +28,41 @@ Cambridge, MA 02139, USA.  */
 #define ENTNAME                spent
 struct spent_data {};
 
+/* Predicate which always returns false, needed below.  */
+#define FALSE(arg) 0
+
+
 #include "../nss/nss_files/files-parse.c"
 LINE_PARSER
 (,
  STRING_FIELD (result->sp_namp, ISCOLON, 0);
  STRING_FIELD (result->sp_pwdp, ISCOLON, 0);
- INT_FIELD (result->sp_lstchg, ISCOLON, 0, 10, (time_t));
- INT_FIELD (result->sp_min, ISCOLON, 0, 10, (time_t));
- INT_FIELD (result->sp_max, ISCOLON, 0, 10, (time_t));
+ INT_FIELD (result->sp_lstchg, ISCOLON, 0, 10, (long int));
+ INT_FIELD (result->sp_min, ISCOLON, 0, 10, (long int));
+ INT_FIELD (result->sp_max, ISCOLON, 0, 10, (long int));
  while (isspace (*line))
    ++line;
  if (*line == '\0')
    {
      /* The old form.  */
-     result->sp_warn = (time_t) -1;
-     result->sp_inact = (time_t) -1;
-     result->sp_expire = (time_t) -1;
+     result->sp_warn = (long int) -1;
+     result->sp_inact = (long int) -1;
+     result->sp_expire = (long int) -1;
      result->sp_flag = ~0ul;
    }
  else
    {
-     INT_FIELD_MAYBE_NULL (result->sp_warn, ISCOLON, 0, 10, (time_t),
-                          (time_t) -1);
-     INT_FIELD_MAYBE_NULL (result->sp_inact, ISCOLON, 0, 10, (time_t),
-                          (time_t) -1);
-     INT_FIELD_MAYBE_NULL (result->sp_expire, ISCOLON, 0, 10, (time_t),
-                          (time_t) -1);
-     INT_FIELD_MAYBE_NULL (result->sp_flag, ISCOLON, 0, 10,
-                          (unsigned long int), ~0ul);
+     INT_FIELD_MAYBE_NULL (result->sp_warn, ISCOLON, 0, 10, (long int),
+                          (long int) -1);
+     INT_FIELD_MAYBE_NULL (result->sp_inact, ISCOLON, 0, 10, (long int),
+                          (long int) -1);
+     INT_FIELD_MAYBE_NULL (result->sp_expire, ISCOLON, 0, 10, (long int),
+                          (long int) -1);
+     if (*line != '\0')
+       INT_FIELD_MAYBE_NULL (result->sp_flag, FALSE, 0, 10,
+                            (unsigned long int), ~0ul)
+     else
+       result->sp_flag = ~0ul;
    }
  )
 
index b1a4c82..133cfd6 100644 (file)
@@ -25,8 +25,6 @@ Boston, MA 02111-1307, USA.  */
 
 #define        __need_FILE
 #include <stdio.h>
-#define        __need_time_t
-#include <time.h>
 
 /* Paths to the userd files.  */
 #define        SHADOW "/etc/shadow"
@@ -39,14 +37,14 @@ struct spwd
 {
   char *sp_namp;               /* Login name.  */
   char *sp_pwdp;               /* Encrypted password.  */
-  __time_t sp_lstchg;          /* Date of last change.  */
-  __time_t sp_min;             /* Minimum number of days between changes.  */
-  __time_t sp_max;             /* Maximum number of days between changes.  */
-  __time_t sp_warn;            /* Number of days to warn user to change
+  long int sp_lstchg;          /* Date of last change.  */
+  long int sp_min;             /* Minimum number of days between changes.  */
+  long int sp_max;             /* Maximum number of days between changes.  */
+  long int sp_warn;            /* Number of days to warn user to change
                                   the password.  */
-  __time_t sp_inact;           /* Number of days the account may be
+  long int sp_inact;           /* Number of days the account may be
                                   inactive.  */
-  __time_t sp_expire;          /* Number of days since 1970-01-01 until
+  long int sp_expire;          /* Number of days since 1970-01-01 until
                                   account expires.  */
   unsigned long int sp_flag;   /* Reserved.  */
 };
index b9ac34d..69185ed 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -20,11 +20,13 @@ Cambridge, MA 02139, USA.  */
 
 /* Add SIGNO to SET.  */
 int
-DEFUN(sigaddset, (set, signo), sigset_t *set AND int signo)
+sigaddset (set, signo)
+     sigset_t *set;
+     int signo;
 {
   if (set == NULL || signo <= 0 || signo >= NSIG)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 07e880f..0b88a09 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -20,11 +20,13 @@ Cambridge, MA 02139, USA.  */
 
 /* Add SIGNO to SET.  */
 int
-DEFUN(sigdelset, (set, signo), sigset_t *set AND int signo)
+sigdelset (set, signo)
+     sigset_t *set;
+     int signo;
 {
   if (set == NULL || signo <= 0 || signo >= NSIG)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 0ec129d..5e4bebb 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -20,11 +20,12 @@ Cambridge, MA 02139, USA.  */
 
 /* Clear all signals from SET.  */
 int
-DEFUN(sigemptyset, (set), sigset_t *set)
+sigemptyset (set)
+     sigset_t *set;
 {
   if (set == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 88c1833..6ea4707 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -20,11 +20,12 @@ Cambridge, MA 02139, USA.  */
 
 /* Set all signals in SET.  */
 int
-DEFUN(sigfillset, (set), sigset_t *set)
+sigfillset (set)
+     sigset_t *set;
 {
   if (set == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 36c04db..d171517 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -20,11 +20,13 @@ Cambridge, MA 02139, USA.  */
 
 /* Return 1 if SIGNO is in SET, 0 if not.  */
 int
-DEFUN(sigismember, (set, signo), CONST sigset_t *set AND int signo)
+sigismember (set, signo)
+     const sigset_t *set;
+     int signo;
 {
   if (set == NULL || signo <= 0 || signo >= NSIG)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index db33a3d..2cb086d 100644 (file)
@@ -35,7 +35,7 @@ __register_printf_function (spec, converter, arginfo)
 {
   if (spec < 0 || spec > (int) UCHAR_MAX)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index b252357..f47eaa2 100644 (file)
@@ -102,7 +102,6 @@ ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n));
        }                                                                     \
     } while (0)
 # define UNBUFFERED_P(S) ((S)->_IO_file_flags & _IO_UNBUFFERED)
-/* This macro must be without parameter!  Don't change it.  */
 #else /* ! USE_IN_LIBIO */
 /* This code is for use in the GNU C library.  */
 # include <stdio.h>
@@ -113,7 +112,7 @@ ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n));
       /* Check file argument for consistence.  */                            \
       if (!__validfp(S) || !S->__mode.__write || Format == NULL)             \
        {                                                                     \
-         errno = EINVAL;                                                     \
+         __set_errno (EINVAL);                                               \
          return -1;                                                          \
        }                                                                     \
       if (!S->__seen)                                                        \
@@ -1431,6 +1430,9 @@ struct helper_file
   {
     struct _IO_FILE_plus _f;
     _IO_FILE *_put_stream;
+#ifdef _IO_MTSAFE_IO
+    _IO_lock_t lock;
+#endif
   };
 
 static int
@@ -1483,6 +1485,9 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
   hp->_IO_write_ptr = buf;
   hp->_IO_write_end = buf + sizeof buf;
   hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS;
+#ifdef _IO_MTSAFE_IO
+  hp->_lock = &helper.lock;
+#endif
   _IO_JUMPS (hp) = (struct _IO_jump_t *) &_IO_helper_jumps;
 
   /* Now print to helper instead.  */
index f83fd28..ee2c922 100644 (file)
@@ -66,7 +66,7 @@ Cambridge, MA 02139, USA.  */
                        } while (0)
 # define memory_error()        do {                                                  \
                          _IO_funlockfile (s);                                \
-                         errno = ENOMEM;                                     \
+                         __set_errno (ENOMEM);                               \
                          return EOF;                                         \
                        } while (0)
 # define ARGCHECK(s, format)                                                 \
@@ -97,7 +97,7 @@ Cambridge, MA 02139, USA.  */
                        } while (0)
 # define memory_error()        do {                                                  \
                          funlockfile (s);                                    \
-                         errno = ENOMEM;                                     \
+                         __set_errno (ENOMEM);                               \
                          return EOF;                                         \
                        } while (0)
 # define ARGCHECK(s, format)                                                 \
@@ -106,7 +106,7 @@ Cambridge, MA 02139, USA.  */
       /* Check file argument for consistence.  */                            \
       if (!__validfp (s) || !s->__mode.__read || format == NULL)             \
        {                                                                     \
-         errno = EINVAL;                                                     \
+         __set_errno (EINVAL);                                               \
          return EOF;                                                         \
        }                                                                     \
     } while (0)
index bcf4cd4..413d8f3 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -26,7 +25,8 @@ Cambridge, MA 02139, USA.  */
 
 /* Close a stream.  */
 int
-DEFUN(fclose, (stream), register FILE *stream)
+fclose (stream)
+     register FILE *stream;
 {
   int status;
 
@@ -42,10 +42,10 @@ DEFUN(fclose, (stream), register FILE *stream)
 
   if (!__validfp(stream))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
-       
+
   if (stream->__mode.__write &&
       /* Flush the buffer.  */
       __flshfp (stream, EOF) == EOF)
index c18300f..b982207 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -25,13 +24,14 @@ Cambridge, MA 02139, USA.  */
 
 /* Return non-zero if STREAM has its EOF indicator set.  */
 int
-DEFUN(feof, (stream), FILE *stream)
+feof (stream)
+     FILE *stream;
 {
-  if (!__validfp(stream))
+  if (!__validfp (stream))
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  return(stream->__eof);
+  return stream->__eof;
 }
index ed8f744..857b250 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -25,13 +24,14 @@ Cambridge, MA 02139, USA.  */
 
 /* Return non-zero if STREAM has its error indicator set.  */
 int
-DEFUN(ferror, (stream), FILE *stream)
+ferror (stream)
+     FILE *stream;
 {
-  if (!__validfp(stream))
+  if (!__validfp (stream))
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  return(stream->__error);
+  return stream->__error;
 }
index a6d52ba..41e66fa 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -24,22 +23,23 @@ Cambridge, MA 02139, USA.  */
 /* Flush STREAM's buffer.
    If STREAM is NULL, flush the buffers of all streams that are writing.  */
 int
-DEFUN(fflush, (stream), register FILE *stream)
+fflush (stream)
+     register FILE *stream;
 {
   if (stream == NULL)
     {
       int lossage = 0;
       for (stream = __stdio_head; stream != NULL; stream = stream->__next)
-       if (__validfp(stream) && stream->__mode.__write)
-         lossage |= fflush(stream) == EOF;
+       if (__validfp (stream) && stream->__mode.__write)
+         lossage |= fflush (stream) == EOF;
       return lossage ? EOF : 0;
     }
 
-  if (!__validfp(stream) || !stream->__mode.__write)
+  if (!__validfp (stream) || !stream->__mode.__write)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
-  return __flshfp(stream, EOF);
+  return __flshfp (stream, EOF);
 }
index 7f01090..9bfff34 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,20 +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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
 
 /* Read a character from STREAM.  */
 int
-DEFUN(fgetc, (stream), FILE *stream)
+fgetc (stream)
+     FILE *stream;
 {
-  if (!__validfp(stream) || !stream->__mode.__read)
+  if (!__validfp (stream) || !stream->__mode.__read)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
-  return __getc(stream);
+  return __getc (stream);
 }
index cb6a158..a615081 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -25,16 +24,18 @@ Cambridge, MA 02139, USA.  */
 
 /* Put the current position of STREAM in *POS.  */
 int
-DEFUN(fgetpos, (stream, pos), FILE *stream AND fpos_t *pos)
+fgetpos (stream, pos)
+     FILE *stream;
+     fpos_t *pos;
 {
-  if (!__validfp(stream) || pos == NULL)
+  if (!__validfp (stream) || pos == NULL)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  *pos = ftell(stream);
+  *pos = ftell (stream);
   if (*pos < 0L)
-    return(-1);
-  return(0);
+    return -1;
+  return 0;
 }
index e9e53c8..01d4d9d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
@@ -28,13 +27,16 @@ Cambridge, MA 02139, USA.  */
    to S, the function returns NULL without appending the null character.
    If there is a file error, always return NULL.  */
 char *
-DEFUN(fgets, (s, n, stream), char *s AND int n AND register FILE *stream)
+fgets (s, n, stream)
+     char *s;
+     int n;
+     register FILE *stream;
 {
   register char *p = s;
 
-  if (!__validfp(stream) || s == NULL || n <= 0)
+  if (!__validfp (stream) || s == NULL || n <= 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
@@ -45,7 +47,7 @@ DEFUN(fgets, (s, n, stream), char *s AND int n AND register FILE *stream)
     {
       /* Unbuffered stream.  Not much optimization to do.  */
       register int c = 0;
-      while (--n > 0 && (c = getc (stream)) != EOF) 
+      while (--n > 0 && (c = getc (stream)) != EOF)
        if ((*p++ = c) == '\n')
          break;
       if (c == EOF && (p == s || ferror (stream)))
@@ -79,7 +81,7 @@ DEFUN(fgets, (s, n, stream), char *s AND int n AND register FILE *stream)
       size_t i;
       char *found;
 
-      i = stream->__get_limit - stream->__bufp;        
+      i = stream->__get_limit - stream->__bufp;
       if (i == 0)
        {
          /* Refill the buffer.  */
@@ -93,7 +95,7 @@ DEFUN(fgets, (s, n, stream), char *s AND int n AND register FILE *stream)
              *p = '\0';
              return s;
            }
-         i = stream->__get_limit - stream->__bufp;     
+         i = stream->__get_limit - stream->__bufp;
        }
 
       if (i > n)
index da55300..dc3dfdf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993, 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,19 +16,19 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
 /* Return the system file descriptor associated with STREAM.  */
 int
-DEFUN(fileno, (stream), FILE *stream)
+fileno (stream)
+     FILE *stream;
 {
   extern void __stdio_check_funcs __P ((FILE *));
 
   if (! __validfp (stream))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -37,9 +37,9 @@ DEFUN(fileno, (stream), FILE *stream)
   if (stream->__io_funcs.__fileno == NULL)
     {
 #ifdef EOPNOTSUPP
-      errno = EOPNOTSUPP;
+      __set_errno (EOPNOTSUPP);
 #else
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
 #endif
       return -1;
     }
index 42a137a..a161110 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -25,7 +24,7 @@ Cambridge, MA 02139, USA.  */
 
 
 /* Defined in fopen.c.  */
-extern int EXFUN(__getmode, (CONST char *mode, __io_mode *mptr));
+extern int __getmode __P ((const char *mode, __io_mode *mptr));
 
 /* Open a new stream that will read and/or write from the buffer in
    S, which is of LEN bytes.  If the mode indicates appending, the
@@ -40,8 +39,10 @@ extern int EXFUN(__getmode, (CONST char *mode, __io_mode *mptr));
    to read, attempted writes always return an output error and attempted
    reads always return end-of-file.  */
 FILE *
-DEFUN(fmemopen, (s, len, mode),
-      PTR s AND size_t len AND CONST char *mode)
+fmemopen (s, len, mode)
+     void *s;
+     size_t len;
+     const char *mode;
 {
   __io_mode m;
   register FILE *stream;
@@ -77,7 +78,7 @@ DEFUN(fmemopen, (s, len, mode),
        {
          int save = errno;
          (void) fclose (stream);
-         errno = save;
+         __set_errno (save);
          return NULL;
        }
     }
@@ -102,7 +103,7 @@ DEFUN(fmemopen, (s, len, mode),
        stream->__bufp = p;
     }
   else if (stream->__mode.__truncate)
-    memset ((PTR) stream->__buffer, 0, len);
+    memset ((void *) stream->__buffer, 0, len);
 
   return stream;
 }
index fba6ac4..fea2274 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
@@ -24,18 +23,20 @@ Cambridge, MA 02139, USA.  */
 #include <string.h>
 
 
-#define        badmode()       return ((errno = EINVAL), 0)
+#define        badmode()       return ((__set_errno (EINVAL)), 0)
 
 /* Dissect the given mode string into an __io_mode.  */
 int
-DEFUN(__getmode, (mode, mptr), CONST char *mode AND __io_mode *mptr)
+__getmode (mode, mptr)
+     const char *mode;
+     __io_mode *mptr;
 {
   register unsigned char i;
 
   if (mode == NULL)
     badmode ();
 
-  memset ((PTR) mptr, 0, sizeof (*mptr));
+  memset ((void *) mptr, 0, sizeof (*mptr));
 
   switch (*mode)
     {
@@ -78,14 +79,16 @@ DEFUN(__getmode, (mode, mptr), CONST char *mode AND __io_mode *mptr)
 \f
 /* Open a new stream on the given file.  */
 FILE *
-DEFUN(fopen, (filename, mode), CONST char *filename AND CONST char *mode)
+fopen (filename, mode)
+     const char *filename;
+     const char *mode;
 {
   FILE *stream;
   __io_mode m;
 
   if (filename == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
@@ -100,7 +103,7 @@ DEFUN(fopen, (filename, mode), CONST char *filename AND CONST char *mode)
     {
       int save = errno;
       (void) fclose (stream);
-      errno = save;
+      __set_errno (save);
       return NULL;
     }
 
index 36b9501..2cbba2a 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,20 +16,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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
 
 /* Write the character C to STREAM.  */
 int
-DEFUN(fputc, (c, stream), int c AND FILE *stream)
+fputc (c, stream)
+     int c;
+     FILE *stream;
 {
-  if (!__validfp(stream) || !stream->__mode.__write)
+  if (!__validfp (stream) || !stream->__mode.__write)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
-  return __putc(c, stream);
+  return __putc (c, stream);
 }
index d2766f6..63d41d2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
@@ -26,19 +25,22 @@ Cambridge, MA 02139, USA.  */
 
 /* Read NMEMB chunks of SIZE bytes each from STREAM into P.  */
 size_t
-DEFUN(fread, (p, size, nmemb, stream),
-      PTR p AND size_t size AND size_t nmemb AND register FILE *stream)
+fread (p, size, nmemb, stream)
+     void *p;
+     size_t size;
+     size_t nmemb;
+     register FILE *stream;
 {
   register char *ptr = (char *) p;
   register size_t to_read = size * nmemb;
   size_t bytes = to_read;
 
-  if (!__validfp(stream) || !stream->__mode.__read)
+  if (!__validfp (stream) || !stream->__mode.__read)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return 0;
     }
-  if (feof(stream) || ferror(stream))
+  if (feof (stream) || ferror (stream))
     return 0;
   if (p == NULL || to_read == 0)
     return 0;
@@ -48,7 +50,7 @@ DEFUN(fread, (p, size, nmemb, stream),
       /* This stream has never been seen before, or it has a character
         pushed back.  Call __fillbf to deal with those cases.  Life will
         be simpler after this call.  */
-      int c = __fillbf(stream);
+      int c = __fillbf (stream);
       if (c == EOF)
        return 0;
       *ptr++ = c;
@@ -65,7 +67,7 @@ DEFUN(fread, (p, size, nmemb, stream),
        copy = to_read;
       to_read -= copy;
       if (copy > 20)
-       memcpy((PTR) ptr, (PTR) stream->__bufp, copy);
+       memcpy((void *) ptr, (void *) stream->__bufp, copy);
       else
        {
          register size_t i;
@@ -90,8 +92,8 @@ DEFUN(fread, (p, size, nmemb, stream),
        while (to_read > 0)
          {
            register int count;
-           count = (*stream->__io_funcs.__read)(stream->__cookie,
-                                                ptr, to_read);
+           count = (*stream->__io_funcs.__read) (stream->__cookie,
+                                                 ptr, to_read);
            if (count > 0)
              {
                to_read -= count;
@@ -118,7 +120,7 @@ DEFUN(fread, (p, size, nmemb, stream),
     }
   else
     {
-      int c = __fillbf(stream);
+      int c = __fillbf (stream);
       if (c == EOF)
        return (bytes - to_read) / size;
       *ptr++ = (char) c;
index bedddb1..a21d725 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -30,16 +29,18 @@ extern int __stdio_reopen __P ((const char *filename, __io_mode mode,
 
 /* Replace STREAM, opening it on FILENAME.  */
 FILE *
-DEFUN(freopen, (filename, mode, stream),
-      CONST char *filename AND CONST char *mode AND register FILE *stream)
+freopen (filename, mode, stream)
+     const char *filename;
+     const char *mode;
+     register FILE *stream;
 {
   __io_mode m;
-  PTR cookie;
+  void *cookie;
 
   if (!__getmode (mode, &m))
     {
       (void) fclose (stream);
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
@@ -56,7 +57,7 @@ DEFUN(freopen, (filename, mode, stream),
     {
       int save = errno;
       (void) fclose (stream);
-      errno = save;
+      __set_errno (save);
       return NULL;
     }
 
index 2127c97..9dce18f 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -26,14 +25,16 @@ Cambridge, MA 02139, USA.  */
    is SEEK_SET, the end of the file is it is SEEK_END,
    or the current position if it is SEEK_CUR.  */
 int
-DEFUN(fseek, (stream, offset, whence),
-      register FILE *stream AND long int offset AND int whence)
+fseek (stream, offset, whence)
+     register FILE *stream;
+     long int offset;
+     int whence;
 {
   long int o;
 
   if (!__validfp (stream))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
@@ -63,7 +64,7 @@ DEFUN(fseek, (stream, offset, whence),
   switch (whence)
     {
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
 
     case SEEK_END:
@@ -72,7 +73,7 @@ DEFUN(fseek, (stream, offset, whence),
         for, and then look where that is.  */
       if (stream->__io_funcs.__seek == NULL)
        {
-         errno = ESPIPE;
+         __set_errno (ESPIPE);
          return EOF;
        }
       else
@@ -144,7 +145,7 @@ DEFUN(fseek, (stream, offset, whence),
   if (o < 0)
     {
       /* Negative file position is meaningless.  */
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -167,7 +168,7 @@ DEFUN(fseek, (stream, offset, whence),
         But it makes more sense for fseek to to fail with ESPIPE
         than for the next reading or writing operation to fail
         that way.  */
-      errno = ESPIPE;
+      __set_errno (ESPIPE);
       return EOF;
     }
 
index 7c8fcb7..6aea674 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -25,13 +24,15 @@ Cambridge, MA 02139, USA.  */
 
 /* Set the file position of STREAM to *POS.  */
 int
-DEFUN(fsetpos, (stream, pos), FILE *stream AND CONST fpos_t *pos)
+fsetpos (stream, pos)
+     FILE *stream;
+     const fpos_t *pos;
 {
   if (pos == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
-  return fseek(stream, *pos, SEEK_SET);
+  return fseek (stream, *pos, SEEK_SET);
 }
index d27eaf7..d715f20 100644 (file)
@@ -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,20 +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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
 /* Return the offset in bytes from the beginning
    of the file of the file position of STREAM.  */
 long int
-DEFUN(ftell, (stream), FILE *stream)
+ftell (stream)
+     FILE *stream;
 {
   long int pos;
 
   if (!__validfp (stream))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1L;
     }
 
index 790c663..7cf3898 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
@@ -24,11 +23,13 @@ Cambridge, MA 02139, USA.  */
 
 /* Write NMEMB chunks of SIZE bytes each from PTR onto STREAM.  */
 size_t
-DEFUN(fwrite, (ptr, size, nmemb, stream),
-      CONST PTR ptr AND size_t size AND
-      size_t nmemb AND register FILE *stream)
+fwrite (ptr, size, nmemb, stream)
+     const void *ptr;
+     size_t size;
+     size_t nmemb;
+     register FILE *stream;
 {
-  register CONST unsigned char *p = (CONST unsigned char *) ptr;
+  register const unsigned char *p = (const unsigned char *) ptr;
   register size_t to_write = size * nmemb;
   register size_t written = 0;
   int newlinep;
@@ -37,7 +38,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream),
 
   if (!__validfp (stream) || !stream->__mode.__write)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return 0;
     }
 
@@ -71,7 +72,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream),
        goto done;
       }
 
-    errno = save;
+    __set_errno (save);
   }
 
   if (stream->__buffer == NULL && default_func &&
@@ -82,7 +83,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream),
     {
       int count = (stream->__io_funcs.__write == NULL ? to_write :
                   (*stream->__io_funcs.__write) (stream->__cookie,
-                                                 (CONST char *) p,
+                                                 (const char *) p,
                                                  to_write));
       if (count > 0)
        {
@@ -105,7 +106,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream),
   buffer_space = stream->__bufsize - (stream->__bufp - stream->__buffer);
 
   newlinep = (stream->__linebuf &&
-             memchr ((CONST PTR) p, '\n', to_write) != NULL);
+             memchr ((const void *) p, '\n', to_write) != NULL);
 
   if (newlinep && stream->__bufp == stream->__buffer &&
       stream->__offset == stream->__target)
@@ -148,7 +149,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream),
              *stream->__bufp++ = *p++;
          else
            {
-             memcpy ((PTR) stream->__bufp, (PTR) p, n);
+             memcpy ((void *) stream->__bufp, (void *) p, n);
              stream->__bufp += n;
              p += n;
            }
index 2cdb95c..761c798 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -31,15 +30,18 @@ Cambridge, MA 02139, USA.  */
    null terminator), or -1 on error or EOF.  */
 
 ssize_t
-DEFUN(__getdelim, (lineptr, n, terminator, stream),
-      char **lineptr AND size_t *n AND int terminator AND FILE *stream)
+__getdelim (lineptr, n, terminator, stream)
+     char **lineptr;
+     size_t *n;
+     int terminator;
+     FILE *stream;
 {
   char *line, *p;
   size_t size, copy;
 
   if (!__validfp (stream) || lineptr == NULL || n == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -116,7 +118,7 @@ DEFUN(__getdelim, (lineptr, n, terminator, stream),
          size_t i;
          char *found;
 
-         i = stream->__get_limit - stream->__bufp;     
+         i = stream->__get_limit - stream->__bufp;
          if (i == 0)
            {
              /* Refill the buffer.  */
@@ -127,7 +129,7 @@ DEFUN(__getdelim, (lineptr, n, terminator, stream),
              if (c == terminator)
                goto win;
              --copy;
-             i = stream->__get_limit - stream->__bufp; 
+             i = stream->__get_limit - stream->__bufp;
            }
 
          if (i > copy)
index 37426cf..7f84c92 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
@@ -27,22 +26,23 @@ link_warning (gets,
 /* Read a newline-terminated string from stdin into S,
    removing the trailing newline.  Return S or NULL.  */
 char *
-DEFUN(gets, (s), char *s)
+gets (s)
+     char *s;
 {
   register char *p = s;
   register int c;
   FILE *stream = stdin;
 
-  if (!__validfp(stream) || p == NULL)
+  if (!__validfp (stream) || p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
-  if (feof(stream) || ferror(stream))
+  if (feof (stream) || ferror (stream))
     return NULL;
 
-  while ((c = getchar()) != EOF)
+  while ((c = getchar ()) != EOF)
     if (c == '\n')
       break;
     else
index 6ef52a7..592700f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 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
@@ -27,7 +27,6 @@ Cambridge, MA 02139, USA.  */
    libraries) compiled with Unix header files to work with the GNU C
    library.  */
 
-#include <ansidecl.h>
 #include <stdio.h>
 #include <errno.h>
 
@@ -74,7 +73,8 @@ unix_FILE _iob[] =
    In a Unix stdio FILE `_cnt' is the first element.
    In a GNU stdio or glued FILE, the first element is the magic number.  */
 int
-DEFUN(_filbuf, (file), unix_FILE *file)
+_filbuf (file)
+     unix_FILE *file;
 {
   switch (++file->glue.magic)  /* Compensate for Unix getc's decrement.  */
     {
@@ -88,15 +88,16 @@ DEFUN(_filbuf, (file), unix_FILE *file)
 
     default:
       /* Bogus stream.  */
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 }
 
 /* Called by the Unix stdio `putc' macro.  Much like getc, above.  */
 int
-DEFUN(_flsbuf, (c, file),
-      int c AND unix_FILE *file)
+_flsbuf (c, file)
+     int c;
+     unix_FILE *file;
 {
   /* Compensate for putc's decrement.  */
   switch (++file->glue.magic)
@@ -108,7 +109,7 @@ DEFUN(_flsbuf, (c, file),
       return putc (c, (FILE *) file);
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 }
index a1d1fa4..8c2acc4 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -25,7 +24,8 @@ Cambridge, MA 02139, USA.  */
 
 /* Make sure that FP has its functions set.  */
 void
-DEFUN(__stdio_check_funcs, (fp), register FILE *fp)
+__stdio_check_funcs (fp)
+     register FILE *fp;
 {
   if (!fp->__seen)
     {
@@ -34,7 +34,7 @@ DEFUN(__stdio_check_funcs, (fp), register FILE *fp)
         If no buffer is set (and the stream is not made explicitly
         unbuffered), we allocate a buffer below, using the bufsize
         set by this function.  */
-      extern void EXFUN(__stdio_init_stream, (FILE *));
+      extern void __stdio_init_stream __P ((FILE *));
       fp->__room_funcs = __default_room_functions;
       fp->__io_funcs = __default_io_functions;
       __stdio_init_stream (fp);
@@ -51,7 +51,8 @@ DEFUN(__stdio_check_funcs, (fp), register FILE *fp)
 /* Figure out what kind of buffering (none, line, or full)
    and what buffer size to give FP.  */
 static void
-DEFUN(init_stream, (fp), register FILE *fp)
+init_stream (fp)
+     register FILE *fp;
 {
   __stdio_check_funcs (fp);
 
@@ -69,13 +70,13 @@ DEFUN(init_stream, (fp), register FILE *fp)
       save = errno;
       while (fp->__bufsize >= MIN_BUFSIZE)
        {
-         fp->__buffer = (char *) malloc(fp->__bufsize);
+         fp->__buffer = (char *) malloc (fp->__bufsize);
          if (fp->__buffer == NULL)
            fp->__bufsize /= 2;
          else
            break;
        }
-      errno = save;
+      __set_errno (save);
 
       if (fp->__buffer == NULL)
        {
@@ -96,7 +97,8 @@ DEFUN(init_stream, (fp), register FILE *fp)
 
 /* Determine the current file position of STREAM if it is unknown.  */
 int
-DEFUN(__stdio_check_offset, (stream), FILE *stream)
+__stdio_check_offset (stream)
+     FILE *stream;
 {
   init_stream (stream);
 
@@ -106,15 +108,15 @@ DEFUN(__stdio_check_offset, (stream), FILE *stream)
       if (stream->__io_funcs.__seek == NULL)
        {
          /* Unknowable.  */
-         errno = ESPIPE;
+         __set_errno (ESPIPE);
          return EOF;
        }
       else
        {
          /* Unknown.  Find it out.  */
          fpos_t pos = (fpos_t) 0;
-         if ((*stream->__io_funcs.__seek)(stream->__cookie,
-                                          &pos, SEEK_CUR) < 0)
+         if ((*stream->__io_funcs.__seek) (stream->__cookie,
+                                           &pos, SEEK_CUR) < 0)
            {
              if (errno == ESPIPE)
                /* Object is incapable of seeking.  */
@@ -139,13 +141,14 @@ DEFUN(__stdio_check_offset, (stream), FILE *stream)
    seeking as necessary and updating its `offset' field.
    Sets ferror(FP) (and possibly errno) for errors.  */
 static void
-DEFUN(seek_to_target, (fp), FILE *fp)
+seek_to_target (fp)
+     FILE *fp;
 {
   int save = errno;
   if (__stdio_check_offset (fp) == EOF)
     {
       if (errno == ESPIPE)
-       errno = save;
+       __set_errno (save);
       else
        fp->__error = 1;
     }
@@ -156,13 +159,13 @@ DEFUN(seek_to_target, (fp), FILE *fp)
       if (fp->__io_funcs.__seek == NULL)
        {
          /* We can't seek!  */
-         errno = ESPIPE;
+         __set_errno (ESPIPE);
          fp->__error = 1;
        }
       else
        {
          fpos_t pos = fp->__target;
-         if ((*fp->__io_funcs.__seek)(fp->__cookie, &pos, SEEK_SET) < 0)
+         if ((*fp->__io_funcs.__seek) (fp->__cookie, &pos, SEEK_SET) < 0)
            /* Seek failed!  */
            fp->__error = 1;
          else
@@ -175,10 +178,10 @@ DEFUN(seek_to_target, (fp), FILE *fp)
 #ifdef EGRATUITOUS
                  /* It happens in the Hurd when the io server doesn't
                     obey the protocol for io_seek.  */
-                 errno = EGRATUITOUS;
+                 __set_errno (EGRATUITOUS);
 #else
                  /* I don't think this can happen in Unix.  */
-                 errno = ESPIPE; /* ??? */
+                 __set_errno (ESPIPE); /* ??? */
 #endif
                  fp->__error = 1;
                }
@@ -194,8 +197,9 @@ DEFUN(seek_to_target, (fp), FILE *fp)
    flushed to avoid a system call for a single character.
    This is the default `output room' function.  */
 static void
-DEFUN(flushbuf, (fp, c),
-      register FILE *fp AND int c)
+flushbuf (fp, c)
+     register FILE *fp;
+     int c;
 {
   int flush_only = c == EOF;
   size_t buffer_written;
@@ -223,21 +227,21 @@ DEFUN(flushbuf, (fp, c),
          !fp->__mode.__append)
        {
          int save = errno;
-         CONST int aligned = (fp->__buffer == NULL ||
-                              __stdio_check_offset(fp) == EOF ||
+         const int aligned = (fp->__buffer == NULL ||
+                              __stdio_check_offset (fp) == EOF ||
                               fp->__target % fp->__bufsize == 0);
-         errno = save;
+         __set_errno (save);
 
          if (!aligned)
            {
              /* Move to a block (buffer size) boundary and read in a block.
                 Then the output will be written as a whole block, too.  */
-             CONST size_t o = fp->__target % fp->__bufsize;
+             const size_t o = fp->__target % fp->__bufsize;
              fp->__target -= o;
-             if ((*fp->__room_funcs.__input)(fp) == EOF && ferror(fp))
+             if ((*fp->__room_funcs.__input) (fp) == EOF && ferror (fp))
                return;
              else
-               __clearerr(fp);
+               __clearerr (fp);
 
              if (fp->__get_limit - fp->__buffer < o)
                /* Oops.  We didn't read enough (probably because we got EOF).
@@ -322,8 +326,8 @@ DEFUN(flushbuf, (fp, c),
       if (!ferror(fp))
        {
          /* Write out the buffered data.  */
-         wrote = (*fp->__io_funcs.__write)(fp->__cookie, fp->__buffer,
-                                           to_write);
+         wrote = (*fp->__io_funcs.__write) (fp->__cookie, fp->__buffer,
+                                            to_write);
          if (wrote > 0)
            {
              if (fp->__mode.__append)
@@ -347,7 +351,7 @@ DEFUN(flushbuf, (fp, c),
   fp->__bufp = fp->__buffer;
 
   /* If we're not just flushing, write the last character, C.  */
-  if (!flush_only && !ferror(fp))
+  if (!flush_only && !ferror (fp))
     {
       if (fp->__buffer == NULL || (fp->__linebuf && (unsigned char) c == '\n'))
        {
@@ -382,7 +386,7 @@ DEFUN(flushbuf, (fp, c),
       fp->__get_limit = fp->__buffer;
     }
 
-  if (feof(fp) || ferror(fp))
+  if (feof (fp) || ferror (fp))
     fp->__bufp = fp->__put_limit;
 }
 
@@ -390,7 +394,8 @@ DEFUN(flushbuf, (fp, c),
 /* Fill the buffer for FP and return the first character read (or EOF).
    This is the default `input_room' function.  */
 static int
-DEFUN(fillbuf, (fp), register FILE *fp)
+fillbuf (fp)
+     register FILE *fp;
 {
   /* How far into the buffer we read we want to start bufp.  */
   size_t buffer_offset = 0;
@@ -435,13 +440,13 @@ DEFUN(fillbuf, (fp), register FILE *fp)
          }
        seek_to_target (fp);
       }
-    errno = save;
+    __set_errno (save);
   }
 
-  while (!ferror(fp) && !feof(fp) && nread <= buffer_offset)
+  while (!ferror (fp) && !feof (fp) && nread <= buffer_offset)
     {
       /* Try to fill the buffer.  */
-      int count = (*fp->__io_funcs.__read)(fp->__cookie, buffer, to_read);
+      int count = (*fp->__io_funcs.__read) (fp->__cookie, buffer, to_read);
       if (count == 0)
        fp->__eof = 1;
       else if (count < 0)
@@ -460,7 +465,7 @@ DEFUN(fillbuf, (fp), register FILE *fp)
   if (fp->__buffer == NULL)
     /* There is no buffer, so return the character we read
        without all the buffer pointer diddling.  */
-    return (feof(fp) || ferror(fp)) ? EOF : c;
+    return (feof (fp) || ferror (fp)) ? EOF : c;
 
   /* Reset the buffer pointer to the beginning of the buffer
      (plus whatever offset we may have set above).  */
@@ -468,7 +473,7 @@ DEFUN(fillbuf, (fp), register FILE *fp)
 
  end:;
 
-  if (feof(fp) || ferror(fp))
+  if (feof (fp) || ferror (fp))
     {
       /* Set both end pointers to the beginning of the buffer so
         the next i/o call will force a call to __fillbf/__flshfp.  */
@@ -494,12 +499,12 @@ extern __io_write_fn __stdio_write;
 extern __io_seek_fn __stdio_seek;
 extern __io_close_fn __stdio_close;
 extern __io_fileno_fn __stdio_fileno;
-CONST __io_functions __default_io_functions =
+const __io_functions __default_io_functions =
   {
     __stdio_read, __stdio_write, __stdio_seek, __stdio_close, __stdio_fileno
   };
 
-CONST __room_functions __default_room_functions =
+const __room_functions __default_room_functions =
   {
     fillbuf, flushbuf
   };
@@ -508,18 +513,19 @@ CONST __room_functions __default_room_functions =
 /* Flush the buffer for FP and also write C if FLUSH_ONLY is nonzero.
    This is the function used by putc and fflush.  */
 int
-DEFUN(__flshfp, (fp, c),
-      register FILE *fp AND int c)
+__flshfp (fp, c)
+     register FILE *fp;
+     int c;
 {
   int flush_only = c == EOF;
 
-  if (!__validfp(fp) || !fp->__mode.__write)
+  if (!__validfp (fp) || !fp->__mode.__write)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
-  if (ferror(fp))
+  if (ferror (fp))
     return EOF;
 
   if (fp->__pushed_back)
@@ -530,7 +536,7 @@ DEFUN(__flshfp, (fp, c),
     }
 
   /* Make sure the stream is initialized (has functions and buffering).  */
-  init_stream(fp);
+  init_stream (fp);
 
   /* Do this early, so a `putc' on such a stream will never return success.  */
   if (fp->__room_funcs.__output == NULL)
@@ -589,14 +595,15 @@ DEFUN(__flshfp, (fp, c),
 /* Fill the buffer for FP and return the first character read.
    This is the function used by getc.  */
 int
-DEFUN(__fillbf, (fp), register FILE *fp)
+__fillbf (fp)
+     register FILE *fp;
 {
   register int c;
   fpos_t new_target;
 
-  if (!__validfp(fp) || !fp->__mode.__read)
+  if (!__validfp (fp) || !fp->__mode.__read)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
@@ -609,7 +616,7 @@ DEFUN(__fillbf, (fp), register FILE *fp)
     }
 
   /* Make sure the stream is initialized (has functions and buffering). */
-  init_stream(fp);
+  init_stream (fp);
 
   /* If we're trying to read the first character of a new
      line of input from an unbuffered or line buffered stream,
@@ -648,11 +655,11 @@ DEFUN(__fillbf, (fp), register FILE *fp)
 
   fp->__target = new_target;
 
-  if (ferror(fp))
+  if (ferror (fp))
     c = EOF;
   else if (fp->__room_funcs.__input != NULL)
     {
-      c = (*fp->__room_funcs.__input)(fp);
+      c = (*fp->__room_funcs.__input) (fp);
       if (fp->__buffer == NULL)
        /* This is an unbuffered stream, so the target sync above
           won't do anything the next time around.  Instead, note that
@@ -673,13 +680,14 @@ DEFUN(__fillbf, (fp), register FILE *fp)
 
 /* Nuke a stream, but don't kill its link in the chain.  */
 void
-DEFUN(__invalidate, (stream), register FILE *stream)
+__invalidate (stream)
+     register FILE *stream;
 {
   /* Save its link.  */
   register FILE *next = stream->__next;
 
   /* Pulverize the fucker.  */
-  memset((PTR) stream, 0, sizeof(FILE));
+  memset((void *) stream, 0, sizeof(FILE));
 
   /* Restore the deceased's link.  */
   stream->__next = next;
index 1a8b350..ab285f4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -30,8 +29,9 @@ struct memstream_info
 
 /* Enlarge STREAM's buffer.  */
 static void
-DEFUN(enlarge_buffer, (stream, c),
-      register FILE *stream AND int c)
+enlarge_buffer (stream, c)
+     register FILE *stream;
+     int c;
 {
   struct memstream_info *info = (struct memstream_info *) stream->__cookie;
   size_t need;
@@ -64,7 +64,7 @@ DEFUN(enlarge_buffer, (stream, c),
        newsize = need;
       else
        newsize = stream->__bufsize * 2;
-      newbuf = (char *) realloc ((PTR) stream->__buffer, newsize);
+      newbuf = (char *) realloc ((void *) stream->__buffer, newsize);
       if (newbuf == NULL)
        {
          stream->__error = 1;
@@ -82,7 +82,7 @@ DEFUN(enlarge_buffer, (stream, c),
   if (need > 0)
     {
       /* We are extending the buffer after an fseek; zero-fill new space.  */
-      bzero (stream->__bufp, need);
+      memset (stream->__bufp, '\0', need);
       stream->__bufp += need;
     }
 
@@ -96,8 +96,10 @@ DEFUN(enlarge_buffer, (stream, c),
    There is no external state to munge.  */
 
 static int
-DEFUN(seek, (cookie, pos, whence),
-      PTR cookie AND fpos_t *pos AND int whence)
+seek (cookie, pos, whence)
+     void *cookie;
+     fpos_t *pos;
+     int whence;
 {
   switch (whence)
     {
@@ -118,7 +120,8 @@ DEFUN(seek, (cookie, pos, whence),
 }
 
 static int
-DEFUN(free_info, (cookie), PTR cookie)
+free_info (cookie)
+     void *cookie;
 {
 #if 0
   struct memstream_info *info = (struct memstream_info *) cookie;
@@ -138,15 +141,16 @@ DEFUN(free_info, (cookie), PTR cookie)
    necessary.  *BUFLOC and *SIZELOC are updated with the buffer's location
    and the number of characters written on fflush or fclose.  */
 FILE *
-DEFUN(open_memstream, (bufloc, sizeloc),
-      char **bufloc AND size_t *sizeloc)
+open_memstream (bufloc, sizeloc)
+     char **bufloc;
+     size_t *sizeloc;
 {
   FILE *stream;
   struct memstream_info *info;
 
   if (bufloc == NULL || sizeloc == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
@@ -159,14 +163,14 @@ DEFUN(open_memstream, (bufloc, sizeloc),
     {
       int save = errno;
       (void) fclose (stream);
-      errno = save;
+      __set_errno (save);
       return NULL;
     }
 
   stream->__room_funcs.__output = enlarge_buffer;
   stream->__io_funcs.__seek = seek;
   stream->__io_funcs.__close = free_info;
-  stream->__cookie = (PTR) info;
+  stream->__cookie = (void *) info;
   stream->__userbuf = 1;
 
   info->buffer = bufloc;
index 6bfe829..ba79959 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -27,12 +26,15 @@ Cambridge, MA 02139, USA.  */
    If MODE indicates full or line buffering, use BUF,
    a buffer of SIZE bytes; if BUF is NULL, malloc a buffer.  */
 int
-DEFUN(setvbuf, (stream, buf, mode, size),
-      FILE *stream AND char *buf AND int mode AND size_t size)
+setvbuf (stream, buf, mode, size)
+     FILE *stream;
+     char *buf;
+     int mode;
+     size_t size;
 {
-  if (!__validfp(stream))
+  if (!__validfp (stream))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
@@ -40,7 +42,7 @@ DEFUN(setvbuf, (stream, buf, mode, size),
      but we allow it to replace an old buffer, flushing it first.  */
   if (stream->__buffer != NULL)
     {
-      (void) fflush(stream);
+      (void) fflush (stream);
       /* Free the old buffer if it was malloc'd.  */
       if (!stream->__userbuf)
        free(stream->__buffer);
@@ -53,7 +55,7 @@ DEFUN(setvbuf, (stream, buf, mode, size),
   switch (mode)
     {
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     case _IONBF:       /* Unbuffered.  */
       stream->__buffer = NULL;
@@ -65,13 +67,13 @@ DEFUN(setvbuf, (stream, buf, mode, size),
     case _IOFBF:       /* Fully buffered.  */
       if (size == 0)
        {
-         errno = EINVAL;
+         __set_errno (EINVAL);
          return EOF;
        }
       stream->__bufsize = size;
       if (buf != NULL)
        stream->__userbuf = 1;
-      else if ((buf = (char *) malloc(size)) == NULL)
+      else if ((buf = (char *) malloc (size)) == NULL)
        return EOF;
       stream->__buffer = buf;
       break;
index 7b22a20..834f5be 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 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,18 +16,19 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
 
 /* Push the character C back onto the input stream of STREAM.  */
 int
-DEFUN(ungetc, (c, stream), register int c AND register FILE *stream)
+ungetc (c, stream)
+     register int c;
+     register FILE *stream;
 {
-  if (!__validfp(stream) || !stream->__mode.__read)
+  if (!__validfp (stream) || !stream->__mode.__read)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return EOF;
     }
 
index 6f027d5..5e53829 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -28,18 +27,20 @@ Cambridge, MA 02139, USA.  */
 /* Read formatted input from S according to the format
    string FORMAT, using the argument list in ARG.  */
 int
-DEFUN(__vsscanf, (s, format, arg),
-      CONST char *s AND CONST char *format AND va_list arg)
+__vsscanf (s, format, arg)
+     const char *s;
+     const char *format;
+     va_list arg;
 {
   FILE f;
 
   if (s == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  memset((PTR) &f, 0, sizeof(f));
+  memset ((void *) &f, 0, sizeof (f));
   f.__magic = _IOMAGIC;
   f.__mode.__read = 1;
   f.__bufp = f.__buffer = (char *) s;
@@ -51,7 +52,7 @@ DEFUN(__vsscanf, (s, format, arg),
   f.__room_funcs.__input = NULL;
   f.__seen = 1;
 
-  return __vfscanf(&f, format, arg);
+  return __vfscanf (&f, format, arg);
 }
 
 
index 356c619..554e1b2 100644 (file)
@@ -93,7 +93,7 @@ canonicalize (const char *name, char *resolved)
            {
              if (resolved)
                {
-                 errno = ENAMETOOLONG;
+                 __set_errno (ENAMETOOLONG);
                  goto error;
                }
              new_size = rpath_limit - rpath;
@@ -120,7 +120,7 @@ canonicalize (const char *name, char *resolved)
 
              if (++num_links > MAXSYMLINKS)
                {
-                 errno = ELOOP;
+                 __set_errno (ELOOP);
                  goto error;
                }
 
@@ -134,7 +134,7 @@ canonicalize (const char *name, char *resolved)
 
              if ((long int) (n + strlen (end)) >= path_max)
                {
-                 errno = ENAMETOOLONG;
+                 __set_errno (ENAMETOOLONG);
                  goto error;
                }
 
index e2834ce..7b36df4 100644 (file)
@@ -1,5 +1,5 @@
 /* msort -- an alternative to qsort, with an identical interface.
-   Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
    Written by Mike Haertel, September 1988.
 
 This file is part of the GNU C Library.
@@ -19,15 +19,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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <memcopy.h>
 #include <errno.h>
 
+static void msort_with_tmp __P ((void *b, size_t n, size_t s,
+                                __compar_fn_t cmp, char *t));
+
 static void
-DEFUN(msort_with_tmp, (b, n, s, cmp, t),
-      PTR b AND size_t n AND size_t s AND __compar_fn_t cmp AND char *t)
+msort_with_tmp (b, n, s, cmp, t)
+     void *b;
+     size_t n;
+     size_t s;
+     __compar_fn_t cmp;
+     char *t;
 {
   char *tmp;
   char *b1, *b2;
@@ -84,10 +90,13 @@ DEFUN(msort_with_tmp, (b, n, s, cmp, t),
 }
 
 void
-DEFUN(qsort, (b, n, s, cmp),
-      PTR b AND size_t n AND size_t s AND __compar_fn_t cmp)
+qsort (b, n, s, cmp)
+     void *b;
+     size_t n;
+     size_t s;
+     __compar_fn_t cmp;
 {
-  CONST size_t size = n * s;
+  const size_t size = n * s;
 
   if (size < 1024)
     /* The temporary array is small, so put it on the stack.  */
@@ -101,9 +110,9 @@ DEFUN(qsort, (b, n, s, cmp),
        {
          /* Couldn't get space, so use the slower algorithm
             that doesn't need a temporary array.  */
-         extern void EXFUN(_quicksort, (PTR __base,
-                                        size_t __nmemb, size_t __size,
-                                        __compar_fn_t __compar));
+         extern void _quicksort __P ((void *__base,
+                                      size_t __nmemb, size_t __size,
+                                      __compar_fn_t __compar));
          _quicksort (b, n, s, cmp);
        }
       else
@@ -111,6 +120,6 @@ DEFUN(qsort, (b, n, s, cmp),
          msort_with_tmp (b, n, s, cmp, tmp);
          free (tmp);
        }
-      errno = save;
+      __set_errno (save);
     }
 }
index f2fe923..8c51678 100644 (file)
@@ -185,7 +185,7 @@ __initstate_r (seed, arg_state, n, buf)
     {
       if (n < BREAK_0)
        {
-         errno = EINVAL;
+         __set_errno (EINVAL);
          return -1;
        }
       buf->rand_type = TYPE_0;
@@ -271,7 +271,7 @@ __setstate_r (arg_state, buf)
       break;
     default:
       /* State info munged.  */
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 3b8c7d6..99408c7 100644 (file)
@@ -38,7 +38,7 @@ Boston, MA 02111-1307, USA.  */
   do {                                                                       \
     if (dest >= s + maxsize - 1)                                             \
       {                                                                              \
-       errno = E2BIG;                                                        \
+       __set_errno (E2BIG);                                                  \
        va_end (ap);                                                          \
        return -1;                                                            \
       }                                                                              \
@@ -158,7 +158,7 @@ strfmon (char *s, size_t maxsize, const char *format, ...)
            case '+':                   /* Use +/- for sign of number.  */
              if (n_sign_posn != -1)
                {
-                 errno = EINVAL;
+                 __set_errno (EINVAL);
                  va_end (ap);
                  return -1;
                }
@@ -174,7 +174,7 @@ strfmon (char *s, size_t maxsize, const char *format, ...)
            case '(':                   /* Use ( ) for negative sign.  */
              if (n_sign_posn != -1)
                {
-                 errno = EINVAL;
+                 __set_errno (EINVAL);
                  va_end (ap);
                  return -1;
                }
@@ -207,7 +207,7 @@ strfmon (char *s, size_t maxsize, const char *format, ...)
             can stop now and return an error.  */
          if (dest + width >= s + maxsize)
            {
-             errno = E2BIG;
+             __set_errno (E2BIG);
              va_end (ap);
              return -1;
            }
@@ -218,7 +218,7 @@ strfmon (char *s, size_t maxsize, const char *format, ...)
        {
          if (!isdigit (*++fmt))
            {
-             errno = EINVAL;
+             __set_errno (EINVAL);
              va_end (ap);
              return -1;
            }
@@ -236,7 +236,7 @@ strfmon (char *s, size_t maxsize, const char *format, ...)
        {
          if (!isdigit (*++fmt))
            {
-             errno = EINVAL;
+             __set_errno (EINVAL);
              va_end (ap);
              return -1;
            }
@@ -276,7 +276,7 @@ strfmon (char *s, size_t maxsize, const char *format, ...)
              right_prec = *_NL_CURRENT (LC_MONETARY, FRAC_DIGITS);
          break;
        default:                /* Any unrecognized format is an error.  */
-         errno = EINVAL;
+         __set_errno (EINVAL);
          va_end (ap);
          return -1;
        }
index 66d6726..b47d5ed 100644 (file)
@@ -151,7 +151,7 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
 
       if (shift > MANT_DIG)
        {
-         errno = EDOM;
+         __set_errno (EDOM);
          return 0.0;
        }
 
@@ -563,7 +563,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
                  FLOAT retval;
 
                  /* Overflow or underflow.  */
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                  retval = (exp_negative ? 0.0 :
                            negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL);
 
@@ -631,13 +631,13 @@ INTERNAL (STRTOF) (nptr, endptr, group)
 
   if (int_no + exponent > MAX_10_EXP + 1)
     {
-      errno = ERANGE;
+      __set_errno (ERANGE);
       return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
     }
 
   if (exponent < MIN_10_EXP - (DIG + 1))
     {
-      errno = ERANGE;
+      __set_errno (ERANGE);
       return 0.0;
     }
 
@@ -694,7 +694,7 @@ INTERNAL (STRTOF) (nptr, endptr, group)
         Check it against the maximum possible exponent.  */
       if (bits > MAX_EXP)
        {
-         errno = ERANGE;
+         __set_errno (ERANGE);
          return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
        }
 
index 1481d33..5543ab9 100644 (file)
@@ -31,6 +31,9 @@ Cambridge, MA 02139, USA.  */
 #ifndef errno
 extern int errno;
 #endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
 
 #ifdef HAVE_LIMITS_H
 # include <limits.h>
@@ -309,7 +312,7 @@ INTERNAL (strtol) (nptr, endptr, base, group)
 
   if (overflow)
     {
-      errno = ERANGE;
+      __set_errno (ERANGE);
 #if UNSIGNED
       return ULONG_MAX;
 #else
index 8d04bb6..f411067 100644 (file)
@@ -148,7 +148,7 @@ main (int argc, char ** argv)
       if (!tests[i].out && errno != tests[i].error)
        {
          printf ("%s: flunked test %d (expected errno %d, got %d)\n",
-                 argv[0], i, tests[i].errno, error);
+                 argv[0], i, tests[i].errno, errno);
          ++errors;
          continue;
        }
index 71803dd..44660de 100644 (file)
@@ -6,23 +6,23 @@ static  char sccsid[] = "@(#)bindresvport.c   2.2 88/07/29 4.0 RPCSRC 1.8 88/02/08
  * may copy or modify Sun RPC without charge, but are not authorized
  * to license or distribute it to anyone else except as part of a product or
  * program developed by the user.
- * 
+ *
  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- * 
+ *
  * Sun RPC is provided with no support and without any obligation on the
  * part of Sun Microsystems, Inc. to assist in its use, correction,
  * modification or enhancement.
- * 
+ *
  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  * OR ANY PART THEREOF.
- * 
+ *
  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  * or profits or other special, indirect and consequential damages, even if
  * Sun has been advised of the possibility of such damages.
- * 
+ *
  * Sun Microsystems, Inc.
  * 2550 Garcia Avenue
  * Mountain View, California  94043
@@ -47,7 +47,9 @@ bindresvport(sd, sin)
        int res;
        static short port;
        struct sockaddr_in myaddr;
+#ifndef errno
        extern int errno;
+#endif
        int i;
 
 #define STARTPORT 600
@@ -59,14 +61,14 @@ bindresvport(sd, sin)
                bzero(sin, sizeof (*sin));
                sin->sin_family = AF_INET;
        } else if (sin->sin_family != AF_INET) {
-               errno = EPFNOSUPPORT;
+               __set_errno (EPFNOSUPPORT);
                return (-1);
        }
        if (port == 0) {
                port = (getpid() % NPORTS) + STARTPORT;
        }
        res = -1;
-       errno = EADDRINUSE;
+       __set_errno (EADDRINUSE);
        for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; i++) {
                sin->sin_port = htons(port++);
                if (port > ENDPORT) {
index 3b71e11..be365f1 100644 (file)
@@ -59,7 +59,9 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
 
 #define MCALL_MSG_SIZE 24
 
+#ifndef errno
 extern int errno;
+#endif
 
 static int     readtcp();
 static int     writetcp();
index 706457a..2074095 100644 (file)
@@ -6,23 +6,23 @@
  * may copy or modify Sun RPC without charge, but are not authorized
  * to license or distribute it to anyone else except as part of a product or
  * program developed by the user.
- * 
+ *
  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- * 
+ *
  * Sun RPC is provided with no support and without any obligation on the
  * part of Sun Microsystems, Inc. to assist in its use, correction,
  * modification or enhancement.
- * 
+ *
  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  * OR ANY PART THEREOF.
- * 
+ *
  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  * or profits or other special, indirect and consequential damages, even if
  * Sun has been advised of the possibility of such damages.
- * 
+ *
  * Sun Microsystems, Inc.
  * 2550 Garcia Avenue
  * Mountain View, California  94043
@@ -45,7 +45,9 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
 #include <errno.h>
 #include <rpc/pmap_clnt.h>
 
+#ifndef errno
 extern int errno;
+#endif
 
 /*
  * UDP bases client side rpc operations
@@ -66,7 +68,7 @@ static struct clnt_ops udp_ops = {
        clntudp_control
 };
 
-/* 
+/*
  * Private data kept per client handle
  */
 struct cu_data {
@@ -204,7 +206,7 @@ clntudp_create(raddr, program, version, wait, sockp)
            UDPMSGSIZE, UDPMSGSIZE));
 }
 
-static enum clnt_stat 
+static enum clnt_stat
 clntudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
        register CLIENT *cl;            /* client handle */
        u_long          proc;           /* procedure number */
@@ -286,7 +288,7 @@ send_again:
 #endif /* def FD_SETSIZE */
        for (;;) {
                readfds = mask;
-               switch (select(_rpc_dtablesize(), &readfds, (int *)NULL, 
+               switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
                               (int *)NULL, &(cu->cu_wait))) {
 
                case 0:
@@ -299,7 +301,7 @@ send_again:
                        if ((time_waited.tv_sec < timeout.tv_sec) ||
                                ((time_waited.tv_sec == timeout.tv_sec) &&
                                (time_waited.tv_usec < timeout.tv_usec)))
-                               goto send_again;        
+                               goto send_again;
                        return (cu->cu_error.re_status = RPC_TIMEDOUT);
 
                /*
@@ -308,27 +310,27 @@ send_again:
                 */
                case -1:
                        if (errno == EINTR)
-                               continue;       
+                               continue;
                        cu->cu_error.re_errno = errno;
                        return (cu->cu_error.re_status = RPC_CANTRECV);
                }
                do {
                        fromlen = sizeof(struct sockaddr);
-                       inlen = recvfrom(cu->cu_sock, cu->cu_inbuf, 
+                       inlen = recvfrom(cu->cu_sock, cu->cu_inbuf,
                                (int) cu->cu_recvsz, 0,
                                (struct sockaddr *)&from, &fromlen);
                } while (inlen < 0 && errno == EINTR);
                if (inlen < 0) {
                        if (errno == EWOULDBLOCK)
-                               continue;       
+                               continue;
                        cu->cu_error.re_errno = errno;
                        return (cu->cu_error.re_status = RPC_CANTRECV);
                }
                if (inlen < 4)
-                       continue;       
+                       continue;
                /* see if reply transaction id matches sent id */
                if (*((u_int32_t *)(cu->cu_inbuf)) != *((u_int32_t *)(cu->cu_outbuf)))
-                       continue;       
+                       continue;
                /* we now assume we have the proper reply */
                break;
        }
@@ -351,7 +353,7 @@ send_again:
                                xdrs->x_op = XDR_FREE;
                                (void)xdr_opaque_auth(xdrs,
                                    &(reply_msg.acpted_rply.ar_verf));
-                       } 
+                       }
                }  /* end successful completion */
                else {
                        /* maybe our credentials need to be refreshed ... */
@@ -391,7 +393,7 @@ clntudp_freeres(cl, xdr_res, res_ptr)
        return ((*xdr_res)(xdrs, res_ptr));
 }
 
-static void 
+static void
 clntudp_abort(/*h*/)
        /*CLIENT *h;*/
 {
@@ -426,7 +428,7 @@ clntudp_control(cl, request, info)
        }
        return (TRUE);
 }
-       
+
 static void
 clntudp_destroy(cl)
        CLIENT *cl;
index 7a9cbb6..d84e0c5 100644 (file)
@@ -54,7 +54,9 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";
 #define MAX_BROADCAST_SIZE 1400
 #endif
 
+#ifndef errno
 extern int errno;
+#endif
 
 /*
  * Get a copy of the current port maps.
index a944f6c..3fbc472 100644 (file)
@@ -53,7 +53,9 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
 #include <arpa/inet.h>
 #define MAX_BROADCAST_SIZE 1400
 
+#ifndef errno
 extern int errno;
+#endif
 static struct timeval timeout = { 3, 0 };
 
 
@@ -388,4 +390,3 @@ done_broad:
        AUTH_DESTROY(unix_auth);
        return (stat);
 }
-
index e0af710..5995c25 100644 (file)
@@ -6,23 +6,23 @@
  * may copy or modify Sun RPC without charge, but are not authorized
  * to license or distribute it to anyone else except as part of a product or
  * program developed by the user.
- * 
+ *
  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- * 
+ *
  * Sun RPC is provided with no support and without any obligation on the
  * part of Sun Microsystems, Inc. to assist in its use, correction,
  * modification or enhancement.
- * 
+ *
  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  * OR ANY PART THEREOF.
- * 
+ *
  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  * or profits or other special, indirect and consequential damages, even if
  * Sun has been advised of the possibility of such damages.
- * 
+ *
  * Sun Microsystems, Inc.
  * 2550 Garcia Avenue
  * Mountain View, California  94043
@@ -45,7 +45,9 @@ static char sccsid[] = "@(#)svc.c 1.41 87/10/13 Copyr 1984 Sun Micro";
 #include <rpc/rpc.h>
 #include <rpc/pmap_clnt.h>
 
+#ifndef errno
 extern int errno;
+#endif
 
 #ifdef FD_SETSIZE
 static SVCXPRT **xports;
@@ -103,12 +105,12 @@ xprt_register(xprt)
 }
 
 /*
- * De-activate a transport handle. 
+ * De-activate a transport handle.
  */
 void
-xprt_unregister(xprt) 
+xprt_unregister(xprt)
        SVCXPRT *xprt;
-{ 
+{
        register int sock = xprt->xp_sock;
 
 #ifdef FD_SETSIZE
@@ -223,15 +225,15 @@ svc_sendreply(xprt, xdr_results, xdr_location)
        xdrproc_t xdr_results;
        caddr_t xdr_location;
 {
-       struct rpc_msg rply; 
+       struct rpc_msg rply;
 
-       rply.rm_direction = REPLY;  
-       rply.rm_reply.rp_stat = MSG_ACCEPTED; 
-       rply.acpted_rply.ar_verf = xprt->xp_verf; 
+       rply.rm_direction = REPLY;
+       rply.rm_reply.rp_stat = MSG_ACCEPTED;
+       rply.acpted_rply.ar_verf = xprt->xp_verf;
        rply.acpted_rply.ar_stat = SUCCESS;
        rply.acpted_rply.ar_results.where = xdr_location;
        rply.acpted_rply.ar_results.proc = xdr_results;
-       return (SVC_REPLY(xprt, &rply)); 
+       return (SVC_REPLY(xprt, &rply));
 }
 
 /*
@@ -257,13 +259,13 @@ void
 svcerr_decode(xprt)
        register SVCXPRT *xprt;
 {
-       struct rpc_msg rply; 
+       struct rpc_msg rply;
 
-       rply.rm_direction = REPLY; 
-       rply.rm_reply.rp_stat = MSG_ACCEPTED; 
+       rply.rm_direction = REPLY;
+       rply.rm_reply.rp_stat = MSG_ACCEPTED;
        rply.acpted_rply.ar_verf = xprt->xp_verf;
        rply.acpted_rply.ar_stat = GARBAGE_ARGS;
-       SVC_REPLY(xprt, &rply); 
+       SVC_REPLY(xprt, &rply);
 }
 
 /*
@@ -273,13 +275,13 @@ void
 svcerr_systemerr(xprt)
        register SVCXPRT *xprt;
 {
-       struct rpc_msg rply; 
+       struct rpc_msg rply;
 
-       rply.rm_direction = REPLY; 
-       rply.rm_reply.rp_stat = MSG_ACCEPTED; 
+       rply.rm_direction = REPLY;
+       rply.rm_reply.rp_stat = MSG_ACCEPTED;
        rply.acpted_rply.ar_verf = xprt->xp_verf;
        rply.acpted_rply.ar_stat = SYSTEM_ERR;
-       SVC_REPLY(xprt, &rply); 
+       SVC_REPLY(xprt, &rply);
 }
 
 /*
@@ -313,15 +315,15 @@ svcerr_weakauth(xprt)
 /*
  * Program unavailable error reply
  */
-void 
+void
 svcerr_noprog(xprt)
        register SVCXPRT *xprt;
 {
-       struct rpc_msg rply;  
+       struct rpc_msg rply;
 
-       rply.rm_direction = REPLY;   
-       rply.rm_reply.rp_stat = MSG_ACCEPTED;  
-       rply.acpted_rply.ar_verf = xprt->xp_verf;  
+       rply.rm_direction = REPLY;
+       rply.rm_reply.rp_stat = MSG_ACCEPTED;
+       rply.acpted_rply.ar_verf = xprt->xp_verf;
        rply.acpted_rply.ar_stat = PROG_UNAVAIL;
        SVC_REPLY(xprt, &rply);
 }
@@ -329,9 +331,9 @@ svcerr_noprog(xprt)
 /*
  * Program version mismatch error reply
  */
-void  
+void
 svcerr_progvers(xprt, low_vers, high_vers)
-       register SVCXPRT *xprt; 
+       register SVCXPRT *xprt;
        u_long low_vers;
        u_long high_vers;
 {
@@ -356,9 +358,9 @@ svcerr_progvers(xprt, low_vers, high_vers)
  * the "raw" parameters (msg.rm_call.cb_cred and msg.rm_call.cb_verf) and
  * the "cooked" credentials (rqst->rq_clntcred).
  * However, this function does not know the structure of the cooked
- * credentials, so it make the following assumptions: 
+ * credentials, so it make the following assumptions:
  *   a) the structure is contiguous (no pointers), and
- *   b) the cred structure size does not exceed RQCRED_SIZE bytes. 
+ *   b) the cred structure size does not exceed RQCRED_SIZE bytes.
  * In all events, all three parameters are freed upon exit from this routine.
  * The storage is trivially management on the call stack in user land, but
  * is mallocated in kernel land.
@@ -410,7 +412,7 @@ svc_getreqset(readfds)
 
 
 #ifdef FD_SETSIZE
-       setsize = _rpc_dtablesize();    
+       setsize = _rpc_dtablesize();
        maskp = (u_int32_t *)readfds->fds_bits;
        for (sock = 0; sock < setsize; sock += 32) {
            for (mask = *maskp++; bit = ffs(mask); mask ^= (1 << (bit - 1))) {
index c1c3e04..45ea400 100644 (file)
@@ -10,23 +10,23 @@ static char sccsid[] = "@(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro";
  * may copy or modify Sun RPC without charge, but are not authorized
  * to license or distribute it to anyone else except as part of a product or
  * program developed by the user.
- * 
+ *
  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- * 
+ *
  * Sun RPC is provided with no support and without any obligation on the
  * part of Sun Microsystems, Inc. to assist in its use, correction,
  * modification or enhancement.
- * 
+ *
  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  * OR ANY PART THEREOF.
- * 
+ *
  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  * or profits or other special, indirect and consequential damages, even if
  * Sun has been advised of the possibility of such damages.
- * 
+ *
  * Sun Microsystems, Inc.
  * 2550 Garcia Avenue
  * Mountain View, California  94043
@@ -47,7 +47,9 @@ svc_run()
 #else
       int readfds;
 #endif /* def FD_SETSIZE */
+#ifndef errno
        extern int errno;
+#endif
 
        for (;;) {
 #ifdef FD_SETSIZE
index 8886a9f..6846f38 100644 (file)
@@ -46,7 +46,9 @@ static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 #include <sys/socket.h>
 #include <errno.h>
 #define abort ((bool_t (*) ()) abort)
+#ifndef errno
 extern errno;
+#endif
 
 /*
  * Ops vector for TCP/IP based rpc service handle
index a910452..7c3a31b 100644 (file)
@@ -64,7 +64,9 @@ static struct xp_ops svcudp_op = {
        svcudp_destroy
 };
 
+#ifndef errno
 extern int errno;
+#endif
 
 /*
  * kept in xprt->xp_p2
@@ -472,4 +474,3 @@ cache_get(xprt, msg, replyp, replylenp)
        uc->uc_addr = xprt->xp_raddr;
        return(0);
 }
-
index 600e959..729c7b2 100644 (file)
@@ -27,7 +27,7 @@ ftime (timebuf)
   int save = errno;
   struct tm tp;
 
-  errno = 0;
+  __set_errno (0);
   if (time (&timebuf->time) == (time_t) -1 && errno != 0)
     return -1;
   timebuf->millitm = 0;
@@ -38,6 +38,6 @@ ftime (timebuf)
   timebuf->timezone = tp.tm_gmtoff / 60;
   timebuf->dstflag = tp.tm_isdst;
 
-  errno = save;
+  __set_errno (save);
   return 0;
 }
index a539a9b..dda2125 100644 (file)
@@ -82,10 +82,10 @@ openpty(amaster, aslave, name, termp, winp)
                                        if (name)
                                                strcpy(name, line);
                                        if (termp)
-                                               (void) tcsetattr(slave, 
+                                               (void) tcsetattr(slave,
                                                        TCSAFLUSH, termp);
                                        if (winp)
-                                               (void) ioctl(slave, TIOCSWINSZ, 
+                                               (void) ioctl(slave, TIOCSWINSZ,
                                                        (char *)winp);
                                        return (0);
                                }
@@ -94,7 +94,7 @@ openpty(amaster, aslave, name, termp, winp)
                        }
                }
        }
-       errno = ENOENT; /* out of ptys */
+       __set_errno (ENOENT);   /* out of ptys */
        return (-1);
 }
 
@@ -114,7 +114,7 @@ forkpty(amaster, name, termp, winp)
        case -1:
                return (-1);
        case 0:
-               /* 
+               /*
                 * child
                 */
                (void) close(master);
index a84a8eb..44830e9 100644 (file)
@@ -88,7 +88,7 @@ setenv (name, value, replace)
       if (new_environ[size] == NULL)
        {
          free ((char *) new_environ);
-         errno = ENOMEM;
+         __set_errno (ENOMEM);
          UNLOCK;
          return -1;
        }
index 1f5a3ee..229c066 100644 (file)
@@ -1,5 +1,5 @@
 /* `struct termios' speed frobnication functions.  4.4 BSD/generic GNU 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
@@ -43,7 +43,7 @@ DEFUN(cfsetospeed, (termios_p, speed),
 {
   if (termios_p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -58,7 +58,7 @@ DEFUN(cfsetispeed, (termios_p, speed),
 {
   if (termios_p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 9544713..cb30619 100644 (file)
@@ -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., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#include <errno.h>
 #include <string.h>
 
 
@@ -39,15 +38,7 @@ strtok (s, delim)
   char *token;
 
   if (s == NULL)
-    {
-      if (olds == NULL)
-       {
-         errno = EINVAL;
-         return NULL;
-       }
-      else
-       s = olds;
-    }
+    s = olds;
 
   /* Scan leading delimiters.  */
   s += strspn (s, delim);
index 08a2936..488d3ea 100644 (file)
@@ -17,7 +17,6 @@ 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.  */
 
-#include <errno.h>
 #include <string.h>
 
 
@@ -40,15 +39,7 @@ strtok_r (s, delim, save_ptr)
   char *token;
 
   if (s == NULL)
-    {
-      if (*save_ptr == NULL)
-       {
-         errno = EINVAL;
-         return NULL;
-       }
-      else
-       s = *save_ptr;
-    }
+    s = *save_ptr;
 
   /* Scan leading delimiters.  */
   s += strspn (s, delim);
index 7a3f7fc..d28dde8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,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 <ansidecl.h>
-#include <errno.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -29,16 +27,18 @@ Cambridge, MA 02139, USA.  */
 
 /* Read N bytes into BUF from COOKIE.  */
 int
-DEFUN(__stdio_read, (cookie, buf, n),
-      PTR cookie AND register char *buf AND register size_t n)
+__stdio_read (cookie, buf, n)
+     void *cookie;
+     register char *buf;
+     register size_t n;
 {
-  CONST int fd = (int) cookie;
+  const int fd = (int) cookie;
 #if    defined (EINTR) && defined (EINTR_REPEAT)
   int save = errno;
   int nread;
 
  try:;
-  errno = 0;
+  __set_errno (0);
   nread = __read (fd, buf, (int) n);
   if (nread < 0)
     {
@@ -46,7 +46,7 @@ DEFUN(__stdio_read, (cookie, buf, n),
        goto try;
       return -1;
     }
-  errno = save;
+  __set_errno (save);
   return nread;
 
 #else  /* No EINTR.  */
@@ -57,10 +57,12 @@ DEFUN(__stdio_read, (cookie, buf, n),
 
 /* Write N bytes from BUF to COOKIE.  */
 int
-DEFUN(__stdio_write, (cookie, buf, n),
-      PTR cookie AND register CONST char *buf AND register size_t n)
+__stdio_write (cookie, buf, n)
+     void *cookie;
+     register const char *buf;
+     register size_t n;
 {
-  CONST int fd = (int) cookie;
+  const int fd = (int) cookie;
   register size_t written = 0;
 
   while (n > 0)
@@ -89,8 +91,10 @@ DEFUN(__stdio_write, (cookie, buf, n),
    The new file position is stored in *POS.
    Returns zero if successful, nonzero if not.  */
 int
-DEFUN(__stdio_seek, (cookie, pos, whence),
-      PTR cookie AND fpos_t *pos AND int whence)
+__stdio_seek (cookie, pos, whence)
+     void *cookie;
+     fpos_t *pos;
+     int whence;
 {
   off_t new;
   new = __lseek ((int) cookie, (off_t) *pos, whence);
@@ -103,7 +107,8 @@ DEFUN(__stdio_seek, (cookie, pos, whence),
 
 /* Close COOKIE.  */
 int
-DEFUN(__stdio_close, (cookie), PTR cookie)
+__stdio_close (cookie)
+     void *cookie;
 {
   return __close ((int) cookie);
 }
@@ -112,7 +117,8 @@ DEFUN(__stdio_close, (cookie), PTR cookie)
    or -1 for errors.  If COOKIE does not relate to any POSIX.1 file
    descriptor, this should return -1 with errno set to EOPNOTSUPP.  */
 int
-DEFUN(__stdio_fileno, (cookie), PTR cookie)
+__stdio_fileno (cookie)
+     void *cookie;
 {
   return (int) cookie;
 }
@@ -120,8 +126,10 @@ DEFUN(__stdio_fileno, (cookie), PTR cookie)
 
 /* Open the given file with the mode given in the __io_mode argument.  */
 int
-DEFUN(__stdio_open, (filename, m, cookieptr),
-      CONST char *filename AND __io_mode m AND PTR *cookieptr)
+__stdio_open (filename, m, cookieptr)
+     const char *filename;
+     __io_mode m;
+     void **cookieptr;
 {
   int fd;
   int mode;
@@ -155,11 +163,13 @@ DEFUN(__stdio_open, (filename, m, cookieptr),
 /* Open FILENAME with the mode in M.  Use the same magic cookie
    already in *COOKIEPTR if possible, closing the old cookie with CLOSEFN.  */
 int
-DEFUN(__stdio_reopen, (filename, m, cookieptr),
-      CONST char *filename AND __io_mode m AND
-      PTR *cookieptr AND __io_close_fn closefn)
+__stdio_reopen (filename, m, cookieptr)
+     const char *filename;
+     __io_mode m;
+     void **cookieptr;
+     __io_close_fn closefn;
 {
-  PTR newcookie;
+  void *newcookie;
 
   /* We leave the old descriptor open while we open the file.
      That way ``freopen ("/dev/stdin", "r", stdin)'' works.  */
index b3ecf70..c0bc13e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <string.h>
 #include <sys/utsname.h>
@@ -27,13 +26,14 @@ Cambridge, MA 02139, USA.  */
 
 /* Put information about the system in NAME.  */
 int
-DEFUN(uname, (name), struct utsname *name)
+uname (name)
+     struct utsname *name;
 {
   int save;
 
   if (name == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -49,7 +49,7 @@ DEFUN(uname, (name), struct utsname *name)
 #ifdef ENAMETOOLONG
       else if (errno == ENAMETOOLONG)
        /* The name was truncated.  */
-       errno = save;
+       __set_errno (save);
 #endif
       else
        return -1;
index 56f1199..235a5ab 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,6 @@ Cambridge, MA 02139, USA.  */
    or stub versions of getrlimit.  Separate versions could be written
    for efficiency, but it's probably not worth it.  */
 
-#include <ansidecl.h>
 #include <sys/vlimit.h>
 #include <sys/resource.h>
 #include <errno.h>
@@ -28,8 +27,9 @@ Cambridge, MA 02139, USA.  */
 /* Set the soft limit for RESOURCE to be VALUE.
    Returns 0 for success, -1 for failure.  */
 int
-DEFUN(vlimit, (resource, value),
-      enum __vlimit_resource resource AND int value)
+vlimit (resource, value)
+     enum __vlimit_resource resource;
+     int value;
 {
   if (resource >= LIM_CPU && resource <= LIM_MAXRSS)
     {
@@ -39,13 +39,13 @@ DEFUN(vlimit, (resource, value),
        (enum __rlimit_resource) ((int) resource - 1);
       struct rlimit lims;
 
-      if (getrlimit(rlimit_res, &lims) < 0)
+      if (getrlimit (rlimit_res, &lims) < 0)
        return -1;
 
       lims.rlim_cur = value;
       return setrlimit(rlimit_res, &lims);
     }
 
-  errno = EINVAL;
+  __set_errno (EINVAL);
   return -1;
 }
index fdb40db..8bdebd8 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of status bits for `wait' et al.
-Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+Copyright (C) 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
@@ -61,6 +61,7 @@ Cambridge, MA 02139, USA.  */
 
 union wait
   {
+    int w_status;
     struct
       {
 #if    __BYTE_ORDER == __LITTLE_ENDIAN
index de34370..d6b0bc6 100644 (file)
@@ -118,10 +118,10 @@ __MATH_INLINE double
 tan (double __x)
 {
   register double __value;
+  register double __value2 __attribute__ ((unused));
   __asm __volatile__
-    ("fptan\n\t"
-     "fincstp"
-     : "=t" (__value) : "0" (__x));
+    ("fptan"
+     : "=t" (__value2), "=u" (__value) : "0" (__x));
 
   return __value;
 }
index 644108e..35026fa 100644 (file)
@@ -111,12 +111,12 @@ static double zero = 0.0; /* used as const */
                                                  ? "acosf" : "acosl");;
                exc.retval = zero;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if(_LIB_VERSION == _SVID_) {
                    (void) WRITE2("acos: DOMAIN error\n", 19);
                  }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 2:
@@ -128,12 +128,12 @@ static double zero = 0.0; /* used as const */
                                                  ? "asinf" : "asinl");
                exc.retval = zero;
                if(_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if(_LIB_VERSION == _SVID_) {
                        (void) WRITE2("asin: DOMAIN error\n", 19);
                  }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 3:
@@ -147,12 +147,12 @@ static double zero = 0.0; /* used as const */
                                                   ? "atan2f" : "atan2l");
                exc.retval = zero;
                if(_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if(_LIB_VERSION == _SVID_) {
                        (void) WRITE2("atan2: DOMAIN error\n", 20);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 4:
@@ -167,9 +167,9 @@ static double zero = 0.0;   /* used as const */
                else
                  exc.retval = HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 5:
@@ -184,9 +184,9 @@ static double zero = 0.0;   /* used as const */
                else
                  exc.retval = HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 6:
@@ -201,9 +201,9 @@ static double zero = 0.0;   /* used as const */
                else
                  exc.retval = HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 7:
@@ -215,9 +215,9 @@ static double zero = 0.0;   /* used as const */
                                                 ? "expf" : "expl");
                exc.retval = zero;
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 8:
@@ -231,12 +231,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("y0: DOMAIN error\n", 17);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 9:
@@ -250,12 +250,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("y0: DOMAIN error\n", 17);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 10:
@@ -269,12 +269,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("y1: DOMAIN error\n", 17);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 11:
@@ -288,12 +288,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("y1: DOMAIN error\n", 17);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 12:
@@ -307,12 +307,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("yn: DOMAIN error\n", 17);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 13:
@@ -326,12 +326,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("yn: DOMAIN error\n", 17);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 14:
@@ -346,9 +346,9 @@ static double zero = 0.0;   /* used as const */
                 else
                   exc.retval = HUGE_VAL;
                 if (_LIB_VERSION == _POSIX_)
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                 else if (!__matherr(&exc)) {
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                }
                break;
            case 15:
@@ -363,12 +363,12 @@ static double zero = 0.0; /* used as const */
                 else
                   exc.retval = HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("lgamma: SING error\n", 19);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 16:
@@ -382,12 +382,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("log: SING error\n", 16);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 17:
@@ -401,12 +401,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("log: DOMAIN error\n", 18);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 18:
@@ -421,12 +421,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("log10: SING error\n", 18);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 19:
@@ -441,12 +441,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("log10: DOMAIN error\n", 20);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 20:
@@ -460,7 +460,7 @@ static double zero = 0.0;   /* used as const */
                if (_LIB_VERSION != _SVID_) exc.retval = 1.0;
                else if (!__matherr(&exc)) {
                        (void) WRITE2("pow(0,0): DOMAIN error\n", 23);
-                       errno = EDOM;
+                       __set_errno (EDOM);
                }
                break;
            case 21:
@@ -479,9 +479,9 @@ static double zero = 0.0;   /* used as const */
                  if(x<zero&&__rint(y)!=y) exc.retval = -HUGE_VAL;
                }
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 22:
@@ -492,9 +492,9 @@ static double zero = 0.0;   /* used as const */
                exc.name = type < 100 ? "pow" : (type < 200 ? "powf" : "powl");
                exc.retval =  zero;
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 23:
@@ -508,12 +508,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("pow(0,neg): DOMAIN error\n", 25);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 24:
@@ -527,12 +527,12 @@ static double zero = 0.0; /* used as const */
                else
                    exc.retval = zero/zero;     /* X/Open allow NaN */
                if (_LIB_VERSION == _POSIX_)
-                  errno = EDOM;
+                  __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("neg**non-integral: DOMAIN error\n", 32);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 25:
@@ -547,9 +547,9 @@ static double zero = 0.0;   /* used as const */
                else
                  exc.retval = ( (x>zero) ? HUGE_VAL : -HUGE_VAL);
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 26:
@@ -564,12 +564,12 @@ static double zero = 0.0; /* used as const */
                else
                  exc.retval = zero/zero;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("sqrt: DOMAIN error\n", 19);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
             case 27:
@@ -584,12 +584,12 @@ static double zero = 0.0; /* used as const */
                else
                    exc.retval = zero/zero;
                 if (_LIB_VERSION == _POSIX_)
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 else if (!__matherr(&exc)) {
                   if (_LIB_VERSION == _SVID_) {
                     (void) WRITE2("fmod:  DOMAIN error\n", 20);
                   }
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 }
                 break;
             case 28:
@@ -602,12 +602,12 @@ static double zero = 0.0; /* used as const */
                                                       : "remainderl");
                 exc.retval = zero/zero;
                 if (_LIB_VERSION == _POSIX_)
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 else if (!__matherr(&exc)) {
                   if (_LIB_VERSION == _SVID_) {
                     (void) WRITE2("remainder: DOMAIN error\n", 24);
                   }
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 }
                 break;
             case 29:
@@ -619,12 +619,12 @@ static double zero = 0.0; /* used as const */
                                                   ? "acoshf" : "acoshl");
                 exc.retval = zero/zero;
                 if (_LIB_VERSION == _POSIX_)
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 else if (!__matherr(&exc)) {
                   if (_LIB_VERSION == _SVID_) {
                     (void) WRITE2("acosh: DOMAIN error\n", 20);
                   }
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 }
                 break;
             case 30:
@@ -636,12 +636,12 @@ static double zero = 0.0; /* used as const */
                                                   ? "atanhf" : "atanhl");
                 exc.retval = zero/zero;
                 if (_LIB_VERSION == _POSIX_)
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 else if (!__matherr(&exc)) {
                   if (_LIB_VERSION == _SVID_) {
                     (void) WRITE2("atanh: DOMAIN error\n", 20);
                   }
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 }
                 break;
             case 31:
@@ -653,12 +653,12 @@ static double zero = 0.0; /* used as const */
                                                   ? "atanhf" : "atanhl");
                exc.retval = x/zero;    /* sign(x)*inf */
                 if (_LIB_VERSION == _POSIX_)
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 else if (!__matherr(&exc)) {
                   if (_LIB_VERSION == _SVID_) {
                     (void) WRITE2("atanh: SING error\n", 18);
                   }
-                  errno = EDOM;
+                  __set_errno (EDOM);
                 }
                 break;
            case 32:
@@ -670,9 +670,9 @@ static double zero = 0.0;   /* used as const */
                                                   ? "scalbf" : "scalbl");
                exc.retval = x > zero ? HUGE_VAL : -HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 33:
@@ -684,9 +684,9 @@ static double zero = 0.0;   /* used as const */
                                                   ? "scalbf" : "scalbl");
                exc.retval = __copysign(zero,x);
                if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                else if (!__matherr(&exc)) {
-                       errno = ERANGE;
+                       __set_errno (ERANGE);
                }
                break;
            case 34:
@@ -697,13 +697,13 @@ static double zero = 0.0; /* used as const */
                 exc.name = type < 100 ? "j0" : (type < 200 ? "j0f" : "j0l");
                 exc.retval = zero;
                 if (_LIB_VERSION == _POSIX_)
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 else if (!__matherr(&exc)) {
                         if (_LIB_VERSION == _SVID_) {
                                 (void) WRITE2(exc.name, 2);
                                 (void) WRITE2(": TLOSS error\n", 14);
                         }
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 }
                break;
            case 35:
@@ -714,13 +714,13 @@ static double zero = 0.0; /* used as const */
                 exc.name = type < 100 ? "y0" : (type < 200 ? "y0f" : "y0l");
                 exc.retval = zero;
                 if (_LIB_VERSION == _POSIX_)
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 else if (!__matherr(&exc)) {
                         if (_LIB_VERSION == _SVID_) {
                                 (void) WRITE2(exc.name, 2);
                                 (void) WRITE2(": TLOSS error\n", 14);
                         }
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 }
                break;
            case 36:
@@ -731,13 +731,13 @@ static double zero = 0.0; /* used as const */
                 exc.name = type < 100 ? "j1" : (type < 200 ? "j1f" : "j1l");
                 exc.retval = zero;
                 if (_LIB_VERSION == _POSIX_)
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 else if (!__matherr(&exc)) {
                         if (_LIB_VERSION == _SVID_) {
                                 (void) WRITE2(exc.name, 2);
                                 (void) WRITE2(": TLOSS error\n", 14);
                         }
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 }
                break;
            case 37:
@@ -748,13 +748,13 @@ static double zero = 0.0; /* used as const */
                 exc.name = type < 100 ? "y1" : (type < 200 ? "y1f" : "y1l");
                 exc.retval = zero;
                 if (_LIB_VERSION == _POSIX_)
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 else if (!__matherr(&exc)) {
                         if (_LIB_VERSION == _SVID_) {
                                 (void) WRITE2(exc.name, 2);
                                 (void) WRITE2(": TLOSS error\n", 14);
                         }
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 }
                break;
            case 38:
@@ -765,13 +765,13 @@ static double zero = 0.0; /* used as const */
                 exc.name = type < 100 ? "jn" : (type < 200 ? "jnf" : "jnl");
                 exc.retval = zero;
                 if (_LIB_VERSION == _POSIX_)
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 else if (!__matherr(&exc)) {
                         if (_LIB_VERSION == _SVID_) {
                                 (void) WRITE2(exc.name, 2);
                                 (void) WRITE2(": TLOSS error\n", 14);
                         }
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 }
                break;
            case 39:
@@ -782,13 +782,13 @@ static double zero = 0.0; /* used as const */
                 exc.name = type < 100 ? "yn" : (type < 200 ? "ynf" : "ynl");
                 exc.retval = zero;
                 if (_LIB_VERSION == _POSIX_)
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 else if (!__matherr(&exc)) {
                         if (_LIB_VERSION == _SVID_) {
                                 (void) WRITE2(exc.name, 2);
                                 (void) WRITE2(": TLOSS error\n", 14);
                         }
-                        errno = ERANGE;
+                        __set_errno (ERANGE);
                 }
                break;
            case 40:
@@ -803,9 +803,9 @@ static double zero = 0.0;   /* used as const */
                 else
                   exc.retval = HUGE_VAL;
                 if (_LIB_VERSION == _POSIX_)
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                 else if (!__matherr(&exc)) {
-                  errno = ERANGE;
+                  __set_errno (ERANGE);
                 }
                break;
            case 41:
@@ -820,12 +820,12 @@ static double zero = 0.0; /* used as const */
                 else
                   exc.retval = HUGE_VAL;
                if (_LIB_VERSION == _POSIX_)
-                 errno = EDOM;
+                 __set_errno (EDOM);
                else if (!__matherr(&exc)) {
                  if (_LIB_VERSION == _SVID_) {
                        (void) WRITE2("gamma: SING error\n", 18);
                      }
-                 errno = EDOM;
+                 __set_errno (EDOM);
                }
                break;
            case 42:
@@ -839,7 +839,7 @@ static double zero = 0.0;   /* used as const */
                if (_LIB_VERSION == _IEEE_ ||
                    _LIB_VERSION == _POSIX_) exc.retval = 1.0;
                else if (!__matherr(&exc)) {
-                       errno = EDOM;
+                       __set_errno (EDOM);
                }
                break;
        }
index 754fef6..94a93fc 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -27,7 +27,7 @@ static char rcsid[] = "$NetBSD: s_ldexp.c,v 1.6 1995/05/10 20:47:40 jtc Exp $";
 {
        if(!__finite(value)||value==0.0) return value;
        value = __scalbn(value,exp);
-       if(!__finite(value)||value==0.0) errno = ERANGE;
+       if(!__finite(value)||value==0.0) __set_errno (ERANGE);
        return value;
 }
 weak_alias (__ldexp, ldexp)
index d047677..1ecbe83 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -30,7 +30,7 @@ static char rcsid[] = "$NetBSD: s_ldexpf.c,v 1.3 1995/05/10 20:47:42 jtc Exp $";
 {
        if(!__finitef(value)||value==(float)0.0) return value;
        value = __scalbnf(value,exp);
-       if(!__finitef(value)||value==(float)0.0) errno = ERANGE;
+       if(!__finitef(value)||value==(float)0.0) __set_errno (ERANGE);
        return value;
 }
 weak_alias (__ldexpf, ldexpf)
index bf64c89..123a6b3 100644 (file)
@@ -31,7 +31,7 @@ static char rcsid[] = "$NetBSD: $";
 {
        if(!__finitel(value)||value==0.0) return value;
        value = __scalbnl(value,exp);
-       if(!__finitel(value)||value==0.0) errno = ERANGE;
+       if(!__finitel(value)||value==0.0) __set_errno (ERANGE);
        return value;
 }
 weak_alias (__ldexpl, ldexpl)
index f718bc2..53d4114 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -16,7 +16,7 @@ static char rcsid[] = "$NetBSD: w_scalb.c,v 1.6 1995/05/10 20:49:48 jtc Exp $";
 
 /*
  * wrapper scalb(double x, double fn) is provide for
- * passing various standard test suite. One 
+ * passing various standard test suite. One
  * should use scalbn() instead.
  */
 
@@ -51,11 +51,11 @@ static char rcsid[] = "$NetBSD: w_scalb.c,v 1.6 1995/05/10 20:49:48 jtc Exp $";
        }
        if(z==0.0&&z!=x) {
            return __kernel_standard(x,(double)fn,33); /* scalb underflow */
-       } 
+       }
 #ifndef _SCALB_INT
-       if(!__finite(fn)) errno = ERANGE;
+       if(!__finite(fn)) __set_errno (ERANGE);
 #endif
        return z;
-#endif 
+#endif
 }
 weak_alias (__scalb, scalb)
index 3af7ed3..488a717 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -19,7 +19,7 @@ static char rcsid[] = "$NetBSD: w_scalbf.c,v 1.3 1995/05/10 20:49:50 jtc Exp $";
 
 /*
  * wrapper scalbf(float x, float fn) is provide for
- * passing various standard test suite. One 
+ * passing various standard test suite. One
  * should use scalbn() instead.
  */
 
@@ -56,11 +56,11 @@ static char rcsid[] = "$NetBSD: w_scalbf.c,v 1.3 1995/05/10 20:49:50 jtc Exp $";
        if(z==(float)0.0&&z!=x) {
            /* scalbf underflow */
            return (float)__kernel_standard((double)x,(double)fn,133);
-       } 
+       }
 #ifndef _SCALB_INT
-       if(!__finitef(fn)) errno = ERANGE;
+       if(!__finitef(fn)) __set_errno (ERANGE);
 #endif
        return z;
-#endif 
+#endif
 }
 weak_alias (__scalbf, scalbf)
index ff5117d..3ca8d96 100644 (file)
@@ -57,7 +57,7 @@ static char rcsid[] = "$NetBSD: $";
            return __kernel_standard(x,(double)fn,233); /* scalb underflow */
        }
 #ifndef _SCALB_INT
-       if(!__finitel(fn)) errno = ERANGE;
+       if(!__finitel(fn)) __set_errno (ERANGE);
 #endif
        return z;
 #endif
index 4039bba..6d2b74a 100644 (file)
@@ -22,7 +22,6 @@ Cambridge, MA 02139, USA.  */
 
 #ifndef FUNC
 #define FUNC scalbn
-#include <s_ldexp.c>
 #endif
 #ifndef float_type
 #define float_type double
index 55d64fd..3345971 100644 (file)
@@ -1,6 +1,5 @@
 #ifndef FUNC
 #define FUNC scalbnf
-#include <s_ldexpf.c>
 #endif
 #define float_type float
 #include <s_scalbn.c>
index 8484992..c6ad950 100644 (file)
@@ -1,6 +1,5 @@
 #ifndef FUNC
 #define FUNC scalbnl
-#include <s_ldexpl.c>
 #endif
 #define float_type long double
 #include <s_scalbn.c>
index 100e4b1..915cb11 100644 (file)
@@ -149,6 +149,7 @@ END \
     print "/* errno is a per-thread variable.  */";
     print "#include <hurd/threadvar.h>";
     print "#define errno       (*__hurd_errno_location ())";
+    print "#define __set_errno(val) errno = (val)";
     print "";
     print "#endif /* <errno.h> included.  */";
     print "";
index 1c9b16c..4954cc2 100644 (file)
@@ -31,9 +31,9 @@ typedef struct __libc_lock_opaque__ __libc_lock_t;
    initialized with __libc_lock_init before it can be used (or define it
    with __libc_lock_define_initialized, below).  Use `extern' for CLASS to
    declare a lock defined in another module.  In public structure
-   definitions, the lock element must come last, because its storage size
-   will not be known outside of libc.  (Or you can use a pointer to the
-   lock structure; i.e. NAME begins with a `*'.)  */
+   definitions you must use a pointer to the lock structure (i.e., NAME
+   begins with a `*'), because its storage size will not be known outside
+   of libc.  */
 #define __libc_lock_define(CLASS,NAME) \
   CLASS __libc_lock_t NAME;
 
index c0c6b2a..8730172 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
+/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <limits.h>
@@ -26,7 +25,9 @@ Cambridge, MA 02139, USA.  */
 /* Duplicate FD to FD2, closing the old FD2 and making FD2 be
    open the same file as FD is.  Return FD2 or -1.  */
 int
-DEFUN(__dup2, (fd, fd2), int fd AND int fd2)
+__dup2 (fd, fd2)
+     int fd;
+     int fd2;
 {
   int save;
 
@@ -36,7 +37,7 @@ DEFUN(__dup2, (fd, fd2), int fd AND int fd2)
 #endif
 )
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
@@ -51,7 +52,7 @@ DEFUN(__dup2, (fd, fd2), int fd AND int fd2)
 
   save = errno;
   (void) close (fd2);
-  errno = save;
+  __set_errno (save);
 
   return fcntl (fd, F_DUPFD, fd2);
 }
index e50bdfb..26f3af6 100644 (file)
@@ -1,5 +1,5 @@
 /* euidaccess -- check if effective user id can access file
-   Copyright (C) 1990, 1991, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1991, 1995, 1996 Free Software Foundation, Inc.
 
 This file is part of the GNU C Library.
 
@@ -66,6 +66,9 @@ gid_t getegid ();
 #ifndef errno
 extern int errno;
 #endif
+#ifndef __set_errno
+#define __set_errno(val) errno = 8val)
+#endif
 
 #if defined(EACCES) && !defined(EACCESS)
 #define EACCESS EACCES
@@ -176,7 +179,7 @@ euidaccess (path, mode)
     granted = (stats.st_mode & mode);
   if (granted == mode)
     return 0;
-  errno = EACCESS;
+  __set_errno (EACCESS);
   return -1;
 }
 \f
index ad746ec..fb2bda8 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <fcntl.h>
@@ -26,7 +25,9 @@ extern int EXFUN(__getmode, (CONST char *mode, __io_mode *mptr));
 
 /* Open a new stream on a given system file descriptor.  */
 FILE *
-DEFUN(fdopen, (fd, mode), int fd AND CONST char *mode)
+fdopen (fd, mode)
+     int fd;
+     const char *mode;
 {
   register FILE *stream;
   __io_mode m;
@@ -48,14 +49,14 @@ DEFUN(fdopen, (fd, mode), int fd AND CONST char *mode)
     case O_RDONLY:
       if (!m.__read)
        {
-         errno = EBADF;
+         __set_errno (EBADF);
          return NULL;
        }
       break;
     case O_WRONLY:
       if (!m.__write)
        {
-         errno = EBADF;
+         __set_errno (EBADF);
          return NULL;
        }
       break;
@@ -65,7 +66,7 @@ DEFUN(fdopen, (fd, mode), int fd AND CONST char *mode)
   if (stream == NULL)
     return NULL;
 
-  stream->__cookie = (PTR) fd;
+  stream->__cookie = (void *) fd;
   stream->__mode = m;
 
   return stream;
index b4c9fc3..15d348a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -20,7 +20,6 @@ Cambridge, MA 02139, USA.  */
    locking mechanism.  In 4BSD, these are two incompatible locking mechanisms,
    perhaps with different semantics?  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -29,7 +28,9 @@ Cambridge, MA 02139, USA.  */
 /* Apply or remove an advisory lock, according to OPERATION,
    on the file FD refers to.  */
 int
-DEFUN(__flock, (fd, operation), int fd AND int operation)
+__flock (fd, operation)
+     int fd;
+     int operation;
 {
   struct flock lbuf;
 
@@ -45,7 +46,7 @@ DEFUN(__flock, (fd, operation), int fd AND int operation)
       lbuf.l_type = F_UNLCK;
       break;
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 9b54b5f..1e7cba4 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -26,25 +25,27 @@ Cambridge, MA 02139, USA.  */
 
 /* Get file-specific information about descriptor FD.  */
 long int
-DEFUN(__fpathconf, (fd, name), int fd AND int name)
+__fpathconf (fd, name)
+     int fd;
+     int name;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
   switch (name)
     {
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
 
     case _PC_LINK_MAX:
 #ifdef LINK_MAX
       return LINK_MAX;
 #else
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
 #endif
 
@@ -52,7 +53,7 @@ DEFUN(__fpathconf, (fd, name), int fd AND int name)
 #ifdef MAX_CANON
       return MAX_CANON;
 #else
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
 #endif
 
@@ -60,7 +61,7 @@ DEFUN(__fpathconf, (fd, name), int fd AND int name)
 #ifdef MAX_INPUT
       return MAX_INPUT;
 #else
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
 #endif
 
@@ -68,7 +69,7 @@ DEFUN(__fpathconf, (fd, name), int fd AND int name)
 #ifdef NAME_MAX
       return NAME_MAX;
 #else
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
 #endif
 
@@ -83,7 +84,7 @@ DEFUN(__fpathconf, (fd, name), int fd AND int name)
          return buf.f_namelen;
       }
 #else
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
 #endif
 
@@ -91,7 +92,7 @@ DEFUN(__fpathconf, (fd, name), int fd AND int name)
 #ifdef PIPE_BUF
       return PIPE_BUF;
 #else
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
 #endif
 
@@ -141,12 +142,12 @@ DEFUN(__fpathconf, (fd, name), int fd AND int name)
 #ifdef SOCK_MAXBUF
       return SOCK_MAXBUF;
 #else
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
 #endif
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 2d8011e..a9536b9 100644 (file)
@@ -45,6 +45,9 @@ Cambridge, MA 02139, USA.  */
 #if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
 extern int errno;
 #endif
+#ifndef __set_errno
+#define __set_errno(val) errno = (val)
+#endif
 
 #ifndef        NULL
 #define        NULL    0
@@ -211,7 +214,7 @@ __getcwd (buf, size)
     {
       if (buf != NULL)
        {
-         errno = EINVAL;
+         __set_errno (EINVAL);
          return NULL;
        }
 
@@ -305,7 +308,7 @@ __getcwd (buf, size)
                {
                  int save = errno;
                  (void) __closedir (dirstream);
-                 errno = save;
+                 __set_errno (save);
                  goto lose;
                }
              if (st.st_dev == thisdev && st.st_ino == thisino)
@@ -316,7 +319,7 @@ __getcwd (buf, size)
        {
          int save = errno;
          (void) __closedir (dirstream);
-         errno = save;
+         __set_errno (save);
          goto lose;
        }
       else
@@ -327,7 +330,7 @@ __getcwd (buf, size)
            {
              if (buf != NULL)
                {
-                 errno = ERANGE;
+                 __set_errno (ERANGE);
                  return NULL;
                }
              else
@@ -338,7 +341,7 @@ __getcwd (buf, size)
                    {
                      (void) __closedir (dirstream);
                      free (path);
-                     errno = ENOMEM; /* closedir might have changed it.  */
+                     __set_errno (ENOMEM);/* closedir might have changed it.*/
                      return NULL;
                    }
                  pathp = &buf[pathp - path];
index 3c079a5..9d4e078 100644 (file)
@@ -37,7 +37,7 @@ __gettimeofday (tv, tz)
 {
   if (tv == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 7536b1e..2dcae18 100644 (file)
@@ -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
@@ -16,22 +16,22 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <termios.h>
 
 /* Return 1 if FD is a terminal, 0 if not.  */
 int
-DEFUN(__isatty, (fd), int fd)
+__isatty (fd)
+     int fd;
 {
   int save;
   int is_tty;
   struct termios term;
 
   save = errno;
-  is_tty = __tcgetattr(fd, &term) == 0;
-  errno = save;
+  is_tty = __tcgetattr (fd, &term) == 0;
+  __set_errno (save);
 
   return is_tty;
 }
index 9ac38a8..8edcf59 100644 (file)
@@ -30,7 +30,7 @@ isfdtype (int fildes, int fdtype)
   {
     int save_error = errno;
     result = fstat (fildes, &st);
-    errno = save_error;
+    __set_errno (save_error);
   }
 
   return result ?: (st.st_mode & S_IFMT) == fdtype;
index 0c70dd2..5197673 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 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 <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -25,11 +24,13 @@ Cambridge, MA 02139, USA.  */
    If PGRP is zero, send SIG to all processes in
    the current process's process group.  */
 int
-DEFUN(killpg, (pgrp, sig), __pid_t pgrp AND int sig)
+killpg (pgrp, sig)
+     __pid_t pgrp;
+     int sig;
 {
   if (pgrp < 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 9f4f68d..920136d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <string.h>
 #include <errno.h>
 #include <stdio.h>
@@ -28,9 +27,10 @@ Cambridge, MA 02139, USA.  */
    they are replaced with a string that makes the filename unique.
    Returns a file descriptor open on the file for reading and writing.  */
 int
-DEFUN(mkstemp, (template), char *template)
+mkstemp (template)
+     char *template;
 {
-  static CONST char letters[]
+  static const char letters[]
     = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
   size_t len;
   size_t i;
@@ -38,7 +38,7 @@ DEFUN(mkstemp, (template), char *template)
   len = strlen (template);
   if (len < 6 || strcmp (&template[len - 6], "XXXXXX"))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index c3aae36..111206f 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <string.h>
 #include <errno.h>
 #include <unistd.h>
@@ -28,9 +27,10 @@ Cambridge, MA 02139, USA.  */
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the filename unique.  */
 char *
-DEFUN(mktemp, (template), char *template)
+mktemp (template)
+     char *template;
 {
-  static CONST char letters[]
+  static const char letters[]
     = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
   size_t len;
   size_t i;
@@ -38,7 +38,7 @@ DEFUN(mktemp, (template), char *template)
   len = strlen (template);
   if (len < 6 || strcmp (&template[len - 6], "XXXXXX"))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 05cee5e..9539957 100644 (file)
@@ -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
@@ -28,10 +28,10 @@ __pathconf (const char *path, int name)
   int fd = open (path, 0);
   if (fd >= 0)
     {
-      long int value = __fpathconf (0, name);
+      long int value = __fpathconf (fd, name);
       int save = errno;
       (void) close (fd);
-      errno = save;
+      __set_errno (save);
       return value;
     }
   return -1L;
index 53595f5..539bf43 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <signal.h>
@@ -43,7 +42,7 @@ struct child
    original function with the original cookie.  */
 
 #define FUNC(type, name, args)                                               \
-  static type DEFUN(__CONCAT(child_,name), args, __CONCAT(name,decl))        \
+  static type __CONCAT(child_,name) args __CONCAT(name,decl))                \
   {                                                                          \
     struct child *c = (struct child *) cookie;                               \
     {                                                                        \
@@ -52,15 +51,15 @@ struct child
     }                                                                        \
   }
 
-#define readdecl PTR cookie AND register char *buf AND register size_t n
+#define readdecl void *cookie AND register char *buf AND register size_t n
 FUNC (int, read, (cookie, buf, n))
-#define writedecl PTR cookie AND register CONST char *buf AND register size_t n
+#define writedecl void *cookie AND register const char *buf AND register size_t n
 FUNC (int, write, (cookie, buf, n))
-#define seekdecl PTR cookie AND fpos_t *pos AND int whence
+#define seekdecl void *cookie AND fpos_t *pos AND int whence
 FUNC (int, seek, (cookie, pos, whence))
-#define closedecl PTR cookie
+#define closedecl void *cookie
 FUNC (int, close, (cookie))
-#define filenodecl PTR cookie
+#define filenodecl void *cookie
 FUNC (int, fileno, (cookie))
 
 static const __io_functions child_funcs
@@ -69,7 +68,9 @@ static const __io_functions child_funcs
 /* Open a new stream that is a one-way pipe to a
    child process running the given shell command.  */
 FILE *
-DEFUN(popen, (command, mode), CONST char *command AND CONST char *mode)
+popen (command, mode)
+     const char *command;
+     const char *mode;
 {
   pid_t pid;
   int pipedes[2];
@@ -78,12 +79,12 @@ DEFUN(popen, (command, mode), CONST char *command AND CONST char *mode)
 
   if (command == NULL || mode == NULL || (*mode != 'r' && *mode != 'w'))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
   /* Create the pipe.  */
-  if (pipe(pipedes) < 0)
+  if (pipe (pipedes) < 0)
     return NULL;
 
   /* Fork off the child.  */
@@ -100,24 +101,24 @@ DEFUN(popen, (command, mode), CONST char *command AND CONST char *mode)
       /* We are the child side.  Make the write side of
         the pipe be stdin or the read side be stdout.  */
 
-      CONST char *new_argv[4];
+      const char *new_argv[4];
 
       if ((*mode == 'w' ? dup2(pipedes[STDIN_FILENO], STDIN_FILENO) :
-         dup2(pipedes[STDOUT_FILENO], STDOUT_FILENO)) < 0)
-       _exit(127);
+         dup2 (pipedes[STDOUT_FILENO], STDOUT_FILENO)) < 0)
+       _exit (127);
 
       /* Close the pipe descriptors.  */
-      (void) close(pipedes[STDIN_FILENO]);
-      (void) close(pipedes[STDOUT_FILENO]);
+      (void) close (pipedes[STDIN_FILENO]);
+      (void) close (pipedes[STDOUT_FILENO]);
 
       /* Exec the shell.  */
       new_argv[0] = SH_NAME;
       new_argv[1] = "-c";
       new_argv[2] = command;
       new_argv[3] = NULL;
-      (void) execve(SH_PATH, (char *CONST *) new_argv, environ);
+      (void) execve (SH_PATH, (char *CONST *) new_argv, environ);
       /* Die if it failed.  */
-      _exit(127);
+      _exit (127);
     }
 
   /* We are the parent side.  */
@@ -180,7 +181,7 @@ DEFUN(popen, (command, mode), CONST char *command AND CONST char *mode)
       while (dead > 0 && dead != pid);
     }
 #endif
-    errno = save;
+    __set_errno (save);
     return NULL;
   }
 }
@@ -188,15 +189,16 @@ DEFUN(popen, (command, mode), CONST char *command AND CONST char *mode)
 /* Close a stream opened by popen and return its status.
    Returns -1 if the stream was not opened by popen.  */
 int
-DEFUN(pclose, (stream), register FILE *stream)
+pclose (stream)
+     register FILE *stream;
 {
   struct child *c;
   pid_t pid, dead;
   int status;
 
-  if (!__validfp(stream) || !stream->__ispipe)
+  if (!__validfp (stream) || !stream->__ispipe)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -204,7 +206,7 @@ DEFUN(pclose, (stream), register FILE *stream)
   pid = c->pid;
   stream->__cookie = c->cookie;
   stream->__io_funcs = c->funcs;
-  free ((PTR) c);
+  free ((void *) c);
   stream->__ispipe = 0;
   if (fclose (stream))
     return -1;
index 66414c9..9999021 100644 (file)
@@ -1,5 +1,5 @@
 /* ANSI C `remove' function to delete a file or directory.  POSIX.1 version.
-Copyright (C) 1995 Free Software Foundation, Inc.
+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
@@ -32,7 +32,7 @@ remove (file)
     return 0;
   else if (errno == ENOTDIR && __unlink (file) == 0)
     {
-      errno = save;
+      __set_errno (save);
       return 0;
     }
 
index 3245f9c..c318081 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 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,34 +16,35 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
 
 /* Rename the file OLD to NEW.  */
 int
-DEFUN(rename, (old, new), CONST char *old AND CONST char *new)
+rename (old, new)
+     const char *old;
+     const char *new;
 {
   int save = errno;
-  if (__link(old, new) < 0)
+  if (__link (old, new) < 0)
     {
       if (errno == EEXIST)
        {
          errno = save;
          /* Race condition, required for 1003.1 conformance.  */
-         if (__unlink(new) < 0 ||
-             __link(old, new) < 0)
+         if (__unlink (new) < 0 ||
+             __link (old, new) < 0)
            return -1;
        }
       else
        return -1;
     }
-  if (__unlink(old) < 0)
+  if (__unlink (old) < 0)
     {
       save = errno;
-      if (__unlink(new) == 0)
-       errno = save;
+      if (__unlink (new) == 0)
+       __set_errno (save);
       return -1;
     }
   return 0;
index 441c643..37914e9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 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,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <signal.h>
 #include <errno.h>
@@ -25,8 +24,9 @@ Cambridge, MA 02139, USA.  */
    (causing them to fail with EINTR); if INTERRUPT is zero, make system
    calls be restarted after signal SIG.  */
 int
-DEFUN(siginterrupt, (sig, interrupt),
-      int sig AND int interrupt)
+siginterrupt (sig, interrupt)
+     int sig;
+     int interrupt;
 {
 #ifdef SA_RESTART
   extern sigset_t _sigintr;    /* Defined in signal.c.  */
@@ -51,7 +51,7 @@ DEFUN(siginterrupt, (sig, interrupt),
 
   return 0;
 #else
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 #endif
 }
index f9ae47b..9a8d2de 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -26,13 +25,15 @@ sigset_t _sigintr;          /* Set by siginterrupt.  */
 /* Set the handler for the signal SIG to HANDLER,
    returning the old handler, or SIG_ERR on error.  */
 __sighandler_t
-DEFUN(signal, (sig, handler), int sig AND __sighandler_t handler)
+signal (sig, handler)
+     int sig;
+     __sighandler_t handler;
 {
   struct sigaction act, oact;
 
   if (handler == SIG_ERR)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return SIG_ERR;
     }
 
index 7713153..49a55f3 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 #include <stddef.h>
@@ -26,26 +25,27 @@ Cambridge, MA 02139, USA.  */
 /* Change the set of blocked signals to SET,
    wait until a signal arrives, and restore the set of blocked signals.  */
 int
-DEFUN(sigsuspend, (set), CONST sigset_t *set)
+sigsuspend (set)
+     const sigset_t *set;
 {
   sigset_t oset;
   int save;
 
   if (set == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  if (sigprocmask(SIG_SETMASK, set, &oset) < 0)
+  if (sigprocmask (SIG_SETMASK, set, &oset) < 0)
     return -1;
 
   (void) pause();
   save = errno;
 
-  if (sigprocmask(SIG_SETMASK, &oset, (sigset_t *) NULL) < 0)
+  if (sigprocmask (SIG_SETMASK, &oset, (sigset_t *) NULL) < 0)
     return -1;
 
-  errno = save;
+  __set_errno (save);
   return -1;
 }
index 4aef22a..6a224e1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <signal.h>
 #include <errno.h>
 #include <stddef.h>
@@ -28,7 +27,8 @@ static __sighandler_t wrapped_handlers[NSIG];
 static sigset_t wrapped_masks[NSIG];
 
 static void
-DEFUN(wrapper_handler, (sig), int sig)
+wrapper_handler (sig)
+     int sig;
 {
   int save;
   struct sigaction act;
@@ -37,33 +37,31 @@ DEFUN(wrapper_handler, (sig), int sig)
   act.sa_mask = wrapped_masks[sig];
   act.sa_flags = 0;
   save = errno;
-  (void) __sigaction(sig, &act, (struct sigaction *) NULL);
-  errno = save;
+  (void) __sigaction (sig, &act, (struct sigaction *) NULL);
+  __set_errno (save);
 
-  (*wrapped_handlers[sig])(sig);
+  (*wrapped_handlers[sig]) (sig);
 }
 
-static
-#ifdef __GNUC__
-inline
-#endif
-int
-DEFUN(convert_mask, (set, mask), sigset_t *set AND CONST int mask)
+static inline int
+convert_mask (set, mask)
+     sigset_t *set;
+     const int mask;
 {
   register int sig;
 
-  if (sizeof(*set) == sizeof(mask))
+  if (sizeof (*set) == sizeof (mask))
     {
       *(int *) set = mask;
       return 0;
     }
 
-  if (__sigemptyset(set) < 0)
+  if (__sigemptyset (set) < 0)
     return -1;
 
   for (sig = 1; sig < NSIG; ++sig)
-    if (mask & sigmask(sig))
-      if (__sigaddset(set, sig) < 0)
+    if (mask & sigmask (sig))
+      if (__sigaddset (set, sig) < 0)
        return -1;
 
   return 0;
@@ -75,8 +73,10 @@ DEFUN(convert_mask, (set, mask), sigset_t *set AND CONST int mask)
    reset to SIG_DFL before `sv_handler' is entered.  If OVEC is non-NULL,
    it is filled in with the old information for SIG.  */
 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;
 {
   struct sigaction old;
 
@@ -93,13 +93,13 @@ DEFUN(__sigvec, (sig, vec, ovec),
          if (convert_mask (&n->sa_mask, vec->sv_mask) < 0)
            return -1;
          n->sa_flags = 0;
-         
+
          if (vec->sv_flags & SV_ONSTACK)
            {
 #ifdef SA_ONSTACK
              n->sa_flags |= SA_ONSTACK;
 #else
-             errno = ENOSYS;
+             __set_errno (ENOSYS);
              return -1;
 #endif
            }
index 20f78a0..fd63a4b 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <signal.h>
 #include <time.h>
 #include <unistd.h>
@@ -26,7 +25,8 @@ Cambridge, MA 02139, USA.  */
 /* SIGALRM signal handler for `sleep'.  This does nothing but return,
    but SIG_IGN isn't supposed to break `pause'.  */
 static void
-DEFUN(sleep_handler, (sig), int sig)
+sleep_handler (sig)
+     int sig;
 {
   return;
 }
@@ -39,7 +39,8 @@ DEFUN(sleep_handler, (sig), int sig)
    signal afterwards is undefined.  There is no return value to indicate
    error, but if `sleep' returns SECONDS, it probably didn't work.  */
 unsigned int
-DEFUN(sleep, (seconds), unsigned int seconds)
+sleep (seconds)
+     unsigned int seconds;
 {
   unsigned int remaining, slept;
   time_t before, after;
@@ -100,7 +101,7 @@ DEFUN(sleep, (seconds), unsigned int seconds)
 
   /* Restore the `errno' value we started with.
      Some of the calls we made might have failed, but we didn't care.  */
-  errno = save;
+  __set_errno (save);
 
   return slept > seconds ? 0 : seconds - slept;
 }
index 14ee58c..9660724 100644 (file)
@@ -37,7 +37,7 @@ __sysconf (name)
   switch (name)
     {
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
 
     case _SC_ARG_MAX:
index da58be5..b1a685c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -35,7 +34,7 @@ Cambridge, MA 02139, USA.  */
 
 /* Execute LINE as a shell command, returning its status.  */
 int
-DEFUN(system, (line), register CONST char *line)
+__libc_system (const char *line)
 {
   int status, save;
   pid_t pid;
@@ -57,7 +56,7 @@ DEFUN(system, (line), register CONST char *line)
     {
       save = errno;
       (void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL);
-      errno = save;
+      __set_errno (save);
       return -1;
     }
 
@@ -74,13 +73,13 @@ DEFUN(system, (line), register CONST char *line)
   if (__sigprocmask (SIG_BLOCK, &block, &omask) < 0)
     {
       if (errno == ENOSYS)
-       errno = save;
+       __set_errno (save);
       else
        {
          save = errno;
          (void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL);
          (void) __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL);
-         errno = save;
+         __set_errno (save);
          return -1;
        }
     }
@@ -93,7 +92,7 @@ DEFUN(system, (line), register CONST char *line)
   if (pid == (pid_t) 0)
     {
       /* Child side.  */
-      CONST char *new_argv[4];
+      const char *new_argv[4];
       new_argv[0] = SHELL_NAME;
       new_argv[1] = "-c";
       new_argv[2] = line;
@@ -105,7 +104,7 @@ DEFUN(system, (line), register CONST char *line)
       (void) UNBLOCK;
 
       /* Exec the shell.  */
-      (void) __execve (SHELL_PATH, (char *CONST *) new_argv, __environ);
+      (void) __execve (SHELL_PATH, (char *const *) new_argv, __environ);
       _exit (127);
     }
   else if (pid < (pid_t) 0)
@@ -137,10 +136,11 @@ DEFUN(system, (line), register CONST char *line)
        UNBLOCK) != 0)
     {
       if (errno == ENOSYS)
-       errno = save;
+       __set_errno (save);
       else
        return -1;
     }
 
   return status;
 }
+weak_alias (__libc_system, system)
index 0f088ec..6fd698e 100644 (file)
@@ -56,7 +56,7 @@ exists (const char *file)
         trouble, while reporting that it doesn't exist when it does would
         violate the interface of __stdio_gen_tempname.  */
       int exists = errno != ENOENT;
-      errno = save;
+      __set_errno (save);
       return exists;
     }
 }
@@ -106,7 +106,7 @@ __stdio_gen_tempname (const char *dir, const char *pfx, int dir_search,
        d = "/tmp";
       if (d == NULL)
        {
-         errno = ENOENT;
+         __set_errno (ENOENT);
          return NULL;
        }
       dir = d;
@@ -186,7 +186,7 @@ __stdio_gen_tempname (const char *dir, const char *pfx, int dir_search,
                lose:
                  (void) remove (buf);
                  (void) __close (fd);
-                 errno = save;
+                 __set_errno (save);
                  return NULL;
                }
              _IO_init (&fp->file, 0);
@@ -214,7 +214,7 @@ __stdio_gen_tempname (const char *dir, const char *pfx, int dir_search,
                  const int save = errno;
                  (void) remove (buf);
                  (void) __close (fd);
-                 errno = save;
+                 __set_errno (save);
                  return NULL;
                }
              (*streamptr)->__cookie = (__ptr_t) (long int) fd;
@@ -232,7 +232,7 @@ __stdio_gen_tempname (const char *dir, const char *pfx, int dir_search,
       /* If the file already existed we have continued the loop above,
         so we only get here when we have a winning name to return.  */
 
-      errno = saverrno;
+      __set_errno (saverrno);
 
       if (lenptr != NULL)
        *lenptr = len + 1;
@@ -240,6 +240,6 @@ __stdio_gen_tempname (const char *dir, const char *pfx, int dir_search,
     }
 
   /* We got out of the loop because we ran out of combinations to try.  */
-  errno = EEXIST;              /* ? */
+  __set_errno (EEXIST);                /* ? */
   return NULL;
 }
index 4f4c07e..2ab5d66 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <unistd.h>
@@ -24,8 +23,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Truncate PATH to LENGTH bytes.  */
 int
-DEFUN(truncate, (path, length),
-      CONST char *path AND off_t length)
+truncate (path, length)
+     const char *path;
+     off_t length;
 {
   int fd, ret, save;
 
@@ -37,6 +37,6 @@ DEFUN(truncate, (path, length),
   save = errno;
   (void) close (fd);
   if (ret < 0)
-    errno = save;
+    __set_errno (save);
   return ret;
 }
index 7c7ed24..be82827 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <limits.h>
 #include <stddef.h>
@@ -32,9 +31,10 @@ char *__ttyname = NULL;
 /* Return the pathname of the terminal FD is open on, or NULL on errors.
    The returned storage is good only until the next call to this function.  */
 char *
-DEFUN(ttyname, (fd), int fd)
+ttyname (fd)
+     int fd;
 {
-  static CONST char dev[] = "/dev";
+  static const char dev[] = "/dev";
   static char *name;
   static size_t namelen = 0;
   struct stat st;
@@ -75,12 +75,12 @@ DEFUN(ttyname, (fd), int fd)
          {
            (void) closedir (dirstream);
            __ttyname = name;
-           errno = save;
+           __set_errno (save);
            return name;
          }
       }
 
   (void) closedir (dirstream);
-  errno = save;
+  __set_errno (save);
   return NULL;
 }
index e6172f1..1fb4b04 100644 (file)
@@ -50,7 +50,7 @@ __ttyname_r (fd, buf, buflen)
      the loop.  */
   if (buflen < (int) (sizeof (dev) + 1))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -83,13 +83,13 @@ __ttyname_r (fd, buf, buflen)
        if (stat (buf, &st) == 0 && st.st_dev == mydev)
          {
            (void) closedir (dirstream);
-           errno = save;
+           __set_errno (save);
            return 0;
          }
       }
 
   (void) closedir (dirstream);
-  errno = save;
+  __set_errno (save);
   return -1;
 }
 weak_alias (__ttyname_r, ttyname_r)
index 38891c7..813c595 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/wait.h>
 
 
 /* Wait for a child to die.  When one does, put its status in *STAT_LOC
    and return its process ID.  For errors, return (pid_t) -1.  */
 __pid_t
-DEFUN(__wait, (stat_loc), __WAIT_STATUS_DEFN stat_loc)
+__libc_wait (__WAIT_STATUS_DEFN stat_loc)
 {
-  return __waitpid(WAIT_ANY, (int *) stat_loc, 0);
+  return __waitpid (WAIT_ANY, (int *) stat_loc, 0);
 }
 
-weak_alias (__wait, wait)
+weak_alias (__libc_wait, __wait)
+weak_alias (__libc_wait, wait)
index 5eb084a..f805f10 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/wait.h>
 #include <sys/types.h>
@@ -28,12 +27,14 @@ Cambridge, MA 02139, USA.  */
    there.  If the WUNTRACED bit is set in OPTIONS, return status for stopped
    children; otherwise don't.  */
 pid_t
-DEFUN(__wait3, (stat_loc, options, usage),
-      __WAIT_STATUS_DEFN stat_loc AND int options AND struct rusage *usage)
+__wait3 (stat_loc, options, usage)
+     __WAIT_STATUS_DEFN stat_loc;
+     int options;
+     struct rusage *usage;
 {
   if (usage != NULL)
     {
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return (pid_t) -1;
     }
   return __waitpid (WAIT_ANY, stat_loc, options);
index 59b6073..7ef1a5f 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -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;
     }
 
index cbabf5b..9d7d779 100644 (file)
@@ -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)
 
index 910e793..87097d9 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdarg.h>
@@ -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;
 
index 284321d..40322a5 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <stddef.h>
@@ -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)
index f0ae388..d377dd5 100644 (file)
@@ -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 <ansidecl.h>
 #include <sysdep.h>
 #include <errno.h>
 #include <unistd.h>
@@ -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)
index d7f38f9..ec74f77 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <setjmp.h>
 
@@ -25,12 +24,14 @@ Cambridge, MA 02139, USA.  */
    setjmp call there to return VAL, or 1 if VAL is 0.  */
 __NORETURN
 void
-DEFUN(__longjmp, (env, val), CONST __jmp_buf env AND int val)
+__longjmp (env, val)
+     const __jmp_buf env;
+     int val;
 {
   if (val == 0)
     val = 1;
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   /* No way to signal failure. */
 }
 
index 429f2aa..e9a774c 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -26,10 +25,12 @@ Cambridge, MA 02139, USA.  */
    peer and *ADDR_LEN to the address's actual length, and return the
    new socket's descriptor, or -1 for errors.  */
 int
-DEFUN(accept, (fd, addr, addr_len),
-      int fd AND struct sockaddr *addr AND size_t *addr_len)
+accept (fd, addr, addr_len)
+     int fd;
+     struct sockaddr *addr;
+     size_t *addr_len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 06ddbb5..6779ea0 100644 (file)
@@ -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
@@ -16,23 +16,24 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
 
 /* Test for access to FILE.  */
 int
-DEFUN(__access, (file, type), CONST char *file AND int type)
+__access (file, type)
+     const char *file;
+     int type;
 {
   if (file == NULL || (type & ~(R_OK|W_OK|X_OK|F_OK)) != 0)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
-  return(-1);
+  __set_errno (ENOSYS);
+  return -1;
 }
 stub_warning (access)
 
index 1b547f3..0bed4d9 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -24,9 +23,10 @@ Cambridge, MA 02139, USA.  */
    a record for each process as it terminates, to this file.  If NAME is NULL,
    turn accounting off.  This call is restricted to the super-user.  */
 int
-DEFUN(acct, (name), CONST char *name)
+acct (name)
+     const char *name;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 933e2ef..3496121 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/time.h>
 
@@ -25,11 +24,11 @@ Cambridge, MA 02139, USA.  */
    of time adjustment remaining to be done from the last `__adjtime' call.
    This call is restricted to the super-user.  */
 int
-DEFUN(__adjtime, (delta, olddelta),
-      CONST struct timeval *delta AND
-      struct timeval *olddelta)
+__adjtime (delta, olddelta)
+     const struct timeval *delta;
+     struct timeval *olddelta;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (adjtime)
index 78cf673..9c4e71f 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -28,9 +27,10 @@ Cambridge, MA 02139, USA.  */
    to 0 and check its value after calling `alarm', and this might tell you.
    The signal may come late due to processor scheduling.  */
 unsigned int
-DEFUN(alarm, (seconds), unsigned int seconds)
+alarm (seconds)
+     unsigned int seconds;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return 0;
 }
 
index 38ad46a..7f4d814 100644 (file)
@@ -16,16 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
 /* Give the socket FD the local address ADDR (which is LEN bytes long).  */
 int
-DEFUN(bind, (fd, addr, len),
-      int fd AND const struct sockaddr *addr AND size_t len)
+bind (fd, addr, len)
+     int fd;
+     const struct sockaddr *addr;
+     size_t len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3a48ea2..a4ebbf0 100644 (file)
@@ -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
@@ -16,15 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
+#include <unistd.h>
 
 /* Set the end of the process's data space to ADDR.
    Return 0 if successful, -1 if not.  */
 int
-DEFUN(__brk, (addr), PTR addr)
+__brk (addr)
+     void *addr;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (brk)
index f73c981..7e5d825 100644 (file)
@@ -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
@@ -16,23 +16,23 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
 
 /* Change the current directory to PATH.  */
 int
-DEFUN(__chdir, (path), CONST char *path)
+__chdir (path)
+     const char *path;
 {
   if (path == NULL)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
-  return(-1);
+  __set_errno (ENOSYS);
+  return -1;
 }
 stub_warning (chdir)
 
index a906e1b..9380108 100644 (file)
@@ -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
@@ -16,22 +16,23 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
 
 /* Change the flags of FILE to FLAGS.  */
 int
-DEFUN(chflags, (file, flags), CONST char *file AND int flags)
+chflags (file, flags)
+     const char *file;
+     int flags;
 {
   if (file == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3259d3e..e76566c 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
@@ -24,15 +23,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Change the protections of FILE to MODE.  */
 int
-DEFUN(__chmod, (file, mode), CONST char *file AND mode_t mode)
+__chmod (file, mode)
+     const char *file;
+     mode_t mode;
 {
   if (file == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (chmod)
index e9db1ed..32dd189 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -24,16 +23,18 @@ Cambridge, MA 02139, USA.  */
 
 /* Change the owner and group of FILE.  */
 int
-DEFUN(__chown, (file, owner, group),
-      CONST char *file AND uid_t owner AND gid_t group)
+__chown (file, owner, group)
+     const char *file;
+     uid_t owner;
+     gid_t group;
 {
   if (file == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (chown)
index a18d349..f77010b 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Make PATH be the root directory (the starting point for absolute paths).
    This call is restricted to the super-user.  */
 int
-DEFUN(chroot, (path), CONST char *path)
+chroot (path)
+     const char *path;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index c22192b..b0df84a 100644 (file)
@@ -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
@@ -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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/times.h>
 #include <time.h>
 #include <errno.h>
 
 /* Return the time used by the program so far (user time + system time).  */
 clock_t
-DEFUN_VOID(clock)
+clock ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (clock_t) -1;
 }
 
index efa80a7..9374990 100644 (file)
@@ -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
@@ -16,21 +16,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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Close the file descriptor FD.  */
 int
-DEFUN(__close, (fd), int fd)
+__close (fd)
+     int fd;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (close)
index 5fb2ed3..2073556 100644 (file)
@@ -26,7 +26,7 @@ Cambridge, MA 02139, USA.  */
 int
 __closedir (DIR *dirp)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 weak_alias (__closedir, closedir)
index 49300f3..0d642cb 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -25,10 +24,12 @@ Cambridge, MA 02139, USA.  */
    and the only address from which to accept transmissions.
    Return 0 on success, -1 for errors.  */
 int
-DEFUN(connect, (fd, addr, len),
-      int fd AND const struct sockaddr *addr AND size_t len)
+connect (fd, addr, len)
+     int fd;
+     const struct sockaddr *addr;
+     size_t len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 1025d68..5504c47 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -25,9 +24,10 @@ Cambridge, MA 02139, USA.  */
    If S is not NULL, the name is copied into it (it should be at
    least L_ctermid bytes long), otherwise a static buffer is used.  */
 char *
-DEFUN(ctermid, (s), char *s)
+ctermid (s)
+     char *s;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 
index 655ddaf..9d92b54 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdio.h>
 #include <errno.h>
 
@@ -24,9 +23,10 @@ Cambridge, MA 02139, USA.  */
    If S is not NULL, it points to a buffer of at least L_cuserid bytes
    into which the name is copied; otherwise, a static buffer is used.  */
 char *
-DEFUN(cuserid, (s), char *s)
+cuserid (s)
+     char *s;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 
index 9ec1969..06707cd 100644 (file)
@@ -1,5 +1,5 @@
 /* dirfd -- Return the file desciptor used by a DIR stream.  Stub version.
-Copyright (C) 1995 Free Software Foundation, Inc.
+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
@@ -25,7 +25,7 @@ int
 dirfd (dirp)
      FILE *dirp;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index f15a1be..6c0f63e 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <unistd.h>
 
 /* Duplicate FD, returning a new file descriptor open on the same file.  */
 int
-DEFUN(__dup, (fd), int fd)
+__dup (fd)
+     int fd;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (dup)
index a0f7aad..dd37b28 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -25,11 +24,13 @@ Cambridge, MA 02139, USA.  */
 /* Duplicate FD to FD2, closing the old FD2 and making FD2 be
    open the same file as FD is.  Return FD2 or -1.  */
 int
-DEFUN(__dup2, (fd, fd2), int fd AND int fd2)
+__dup2 (fd, fd2)
+     int fd;
+     int fd2;
 {
   if (fd < 0 || fd2 < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
@@ -37,7 +38,7 @@ DEFUN(__dup2, (fd, fd2), int fd AND int fd2)
     /* No way to check that they are valid.  */
     return fd2;
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (dup2)
index 1170808..0a0f80a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 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
@@ -36,3 +36,5 @@ Cambridge, MA 02139, USA.  */
 #define ENFILE  9
 #define EMFILE  10
 #endif
+
+#define __set_errno(val) errno = (val)
index 1769e0d..79296a7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for access to FILE using effective UID and GID.  Stub version.
-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
@@ -28,11 +28,11 @@ euidaccess (file, type)
 {
   if (file == NULL || (type & ~(R_OK|W_OK|X_OK|F_OK)) != 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (euidaccess)
index 680d237..61a5df3 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -25,17 +24,18 @@ Cambridge, MA 02139, USA.  */
 /* Replace the current process, executing PATH with arguments ARGV and
    environment ENVP.  ARGV and ENVP are terminated by NULL pointers.  */
 int
-DEFUN(__execve, (path, argv, envp),
-      CONST char *path AND
-      char *CONST argv[] AND char *CONST envp[])
+__execve (path, argv, envp)
+     const char *path;
+     char *const argv[];
+     char *const envp[];
 {
   if (path == NULL || argv == NULL || envp == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (execve)
index ba36ed6..8eb7700 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
 
 /* Change the current directory to FD.  */
 int
-DEFUN(fchdir, (fd), int fd)
+fchdir (fd)
+     int fd;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS(;
   return -1;
 }
 
index e9640d2..4f59ad3 100644 (file)
@@ -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
@@ -16,22 +16,23 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
 
 /* Change the flags of the file FD refers to to FLAGS.  */
 int
-DEFUN(fchflags, (fd, flags), int fd AND int flags)
+fchflags (fd, flags)
+     int fd;
+     int flags;
 {
   if (fd < 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 43d4919..f8c5c80 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
@@ -24,15 +23,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Change the protections of the file FD refers to to MODE.  */
 int
-DEFUN(__fchmod, (fd, mode), int fd AND mode_t mode)
+__fchmod (fd, mode)
+     int fd;
+     mode_t mode;
 {
   if (fd < 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL(;
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (fchmod)
index 4af1d0d..16f7f11 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -24,16 +23,18 @@ Cambridge, MA 02139, USA.  */
 
 /* Change the owner and group of the file referred to by FD.  */
 int
-DEFUN(__fchown, (fd, owner, group),
-      int fd AND uid_t owner AND gid_t group)
+__fchown (fd, owner, group)
+     int fd;
+     uid_t owner;
+     gid_t group;
 {
   if (fd < 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (fchown)
index e35021a..21839aa 100644 (file)
@@ -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
@@ -16,21 +16,22 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <fcntl.h>
 
 /* Perform file control operations on FD.  */
 int
-DEFUN(__fcntl, (fd, cmd), int fd AND int cmd DOTS)
+__fcntl (fd, cmd)
+     int fd;
+     int cmd;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (fcntl)
index 4ab921b..3ce0739 100644 (file)
@@ -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
@@ -16,15 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
 /* Open a new stream on a given system file descriptor.  */
 FILE *
-DEFUN(fdopen, (fd, mode), int fd AND CONST char *mode)
+fdopen (fd, mode)
+     int fd;
+     const char *mode;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 
index c0990f5..0772ed5 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -25,17 +24,18 @@ Cambridge, MA 02139, USA.  */
 /* Execute the file FD refers to, overlaying the running program image.
    ARGV and ENVP are passed to the new program, as for `execve'.  */
 int
-DEFUN(fexecve, (fd, argv, envp),
-      int fd AND
-      char *CONST argv[] AND char *CONST envp[])
+fexecve (fd, argv, envp)
+     int fd;
+     char *const argv[];
+     char *const envp[];
 {
   if (fd < 0 || argv == NULL || envp == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index bdd7858..d74f826 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/file.h>
 
 /* Apply or remove an advisory lock, according to OPERATION,
    on the file FD refers to.  */
 int
-DEFUN(__flock, (fd, operation),
-      int fd AND int operation)
+__flock (fd, operation)
+     int fd;
+     int operation;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 0b0b63a..ffb95e7 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -25,9 +24,9 @@ Cambridge, MA 02139, USA.  */
    Return -1 for errors, 0 to the new process,
    and the process ID of the new process to the old process.  */
 int
-DEFUN_VOID(__fork)
+__fork ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (fork)
index 75880fd..36b1369 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -24,18 +23,20 @@ Cambridge, MA 02139, USA.  */
 
 /* Get file-specific information about descriptor FD.  */
 long int
-DEFUN(__fpathconf, (fd, name), int fd AND int name)
+__fpathconf (fd, name)
+     int fd;
+     int name;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
   switch (name)
     {
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
 
     case _PC_LINK_MAX:
@@ -51,7 +52,7 @@ DEFUN(__fpathconf, (fd, name), int fd AND int name)
       break;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 5ef5ccd..9bc0900 100644 (file)
@@ -25,10 +25,9 @@ Cambridge, MA 02139, USA.  */
 int
 __fstatfs (int fd, struct statfs *buf)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (statfs)
 
 weak_alias (__fstatfs, fstatfs)
-
index 84780da..6091159 100644 (file)
@@ -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
@@ -16,15 +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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Make all changes done to FD actually appear on disk.  */
 int
-DEFUN(fsync, (fd), int fd)
+fsync (fd)
+     int fd;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index f9474dd..75d6bbc 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/types.h>
 #include <errno.h>
 
 /* Truncate the file FD refers to to LENGTH bytes.  */
 int
-DEFUN(ftruncate, (fd, length),
-      int fd AND off_t length)
+ftruncate (fd, length)
+     int fd;
+     off_t length;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 7c1eeff..4318a08 100644 (file)
@@ -26,22 +26,22 @@ __fxstat (int vers, int fd, struct stat *buf)
 {
   if (vers != _STAT_VER)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
   else if (buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (__fxstat)
index 2aca490..4318b5b 100644 (file)
@@ -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
@@ -30,7 +30,7 @@ Cambridge, MA 02139, USA.  */
 char *
 __getcwd (char *buf, size_t size)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 weak_alias (__getcwd, getcwd)
index 8cf890a..6e7793a 100644 (file)
@@ -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
@@ -16,16 +16,18 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 #include <sys/types.h>
 
 int
-DEFUN(__getdirentries, (fd, buf, nbytes, basep),
-      int fd AND char *buf AND size_t nbytes AND off_t *basep)
+__getdirentries (fd, buf, nbytes, basep)
+     int fd;
+     char *buf;
+     size_t nbytes;
+     off_t *basep;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (getdirentries)
index c2159df..5156bbd 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -24,10 +23,11 @@ Cambridge, MA 02139, USA.  */
    The result is null-terminated if LEN is large enough for the full
    name and the terminator.  */
 int
-DEFUN(getdomainname, (name, len),
-      char *name AND size_t len)
+getdomainname (name, len)
+     char *name;
+     size_t len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index e9c9b61..cf3dd91 100644 (file)
@@ -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
@@ -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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Return the maximum number of file descriptors
    the current process could possibly have.  */
 int
-DEFUN_VOID(__getdtablesize)
+__getdtablesize ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (getdtablesize)
index 6e4e611..cbba8e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,15 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Get the effective group ID of the calling process.  */
 __gid_t
-DEFUN_VOID(__getegid)
+__getegid ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (getegid)
index a53e25b..fab9f08 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdlib.h>
 
 /* Return the value of the environment variable NAME.  */
 char *
-DEFUN(getenv, (name), CONST char *name)
+getenv (name)
+     const char *name;
 {
-  errno = ENOSYS;
-  return(NULL);
+  __set_errno (ENOSYS);
+  return NULL;
 }
 
 
index f5f4375..7c470fa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 
 /* Get the effective user ID of the calling process.  */
 __uid_t
-DEFUN_VOID(__geteuid)
+__geteuid ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (geteuid)
index f2bfa76..a4e7204 100644 (file)
@@ -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.
 
 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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 /* Get the real group ID of the calling process.  */
 gid_t
-DEFUN_VOID(__getgid)
+__getgid ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (getgid)
index f98d966..7d766d7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -28,14 +27,16 @@ Cambridge, MA 02139, USA.  */
    the calling process is in.  Otherwise, fill in the group IDs
    of its supplementary groups in LIST and return the number written.  */
 int
-DEFUN(__getgroups, (size, list), int size AND gid_t *list)
+__getgroups (size, list)
+     int size;
+     gid_t *list;
 {
 #if defined (NGROUPS_MAX) && NGROUPS_MAX == 0
   /* The system has no supplementary groups.  */
   return 0;
 #endif
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 8ff3827..83c5755 100644 (file)
@@ -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
@@ -16,15 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Return the current machine's Internet number.  */
 long int
-DEFUN_VOID(gethostid)
+gethostid ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1L;
 }
 
index 1cf3c7b..d815f2d 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -24,10 +23,11 @@ Cambridge, MA 02139, USA.  */
    The result is null-terminated if LEN is large enough for the full
    name and the terminator.  */
 int
-DEFUN(__gethostname, (name, len),
-      char *name AND size_t len)
+__gethostname (name, len)
+     char *name;
+     size_t len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (gethostname)
index 75b5488..77b4ebd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 #include <sys/time.h>
@@ -24,16 +23,17 @@ Cambridge, MA 02139, USA.  */
 /* Set *VALUE to the current setting of timer WHICH.
    Return 0 on success, -1 on errors.  */
 int
-DEFUN(__getitimer, (which, value),
-      enum __itimer_which which AND struct itimerval *value)
+__getitimer (which, value)
+     enum __itimer_which which;
+     struct itimerval *value;
 {
   if (value == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (getitimer)
index d350bfb..484c159 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 #include <unistd.h>
@@ -24,9 +23,9 @@ Cambridge, MA 02139, USA.  */
 /* Return the login name of the user, or NULL if it can't be determined.
    The returned pointer, if not NULL, is good only until the next call.  */
 char *
-DEFUN_VOID(getlogin)
+getlogin ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 
index bf29c7c..fa9bb75 100644 (file)
@@ -28,7 +28,7 @@ getlogin_r (name, name_len)
      char *name;
      size_t name_len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return errno;
 }
 
index 1ee4415..2c55df1 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,15 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 
 /* Return the system page size.  */
 size_t
-DEFUN_VOID(__getpagesize)
+__getpagesize ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return 0;
 }
 stub_warning (getpagesize)
index 79497ca..85256ad 100644 (file)
@@ -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
@@ -16,17 +16,18 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
 /* Put the address of the peer connected to socket FD into *ADDR
    (which is *LEN bytes long), and its actual length into *LEN.  */
 int
-DEFUN(getpeername, (fd, addr, len),
-      int fd AND struct sockaddr *addr AND size_t *len)
+getpeername (fd, addr, len)
+     int fd;
+     struct sockaddr *addr;
+     size_t *len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 44efc12..e6cada2 100644 (file)
@@ -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
@@ -16,14 +16,13 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
-#include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 /* Get the process group ID of process PID.  */
 int
-DEFUN(__getpgid, (pid), pid_t pid)
+__getpgid (pid)
+     pid_t pid;
 {
   return pid;
 }
index 270c909..c2926b1 100644 (file)
@@ -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
@@ -16,17 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 
 /* Get the process ID of the calling process.  */
 int
-DEFUN_VOID(__getpid)
+__getpid ()
 {
-  errno = ENOSYS;
-  return(-1);
+  __set_errno (ENOSYS);
+  return -1;
 }
 stub_warning (getpid)
 
index d6547c7..e5cc73f 100644 (file)
@@ -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
@@ -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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 
 /* Get the parent process ID of the calling process.  */
 int
-DEFUN_VOID(__getppid)
+__getppid ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (getppid)
index eb6b43d..599fed2 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/resource.h>
 
@@ -25,10 +24,11 @@ Cambridge, MA 02139, USA.  */
    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;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index a3f3144..9e41e07 100644 (file)
@@ -24,7 +24,7 @@ Cambridge, MA 02139, USA.  */
 int
 __getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 weak_alias (__getrlimit, getrlimit)
index 6417c8d..c13ae7a 100644 (file)
@@ -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
@@ -16,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/resource.h>
 #include <errno.h>
 
 /* Return resource usage information on process indicated by WHO
    and put it in *USAGE.  Returns 0 for success, -1 for failure.  */
 int
-DEFUN(__getrusage, (who, usage),
-      enum __rusage_who who AND struct rusage *usage)
+__getrusage (who, usage)
+     enum __rusage_who who;
+     struct rusage *usage;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (getrusage)
index af474c5..9ae0c84 100644 (file)
@@ -1,5 +1,5 @@
 /* getsid -- Return session ID of a process.  Stub version.
-Copyright (C) 1995 Free Software Foundation, Inc.
+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
@@ -24,6 +24,6 @@ Cambridge, MA 02139, USA.  */
 pid_t
 getsid (pid_t pid)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (pid_t) -1;
 }
index a587e26..17bb2b8 100644 (file)
@@ -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
@@ -16,16 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
 /* Put the local address of FD into *ADDR and its length in *LEN.  */
 int
-DEFUN(getsockname, (fd, addr, len),
-      int fd AND struct sockaddr *addr AND size_t *len)
+getsockname (fd, addr, len)
+     int fd;
+     struct sockaddr *addr;
+     size_t *len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index ab34d8b..e3ea53d 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -24,11 +23,14 @@ Cambridge, MA 02139, USA.  */
    into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
    actual length.  Returns 0 on success, -1 for errors.  */
 int
-DEFUN(getsockopt, (fd, level, optname, optval, optlen),
-      int fd AND int level AND int optname AND
-      PTR optval AND size_t *optlen)
+getsockopt (fd, level, optname, optval, optlen)
+     int fd;
+     int level;
+     int optname;
+     void *optval;
+     size_t *optlen;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index c8fe700..1d0781d 100644 (file)
@@ -48,21 +48,21 @@ int
 __get_phys_pages ()
 {
   /* We have no general way to determine this value.  */
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 weak_alias (__get_phys_pages, get_phys_pages)
 
-link_warning (get_phys_pages, "warning: get_phys_pages will always fail")
+stub_warning (get_phys_pages)
 
 
 int
 __get_avphys_pages ()
 {
   /* We have no general way to determine this value.  */
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 weak_alias (__get_avphys_pages, get_avphys_pages)
 
-link_warning (get_avphys_pages, "warning: get_avphys_pages will always fail")
+stub_warning (get_avphys_pages)
index 74e4619..f6f38f2 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/time.h>
 
@@ -24,10 +23,11 @@ Cambridge, MA 02139, USA.  */
    putting it into *TV and *TZ.  If TZ is NULL, *TZ is not filled.
    Returns 0 on success, -1 on errors.  */
 int
-DEFUN(__gettimeofday, (tv, tz),
-      struct timeval *tv AND struct timezone *tz)
+__gettimeofday (tv, tz)
+     struct timeval *tv;
+     struct timezone *tz;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (gettimeofday)
index ebdd268..2c843e4 100644 (file)
@@ -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.
 
 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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 /* Get the real user ID of the calling process.  */
 uid_t
-DEFUN_VOID(__getuid)
+__getuid ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (getuid)
index b702dda..c06d075 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,23 +16,23 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sgtty.h>
 #include <stddef.h>
 
 /* Fill in *PARAMS with terminal parameters associated with FD.  */
 int
-DEFUN(gtty, (fd, params),
-      int fd AND struct sgttyb *params)
+gtty (fd, params)
+     int fd;
+     struct sgttyb *params;
 {
   if (params == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 579ddab..23d13cd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 93, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/ioctl.h>
 
 /* Perform the I/O control operation specified by REQUEST on FD.
    The actual type and use of ARG and the return value depend on REQUEST.  */
 int
-DEFUN(__ioctl, (fd, request),
-      int fd AND unsigned long int request DOTS)
+__ioctl (fd, request)
+     int fd;
+     unsigned long int request;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (ioctl)
index ae9510b..45e9500 100644 (file)
@@ -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
@@ -16,15 +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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Return 1 if FD is a terminal, 0 if not.  */
 int
-DEFUN(__isatty, (fd), int fd)
+__isatty (fd)
+     int fd;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 560efd8..5baf9e5 100644 (file)
@@ -17,13 +17,14 @@ 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.  */
 
+#include <errno.h>
 #include <sys/stat.h>
 
 
 int
 isfdtype (int fildes, int fdtype)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (isfdtype)
index b9a8b0e..013b27c 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -25,9 +24,11 @@ Cambridge, MA 02139, USA.  */
    send SIG to all processes in the current process's process group.
    If PID is < -1, send SIG to all processes in process group - PID.  */
 int
-DEFUN(__kill, (pid, sig), int pid AND int sig)
+__kill (pid, sig)
+     int pid;
+     int sig;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (kill)
index 6e8424d..047760b 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -25,9 +24,11 @@ Cambridge, MA 02139, USA.  */
    If PGRP is zero, send SIG to all processes in
    the current process's process group.  */
 int
-DEFUN(killpg, (pgrp, sig), __pid_t pgrp AND int sig)
+killpg (pgrp, sig)
+     __pid_t pgrp;
+     int sig;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index ca2d77c..58c60e5 100644 (file)
@@ -25,9 +25,9 @@ Cambridge, MA 02139, USA.  */
    initialized with __libc_lock_init before it can be used (or define it
    with __libc_lock_define_initialized, below).  Use `extern' for CLASS to
    declare a lock defined in another module.  In public structure
-   definitions, the lock element must come last, because its storage size
-   will not be known outside of libc.  (Or you can use a pointer to the
-   lock structure; i.e. NAME begins with a `*'.)  */
+   definitions you must use a pointer to the lock structure (i.e., NAME
+   begins with a `*'), because its storage size will not be known outside
+   of libc.  */
 #define __libc_lock_define(CLASS,NAME)
 
 /* Define an initialized lock variable NAME with storage class CLASS.  */
index c5ea713..643223d 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -24,15 +23,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Make a link to FROM called TO.  */
 int
-DEFUN(__link, (from, to), CONST char *from AND CONST char *to)
+__link (from, to)
+     const char *from;
+     const char *to;
 {
   if (from == NULL || to == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (link)
index 6b7d4df..c042b1c 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -24,10 +23,11 @@ Cambridge, MA 02139, USA.  */
    N connection requests will be queued before further requests are refused.
    Returns 0 on success, -1 for errors.  */
 int
-DEFUN(listen, (fd, n),
-      int fd AND unsigned int n)
+listen (fd, n)
+     int fd;
+     unsigned int n;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 6d9c366..e285cb5 100644 (file)
@@ -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
@@ -16,18 +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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 /* Seek to OFFSET on FD, starting from WHENCE.  */
 off_t
-DEFUN(__lseek, (fd, offset, whence), int fd AND off_t offset AND int whence)
+__lseek (fd, offset, whence)
+     int fd;
+     off_t offset;
+     int whence;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
   switch (whence)
@@ -37,11 +39,11 @@ DEFUN(__lseek, (fd, offset, whence), int fd AND off_t offset AND int whence)
     case SEEK_END:
       break;
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (lseek)
index 5729925..edbe2fc 100644 (file)
@@ -27,11 +27,11 @@ __lxstat (int vers, const char *file, struct stat *buf)
 {
   if (vers != _STAT_VER || file == NULL || buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (__lxstat)
index e3dbacd..dbe2c7c 100644 (file)
@@ -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
@@ -26,7 +26,7 @@ Cambridge, MA 02139, USA.  */
 int
 madvise (caddr_t addr, size_t len, int advice)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 9822b5f..251ea11 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
@@ -25,15 +24,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Create a directory named PATH with protections MODE.  */
 int
-DEFUN(__mkdir, (path, mode), CONST char *path AND mode_t mode)
+__mkdir (path, mode)
+     const char *path;
+     mode_t mode;
 {
   if (path == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (mkdir)
index d8aa882..eaf0d2f 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
@@ -25,15 +24,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Create a named pipe (FIFO) named PATH with protections MODE.  */
 int
-DEFUN(mkfifo, (path, mode), CONST char *path AND mode_t mode)
+mkfifo (path, mode)
+     const char *path;
+     mode_t mode;
 {
   if (path == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 1adf6c0..47dd712 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <string.h>
 #include <errno.h>
 
@@ -25,15 +24,16 @@ Cambridge, MA 02139, USA.  */
    they are replaced with a string that makes the filename unique.
    Returns a file descriptor open on the file for reading and writing.  */
 int
-DEFUN(mkstemp, (template), char *template)
+mkstemp (template)
+     char *template;
 {
-  if (strcmp(&template[strlen(template) - 6], "XXXXXX"))
+  if (strcmp (&template[strlen (template) - 6], "XXXXXX"))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index ad66023..06fe3de 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <string.h>
 #include <errno.h>
 
@@ -24,15 +23,16 @@ Cambridge, MA 02139, USA.  */
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the filename unique.  */
 char *
-DEFUN(mktemp, (template), char *template)
+mktemp (template)
+     char *template;
 {
-  if (strcmp(&template[strlen(template) - 6], "XXXXXX"))
+  if (strcmp (&template[strlen (template) - 6], "XXXXXX"))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return template;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 
index e230c9d..f127eae 100644 (file)
@@ -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
@@ -32,7 +32,7 @@ Cambridge, MA 02139, USA.  */
 caddr_t
 __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (caddr_t) -1;
 }
 
index cb66927..cda38cf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 
@@ -27,9 +26,10 @@ Cambridge, MA 02139, USA.  */
    and return the start of data space, or NULL on errors.
    If INCREMENT is negative, shrink data space.  */
 __ptr_t
-DEFUN(__default_morecore, (increment), ptrdiff_t increment)
+__default_morecore (increment)
+     ptrdiff_t increment;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 
index 2626e4b..81e54cd 100644 (file)
@@ -27,7 +27,7 @@ Cambridge, MA 02139, USA.  */
 int
 __mprotect (caddr_t addr, size_t len, int prot)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 weak_alias (__mprotect, mprotect)
index 8212f09..5c2eea7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -29,7 +29,7 @@ msgctl (msqid, cmd, buf)
      int cmd;
      struct msqid_ds *buf;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3ee2b3d..343c6d8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -28,7 +28,7 @@ msgget (key, msgflg)
      key_t key;
      int msgflg;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3d5dfc5..8638249 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -34,7 +34,7 @@ msgrcv (msqid, msgp, msgsz, msgtyp, msgflg)
      long msgtyp;
      int msgflg;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 77d1880..04df3d9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -33,7 +33,7 @@ msgsnd (msqid, msgp, msgsz, msgflg)
      size_t msgsz;
      int msgflg;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index a01c474..21421b7 100644 (file)
@@ -27,7 +27,7 @@ Cambridge, MA 02139, USA.  */
 int
 msync (caddr_t addr, size_t len)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index ba61e0f..55b674e 100644 (file)
@@ -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
@@ -26,7 +26,7 @@ Cambridge, MA 02139, USA.  */
 int
 __munmap (caddr_t addr, size_t len)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 97cdd50..0995bb9 100644 (file)
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.  */
 int
 nanosleep (const struct timespec *requested_time, struct timespec *remaining)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (nanosleep)
index 5c3768a..ae7f88f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Increment the scheduling priority of the calling process by INCR.
    The superuser may use a negative INCR to decrement the priority.  */
 int
-DEFUN(nice, (incr), int incr)
+nice (incr)
+     int incr;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 1407033..3d421d7 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <nlist.h>
 #include <stddef.h>
@@ -25,16 +24,17 @@ Cambridge, MA 02139, USA.  */
    which is terminated by an element with a NULL `n_un.n_name' member,
    and fill in the elements of NL.  */
 int
-DEFUN(nlist, (file, nl),
-      CONST char *file AND struct nlist *nl)
+nlist (file, nl)
+     const char *file;
+     struct nlist *nl;
 {
   if (nl == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index af0d272..08c4b78 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdarg.h>
@@ -25,13 +24,15 @@ 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;
 
   if (file == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -43,7 +44,7 @@ DEFUN(__open, (file, oflag), CONST char *file AND int oflag DOTS)
       va_end(arg);
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (open)
index f0d7784..f32a6b0 100644 (file)
@@ -25,7 +25,7 @@ Cambridge, MA 02139, USA.  */
 DIR *
 __opendir (const char *name)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 weak_alias (__opendir, opendir)
index 1a544c3..92891fd 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -24,11 +23,13 @@ Cambridge, MA 02139, USA.  */
 
 /* Get file-specific information about PATH.  */
 long int
-DEFUN(__pathconf, (path, name), CONST char *path AND int name)
+__pathconf (path, name)
+     const char *path;
+     int name;
 {
   if (path == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
   return __fpathconf (0, name);
index b2a7add..8a88501 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -26,7 +26,7 @@ Cambridge, MA 02139, USA.  */
 int
 pause ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index acef99b..c3ed56b 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <stddef.h>
@@ -26,15 +25,16 @@ Cambridge, MA 02139, USA.  */
    bytes written on PIPEDES[1] can be read from PIPEDES[0].
    Returns 0 if successful, -1 if not.  */
 int
-DEFUN(__pipe, (__pipedes), int __pipedes[2])
+__pipe (__pipedes)
+     int __pipedes[2];
 {
   if (__pipedes == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (pipe)
index afa2c47..36f6f1b 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <signal.h>
 #include <stdio.h>
@@ -26,30 +25,33 @@ Cambridge, MA 02139, USA.  */
 /* Open a new stream that is a one-way pipe to a
    child process running the given shell command.  */
 FILE *
-DEFUN(popen, (command, mode), CONST char *command AND CONST char *mode)
+popen (command, mode)
+     const char *command;
+     const char *mode;
 {
   if (command == NULL || mode == NULL || (*mode != 'r' && *mode != 'w'))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 \f
 /* Close a stream opened by popen and return its status.
    Returns -1 if the stream was not opened by popen.  */
 int
-DEFUN(pclose, (stream), register FILE *stream)
+pclose (stream)
+     register FILE *stream;
 {
   if (!__validfp (stream) || !stream->__ispipe)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 40fc2c9..9c7a65d 100644 (file)
@@ -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
@@ -31,7 +31,7 @@ poll (fds, nfds, timeout)
      unsigned long int nfds;
      int timeout;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index ab8e1d4..eb5538f 100644 (file)
@@ -1,5 +1,5 @@
 /* Low-level statistical profiling support function.  Stub version.
-Copyright (C) 1995 Free Software Foundation, Inc.
+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
@@ -34,7 +34,7 @@ profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
     /* Disable profiling.  */
     return 0;
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (profil)
index 31fbbb1..d3a2d57 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
+/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/ptrace.h>
 #include <sys/types.h>
@@ -32,11 +31,12 @@ Cambridge, MA 02139, USA.  */
      pid_t PID, void *ADDR, int DATA, void *ADDR2
    after PID.  */
 int
-DEFUN(ptrace, (request), enum __ptrace_request request DOTS)
+ptrace (request)
+     enum __ptrace_request request;
 {
   pid_t pid;
-  PTR addr;
-  PTR addr2;
+  void *addr;
+  void *addr2;
   int data;
   va_list ap;
 
@@ -63,7 +63,7 @@ DEFUN(ptrace, (request), enum __ptrace_request request DOTS)
     case PTRACE_SETFPAREGS:
       va_start(ap, request);
       pid = va_arg(ap, pid_t);
-      addr = va_arg(ap, PTR);
+      addr = va_arg(ap, void *);
       va_end(ap);
       break;
 
@@ -72,7 +72,7 @@ DEFUN(ptrace, (request), enum __ptrace_request request DOTS)
     case PTRACE_POKEUSER:
       va_start(ap, request);
       pid = va_arg(ap, pid_t);
-      addr = va_arg(ap, PTR);
+      addr = va_arg(ap, void *);
       data = va_arg(ap, int);
       va_end(ap);
       break;
@@ -83,18 +83,18 @@ DEFUN(ptrace, (request), enum __ptrace_request request DOTS)
     case PTRACE_WRITETEXT:
       va_start(ap, request);
       pid = va_arg(ap, pid_t);
-      addr = va_arg(ap, PTR);
+      addr = va_arg(ap, void *);
       data = va_arg(ap, int);
-      addr2 = va_arg(ap, PTR);
+      addr2 = va_arg(ap, void *);
       va_end(ap);
       break;
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3d845d8..d50b4a5 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdlib.h>
 
 /* Put STRING, which is of the form "NAME=VALUE", in the environment.
    If there is no `=', remove NAME from the environment.  */
 int
-DEFUN(putenv, (string), CONST char *string)
+putenv (string)
+     const char *string;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index ea89874..cac49df 100644 (file)
@@ -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
@@ -16,15 +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 <ansidecl.h>
 #include <signal.h>
 #include <errno.h>
 
 /* Raise the signal SIG.  */
 int
-DEFUN(raise, (sig), int sig)
+raise (sig)
+     int sig;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 0143132..724f8f8 100644 (file)
@@ -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
@@ -16,32 +16,31 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <stddef.h>
 
 /* 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)
 {
   if (nbytes == 0)
     return 0;
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
   if (buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (read)
 
-weak_alias (__read, read)
+weak_alias (__libc_read, __read)
+weak_alias (__libc_read, read)
index d210906..1555706 100644 (file)
@@ -24,7 +24,7 @@ Cambridge, MA 02139, USA.  */
 struct dirent *
 __readdir (DIR *dirp)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 weak_alias (__readdir, readdir)
index b640a8d..99c8525 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -24,10 +23,12 @@ Cambridge, MA 02139, USA.  */
    LEN bytes of BUF.  The contents are not null-terminated.
    Returns the number of characters read, or -1 for errors.  */
 int
-DEFUN(__readlink, (path, buf, len),
-      CONST char *path AND char *buf AND size_t len)
+__readlink (path, buf, len)
+     const char *path;
+     char *buf;
+     size_t len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (readlink)
index 03d6bf9..b537499 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/uio.h>
@@ -27,10 +26,12 @@ Cambridge, MA 02139, USA.  */
    Operates just like `read' (see <unistd.h>) except that data are
    put in VECTOR instead of a contiguous buffer.  */
 int
-DEFUN(readv, (fd, vector, count),
-      int fd AND CONST struct iovec *vector AND size_t count)
+readv (fd, vector, count)
+     int fd;
+     const struct iovec *vector;
+     size_t count;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 5cc05eb..8db83af 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,15 +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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Reboot the system.  */
 int
-DEFUN(reboot, (howto), int howto)
+reboot (howto)
+     int howto;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 21c9cfa..e09ef4f 100644 (file)
@@ -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
@@ -16,17 +16,19 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
 /* Read N bytes into BUF from socket FD.
    Returns the number read or -1 for errors.  */
 int
-DEFUN(recv, (fd, buf, n, flags),
-      int fd AND PTR buf AND size_t n AND int flags)
+recv (fd, buf, n, flags)
+     int fd;
+     void *buf;
+     size_t n;
+     int flags;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index aca6d23..47973ed 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -24,11 +23,15 @@ Cambridge, MA 02139, USA.  */
    at address ADDR (which is ADDR_LEN bytes long).
    Returns the number read or -1 for errors.  */
 int
-DEFUN(recvfrom, (fd, buf, n, flags, addr, addr_len),
-      int fd AND PTR buf AND size_t n AND int flags AND
-      struct sockaddr *addr AND size_t *addr_len)
+recvfrom (fd, buf, n, flags, addr, addr_len)
+     int fd;
+     void *buf;
+     size_t n;
+     int flags;
+     struct sockaddr *addr;
+     size_t *addr_len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index eecff02..27f463c 100644 (file)
@@ -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
@@ -16,17 +16,18 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
 /* Receive a message as described by MESSAGE from socket FD.
    Returns the number of bytes read or -1 for errors.  */
 int
-DEFUN(recvmsg, (fd, message, flags),
-      int fd AND struct msghdr *message AND int flags)
+recvmsg (fd, message, flags)
+     int fd;
+     struct msghdr *message;
+     int flags;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index c044e0a..a8a4d3c 100644 (file)
@@ -1,5 +1,5 @@
 /* ANSI C `remove' function to delete a file or directory.  Stub version.
-Copyright (C) 1995 Free Software Foundation, Inc.
+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
@@ -24,7 +24,7 @@ int
 remove (file)
      const char *file;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index e880d79..b0a8521 100644 (file)
@@ -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
@@ -16,23 +16,24 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdio.h>
 #include <errno.h>
 
 
 /* Rename the file OLD to NEW.  */
 int
-DEFUN(rename, (old, new), CONST char *old AND CONST char *new)
+rename (old, new)
+     const char *old;
+     const char *new;
 {
   if (old == NULL || new == NULL)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
-  return(-1);
+  __set_errno (ENOSYS);
+  return -1;
 }
 
 
index 295dc2b..94107ef 100644 (file)
@@ -1,5 +1,5 @@
 /* Revoke the access of all descriptors currently open on a file.
-Copyright (C) 1995 Free Software Foundation, Inc.
+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
@@ -24,7 +24,7 @@ int
 revoke (file)
      const char *file;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (revoke)
index d4f0ce9..1ad85c4 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <dirent.h>
@@ -24,9 +23,10 @@ Cambridge, MA 02139, USA.  */
 
 /* Rewind DIRP to the beginning of the directory.  */
 void
-DEFUN(rewinddir, (dirp), DIR *dirp)
+rewinddir (dirp)
+     DIR *dirp;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   /* No way to indicate failure.       */
 }
 
index 828a261..7e54ee4 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -24,15 +23,16 @@ Cambridge, MA 02139, USA.  */
 
 /* Remove the directory PATH.  */
 int
-DEFUN(__rmdir, (path), CONST char *path)
+__rmdir (path)
+     const char *path;
 {
   if (path == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (rmdir)
index 46d9ecd..0e9d07d 100644 (file)
@@ -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
@@ -16,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 
 /* Extend the process's data space by INCREMENT.
    If INCREMENT is negative, shrink data space by - INCREMENT.
    Return the address of the start of data space, or -1 for errors.  */
-PTR
-DEFUN(__sbrk, (increment), int increment)
+void *
+__sbrk (increment)
+     int increment;
 {
-  errno = ENOSYS;
-  return (PTR) -1;
+  __set_errno (ENOSYS);
+  return (void *) -1;
 }
 stub_warning (sbrk)
 
index 0da92bc..e908638 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 int
 __sched_getparam (pid_t pid, struct sched_param *param)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sched_getparam)
index bb64838..9fe4921 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 int
 __sched_getscheduler (pid_t pid)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sched_getscheduler)
index 7ff5af3..cf76994 100644 (file)
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.  */
 int
 __sched_get_priority_max (int algorithm)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sched_get_priority_max)
index 370f10c..2f79194 100644 (file)
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.  */
 int
 __sched_get_priority_min (int algorithm)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sched_get_priority_min)
index b818561..f23aacb 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 int
 __sched_rr_get_interval (pid_t pid, struct timespec *t)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sched_rr_get_interval)
index 513c717..c29bcc7 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 int
 __sched_setparam (pid_t pid, const struct sched_param *param)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sched_setparam)
index 98008e6..b845c2e 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 int
 __sched_setscheduler (pid_t pid, int policy, const struct sched_param *param)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sched_setscheduler)
index 244ac15..6c37285 100644 (file)
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.  */
 int
 __sched_yield (void)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sched_yield)
index 449aa62..fe40c8b 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <stddef.h>
@@ -24,15 +23,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Seek to position POS in DIRP.  */
 void
-DEFUN(seekdir, (dirp, pos), DIR *dirp AND off_t pos)
+seekdir (dirp, pos)
+     DIR *dirp
+     off_t pos;
 {
   if (dirp == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
 }
 
 
index 837f0ad..1c5e12f 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <errno.h>
@@ -27,11 +26,14 @@ Cambridge, MA 02139, USA.  */
    after waiting the interval specified therein.  Returns the number of ready
    descriptors, or -1 for errors.  */
 int
-DEFUN(__select, (nfds, readfds, writefds, exceptfds, timeout),
-      int nfds AND fd_set *readfds AND fd_set *writefds AND
-      fd_set *exceptfds AND struct timeval *timeout)
+__select (nfds, readfds, writefds, exceptfds, timeout)
+     int nfds;
+     fd_set *readfds;
+     fd_set *writefds;
+     fd_set *exceptfds;
+     struct timeval *timeout;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (select)
index 8f2fe99..cf44af8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -30,7 +30,7 @@ semctl (semid, semnum, cmd, arg)
      int cmd;
      union semun arg;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3ccf271..327bc8e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -29,7 +29,7 @@ semget (key, nsems, semflg)
      int nsems;
      int semflg;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 2bba862..29bf159 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -28,7 +28,7 @@ semop (semid, sops, nsops)
      struct sembuf *sops;
      unsigned int nsops;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3832185..e921fd7 100644 (file)
@@ -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
@@ -16,16 +16,18 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
 /* Send N bytes of BUF to socket FD.  Returns the number sent or -1.  */
 int
-DEFUN(send, (fd, buf, n, flags),
-      int fd AND PTR buf AND size_t n AND int flags)
+send (fd, buf, n, flags)
+     int fd;
+     void *buf;
+     size_t n;
+     int flags;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 2066e52..12d1698 100644 (file)
@@ -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
@@ -16,17 +16,18 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
 /* Send a message described MESSAGE on socket FD.
    Returns the number of bytes sent, or -1 for errors.  */
 int
-DEFUN(sendmsg, (fd, message, flags),
-      int fd AND CONST struct msghdr *message AND int flags)
+sendmsg (fd, message, flags)
+     int fd;
+     const struct msghdr *message;
+     int flags;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index e26c887..2635391 100644 (file)
@@ -16,18 +16,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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
 /* Send N bytes of BUF on socket FD to peer at address ADDR (which is
    ADDR_LEN bytes long).  Returns the number sent, or -1 for errors.  */
 int
-DEFUN(sendto, (fd, buf, n, flags, addr, addr_len),
-      int fd AND PTR buf AND size_t n AND int flags AND
-      const struct sockaddr *addr AND size_t addr_len)
+sendto (fd, buf, n, flags, addr, addr_len)
+     int fd;
+     void *buf;
+     size_t n;
+     int flags;
+     const struct sockaddr *addr;
+     size_t addr_len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 052b45b..891141b 100644 (file)
@@ -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,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Set the name of the current YP domain to NAME, which is LEN bytes long.
    This call is restricted to the super-user.  */
 int
-DEFUN(setdomainname, (name, len),
-      __const char *name AND size_t len)
+setdomainname (name, len)
+     const char *name;
+     size_t len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3429c67..573eb63 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 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,15 +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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Set the effective group ID of the calling process to GID.  */
 int
-DEFUN(setegid, (gid), __gid_t gid)
+setegid (gid)
+     __gid_t gid;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 998c055..f318475 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,15 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stdlib.h>
 #include <errno.h>
 
 int
-DEFUN(setenv, (name, value, replace),
-      CONST char *name AND CONST char *value AND int replace)
+setenv (name, value, replace)
+     const char *name;
+     const char *value;
+     int replace;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index e86e9a5..53b318e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,15 +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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Set the effective user ID of the calling process to UID.  */
 int
-DEFUN(seteuid, (uid), __uid_t uid)
+seteuid (uid)
+     __uid_t uid;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index df1adbb..a51eb48 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -26,9 +25,10 @@ Cambridge, MA 02139, USA.  */
    and effective group IDs, and the saved set-group-ID to GID;
    if not, the effective group ID is set to GID.  */
 int
-DEFUN(__setgid, (gid), gid_t gid)
+__setgid (gid)
+     gid_t gid;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (setgid)
index c5955a0..0fa9631 100644 (file)
@@ -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
@@ -16,16 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <grp.h>
 
 /* Set the group set for the current user to GROUPS (N of them).  */
 int
-DEFUN(setgroups, (n, groups), size_t n AND CONST gid_t *groups)
+setgroups (n, groups)
+     size_t n;
+     const gid_t *groups;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index d12b93b..30f24ee 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Set the current machine's Internet number to ID.
    This call is restricted to the super-user.  */
 int
-DEFUN(sethostid, (id), long int id)
+sethostid (id)
+     long int id;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 81fa5fb..aeb6789 100644 (file)
@@ -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
@@ -16,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Set the name of the current host to NAME, which is LEN bytes long.
    This call is restricted to the super-user.  */
 int
-DEFUN(sethostname, (name, len),
-      CONST char *name AND size_t len)
+sethostname (name, len)
+     const char *name;
+     size_t len;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 6ba7031..737257f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 #include <sys/time.h>
@@ -25,17 +24,18 @@ Cambridge, MA 02139, USA.  */
    set *OLD to the old value of timer WHICH.
    Returns 0 on success, -1 on errors.  */
 int
-DEFUN(__setitimer, (which, new, old),
-      enum __itimer_which which AND
-      struct itimerval *new AND struct itimerval *old)
+__setitimer (which, new, old)
+     enum __itimer_which which;
+     struct itimerval *new;
+     struct itimerval *old;
 {
   if (new == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (setitimer)
index 01f5812..b38b0bd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 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
@@ -27,7 +27,7 @@ __sigsetjmp (jmp_buf env, int savemask)
   /* Save the signal mask if requested.  */
   __sigjmp_save (env, savemask);
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   /* No way to signal failure. */
   return 0;
 }
index a406bc5..30e7b54 100644 (file)
@@ -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
@@ -16,15 +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 <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Set the login name returned by `getlogin'.  */
 int
-DEFUN(setlogin, (name), CONST char *name)
+setlogin (name)
+     const char *name;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index c694215..6527a3e 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -24,9 +23,11 @@ Cambridge, MA 02139, USA.  */
    If PID is zero, the current process's process group ID is set.
    If PGID is zero, the process ID of the process is used.  */
 int
-DEFUN(__setpgid, (pid, pgid), int pid AND int pgid)
+__setpgid (pid, pgid)
+     int pid;
+     int pgid;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (setpgid)
index 255306e..382a6ca 100644 (file)
@@ -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
@@ -16,17 +16,18 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/resource.h>
 
 /* Set the priority of all processes specified by WHICH and WHO
    to PRIO.  Returns 0 on success, -1 on errors.  */
 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;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 017dd08..0b31afd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -24,10 +23,11 @@ Cambridge, MA 02139, USA.  */
 /* Set the real group ID of the calling process to RGID,
    and the effective group ID of the calling process to EGID.  */
 int
-DEFUN(__setregid, (effective_gid, real_gid),
-      gid_t effective_gid AND gid_t real_gid)
+__setregid (effective_gid, real_gid)
+     gid_t effective_gid;
+     gid_t real_gid;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (setregid)
index 7640d2f..b6f9399 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -24,10 +23,11 @@ Cambridge, MA 02139, USA.  */
 /* Set the real user ID of the calling process to RUID,
    and the effective user ID of the calling process to EUID.  */
 int
-DEFUN(__setreuid, (effective_uid, real_uid),
-      uid_t effective_uid AND uid_t real_uid)
+__setreuid (effective_uid, real_uid)
+     uid_t effective_uid;
+     uid_t real_uid;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (setreuid)
index 2affcc7..79b9623 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/resource.h>
 #include <errno.h>
 
@@ -24,8 +23,9 @@ Cambridge, MA 02139, USA.  */
    Only the super-user can increase hard limits.
    Return 0 if successful, -1 if not (and sets errno).  */
 int
-DEFUN(setrlimit, (resource, rlimits),
-      enum __rlimit_resource resource AND struct rlimit *rlimits)
+setrlimit (resource, rlimits)
+     enum __rlimit_resource resource;
+     struct rlimit *rlimits;
 {
   errno = ENOSYS;
   return -1;
index 9baf1ee..3f0bb3a 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -25,9 +24,9 @@ Cambridge, MA 02139, USA.  */
    The process group IDs of the session and the calling process
    are set to the process ID of the calling process, which is returned.  */
 int
-DEFUN_VOID(__setsid)
+__setsid ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (setsid)
index c1933af..546ca4b 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -24,11 +23,14 @@ Cambridge, MA 02139, USA.  */
    to *OPTVAL (which is OPTLEN bytes long).
    Returns 0 on success, -1 for errors.  */
 int
-DEFUN(setsockopt, (fd, level, optname, optval, optlen),
-      int fd AND int level AND int optname AND
-      PTR optval AND size_t optlen)
+setsockopt (fd, level, optname, optval, optlen)
+     int fd;
+     int level;
+     int optname;
+     void *optval;
+     size_t optlen;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 7d654cd..7b94e88 100644 (file)
@@ -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
@@ -16,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/time.h>
 
 /* Set the current time of day and timezone information.
    This call is restricted to the super-user.  */
 int
-DEFUN(__settimeofday, (tv, tz),
-      CONST struct timeval *tv AND CONST struct timezone *tz)
+__settimeofday (tv, tz)
+     const struct timeval *tv;
+     const struct timezone *tz;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (settimeofday)
index 3415925..1228886 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -26,9 +25,10 @@ Cambridge, MA 02139, USA.  */
    and effective user IDs, and the saved set-user-ID to UID;
    if not, the effective user ID is set to UID.  */
 int
-DEFUN(__setuid, (uid), uid_t uid)
+__setuid (uid)
+     uid_t uid;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (setuid)
index 099f227..9d5629b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -30,7 +30,7 @@ shmat (shmid, shmaddr, shmflg)
      char *shmaddr;
      int shmflg;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (char *) -1;
 }
 
index 75a4613..a3b3707 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -28,7 +28,7 @@ shmctl (shmid, cmd, buf)
      int cmd;
      struct shmid_ds *buf;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 8affa6c..8cca774 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -27,7 +27,7 @@ int
 shmdt (shmaddr)
      char *shmaddr;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index d59ff90..63c5443 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -29,7 +29,7 @@ shmget (key, size, shmflg)
      int size;
      int shmflg;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 501d532..cce3dd7 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -27,10 +26,11 @@ Cambridge, MA 02139, USA.  */
      2 = No more receptions or transmissions.
    Returns 0 on success, -1 for errors.  */
 int
-DEFUN(shutdown, (fd, how),
-      int fd AND int how)
+shutdown (fd, how)
+     int fd;
+     int how;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 7321140..1344d45 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -24,17 +23,19 @@ Cambridge, MA 02139, USA.  */
 /* 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;
 {
   if (sig <= 0 || sig >= NSIG)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
-  return(-1);
+  __set_errno (ENOSYS);
+  return -1;
 }
 stub_warning (sigaction)
 
index 01a547c..f348a53 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
 /* Run signals handlers on the stack specified by SS (if not NULL).
    If OSS is not NULL, it is filled in with the old signal stack status.  */
 int
-DEFUN(sigaltstack, (ss, oss),
-      CONST struct sigaltstack *ss AND struct sigaltstack *oss)
+sigaltstack (ss, oss)
+     const struct sigaltstack *ss;
+     struct sigaltstack *oss;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 7c7469e..320027f 100644 (file)
@@ -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
@@ -16,15 +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 <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
 /* Block signals in MASK, returning the old mask.  */
 int
-DEFUN(__sigblock, (mask), int mask)
+__sigblock (mask)
+     int mask;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sigblock)
index a15b2c1..f98f988 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -24,10 +23,11 @@ Cambridge, MA 02139, USA.  */
    (causing them to fail with EINTR); if INTERRUPT is zero, make system
    calls be restarted after signal SIG.  */
 int
-DEFUN(siginterrupt, (sig, interrupt),
-      int sig AND int interrupt)
+siginterrupt (sig, interrupt)
+     int sig;
+     int interrupt;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 2bd9b42..6ee587a 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -24,9 +23,11 @@ Cambridge, MA 02139, USA.  */
 /* Set the handler for the signal SIG to HANDLER,
    returning the old handler, or SIG_ERR on error.  */
 __sighandler_t
-DEFUN(signal, (sig, handler), int sig AND __sighandler_t handler)
+signal (sig, handler)
+     int sig;
+     __sighandler_t handler;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return SIG_ERR;
 }
 
index a307422..54d23ee 100644 (file)
@@ -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
@@ -16,14 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
 int
-DEFUN(__sigpause, (mask), int mask)
+__sigpause (mask)
+     int mask;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sigpause)
index def44ed..81096db 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <signal.h>
@@ -24,15 +23,16 @@ Cambridge, MA 02139, USA.  */
 
 /* Store in SET all signals that are blocked and pending.  */
 int
-DEFUN(sigpending, (set), sigset_t *set)
+sigpending (set)
+     sigset_t *set;
 {
   if (set == NULL)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index a89f683..48623be 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -25,8 +24,10 @@ Cambridge, MA 02139, USA.  */
    according to HOW, which may be SIG_BLOCK, SIG_UNBLOCK or SIG_SETMASK.
    If OSET is not NULL, store the old set of blocked signals in *OSET.  */
 int
-DEFUN(__sigprocmask, (how, set, oset),
-      int how AND CONST sigset_t *set AND sigset_t *oset)
+__sigprocmask (how, set, oset)
+     int how;
+     const sigset_t *set;
+     sigset_t *oset;
 {
   switch (how)
     {
@@ -35,11 +36,11 @@ DEFUN(__sigprocmask, (how, set, oset),
     case SIG_SETMASK:
       break;
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index d4370e4..7a2db5b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 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,14 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <signal.h>
 #include <errno.h>
 
 int
-DEFUN(__sigreturn, (context), struct sigcontext *context)
+__sigreturn (context)
+     struct sigcontext *context;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sigreturn)
index ab4ae81..7bb5eab 100644 (file)
@@ -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
@@ -16,14 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
 int
-DEFUN(__sigsetmask, (mask), int mask)
+__sigsetmask (mask)
+     int mask;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sigsetmask)
index a9da1e6..79f21c4 100644 (file)
@@ -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
@@ -16,17 +16,17 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
 /* Run signals handlers on the stack specified by SS (if not NULL).
    If OSS is not NULL, it is filled in with the old signal stack status.  */
 int
-DEFUN(sigstack, (ss, oss),
-      CONST struct sigstack *ss AND struct sigstack *oss)
+sigstack (ss, oss)
+     const struct sigstack *ss;
+     struct sigstack *oss;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index da7ff85..ce604f8 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 
@@ -24,9 +23,10 @@ Cambridge, MA 02139, USA.  */
 /* Change the set of blocked signals to SET,
    wait until a signal arrives, and restore the set of blocked signals.  */
 int
-DEFUN(sigsuspend, (set), CONST sigset_t *set)
+sigsuspend (set)
+     const sigset_t *set;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index af8e24d..62505a7 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <signal.h>
 #include <errno.h>
 
@@ -26,10 +25,12 @@ Cambridge, MA 02139, USA.  */
    reset to SIG_DFL before `sv_handler' is entered.  If OVEC is non-NULL,
    it is filled in with the old information for SIG.  */
 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;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (sigvec)
index 88c7120..9ba448f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <signal.h>
 #include <time.h>
 #include <unistd.h>
@@ -30,9 +29,10 @@ Cambridge, MA 02139, USA.  */
    signal afterwards is undefined.  There is no return value to indicate
    error, but if `sleep' returns SECONDS, it probably didn't work.  */
 unsigned int
-DEFUN(sleep, (seconds), unsigned int seconds)
+sleep (seconds)
+     unsigned int seconds;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return seconds;
 }
 
index 26f550d..52017cb 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -24,10 +23,12 @@ Cambridge, MA 02139, USA.  */
    protocol PROTOCOL.  If PROTOCOL is zero, one is chosen automatically.
    Returns a file descriptor for the new socket, or -1 for errors.  */
 int
-DEFUN(socket, (domain, type, protocol),
-      int domain AND int type AND int protocol)
+socket (domain, type, protocol)
+     int domain;
+     int type;
+     int protocol;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index bc9b4b5..938e08f 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/socket.h>
 
@@ -25,10 +24,13 @@ Cambridge, MA 02139, USA.  */
    descriptors for them in FDS[0] and FDS[1].  If PROTOCOL is zero,
    one will be chosen automatically.  Returns 0 on success, -1 for errors.  */
 int
-DEFUN(socketpair, (domain, type, protocol, fds),
-      int domain AND int type AND int protocol AND int fds[2])
+socketpair (domain, type, protocol, fds)
+     int domain;
+     int type;
+     int protocol;
+     int fds[2];
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index e49bc31..d748673 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 
 /* Increase the size of the stack by INCREMENT,
    and return the address of the bottom of the stack.  */
-PTR
-DEFUN(sstk, (increment), int increment)
+void *
+sstk (increment)
+     int increment;
 {
-  errno = ENOSYS;
-  return (PTR) -1;
+  __set_errno (ENOSYS);
+  return (void *) -1;
 }
 
 stub_warning (sstk)
index 9d41201..c16582d 100644 (file)
@@ -12,4 +12,5 @@ int __data_start = 0;
 weak_alias (__data_start, data_start)
 #endif
 
-volatile int errno;
+volatile int __errno;
+string_alias (__errno, errno)
index 1aa2fee..72a93b2 100644 (file)
@@ -25,10 +25,9 @@ Cambridge, MA 02139, USA.  */
 int
 __statfs (const char *file, struct statfs *buf)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (statfs)
 
 weak_alias (__statfs, statfs)
-
index 231e762..4a58dd8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <time.h>
 #include <stddef.h>
@@ -24,15 +23,16 @@ Cambridge, MA 02139, USA.  */
 /* Set the system clock to *WHEN.  */
 
 int
-DEFUN(stime, (when), CONST time_t *when)
+stime (when)
+     const time_t *when;
 {
   if (when == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index dec67c2..e4fd33b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,23 +16,23 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sgtty.h>
 #include <stddef.h>
 
 /* Set the terminal parameters associated with FD to *PARAMS.  */
 int
-DEFUN(stty, (fd, params),
-      int fd AND CONST struct sgttyb *params)
+stty (fd, params)
+     int fd;
+     const struct sgttyb *params;
 {
   if (params == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index d082bbc..66e2650 100644 (file)
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.  */
 int
 swapoff (const char *path)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 825f353..d990bef 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Make the block special device PATH available to the system for swapping.
    This call is restricted to the super-user.  */
 int
-DEFUN(swapon, (path), CONST char *path)
+swapon (path)
+     const char *path;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index c8e6f12..d02e218 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -24,15 +23,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Make a link to FROM called TO.  */
 int
-DEFUN(__symlink, (from, to), CONST char *from AND CONST char *to)
+__symlink (from, to)
+     const char *from;
+     const char *to;
 {
   if (from == NULL || to == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (symlink)
index 34ddf2f..b775ee8 100644 (file)
@@ -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
@@ -16,15 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
 /* Make all changes done to all files actually appear on disk.  */
 int
-DEFUN_VOID(sync)
+sync ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index d2a5b3c..f08ab3d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sysdep.h>
 #include <errno.h>
 
@@ -24,9 +23,10 @@ Cambridge, MA 02139, USA.  */
    This only makes sense in certain operating systems.  */
 
 int
-DEFUN(syscall, (callno), int callno DOTS)
+syscall (callno)
+     int callno;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 1351b48..43ad6d9 100644 (file)
@@ -32,7 +32,7 @@ __sysconf (name)
   switch (name)
     {
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
 
     case _SC_TZNAME_MAX:
@@ -173,7 +173,7 @@ __sysconf (name)
       break;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index c74823a..75976c2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -24,20 +23,24 @@ Cambridge, MA 02139, USA.  */
 /* Read up to N chars into BUF from COOKIE.
    Return how many chars were read, 0 for EOF or -1 for error.  */
 int
-DEFUN(__stdio_read, (cookie, buf, n),
-      PTR cookie AND register char *buf AND register size_t n)
+__stdio_read (cookie, buf, n)
+     void *cookie;
+     register char *buf;
+     register size_t n;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
 /* Write up to N chars from BUF to COOKIE.
    Return how many chars were written or -1 for error.  */
 int
-DEFUN(__stdio_write, (cookie, buf, n),
-      PTR cookie AND register CONST char *buf AND register size_t n)
+__stdio_write (cookie, buf, n)
+     void *cookie;
+     register const char *buf;
+     register size_t n;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
@@ -45,19 +48,22 @@ DEFUN(__stdio_write, (cookie, buf, n),
    The new file position is stored in *POS.
    Returns zero if successful, nonzero if not.  */
 int
-DEFUN(__stdio_seek, (cookie, pos, whence),
-      PTR cookie AND fpos_t *pos AND int whence)
+__stdio_seek (cookie, pos, whence)
+     void *cookie;
+     fpos_t *pos;
+     int whence;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
 /* Close the file associated with COOKIE.
    Return 0 for success or -1 for failure.  */
 int
-DEFUN(__stdio_close, (cookie), PTR cookie)
+__stdio_close (cookie)
+      void *cookie;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
@@ -65,21 +71,24 @@ DEFUN(__stdio_close, (cookie), PTR cookie)
    or -1 for errors.  If COOKIE does not relate to any POSIX.1 file
    descriptor, this should return -1 with errno set to EOPNOTSUPP.  */
 int
-DEFUN(__stdio_fileno, (cookie), PTR cookie)
+__stdio_fileno (cookie)
+     void *cookie;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
 
 /* Open FILENAME with the mode in M.
    Store the magic cookie associated with the opened file in *COOKIEPTR.
-   Return zero on success and nonzero on failure.  */   
+   Return zero on success and nonzero on failure.  */
 int
-DEFUN(__stdio_open, (filename, m, cookieptr),
-      CONST char *filename AND __io_mode m AND PTR *cookieptr)
+__stdio_open (filename, m, cookieptr)
+     const char *filename;
+     __io_mode m;
+     void **cookieptr;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
@@ -87,11 +96,13 @@ DEFUN(__stdio_open, (filename, m, cookieptr),
 /* Open FILENAME with the mode in M.  Use the same magic cookie
    already in *COOKIEPTR if possible, closing the old cookie with CLOSEFN.  */
 int
-DEFUN(__stdio_reopen, (filename, m, cookieptr),
-      CONST char *filename AND __io_mode m AND
-      PTR *cookieptr AND __io_close_fn closefn)
+__stdio_reopen (filename, m, cookieptr)
+     const char *filename;
+     __io_mode m;
+     void **cookieptr;
+     __io_close_fn closefn;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 75c0747..8cb192d 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,21 +16,22 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdlib.h>
 
 
 /* Execute LINE as a shell command.  */
 int
-DEFUN(system, (line), CONST char *line)
+__libc_system (line)
+     const char *line;
 {
   if (line == NULL)
     return 0;                  /* This indicates no command processor.  */
 
-  errno = ENOSYS;
+  __sys_errno (ENOSYS);
   return -1;
 }
+weak_alias (__libc_system, system)
 
 
 stub_warning (system)
index 20f2b86..4d52f34 100644 (file)
@@ -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
@@ -16,23 +16,23 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <termios.h>
 
 /* Wait for pending output to be written on FD.  */
 int
-DEFUN(tcdrain, (fd), int fd)
+__libc_tcdrain (int fd)
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
+weak_alias (__libc_tcdrain, tcdrain)
 
 
 stub_warning (tcdrain)
index 5ccc9d5..1dbda79 100644 (file)
@@ -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
@@ -16,17 +16,18 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <termios.h>
 
 /* Suspend or restart transmission on FD.  */
 int
-DEFUN(tcflow, (fd, action), int fd AND int action)
+tcflow (fd, action)
+     int fd;
+     int action;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
@@ -39,11 +40,11 @@ DEFUN(tcflow, (fd, action), int fd AND int action)
       break;
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 3e9f7ef..16cc1c4 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,13 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <termios.h>
 
 /* Flush pending data on FD.  */
 int
-DEFUN(tcflush, (fd, queue_selector), int fd AND int queue_selector)
+tcflush (fd, queue_selector)
+     int fd;
+     int queue_selector;
 {
   switch (queue_selector)
     {
@@ -32,19 +33,13 @@ DEFUN(tcflush, (fd, queue_selector), int fd AND int queue_selector)
       break;
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
 
-#ifdef  HAVE_GNU_LD
-
-#include <gnu-stabs.h>
-
 stub_warning(tcflush);
-
-#endif /* GNU stabs.  */
index 7020849..da6e545 100644 (file)
@@ -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
@@ -16,29 +16,29 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
 
 /* Put the state of FD into *TERMIOS_P.  */
 int
-DEFUN(__tcgetattr, (fd, termios_p),
-      int fd AND struct termios *termios_p)
+__tcgetattr (fd, termios_p)
+     int fd;
+     struct termios *termios_p;
 {
   if (fd < 0)
     {
-      errno = EBADF;
-      return(-1);
+      __set_errno (EBADF);
+      return -1;
     }
   if (termios_p == NULL)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
-  return(-1);
+  __set_errno (ENOSYS);
+  return -1;
 }
 stub_warning (tcgetattr)
 
index 1e1ebfa..3b901a9 100644 (file)
@@ -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
@@ -16,22 +16,22 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 /* Return the foreground process group ID of FD.  */
 pid_t
-DEFUN(tcgetpgrp, (fd), int fd)
+tcgetpgrp (fd)
+     int fd;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return (pid_t) -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (pid_t) -1;
 }
 
index 6d8be74..80ee6f4 100644 (file)
@@ -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
@@ -16,21 +16,22 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <termios.h>
 
 /* Send zero bits on FD.  */
 int
-DEFUN(tcsendbreak, (fd, duration), int fd AND int duration)
+tcsendbreak (fd, duration)
+     int fd;
+     int duration;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 89ee7d7..ce1dae0 100644 (file)
@@ -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
@@ -16,26 +16,27 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
 
-static int EXFUN(bad_speed, (speed_t speed));
+static int bad_speed __P ((speed_t speed));
 
 /* 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;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
   if (termios_p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
   switch (optional_actions)
@@ -45,7 +46,7 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
     case TCSAFLUSH:
       break;
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -53,18 +54,19 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
       bad_speed(termios_p->__ispeed == 0 ?
                termios_p->__ospeed : termios_p->__ispeed))
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
 
 /* Stricknine checking.  */
 static int
-DEFUN(bad_speed, (speed), speed_t speed)
+bad_speed (speed)
+     speed_t speed;
 {
   switch (speed)
     {
index 3dbe34e..3a97fef 100644 (file)
@@ -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
@@ -16,23 +16,23 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 
 /* Set the foreground process group ID of FD set PGRP_ID.  */
 int
-DEFUN(tcsetpgrp, (fd, pgrp_id),
-      int fd AND pid_t pgrp_id)
+tcsetpgrp (fd, pgrp_id)
+     int fd;
+     pid_t pgrp_id;
 {
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index ce00e09..811ce74 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <stddef.h>
@@ -24,16 +23,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Return the current position of DIRP.  */
 off_t
-DEFUN(telldir, (dirp), DIR *dirp)
+telldir (dirp)
+     DIR *dirp;
 {
   if (dirp == NULL)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
-  return((off_t) -1);
+  __set_errno (ENOSYS);
+  return (off_t) -1;
 }
 
 
index 42b1c32..939c70f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
+/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdio.h>
 
@@ -27,13 +26,15 @@ Cambridge, MA 02139, USA.  */
    Return the generated filename or NULL if one could not
    be generated, putting the length of the string in *LENPTR.  */
 char *
-DEFUN(__stdio_gen_tempname, (dir, pfx, dir_search, lenptr),
-      CONST char *dir AND CONST char *pfx AND
-      int dir_search AND size_t *lenptr AND
-      FILE **streamptr)
+__stdio_gen_tempname (dir, pfx, dir_search, lenptr)
+     const char *dir;
+     const char *pfx;
+     int dir_search;
+     size_t *lenptr;
+     FILE **streamptr;
 {
   *lenptr = 0;
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 
index cb208bc..d410be3 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@ time_t
 time (timer)
      time_t *timer;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
 
   if (timer != NULL)
     *timer = (time_t) -1;
index 2b47ec2..ab33dca 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/times.h>
 #include <stddef.h>
@@ -26,15 +25,16 @@ Cambridge, MA 02139, USA.  */
    Return the elapsed real time, or (clock_t) -1 for errors.
    All times are in CLK_TCKths of a second.  */
 clock_t
-DEFUN(__times, (buffer), struct tms *buffer)
+__times (buffer)
+     struct tms *buffer;
 {
   if (buffer == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return (clock_t) -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (clock_t) -1;
 }
 stub_warning (times)
index 1367332..1134c6a 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/types.h>
 #include <errno.h>
 
 /* Truncate PATH to LENGTH bytes.  */
 int
-DEFUN(truncate, (path, length),
-      CONST char *path AND off_t length)
+truncate (path, length)
+     const char *path;
+     off_t length;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index a243e85..0d251f4 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -27,9 +26,10 @@ char *__ttyname = NULL;
 /* Return the pathname of the terminal FD is open on, or NULL on errors.
    The returned storage is good only until the next call to this function.  */
 char *
-DEFUN(ttyname, (fd), int fd)
+ttyname (fd)
+     int fd;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return NULL;
 }
 
index 67350d9..7a05629 100644 (file)
@@ -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
@@ -28,7 +28,7 @@ ttyname_r (fd, buf, buflen)
      char *buf;
      int buflen;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index ead365b..ffc4e51 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 
 /* Set an alarm to go off (generating a SIGALRM signal) in VALUE microseconds.
@@ -25,10 +24,11 @@ Cambridge, MA 02139, USA.  */
 
    Returns the number of microseconds remaining before the alarm.  */
 unsigned int
-DEFUN(ualarm, (value, interval),
-      unsigned int value AND unsigned int interval)
+ualarm (value, interval)
+     unsigned int value;
+     unsigned int interval;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 84633c4..e633a6a 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@ __ulimit (cmd, newlimit)
      int cmd;
      long int newlimit;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 weak_alias (__ulimit, ulimit)
index 18c85b7..fea20c2 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include <sys/types.h>
 
 /* Set the file creation mask to MASK, returning the old mask.  */
 mode_t
-DEFUN(__umask, (mask), mode_t mask)
+__umask (mask)
+     mode_t mask;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (umask)
index 7f8e249..6fe7c9d 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -24,16 +23,17 @@ Cambridge, MA 02139, USA.  */
 
 /* Remove the link named NAME.  */
 int
-DEFUN(__unlink, (name), CONST char *name)
+__unlink (name)
+     const char *name;
 {
   if (name == NULL)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
-  return(-1);
+  __set_errno (ENOSYS);
+  return -1;
 }
 stub_warning (unlink)
 
index c1cae9c..4f3f232 100644 (file)
@@ -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
@@ -16,14 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 
 /* Sleep USECONDS microseconds, or until a previously set timer goes off.  */
 unsigned int
-DEFUN(usleep, (useconds), unsigned int useconds)
+usleep (useconds)
+     unsigned int useconds;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index baa98fd..8e909f9 100644 (file)
@@ -26,7 +26,7 @@ ustat (dev, ust)
      dev_t dev;
      struct ustat * ust;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (ustat)
index 641960d..374ed1d 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <utime.h>
 
@@ -24,16 +23,18 @@ Cambridge, MA 02139, USA.  */
 /* Set the access and modification times of FILE to those given in TIMES.
    If TIMES is NULL, set them to the current time.  */
 int
-DEFUN(utime, (file, times), CONST char *file AND CONST struct utimbuf *times)
+utime (file, times)
+     const char *file;
+     const struct utimbuf *times;
 {
   if (file == NULL)
     {
-      errno = EINVAL;
-      return(-1);
+      __set_errno (EINVAL);
+      return -1;
     }
 
-  errno = ENOSYS;
-  return(-1);
+  __set_errno (ENOSYS);
+  return -1;
 }
 
 
index 5afc3d7..824f241 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/time.h>
 #include <errno.h>
 #include <stddef.h>
@@ -24,16 +23,17 @@ Cambridge, MA 02139, USA.  */
 /* Change the access time of FILE to TVP[0] and
    the modification time of FILE to TVP[1].  */
 int
-DEFUN(__utimes, (file, tvp),
-      CONST char *file AND struct timeval tvp[2])
+__utimes (file, tvp)
+     const char *file;
+     struct timeval tvp[2];
 {
   if (file == NULL || tvp == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 6a7a994..532fd64 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 
@@ -24,9 +23,9 @@ Cambridge, MA 02139, USA.  */
    with the control terminal, and then send a SIGHUP signal to the process
    group of the control terminal.  */
 int
-DEFUN_VOID(vhangup)
+vhangup ()
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 97b7841..a41a247 100644 (file)
@@ -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
@@ -16,16 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/wait.h>
 #include <errno.h>
 
 /* Wait for a child to die.  When one does, put its status in *STAT_LOC
    and return its process ID.  For errors, return (pid_t) -1.  */
 __pid_t
-DEFUN(__wait, (stat_loc), __WAIT_STATUS_DEFN stat_loc)
+__wait (stat_loc)
+     __WAIT_STATUS_DEFN stat_loc;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (wait)
index c1640dd..b5ea8e3 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/wait.h>
 #include <sys/types.h>
@@ -27,16 +26,18 @@ Cambridge, MA 02139, USA.  */
    there.  If the WUNTRACED bit is set in OPTIONS, return status for stopped
    children; otherwise don't.  */
 pid_t
-DEFUN(__wait3, (stat_loc, options, usage),
-      __WAIT_STATUS_DEFN stat_loc AND int options AND struct rusage *usage)
+__wait3 (stat_loc, options, usage)
+     __WAIT_STATUS_DEFN stat_loc;
+     int options;
+     struct rusage *usage;
 {
   if ((options & ~(WNOHANG|WUNTRACED)) != 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return (pid_t) -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (pid_t) -1;
 }
 stub_warning (wait3)
index 2062d4b..bf27343 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,17 +16,18 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <errno.h>
 
 pid_t
-DEFUN(__wait4, (pid, stat_loc, options, usage),
-      pid_t pid AND __WAIT_STATUS_DEFN stat_loc AND int options AND
-      struct rusage *usage)
+__wait4 (pid, stat_loc, options, usage)
+     pid_t pid;
+     __WAIT_STATUS_DEFN stat_loc;
+     int options;
+     struct rusage *usage;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (pid_t) -1;
 }
 stub_warning (wait4)
index 22eb019..09ba5a8 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/wait.h>
 #include <sys/types.h>
@@ -35,18 +34,18 @@ Cambridge, MA 02139, USA.  */
    Return (pid_t) -1 for errors.  If the WUNTRACED bit is set in OPTIONS,
    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)
 {
   if ((options & ~(WNOHANG|WUNTRACED)) != 0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return (pid_t) -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return (pid_t) -1;
 }
-stub_warning (waitpid)
+weak_alias (__libc_waitpid, __waitpid)
+weak_alias (__libc_waitpid, waitpid)
 
-weak_alias (__waitpid, waitpid)
+stub_warning (waitpid)
index deb4851..69778c3 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sysdep.h>
 #include <errno.h>
 #include <unistd.h>
@@ -24,25 +23,25 @@ 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)
 {
   if (nbytes == 0)
     return 0;
   if (fd < 0)
     {
-      errno = EBADF;
+      __set_errno (EBADF);
       return -1;
     }
   if (buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (write)
 
-weak_alias (__write, write)
+weak_alias (__libc_write, __write)
+weak_alias (__libc_write, write)
index f1d5749..593880c 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/uio.h>
@@ -27,10 +26,12 @@ Cambridge, MA 02139, USA.  */
    Operates just like `write' (see <unistd.h>) except that the data
    are taken from VECTOR instead of a contiguous buffer.  */
 int
-DEFUN(writev, (fd, vector, count),
-      int fd AND CONST struct iovec *vector AND size_t count)
+writev (fd, vector, count)
+     int fd;
+     const struct iovec *vector;
+     size_t count;
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 6d365cb..48d8b4f 100644 (file)
@@ -28,11 +28,11 @@ __xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
 {
   if (vers != _MKNOD_VER)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (__xmknod)
index ad67aa9..a487062 100644 (file)
@@ -26,11 +26,11 @@ __xstat (int vers, const char *file, struct stat *buf)
 {
   if (vers != _STAT_VER || file == NULL || buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 stub_warning (stat)
index dcfdd9c..c2a9c08 100644 (file)
 #endif /* __USE_BSD */
 
 
+#define __set_errno(val) errno = (val)
+
 #endif /* <errno.h> included.  */
index ac7c9cd..feaa652 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 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,13 +16,13 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
 #include <sys/ioctl.h>
 
 /* Wait for pending output to be written on FD.  */
 int
-DEFUN(tcdrain, (fd), int fd)
+__libc_tcdrain (int fd)
 {
   return __ioctl (fd, TIOCDRAIN);
 }
+weak_alias (__libc_tcdrain, tcdrain)
index a29a99f..29225f8 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sys/wait.h>
 #include <errno.h>
 #include <sys/resource.h>
@@ -25,9 +24,10 @@ Cambridge, MA 02139, USA.  */
 /* Wait for a child to die.  When one does, put its status in *STAT_LOC
    and return its process ID.  For errors, return (pid_t) -1.  */
 __pid_t
-DEFUN(__wait, (stat_loc), __WAIT_STATUS_DEFN stat_loc)
+__libc_wait (__WAIT_STATUS_DEFN stat_loc)
 {
   return __wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
 }
 
-weak_alias (__wait, wait)
+weak_alias (__libc_wait, __wait)
+weak_alias (__libc_wait, wait)
index b5a34c3..2a21e3c 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/wait.h>
 #include <sys/types.h>
@@ -35,10 +34,10 @@ Cambridge, MA 02139, USA.  */
    Return (pid_t) -1 for errors.  If the WUNTRACED bit is set in OPTIONS,
    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)
 {
   return __wait4 (pid, (union wait *) stat_loc, options, NULL);
 }
 
-weak_alias (__waitpid, waitpid)
+weak_alias (__libc_waitpid, __waitpid)
+weak_alias (__libc_waitpid, waitpid)
index c3e80eb..f6e34e8 100644 (file)
@@ -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
@@ -16,14 +16,14 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
 
 /* Return 1 if FD is a terminal, 0 if not.  */
 int
-DEFUN(__isatty, (fd), int fd)
+__isatty (fd)
+     int fd;
 {
   int save;
   int is_tty;
@@ -31,7 +31,7 @@ DEFUN(__isatty, (fd), int fd)
 
   save = errno;
   is_tty = __ioctl (fd, TIOCGETP, &term) == 0;
-  errno = save;
+  __set_errno (save);
 
   return is_tty;
 }
index c4a3780..420751b 100644 (file)
@@ -26,7 +26,7 @@ setegid (gid)
 {
   if (gid == (gid_t) ~0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index f6aa37f..06fd1a3 100644 (file)
@@ -26,7 +26,7 @@ seteuid (uid)
 {
   if (uid == (uid_t) ~0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index e057694..1da7865 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
@@ -27,7 +26,7 @@ Cambridge, MA 02139, USA.  */
    The process group IDs of the session and the calling process
    are set to the process ID of the calling process, which is returned.  */
 int
-DEFUN_VOID(__setsid)
+__setsid ()
 {
   pid_t pid = getpid ();
   int tty;
@@ -36,7 +35,7 @@ DEFUN_VOID(__setsid)
   if (__getpgid (pid) == pid)
     {
       /* Already the leader.  */
-      errno = EPERM;
+      __set_errno (EPERM);
       return -1;
     }
 
@@ -46,13 +45,13 @@ DEFUN_VOID(__setsid)
   tty = open ("/dev/tty", 0);
   if (tty < 0)
     {
-      errno = save;
+      __set_errno (save);
       return 0;
     }
   (void) __ioctl (tty, TIOCNOTTY, 0);
   (void) __close (tty);
 
-  errno = save;
+  __set_errno (save);
   return 0;
 }
 
index aa1c53f..f20968d 100644 (file)
@@ -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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sysdep.h>
 #include <errno.h>
 #include <stddef.h>
@@ -26,14 +25,16 @@ Cambridge, MA 02139, USA.  */
 /* 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 sigvec vec, ovec;
 
   if (sig <= 0 || sig >= NSIG)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -50,7 +51,7 @@ DEFUN(__sigaction, (sig, act, oact),
 
   if (oact != NULL)
     {
-      oact->sa_handler = (void EXFUN((*), (int))) ovec.sv_handler;
+      oact->sa_handler = (void (*) __P ((int))) ovec.sv_handler;
       oact->sa_mask = ovec.sv_mask;
       oact->sa_flags = (((ovec.sv_flags & SV_ONSTACK) ? SA_ONSTACK : 0) |
                        (!(ovec.sv_flags & SV_INTERRUPT) ? SA_RESTART : 0));
index 31ebb74..3421eb4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <signal.h>
@@ -26,8 +25,10 @@ Cambridge, MA 02139, USA.  */
    according to HOW, which may be SIG_BLOCK, SIG_UNBLOCK or SIG_SETMASK.
    If OSET is not NULL, store the old set of blocked signals in *OSET.  */
 int
-DEFUN(__sigprocmask, (how, set, oset),
-      int how AND CONST sigset_t *set AND sigset_t *oset)
+__sigprocmask (how, set, oset)
+     int how;
+     const sigset_t *set;
+     sigset_t *oset;
 {
   int mask;
 
@@ -37,7 +38,7 @@ DEFUN(__sigprocmask, (how, set, oset),
       switch (how)
        {
        case SIG_BLOCK:
-         mask = __sigblock(mask);
+         mask = __sigblock (mask);
          break;
 
        case SIG_UNBLOCK:
@@ -45,16 +46,16 @@ DEFUN(__sigprocmask, (how, set, oset),
          /* Fall through.  */
 
        case SIG_SETMASK:
-         mask = __sigsetmask(mask);
+         mask = __sigsetmask (mask);
          break;
 
        default:
-         errno = EINVAL;
+         __set_errno (EINVAL);
          return -1;
        }
     }
   else
-    mask = __sigblock(0);
+    mask = __sigblock (0);
 
   if (oset != NULL)
     *oset = mask;
index fff56a9..4c045aa 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 #include <stddef.h>
@@ -26,21 +25,22 @@ Cambridge, MA 02139, USA.  */
 /* Change the set of blocked signals to SET,
    wait until a signal arrives, and restore the set of blocked signals.  */
 int
-DEFUN(sigsuspend, (set), CONST sigset_t *set)
+sigsuspend (set)
+     const sigset_t *set;
 {
   int mask;
   int sig;
 
   if (set == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
   mask = 0;
   for (sig = 1; sig <= NSIG; ++sig)
-    if (__sigismember(set, sig))
-      mask |= sigmask(sig);
+    if (__sigismember (set, sig))
+      mask |= sigmask (sig);
 
-  return __sigpause(mask);
+  return __sigpause (mask);
 }
index 32a2c20..db9ffb5 100644 (file)
@@ -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 <ansidecl.h>
-
 #ifndef        __GNUC__
   #error This file uses GNU C extensions; you must compile with GCC.
 #endif
@@ -52,8 +50,8 @@ Cambridge, MA 02139, USA.  */
 #include <errno.h>
 
 /* 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;
     }
 
index 54f6293..11ce194 100644 (file)
@@ -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 <ansidecl.h>
-
 #ifndef        __GNUC__
   #error This file uses GNU C extensions; you must compile with GCC.
 #endif
@@ -52,8 +50,8 @@ Cambridge, MA 02139, USA.  */
 #include <errno.h>
 
 /* 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;
 }
index 1c09d55..de6870a 100644 (file)
@@ -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 <ansidecl.h>
 #include <stddef.h>
 #include <errno.h>
 #include <termios.h>
 
-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;
 }
index f88951f..f825d41 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -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;
     }
 
index c9ed18d..84bc068 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -26,13 +25,14 @@ Cambridge, MA 02139, USA.  */
 
 /* Wait for pending output to be written on FD.  */
 int
-DEFUN(tcdrain, (fd), int fd)
+__libc_tcdrain (int fd)
 {
   /* The TIOCSETP control waits for pending output to be written before
      affecting its changes, so we use that without changing anything.  */
   struct sgttyb b;
-  if (__ioctl(fd, TIOCGETP, (PTR) &b) < 0 ||
-      __ioctl(fd, TIOCSETP, (PTR) &b) < 0)
+  if (__ioctl (fd, TIOCGETP, (void *) &b) < 0 ||
+      __ioctl (fd, TIOCSETP, (void *) &b) < 0)
     return -1;
   return 0;
 }
+weak_alias (__libc_tcdrain, tcdrain)
index 06de144..1919d6d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -26,14 +25,16 @@ Cambridge, MA 02139, USA.  */
 
 /* Suspend or restart transmission on FD.  */
 int
-DEFUN(tcflow, (fd, action), int fd AND int action)
+tcflow (fd, action)
+     int fd;
+     int action;
 {
   switch (action)
     {
     case TCOOFF:
-      return __ioctl(fd, TIOCSTOP, (PTR) NULL);
+      return __ioctl (fd, TIOCSTOP, (PTR) NULL);
     case TCOON:
-      return __ioctl(fd, TIOCSTART, (PTR) NULL);
+      return __ioctl (fd, TIOCSTART, (PTR) NULL);
 
     case TCIOFF:
     case TCION:
@@ -42,7 +43,7 @@ DEFUN(tcflow, (fd, action), int fd AND int action)
           `write'.  Is there another way to do this?  */
        struct termios attr;
        unsigned char c;
-       if (tcgetattr(fd, &attr) < 0)
+       if (tcgetattr (fd, &attr) < 0)
          return -1;
        c = attr.c_cc[action == TCIOFF ? VSTOP : VSTART];
        if (c != _POSIX_VDISABLE && write (fd, &c, 1) < 1)
@@ -51,7 +52,7 @@ DEFUN(tcflow, (fd, action), int fd AND int action)
       }
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 }
index 46454b8..14f7db8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -26,7 +25,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Flush pending data on FD.  */
 int
-DEFUN(tcflush, (fd, queue_selector), int fd AND int queue_selector)
+tcflush (fd, queue_selector)
+     int fd;
+     int queue_selector;
 {
   int arg;
 
@@ -42,7 +43,7 @@ DEFUN(tcflush, (fd, queue_selector), int fd AND int queue_selector)
       arg = FREAD | FWRITE;
       break;
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 0e6e378..5d17bd5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,19 +16,19 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
 
 #include "bsdtty.h"
 
-extern CONST speed_t __bsd_speeds[]; /* Defined in tcsetattr.c.  */
+extern const speed_t __bsd_speeds[]; /* Defined in tcsetattr.c.  */
 
 /* Put the state of FD into *TERMIOS_P.  */
 int
-DEFUN(__tcgetattr, (fd, termios_p),
-      int fd AND struct termios *termios_p)
+__tcgetattr (fd, termios_p)
+     int fd;
+     struct termios *termios_p;
 {
   struct sgttyb buf;
   struct tchars tchars;
@@ -40,7 +40,7 @@ DEFUN(__tcgetattr, (fd, termios_p),
 
   if (termios_p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index e731d83..770bc98 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 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 <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -24,7 +23,7 @@ Cambridge, MA 02139, USA.  */
 #include "bsdtty.h"
 
 
-CONST speed_t __bsd_speeds[] =
+const speed_t __bsd_speeds[] =
   {
     0,
     50,
@@ -47,8 +46,10 @@ CONST speed_t __bsd_speeds[] =
 
 /* 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;
 {
   struct sgttyb buf;
   struct tchars tchars;
@@ -59,18 +60,18 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
 #endif
   size_t i;
 
-  if (__ioctl(fd, TIOCGETP, &buf) < 0 ||
-      __ioctl(fd, TIOCGETC, &tchars) < 0 ||
-      __ioctl(fd, TIOCGLTC, &ltchars) < 0 ||
+  if (__ioctl (fd, TIOCGETP, &buf) < 0 ||
+      __ioctl (fd, TIOCGETC, &tchars) < 0 ||
+      __ioctl (fd, TIOCGLTC, &ltchars) < 0 ||
 #ifdef TIOCGETX
-      __ioctl(fd, TIOCGETX, &extra) < 0 ||
+      __ioctl (fd, TIOCGETX, &extra) < 0 ||
 #endif
-      __ioctl(fd, TIOCLGET, &local) < 0)
+      __ioctl (fd, TIOCLGET, &local) < 0)
     return -1;
 
   if (termios_p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
   switch (optional_actions)
@@ -78,15 +79,15 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
     case TCSANOW:
       break;
     case TCSADRAIN:
-      if (tcdrain(fd) < 0)
+      if (tcdrain (fd) < 0)
        return -1;
       break;
     case TCSAFLUSH:
-      if (tcflush(fd, TCIFLUSH) < 0)
+      if (tcflush (fd, TCIFLUSH) < 0)
        return -1;
       break;
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -100,7 +101,7 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
     }
   if (buf.sg_ispeed == -1 || buf.sg_ospeed == -1)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -174,13 +175,13 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
   tchars.t_startc = termios_p->c_cc[VSTART];
   tchars.t_stopc = termios_p->c_cc[VSTOP];
 
-  if (__ioctl(fd, TIOCSETP, &buf) < 0 ||
-      __ioctl(fd, TIOCSETC, &tchars) < 0 ||
-      __ioctl(fd, TIOCSLTC, &ltchars) < 0 ||
+  if (__ioctl (fd, TIOCSETP, &buf) < 0 ||
+      __ioctl (fd, TIOCSETC, &tchars) < 0 ||
+      __ioctl (fd, TIOCSLTC, &ltchars) < 0 ||
 #ifdef TIOCGETX
-      __ioctl(fd, TIOCSETX, &extra) < 0 ||
+      __ioctl (fd, TIOCSETX, &extra) < 0 ||
 #endif
-      __ioctl(fd, TIOCLSET, &local) < 0)
+      __ioctl (fd, TIOCLSET, &local) < 0)
     return -1;
   return 0;
 }
index edf3e90..8277ce5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
+/* 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/times.h>
@@ -31,7 +30,8 @@ extern time_t _posix_start_time;
 __inline
 #endif
 static clock_t
-DEFUN(timeval_to_clock_t, (tv), CONST struct timeval *tv)
+timeval_to_clock_t (tv)
+     const struct timeval *tv;
 {
   return (clock_t) ((tv->tv_sec * CLK_TCK) +
                    (tv->tv_usec * CLK_TCK / 1000000L));
@@ -42,27 +42,28 @@ DEFUN(timeval_to_clock_t, (tv), CONST struct timeval *tv)
    Return the elapsed real time, or (clock_t) -1 for errors.
    All times are in CLK_TCKths of a second.  */
 clock_t
-DEFUN(__times, (buffer), struct tms *buffer)
+__times (buffer)
+     struct tms *buffer;
 {
   struct rusage usage;
 
   if (buffer == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return (clock_t) -1;
     }
 
-  if (__getrusage(RUSAGE_SELF, &usage) < 0)
+  if (__getrusage (RUSAGE_SELF, &usage) < 0)
     return (clock_t) -1;
-  buffer->tms_utime = (clock_t) timeval_to_clock_t(&usage.ru_utime);
-  buffer->tms_stime = (clock_t) timeval_to_clock_t(&usage.ru_stime);
+  buffer->tms_utime = (clock_t) timeval_to_clock_t (&usage.ru_utime);
+  buffer->tms_stime = (clock_t) timeval_to_clock_t (&usage.ru_stime);
 
-  if (__getrusage(RUSAGE_CHILDREN, &usage) < 0)
+  if (__getrusage (RUSAGE_CHILDREN, &usage) < 0)
     return (clock_t) -1;
-  buffer->tms_cutime = (clock_t) timeval_to_clock_t(&usage.ru_utime);
-  buffer->tms_cstime = (clock_t) timeval_to_clock_t(&usage.ru_stime);
+  buffer->tms_cutime = (clock_t) timeval_to_clock_t (&usage.ru_utime);
+  buffer->tms_cstime = (clock_t) timeval_to_clock_t (&usage.ru_stime);
 
-  return (time((time_t *) NULL) - _posix_start_time) * CLK_TCK;
+  return (time ((time_t *) NULL) - _posix_start_time) * CLK_TCK;
 }
 
 weak_alias (__times, times)
index 912faf4..f90692a 100644 (file)
@@ -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,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sysdep.h>
 #include <sys/resource.h>
 #include <unistd.h>
@@ -37,8 +36,9 @@ extern int _etext;
        can open.
    Returns -1 on errors.  */
 long int
-DEFUN(ulimit, (cmd, newlimit),
-      int cmd AND long int newlimit)
+ulimit (cmd, newlimit)
+     int cmd;
+     long int newlimit;
 {
   int status;
 
@@ -49,7 +49,7 @@ DEFUN(ulimit, (cmd, newlimit),
        /* Get limit on file size.  */
        struct rlimit fsize;
 
-       status = getrlimit(RLIMIT_FSIZE, &fsize);
+       status = getrlimit (RLIMIT_FSIZE, &fsize);
        if (status < 0)
          return -1;
 
@@ -62,25 +62,25 @@ DEFUN(ulimit, (cmd, newlimit),
        struct rlimit fsize;
        fsize.rlim_cur = newlimit * 512;
        fsize.rlim_max = newlimit * 512;
-       
-       return setrlimit(RLIMIT_FSIZE, &fsize);
+
+       return setrlimit (RLIMIT_FSIZE, &fsize);
       }
     case 3:
       /* Get maximum address for `brk'.  */
       {
        struct rlimit dsize;
 
-       status = getrlimit(RLIMIT_DATA, &dsize);
+       status = getrlimit (RLIMIT_DATA, &dsize);
        if (status < 0)
          return -1;
 
        return ((long int) &_etext) + dsize.rlim_cur;
       }
     case 4:
-      return sysconf(_SC_OPEN_MAX);
+      return sysconf (_SC_OPEN_MAX);
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 }
index 24bcbb4..aec5885 100644 (file)
@@ -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 <sysdep.h>
 
+__errno:
 .comm errno,           4
 
 ENTRY(__start)
index a9f3c5b..a24c1c5 100644 (file)
@@ -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 <sys/param.h>,
    which the default sysconf already knows how to handle.  */
 
-#include <ansidecl.h>
 #include <unistd.h>
 #include <errno.h>
 
 /* This is an Ultrix header file.  */
 #include <sys/sysinfo.h>
 
-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);
index 5b938a8..a46d47a 100644 (file)
@@ -32,7 +32,7 @@ __closedir (DIR *dirp)
 
   if (dirp == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 499a083..f332799 100644 (file)
@@ -28,7 +28,7 @@ __lxstat (int vers, const char *file, struct stat *buf)
 {
   if (vers != _STAT_VER)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index b2fafb9..a073dd2 100644 (file)
@@ -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.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <signal.h>
 #include <unistd.h>
 
@@ -25,7 +24,8 @@ Cambridge, MA 02139, USA.  */
    This always returns -1 and sets errno to EINTR.  */
 
 int
-DEFUN_VOID(pause)
+__libc_pause (void)
 {
-  return __sigpause(__sigblock(0));
+  return __sigpause (__sigblock (0));
 }
+weak_alias (__libc_pause, pause)
index 348321a..7d76826 100644 (file)
@@ -40,8 +40,7 @@ tcsendbreak (int fd, int duration)
   /* ioctl can't send a break of any other duration for us.
      This could be changed to use trickery (e.g. lower speed and
      send a '\0') to send the break, but for now just return an error.  */
-  errno = EINVAL;
+  __set_errno (EINVAL);
   return -1;
 #endif
 }
-
index 522d3fd..29cab51 100644 (file)
@@ -29,7 +29,7 @@ __fxstat (int vers, int fd, struct stat *buf)
 {
   if (vers != _STAT_VER)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 485faa1..6dec0dc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -16,15 +16,16 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <stddef.h>
-#include <errno.h>
 #include <sys/types.h>
 #include <unistd.h>
 
 int
-DEFUN(__getdirentries, (fd, buf, nbytes, basep),
-      int fd AND char *buf AND size_t nbytes AND off_t *basep)
+__getdirentries (fd, buf, nbytes, basep)
+     int fd;
+     char *buf;
+     size_t nbytes;
+     off_t *basep;
 {
   if (basep)
     *basep = __lseek (fd, (off_t) 0, SEEK_CUR);
@@ -33,4 +34,3 @@ DEFUN(__getdirentries, (fd, buf, nbytes, basep),
 }
 
 weak_alias (__getdirentries, getdirentries)
-
index e23ffa4..ef985f2 100644 (file)
@@ -58,7 +58,7 @@ getlogin (void)
     {
       if (errno == ESRCH)
        /* The caller expects ENOENT if nothing is found.  */
-       errno = ENOENT;
+       __set_errno (ENOENT);
       result = NULL;
     }
   else
index 154a9d3..f80b2c7 100644 (file)
@@ -53,7 +53,7 @@ getlogin_r (name, name_len)
 
     if (result < 0)
       {
-       errno = err;
+       __set_errno (err);
        return err;
       }
   }
index 16713f9..ff87f9a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
@@ -27,7 +26,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Create a directory named PATH with protections MODE.  */
 int
-DEFUN(__mkdir, (path, mode), CONST char *path AND mode_t mode)
+__mkdir (path, mode)
+     const char *path;
+     mode_t mode;
 {
   char *cmd = __alloca (80 + strlen (path));
   char *p;
@@ -38,7 +39,7 @@ DEFUN(__mkdir, (path, mode), CONST char *path AND mode_t mode)
 
   if (path == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -51,7 +52,7 @@ DEFUN(__mkdir, (path, mode), CONST char *path AND mode_t mode)
     }
   else
     {
-      errno = EEXIST;
+      __set_errno (EEXIST);
       return -1;
     }
 
@@ -83,11 +84,11 @@ DEFUN(__mkdir, (path, mode), CONST char *path AND mode_t mode)
   /* If system doesn't set errno, but the mkdir fails, we really
      have no idea what went wrong.  EIO is the vaguest error I
      can think of, so I'll use that.  */
-  errno = EIO;
+  __set_errno (EIO);
   status = system (cmd);
   if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
     {
-      errno = save;
+      __set_errno (save);
       return 0;
     }
   else
index 2211e8f..a5f44e4 100644 (file)
@@ -3,5 +3,5 @@
 madvise                -       madvise         3       madvise
 mmap           -       mmap            6       __mmap          mmap
 mprotect       -       mprotect        3       __mprotect      mprotect
-msync          -       msync           2       msync
+msync          -       msync           2       __libc_msync    msync
 munmap         -       munmap          2       __munmap        munmap
index 01f1412..d5a44e5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/resource.h>
@@ -24,21 +23,22 @@ Cambridge, MA 02139, USA.  */
 /* Increment the scheduling priority of the calling process by INCR.
    The superuser may use a negative INCR to decrement the priority.  */
 int
-DEFUN(nice, (incr), int incr)
+nice (incr)
+     int incr;
 {
   int save;
   int prio;
 
   /* -1 is a valid priority, so we use errno to check for an error.  */
   save = errno;
-  errno = 0;
+  __set_errno (0);
   prio = getpriority (PRIO_PROCESS, 0);
   if (prio == -1)
     {
       if (errno != 0)
        return -1;
       else
-       errno = save;
+       __set_errno (save);
     }
 
   return setpriority (PRIO_PROCESS, 0, prio + incr);
index 5389f65..b40aedb 100644 (file)
@@ -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.
 
 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
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <a.out.h>
 #include <stdio.h>
@@ -27,8 +26,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    which is terminated by an element with a NULL `n_un.n_name' member,
    and fill in the elements of NL.  */
 int
-DEFUN(nlist, (file, nl),
-      CONST char *file AND struct nlist *nl)
+nlist (file, nl)
+     const char *file;
+     struct nlist *nl;
 {
   FILE *f;
   struct exec header;
@@ -40,52 +40,53 @@ DEFUN(nlist, (file, nl),
 
   if (nl == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
-  f = fopen(file, "r");
+  f = fopen (file, "r");
   if (f == NULL)
     return -1;
 
-  if (fread((PTR) &header, sizeof(header), 1, f) != 1)
+  if (fread ((void *) &header, sizeof (header), 1, f) != 1)
     goto lose;
 
-  if (fseek(f, N_SYMOFF(header), SEEK_SET) != 0)
+  if (fseek (f, N_SYMOFF (header), SEEK_SET) != 0)
     goto lose;
 
-  symbols = (struct nlist *) __alloca(header.a_syms);
-  nsymbols = header.a_syms / sizeof(symbols[0]);
+  symbols = (struct nlist *) __alloca (header.a_syms);
+  nsymbols = header.a_syms / sizeof (symbols[0]);
 
-  if (fread((PTR) symbols, sizeof(symbols[0]), nsymbols, f) != nsymbols)
+  if (fread ((void *) symbols, sizeof (symbols[0]), nsymbols, f) != nsymbols)
     goto lose;
 
-  if (fread((PTR) &string_table_size, sizeof(string_table_size), 1, f) != 1)
+  if (fread ((void *) &string_table_size, sizeof (string_table_size), 1, f)
+      != 1)
     goto lose;
-  string_table_size -= sizeof(string_table_size);
+  string_table_size -= sizeof (string_table_size);
 
-  string_table = (char *) __alloca(string_table_size);
-  if (fread((PTR) string_table, string_table_size, 1, f) != 1)
+  string_table = (char *) __alloca (string_table_size);
+  if (fread ((void *) string_table, string_table_size, 1, f) != 1)
     goto lose;
 
   for (i = 0; i < nsymbols; ++i)
     {
       register struct nlist *nlp;
       for (nlp = nl; nlp->n_un.n_name != NULL; ++nlp)
-       if (!strcmp(nlp->n_un.n_name,
-                   &string_table[symbols[i].n_un.n_strx -
-                                 sizeof(string_table_size)]))
+       if (!strcmp (nlp->n_un.n_name,
+                    &string_table[symbols[i].n_un.n_strx -
+                                 sizeof (string_table_size)]))
          {
-           char *CONST name = nlp->n_un.n_name;
+           char *const name = nlp->n_un.n_name;
            *nlp = symbols[i];
            nlp->n_un.n_name = name;
          }
     }
 
-  (void) fclose(f);
+  (void) fclose (f);
   return 0;
 
  lose:;
-  (void) fclose(f);
+  (void) fclose (f);
   return -1;
 }
index 7161cec..c38c8d4 100644 (file)
@@ -41,7 +41,7 @@ __opendir (const char *name)
     {
       /* POSIX.1-1990 says an empty name gets ENOENT;
         but `open' might like it fine.  */
-      errno = ENOENT;
+      __set_errno (ENOENT);
       return NULL;
     }
 
@@ -56,7 +56,7 @@ __opendir (const char *name)
     goto lose;
   if (! S_ISDIR (statbuf.st_mode))
     {
-      errno = ENOTDIR;
+      __set_errno (ENOTDIR);
       goto lose;
     }
 
@@ -66,7 +66,7 @@ __opendir (const char *name)
     {
       int save = errno;
       (void) __close (fd);
-      errno = save;
+      __set_errno (save);
       return NULL;
     }
 
@@ -85,7 +85,7 @@ __opendir (const char *name)
       int save = errno;
       free (dirp);
       (void) __close (fd);
-      errno = save;
+      __set_errno (save);
       return NULL;
     }
 
index 46f2caf..491469b 100644 (file)
@@ -36,7 +36,7 @@ __readdir (DIR *dirp)
 
   if (dirp == NULL || dirp->data == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 52a130c..7bb4021 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sys/stat.h>
@@ -27,7 +26,8 @@ Cambridge, MA 02139, USA.  */
 
 /* Create a directory named PATH with protections MODE.  */
 int
-DEFUN(__rmdir, (path), CONST char *path)
+__rmdir (path)
+     const char *path;
 {
   char *cmd = __alloca (80 + strlen (path));
   char *p;
@@ -37,7 +37,7 @@ DEFUN(__rmdir, (path), CONST char *path)
 
   if (path == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -46,7 +46,7 @@ DEFUN(__rmdir, (path), CONST char *path)
     return -1;
   if (!S_ISDIR (statbuf.st_mode))
     {
-      errno = ENOTDIR;
+      __set_errno (ENOTDIR);
       return -1;
     }
 
@@ -64,12 +64,12 @@ DEFUN(__rmdir, (path), CONST char *path)
   /* If system doesn't set errno, but the rmdir fails, we really
      have no idea what went wrong.  EIO is the vaguest error I
      can think of, so I'll use that.  */
-  errno = EIO;
+  __set_errno (EIO);
   status = system (cmd);
   if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
     {
       return 0;
-      errno = save;
+      __set_errno (save);
     }
   else
     return -1;
index f8567d2..6c18b5c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -40,7 +40,9 @@ int __data_start = 0;
 weak_alias (__data_start, data_start)
 #endif
 
-VOLATILE int errno;
+VOLATILE int __errno;
+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));
@@ -117,7 +119,7 @@ DEFUN_VOID(init_shlib)
   caddr_t sobssmap;
   void (*ldstart) (int, int);
   struct exec soexec;
-  struct 
+  struct
     {
       caddr_t crt_ba;
       int crt_dzfd;
@@ -126,7 +128,7 @@ DEFUN_VOID(init_shlib)
       char **crt_ep;
       caddr_t crt_bp;
     } soarg;
-  
+
   /* If not dynamically linked, do nothing.  */
   if (&_DYNAMIC == 0)
     return;
@@ -137,7 +139,7 @@ DEFUN_VOID(init_shlib)
       || soexec.a_magic != ZMAGIC)
     {
       static CONST char emsg[] = "crt0: no /usr/lib/ld.so\n";
-      
+
       syscall (SYS_write, 2, emsg, sizeof (emsg) - 1);
       syscall (SYS_exit, 127);
     }
@@ -165,7 +167,7 @@ DEFUN_VOID(init_shlib)
   soarg.crt_dp = &_DYNAMIC;
   soarg.crt_ep = __environ;
   soarg.crt_bp = (caddr_t) &&retaddr;
-  
+
   ldstart = (__typeof (ldstart)) (somap + soexec.a_entry);
   (*ldstart) (1, (char *) &soarg - (char *) sp);
 
index e58bb38..8112d21 100644 (file)
@@ -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.
 
 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
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -36,11 +35,12 @@ weak_alias (__data_start, data_start)
 #endif
 
 #ifndef errno
-volatile int errno;
+volatile int __errno;
+string_alias (__errno, errno)
 #endif
 
-extern void EXFUN(__libc_init, (int argc, char **argv, char **envp));
-extern int EXFUN(main, (int argc, char **argv, char **envp));
+extern void __libc_init __P ((int argc, char **argv, char **envp));
+extern int main __P ((int argc, char **argv, char **envp));
 
 
 /* Not a prototype because it gets called strangely.  */
@@ -51,9 +51,9 @@ static void start1();
 /* N.B.: It is important that this be the first function.
    This file is the first thing in the text section.  */
 void
-DEFUN_VOID(_start)
+_start ()
 {
-  start1();
+  start1 ();
 }
 
 #ifndef NO_UNDERSCORES
index be928e8..869a28a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 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,20 +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,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/time.h>
 
 /* Set the system clock to *WHEN.  */
 
 int
-DEFUN(stime, (when), CONST time_t *when)
+stime (when)
+     const time_t *when;
 {
   struct timeval tv;
 
   if (when == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 0da9d17..fba1245 100644 (file)
@@ -6,12 +6,13 @@ chdir         -       chdir           1       __chdir         chdir
 chmod          -       chmod           2       __chmod         chmod
 chown          -       chown           3       __chown         chown
 chroot         -       chroot          1       chroot
-close          -       close           1       __close         close
+close          -       close           1       __libc_close    __close close
 dup            -       dup             2       __dup           dup
 dup2           -       dup2            2       __dup2          dup2
 fchdir         -       fchdir          1       fchdir
-fcntl          -       fcntl           3       __fcntl         fcntl
-fsync          -       fsync           1       fsync
+fcntl          -       fcntl           3       __libc_fcntl    __fcntl fcntl
+fstatfs                -       fstatfs         2       __fstatfs       fstatfs
+fsync          -       fsync           1       __libc_fsync    fsync
 getdomain      -       getdomainname   2       getdomainname
 getgid         -       getgid          0       __getgid        getgid
 getgroups      -       getgroups       2       __getgroups     getgroups
@@ -23,12 +24,12 @@ getuid              -       getuid          0       __getuid        getuid
 ioctl          -       ioctl           3       __ioctl         ioctl
 kill           -       kill            2       __kill          kill
 link           -       link            2       __link          link
-lseek          -       lseek           3       __lseek         lseek
+lseek          -       lseek           3       __libc_lseek    __lseek lseek
 mkdir          -       mkdir           2       __mkdir         mkdir
-open           -       open            3       __open          open
+open           -       open            3       __libc_open     __open open
 profil         -       profil          4       profil
 ptrace         -       ptrace          4       ptrace
-read           -       read            3       __read          read
+read           -       read            3       __libc_read     __read read
 readlink       -       readlink        3       __readlink      readlink
 readv          -       readv           3       readv
 reboot         -       reboot          1       reboot
@@ -48,6 +49,7 @@ settimeofday  -       settimeofday    2       __settimeofday  settimeofday
 setuid         -       setuid          1       __setuid        setuid
 sigsuspend     -       sigsuspend      1       sigsuspend
 sstk           -       sstk            1       sstk
+statfs         -       statfs          2       __statfs        statfs
 swapoff                -       swapoff         1       swapoff
 swapon         -       swapon          1       swapon
 symlink                -       symlink         2       __symlink       symlink
@@ -55,11 +57,9 @@ sync         -       sync            0       sync
 sys_fstat      fxstat  fstat           2       __syscall_fstat
 sys_mknod      xmknod  mknod           3       __syscall_mknod
 sys_stat       xstat   stat            2       __syscall_stat
-statfs         -       statfs          2       __statfs        statfs
-fstatfs                -       fstatfs         2       __fstatfs       fstatfs
 umask          -       umask           1       __umask         umask
 uname          -       uname           1       uname
 unlink         -       unlink          1       __unlink        unlink
 utimes         -       utimes          2       __utimes        utimes
-write          -       write           3       __write         write
+write          -       write           3       __libc_write    __write write
 writev         -       writev          3       writev
index 70a9431..6ba6219 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <sys/resource.h>
 #include <sys/sysmp.h>
@@ -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;
 }
index a632953..322813a 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <sys/resource.h>
 #include <sys/sysmp.h>
 
 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;
 }
-
index cd86f85..b11d27b 100644 (file)
@@ -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));
index 33220df..7cfa06d 100644 (file)
@@ -7,7 +7,8 @@ sysdep_routines += sysctl clone
 
 sysdep_headers += sys/mount.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/sysmacros.h sys/procfs.h
+                 sys/user.h syscall-list.h sys/sysmacros.h sys/procfs.h \
+                 sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.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
index 44a0cbb..be42ed3 100644 (file)
@@ -43,7 +43,7 @@ __adjtime (itv, otv)
       tmp.tv_usec = itv->tv_usec % 1000000L;
       if (tmp.tv_sec > MAX_SEC || tmp.tv_sec < MIN_SEC)
        {
-         errno = EINVAL;
+         __set_errno (EINVAL);
          return -1;
        }
       tntx.offset = tmp.tv_usec + tmp.tv_sec * 1000000L;
index 731059e..924fc47 100644 (file)
@@ -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)
index 868819e..8a7055a 100644 (file)
@@ -29,5 +29,11 @@ extern int __errno;
 extern int *__errno_location __P ((void)) __attribute__ ((__const__));
 #define errno  (*__errno_location ())
 
+#define __set_errno(val) errno = __errno = (val)
+
+#else /* !__USE_REENTRENT || (_LIBC && !_LIBC_REENTRANT) */
+
+#define __set_errno(val) errno = (val)
+
 #endif
 #endif
index 2883441..a1d141b 100644 (file)
@@ -32,7 +32,7 @@ sethostid (id)
   /* Test for appropriate rights to set host ID.  */
   if (geteuid () || getuid ())
     {
-      errno = EPERM;
+      __set_errno (EPERM);
       return -1;
     }
 
index 4b7720d..8a01fff 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -33,7 +33,7 @@ __gethostname (name, len)
 
   if (name == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -42,7 +42,7 @@ __gethostname (name, len)
 
   if (strlen (buf.nodename) + 1 > len)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 81946b4..c4c6fd7 100644 (file)
@@ -153,7 +153,7 @@ phys_pages_info (const char *format)
 
   if (result == -1)
     /* We cannot get the needed value: signal an error.  */
-    errno = ENOSYS;
+    __set_errno (ENOSYS);
 
   return result;
 }
index f9e92dd..d11c3c4 100644 (file)
@@ -45,11 +45,10 @@ __brk (void *addr)
 
   if (newbrk < addr)
     {
-      errno = ENOMEM;
+      __set_errno (ENOMEM);
       return -1;
     }
 
   return 0;
 }
 weak_alias (__brk, brk)
-
index 58e637e..f3ecd4b 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX.1 `sigaction' call for Linux/i386.
-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
@@ -48,7 +48,7 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 
   if (result < 0)
     {
-      errno = -result;
+      __set_errno (-result);
       return -1;
     }
   return 0;
index 0f3e31d..213af51 100644 (file)
@@ -33,6 +33,9 @@ errno:        .zero 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
index cbd7b55..1bf20bd 100644 (file)
@@ -71,6 +71,8 @@ syscall_error:                                                                      \
   movl %ecx, (%eax);                                                         \
   movl $-1, %eax;                                                            \
   ret;
+/* A quick note: it is assumed that the call to `__errno_location' does
+   not modify the parameter value!  */
 #else
 #define SYSCALL_ERROR_HANDLER                                                \
   .type syscall_error,@function;                                             \
index 3fd5475..402dfc5 100644 (file)
@@ -42,11 +42,10 @@ __brk (void *addr)
 
   if (newbrk < addr)
     {
-      errno = ENOMEM;
+      __set_errno (ENOMEM);
       return -1;
     }
 
   return 0;
 }
 weak_alias (__brk, brk)
-
index b47e167..407c2d3 100644 (file)
@@ -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 <sysdep.h>
+
 /* 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 <sysdep.h>
-#define _ERRNO_H
-#include <errnos.h>
-
 /* 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
index 9de750c..cfc9b04 100644 (file)
@@ -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      \
index 32cc990..ede413a 100644 (file)
@@ -46,12 +46,12 @@ ptrace (enum __ptrace_request request, ...)
     {
       if (request > 0 && request < 4)
        {
-         errno = 0;
+         __set_errno (0);
          return ret;
        }
       return res;
     }
 
-  errno = -res;
+  __set_errno (-res);
   return -1;
 }
index 53510b9..1aeda82 100644 (file)
@@ -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., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#include <ansidecl.h>
-#include <errno.h>
 #include <signal.h>
 #include <stddef.h>
 #include <unistd.h>
@@ -27,7 +25,8 @@ extern int __syscall_sigsuspend (int, unsigned long, unsigned long);
 /* Change the set of blocked signals to SET,
    wait until a signal arrives, and restore the set of blocked signals.  */
 int
-DEFUN(sigsuspend, (set), CONST sigset_t *set)
+sigsuspend (set)
+     const sigset_t *set;
 {
   return __syscall_sigsuspend (0, 0, *set);
 }
diff --git a/sysdeps/unix/sysv/linux/sleep.c b/sysdeps/unix/sysv/linux/sleep.c
new file mode 100644 (file)
index 0000000..1094df5
--- /dev/null
@@ -0,0 +1,36 @@
+/* sleep - Implementation of the POSIX sleep function using nanosleep.
+Copyright (C) 1996 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+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.  */
+
+#include <time.h>
+
+unsigned int
+sleep (unsigned int seconds)
+{
+  struct timespec ts = { tv_sec: (long int) seconds, tv_nsec: 0 };
+  unsigned int result;
+
+  if (nanosleep (&ts, &ts) == 0)
+    result = 0;
+  else
+    /* Round remaining time.  */
+    result = (unsigned int) ts.tv_sec + (ts.tv_nsec >= 500000000L);
+
+  return result;
+}
index 0ad48a2..9dd5e2f 100644 (file)
@@ -79,7 +79,7 @@ cfsetospeed  (termios_p, speed)
 
   if (termios_p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -97,7 +97,7 @@ cfsetospeed  (termios_p, speed)
        return 0;
       }
 
-  errno = EINVAL;
+  __set_errno (EINVAL);
   return -1;
 }
 
diff --git a/sysdeps/unix/sysv/linux/sys/debugreg.h b/sysdeps/unix/sysv/linux/sys/debugreg.h
new file mode 100644 (file)
index 0000000..4300643
--- /dev/null
@@ -0,0 +1 @@
+#include <linux/debugreg.h>
diff --git a/sysdeps/unix/sysv/linux/sys/kd.h b/sysdeps/unix/sysv/linux/sys/kd.h
new file mode 100644 (file)
index 0000000..33b873f
--- /dev/null
@@ -0,0 +1 @@
+#include <linux/kd.h>
diff --git a/sysdeps/unix/sysv/linux/sys/soundcard.h b/sysdeps/unix/sysv/linux/sys/soundcard.h
new file mode 100644 (file)
index 0000000..098fae1
--- /dev/null
@@ -0,0 +1 @@
+#include <linux/soundard.h>
diff --git a/sysdeps/unix/sysv/linux/sys/vt.h b/sysdeps/unix/sysv/linux/sys/vt.h
new file mode 100644 (file)
index 0000000..834abfb
--- /dev/null
@@ -0,0 +1 @@
+#include <linux/vt.h>
index d9dd3d1..3601b5f 100644 (file)
@@ -26,7 +26,8 @@ mount         EXTRA   mount           5       __mount mount
 mremap         -       mremap          4       __mremap        mremap
 munlock                -       munlock         2       __munlock       munlock
 munlockall     -       munlockall      0       __munlockall    munlockall
-nanosleep      -       nanosleep       2       nanosleep
+nanosleep      -       nanosleep       2       __libc_nanosleep        nanosleep
+pause          -       pause           0       __libc_pause    pause
 personality    init-first personality  1       __personality   personality
 pipe           -       pipe            1       __pipe          pipe
 s_getpriority  getpriority getpriority 2       __syscall_getpriority
index 20cc809..bd561b6 100644 (file)
@@ -21,9 +21,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Wait for pending output to be written on FD.  */
 int
-tcdrain (fd)
-      int fd;
+__libc_tcdrain (int fd)
 {
   /* With an argument of 1, TCSBRK for output to be drain.  */
   return __ioctl (fd, TCSBRK, 1);
 }
+weak_alias (__libc_tcdrain, tcdrain)
index 2b11930..7493eaf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sysdep.h>
 #include <sys/resource.h>
 #include <unistd.h>
@@ -45,7 +44,7 @@ __ulimit (cmd, newlimit)
        /* Get limit on file size.  */
        struct rlimit fsize;
 
-       status = getrlimit(RLIMIT_FSIZE, &fsize);
+       status = getrlimit (RLIMIT_FSIZE, &fsize);
        if (status < 0)
          return -1;
 
@@ -58,14 +57,14 @@ __ulimit (cmd, newlimit)
        struct rlimit fsize;
        fsize.rlim_cur = newlimit * 512;
        fsize.rlim_max = newlimit * 512;
-       
-       return setrlimit(RLIMIT_FSIZE, &fsize);
+
+       return setrlimit (RLIMIT_FSIZE, &fsize);
       }
     case 4:
-      return sysconf(_SC_OPEN_MAX);
+      return sysconf (_SC_OPEN_MAX);
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 }
index d4ee06b..bbb98a4 100644 (file)
@@ -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
@@ -21,12 +21,9 @@ Cambridge, MA 02139, USA.  */
 #include <sys/wait.h>
 
 __pid_t
-__waitpid (pid, stat_loc, options)
-     __pid_t pid;
-     int *stat_loc;
-     int options;
+__libc_waitpid (__pid_t pid, int *stat_loc, int options)
 {
   return __wait4 (pid, stat_loc, options, NULL);
 }
-
-weak_alias (__waitpid, waitpid)
+weak_alias (__libc_waitpid, __waitpid)
+weak_alias (__libc_waitpid, waitpid)
index be4158e..2b005e3 100644 (file)
@@ -1,6 +1,6 @@
 /* setrlimit function for systems with ulimit system call (SYSV).
 
-Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+Copyright (C) 1991, 1992, 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
@@ -20,7 +20,6 @@ Cambridge, MA 02139, USA.  */
 
 /* This only implements those functions which are available via ulimit.  */
 
-#include <ansidecl.h>
 #include <sys/resource.h>
 #include <stddef.h>
 #include <errno.h>
@@ -29,30 +28,31 @@ Cambridge, MA 02139, USA.  */
    Only the super-user can increase hard limits.
    Return 0 if successful, -1 if not (and sets errno).  */
 int
-DEFUN(setrlimit, (resource, rlimits),
-      enum __rlimit_resource resource AND struct rlimit *rlimits)
+setrlimit (resource, rlimits)
+     enum __rlimit_resource resource;
+     struct rlimit *rlimits;
 {
   if (rlimits == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
   switch (resource)
     {
     case RLIMIT_FSIZE:
-      return __ulimit(2, rlimits->rlim_cur);
+      return __ulimit (2, rlimits->rlim_cur);
 
     case RLIMIT_DATA:
     case RLIMIT_CPU:
     case RLIMIT_STACK:
     case RLIMIT_CORE:
     case RLIMIT_RSS:
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 }
index 1217c6b..147f796 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,27 +16,27 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <sys/time.h>
 
 /* Set the current time of day and timezone information.
    This call is restricted to the super-user.  */
 int
-DEFUN(__settimeofday, (tv, tz),
-      CONST struct timeval *tv AND CONST struct timezone *tz)
+__settimeofday (tv, tz)
+     const struct timeval *tv;
+     const struct timezone *tz;
 {
   time_t when;
 
   if (tv == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
   if (tz != NULL || tv->tv_usec % 1000000 != 0)
     {
-      errno = ENOSYS;
+      __set_errno (ENOSYS);
       return -1;
     }
 
index ebb42cf..eafaec7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <sysdep.h>
 #include <errno.h>
 #include <stddef.h>
@@ -26,15 +25,17 @@ Cambridge, MA 02139, USA.  */
 /* 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;
 {
   sighandler_t handler;
   int save;
 
   if (sig <= 0 || sig >= NSIG)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
@@ -48,7 +49,7 @@ DEFUN(__sigaction, (sig, act, oact),
        return -1;
       save = errno;
       (void) signal (sig, handler);
-      errno = save;
+      __set_errno (save);
     }
   else
     {
@@ -57,7 +58,7 @@ DEFUN(__sigaction, (sig, act, oact),
       if (act->sa_flags != 0)
        {
        unimplemented:
-         errno = ENOSYS;
+         __set_errno (ENOSYS);
          return -1;
        }
 
index 68fd7a1..37893fa 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <signal.h>
 #include <stddef.h>
@@ -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;
     }
 
index 81d660f..cd0e844 100644 (file)
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <limits.h>
 #include <unistd.h>
@@ -24,16 +23,17 @@ Cambridge, MA 02139, USA.  */
 #include <time.h>
 #include <sysconfig.h>
 
-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:
index f54df4b..586a374 100644 (file)
@@ -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 <ansidecl.h>
 #include <errno.h>
 #include <sys/wait.h>
 #include <sys/types.h>
@@ -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)
index 3714479..92bd7aa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -26,8 +25,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Wait for pending output to be written on FD.  */
 int
-DEFUN(tcdrain, (fd), int fd)
+__libc_tcdrain (int fd)
 {
   /* With an argument of 1, TCSBRK just waits for output to drain.  */
   return __ioctl (fd, _TCSBRK, 1);
 }
+weak_alias (__libc_tcdrain, tcdrain)
index fecb40d..ac9e797 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -27,7 +26,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Suspend or restart transmission on FD.  */
 int
-DEFUN(tcflow, (fd, action), int fd AND int action)
+tcflow (fd, action)
+     int fd;
+     int action;
 {
   switch (action)
     {
@@ -40,7 +41,7 @@ DEFUN(tcflow, (fd, action), int fd AND int action)
     case TCION:
       return __ioctl (fd, _TCXONC, 3);
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 }
index 88574a5..4725042 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -27,7 +26,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Flush pending data on FD.  */
 int
-DEFUN(tcflush, (fd, queue_selector), int fd AND int queue_selector)
+tcflush (fd, queue_selector)
+     int fd;
+     int queue_selector;
 {
   switch (queue_selector)
     {
@@ -38,7 +39,7 @@ DEFUN(tcflush, (fd, queue_selector), int fd AND int queue_selector)
     case TCIOFLUSH:
       return __ioctl (fd, _TCFLSH, 2);
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 }
index dd914a2..cd98e0c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <sysv_termio.h>
@@ -25,15 +24,16 @@ Cambridge, MA 02139, USA.  */
 
 /* Put the state of FD into *TERMIOS_P.  */
 int
-DEFUN(__tcgetattr, (fd, termios_p),
-      int fd AND struct termios *termios_p)
+__tcgetattr (fd, termios_p)
+     int fd;
+     struct termios *termios_p;
 {
   struct __sysv_termio buf;
   int termio_speed;
 
   if (termios_p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 78fe2c5..614b52a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <signal.h>
@@ -27,7 +26,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Send zero bits on FD.  */
 int
-DEFUN(tcsendbreak, (fd, duration), int fd AND int duration)
+tcsendbreak (fd, duration)
+     int fd;
+     int duration;
 {
   /* The break lasts 0.25 to 0.5 seconds if DURATION is zero,
      and an implementation-defined period if DURATION is nonzero.
@@ -38,6 +39,6 @@ DEFUN(tcsendbreak, (fd, duration), int fd AND int duration)
   /* ioctl can't send a break of any other duration for us.
      This could be changed to use trickery (e.g. lower speed and
      send a '\0') to send the break, but for now just return an error.  */
-  errno = EINVAL;
+  __set_errno (EINVAL);
   return -1;
 }
index 230a258..76d0192 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <errno.h>
 #include <stddef.h>
 #include <termios.h>
@@ -25,7 +24,7 @@ Cambridge, MA 02139, USA.  */
 #include <sysv_termio.h>
 
 
-CONST speed_t __unix_speeds[] =
+const speed_t __unix_speeds[] =
   {
     0,
     50,
@@ -48,8 +47,10 @@ CONST speed_t __unix_speeds[] =
 
 /* 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;
 {
   struct __sysv_termio buf;
   int ioctl_function;
@@ -57,7 +58,7 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
 
   if (termios_p == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
   switch (optional_actions)
@@ -72,13 +73,13 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
       ioctl_function = _TCSETAF;
       break;
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
   if (termios_p->__ispeed != termios_p->__ospeed)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
   buf.c_cflag = -1;
@@ -89,7 +90,7 @@ DEFUN(tcsetattr, (fd, optional_actions, termios_p),
     }
   if (buf.c_cflag == -1)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 81c794a..21bd3f4 100644 (file)
@@ -31,7 +31,7 @@ __xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
 {
   if (vers != _MKNOD_VER)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 3b1b112..1a53c88 100644 (file)
@@ -28,7 +28,7 @@ __xstat (int vers, const char *file, struct stat *buf)
 {
   if (vers != _STAT_VER)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index bb20a3a..25bc9de 100644 (file)
@@ -39,7 +39,7 @@ __asctime_r (const struct tm *tp, char *buf)
 {
   if (tp == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 2a78030..ce243e6 100644 (file)
@@ -50,7 +50,7 @@ __localtime_r (timer, tp)
 
   if (timer == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 7837373..9d23cf7 100644 (file)
@@ -529,17 +529,11 @@ strftime (s, maxsize, format, tp)
 #ifdef _NL_CURRENT
          if (modifier == 'O' && 0 <= number_value)
            {
-             /* ALT_DIGITS is the first entry in an array with
-                alternative digit symbols.  We have to find string
-                number NUMBER_VALUE, but must not look beyond
-                END_ALT_DIGITS.  */
-             int run = number_value;
-             const char *cp = alt_digits;
+             /* Get the locale specific alternate representation of
+                the number NUMBER_VALUE.  If none exist NULL is returned.  */
+             const char *cp = _nl_get_alt_digit (number_value);
 
-             while (run-- > 0 && cp < end_alt_digits)
-               cp = strchr (cp, '\0') + 1;
-
-             if (cp < end_alt_digits)
+             if (cp != NULL)
                {
                  size_t digitlen = strlen (cp);
                  if (digitlen != 0)
index 056f7be..efd382b 100644 (file)
@@ -62,7 +62,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
          if ((byte & 0xc0) == 0x80 || (byte & 0xfe) == 0xfe)
            {
              /* Oh, oh.  An encoding error.  */
-             errno = EILSEQ;
+             __set_errno (EILSEQ);
              return (size_t) -1;
            }
 
@@ -109,7 +109,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
          if ((byte & 0xc0) != 0x80)
            {
              /* Oh, oh.  An encoding error.  */
-             errno = EILSEQ;
+             __set_errno (EILSEQ);
              return (size_t) -1;
            }
 
index 2790695..d8c6da6 100644 (file)
@@ -98,7 +98,7 @@ __mbsnrtowcs (dst, src, nmc, len, ps)
       else
        {
          /* This is an illegal encoding.  */
-         errno = EILSEQ;
+         __set_errno (EILSEQ);
          return (size_t) -1;
        }
 
@@ -110,7 +110,7 @@ __mbsnrtowcs (dst, src, nmc, len, ps)
          if ((byte & 0xc0) != 0x80)
            {
              /* This is an illegal encoding.  */
-             errno = EILSEQ;
+             __set_errno (EILSEQ);
              return (size_t) -1;
            }
 
index d7305d6..276d125 100644 (file)
@@ -93,7 +93,7 @@ __mbsrtowcs (dst, src, len, ps)
       else
        {
          /* This is an illegal encoding.  */
-         errno = EILSEQ;
+         __set_errno (EILSEQ);
          return (size_t) -1;
        }
 
@@ -105,7 +105,7 @@ __mbsrtowcs (dst, src, len, ps)
          if ((byte & 0xc0) != 0x80)
            {
              /* This is an illegal encoding.  */
-             errno = EILSEQ;
+             __set_errno (EILSEQ);
              return (size_t) -1;
            }
 
index 052a5b9..f5d9f7e 100644 (file)
@@ -56,7 +56,7 @@ __wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
   if (wc < 0 || wc > 0x7fffffff)
     {
       /* This is no correct ISO 10646 character.  */
-      errno = EILSEQ;
+      __set_errno (EILSEQ);
       return (size_t) -1;
     }
 
index fb50a11..f014914 100644 (file)
@@ -68,7 +68,7 @@ __wcsnrtombs (dst, src, nwc, len, ps)
       if (wc < 0 || wc > 0x7fffffff)
        {
          /* This is no correct ISO 10646 character.  */
-         errno = EILSEQ;
+         __set_errno (EILSEQ);
          return (size_t) -1;
        }
 
index 999e291..ac54e74 100644 (file)
@@ -64,7 +64,7 @@ __wcsrtombs (dst, src, len, ps)
       if (wc < 0 || wc > 0x7fffffff)
        {
          /* This is no correct ISO 10646 character.  */
-         errno = EILSEQ;
+         __set_errno (EILSEQ);
          return (size_t) -1;
        }
 
index 42df619..553c431 100644 (file)
@@ -34,7 +34,7 @@ wcstok (wcs, delim, save_ptr)
   if (wcs == NULL)
     if (*save_ptr == NULL)
       {
-       errno = EINVAL;
+       __set_errno (EINVAL);
        return NULL;
       }
     else