]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
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 0f1d87a38bcf2c96f7edda8b1796d0178a253159..d28ec2d9d147100bb85debe04afe7c384f8d78e1 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 b5789a417680cf1c9f1f308cd6a64e7c1afd9bd3..5cf093ec0fcb1292bc20c98ba58d9ac5f8d0ca1e 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?''
@@ -424,13 +432,120 @@ compilation is provided.  The GNU libc's sysdeps/ directory shows how
 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 791d788a5e9692af0cde10368297ed644e3f0d54..87a66eea81bcd684077505c7b2dc0f239dfdec5a 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 7ba9258be3550b7de49f6e6bec5d6eea58d5ebaf..7fe159e5b9e601fdf29ed354d5fb187ed41ec0a0 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 f816e081698995e9ae9af4bcbe2287f4f1cf3189..cb2ba5308eae5989e66a655ebac84d64b3a30727 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 cfe6aed157262692dc3b9237054fa05cd7801b62..5c0d659f1a268e582f8a41f6386ebad7f2478d5f 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 6907f0873fc3b8f0b362925bad2e039144978660..cffe5056ac2339601ec802e31a2f58d48581a52e 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 b56303fa4affbfa7c5b5c147846aa7bb97496c7f..9dfc961a2fa48e7b3fa5ac3c6b2c54898ad4011b 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 0736218536c450a547bf5c08b1bbe3121950792c..58676924e51baf3854f7f4275628e3d6e0ba4412 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 00fa965fd7c81543a2ccb97568b7cce981abff62..1c63e952dc623a5510b43e281be5b16966e1b135 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 7bbe170b76dc7a39dffcda01c28811bd735af7c7..592f724eb12a1f46b9b4e41689c02700b0f94bd5 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 ee935c87a46f493d806397cb199449679f6a79cc..1e1717b40b86d349a022be2e79470b360e3658b4 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 fe5750ab56ff65dbf549216991c8c648ed9a4706..5e57eaf1b6e7fca31a5b704225a6ec33447c744e 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 ff2e2b1fdc9c8a9fd60613662662dee2a797e57a..b8d745b8d3e52a5f92631281d73b18337cef956a 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 8a8d01a28e0275e685fea0f96ee2bcbbf9a28137..00825ee0b04675471db3d5ab58a2f384c789fe62 100644 (file)
@@ -37,7 +37,7 @@ getwd (buf)
 
   if (buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 91664197aed9beea6b7274b0eac88a537ad2ec91..c391243e97620fceb136bc08e718291df193602b 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 902d63f21cf9aaeb180f7f6b4a61123b84ca0c06..ba64fc7752b2d69543065fe728fe8c289e0be202 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 a3138afd16d77d489bd482d123a66da554260133..b4bd5ce7cd27602b408895ad59e0f4aa16cbaa44 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 818e740851d9636749b40c04b9131309de0d17bb..7c2dcba7b484365eebc6d71351b055b30f2672fa 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 797192eaae3999e3c84818091858b3b4d5924607..67c629c583e2068929aefa8ce4b74fe4f15100ed 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 c45cfacb06e32052d420ab77ed3a10619a6f3e91..4cec7a73d8034b679872824fa8b859a36f503dfa 100644 (file)
@@ -41,7 +41,7 @@ _IO_fgetpos (fp, posp)
     {
 #ifdef EIO
       if (errno == 0)
-       errno = EIO;
+       __set_errno (EIO);
 #endif
       return EOF;
     }
index 96c3a7a2a03df091dbf9d7e48c4b81f33ef8a053..9013606e723ea7c0298b5e605a9b0eb29da7f296 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 12b90b37f52fca1713396b3dd4f060e9b3804263..ec3b1a2f2eb453f428def26917779a26648d4dd6 100644 (file)
@@ -40,7 +40,7 @@ _IO_ftell (fp)
     {
 #ifdef EIO
       if (errno == 0)
-       errno = EIO;
+       __set_errno (EIO);
 #endif
       return -1L;
     }
index 0acd76e6c5d408796face37396293f29e8e06dad..da6efa459aefbca187d199987ed79a53e4b9228f 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 f5e6dc5a0ec62f6d252dcd002be00c162122ee23..d3c871fbebdc34115fce8262859a476ef29d8bef 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 b03ff498ab9dd4f4595a282b9353c1546b0f5021..dbb51f383b8f578bbf738c00906f6510a743bd59 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 5e72319774167f17b781f9237d1ecae5ae3cd5c1..664fc901c46e14d31a8be31875137ccc91036b75 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 82bd51024aa56218c386f433512afc36c8a21c8a..4df8df7a45ba199df6da106a05570c095ebefc0d 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 7b84f99dc2fda79fbab546c545a5f73a43a18191..f4fe561cb9dfedf3298b3f03cead414e1e9e8b07 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 5894b074ded22f94d5efd8363802929801a19d78..474a73cf6e33aa70324cab8d9bb8ef955ad9a778 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 0646f0e8dbada081ed30bdf840184a1c85c29f2b..335e866f91d9586abbc8cf17b1be8c7148c35017 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 a9fa4238c2e4b20c23cf88f9cf63cf50722c0e0d..1c42e14a4a941f0672d26e895f764f4cd6961bfd 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 75f6021109c57976e14d435b76bf71f32eb1fd77..1b118ae14c2a0afc2d7ad201d850a0556d24fb91 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 ea15c876389a7a57ef3007ab9ca0ba08f8e7d3bd..667afbd18861854e1e9d2c9f179cdf7382b97e69 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 1eae6e75d002e890b8dfda30ba0886c2ee888a3a..ff9248e317598b361b9e85c3a886508989d7549a 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 63ebc4b8561a4db521ffbb4227ff82a9985cbe82..97629e5132c39afcef04105f6c31404a50fbb3c9 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 d0d922373378807e02f3d0cc34f56140d76ae927..76320f8a3297c4ee144ae72d15397aadf56e9bea 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 00dbec40c8af823fc49285a62efe9953d55b1d77..81070157a45664ff7ce2ec2f8caad6ab93e0b05d 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 e5c41966c6e43abf68780d17c1ef19debb6ae734..e88267decbbe2e0076f97105c2862e7ae674de40 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 a53613f2383c723efdf7e277467719cb41ca90a1..00b176a104c3ca47ce304b67dc4c20d6f10acb30 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 55436bf2b8d302542bc1a68cfa3b0301d005dcca..42ea3cd778caee74dfed8f89bd1c807459785675 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 343cc3ee62bb87a60d39396f21ab73830afd4803..00f5f785bee35040703d83ec064ee8e81b0c6674 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 cbd5c271ba8a22fc554e1847d38674cd7267a708..7f80242580306fe4cc55296e60b50b83696f829b 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 151bb31efc37f80c057a6ac99cbba7207da26ffd..95813e4bfb484c7cd652ab26a5a22eded167b19a 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 8fa93f721ba81015c296f5163898f71bd5900dfb..150ad6dc2dbf302d672b66e8817e933b7d3cc050 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 d9bf4d7be5f8631c2ddb4e29b9099257a957c357..9a01c9f5451730f8ab653a81be11a527a2322666 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 da4ad1f2a5ab70424b0131137111644f054e4e5d..404a9f975027726bf8ed4ffef6b09a201ccec961 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 ece253d01740c84eaf3c7e7a947dd313ce5c47f3..9cfa579ea40fc679be66ab0a6ab46b42db8336c2 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 79c9d2706d671c9a8e31cf17aa07a51c26e6e4d1..f49ddb95a6a3a7bef73a37170ad42717e4849cf8 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 30721d11a0a392913a3052ef3a79f405188dba14..2b12628a72b04829b637560ab4b7dd153ac8f058 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 5b4a7bea9336845b80895728ca345b122d87db5a..b511ea0ab854fb421f1dd64e7b089369cfc2b259 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 a1fcb791faf1af4c62475187859d372a318c70ba..400e082937a54a66b9a2305f72a681308133e05c 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 76060e14259be359c1727421daec4ef466977785..b8820cee94630adfc53db9ed7c33c4f1b5de225d 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 5bd5c8267a5911f4474d0aa9d030d91ba72f3661..0bd2ab9d0d2eae340dfab8b66952f37a76479d6f 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 ad8a81b3a3b4355fcf041bf69fa18606550e2134..2761cf8801e53ae92b46460774a51dba7ad14a75 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 80abefcba7f398b864df1fe06d420178b1265e31..497b0af7c6922f378337f946123f1a5785ffd828 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 ea9b2d4b55277545f106c9aa35c81c32066f4fc8..7c863492d75ec57d3fcf5f0611a74c23623a27ee 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 ff92d5f2dc734c0cc78efc89abba5d6af2bcba0e..27908d4a475acf735b500882c26fdb8f0d3ef133 100644 (file)
@@ -77,6 +77,6 @@ inet_neta(src, dst, size)
        return (odst);
 
  emsgsize:
-       errno = EMSGSIZE;
+       __set_errno (EMSGSIZE);
        return (NULL);
 }
index a378f3a383db7cf357b66185c3853ed5dd700d7e..bbdabd0fe00862c61e12edaa21165644cad99d35 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 2315de59cdc97b1fc9d3f3ac75c77cf0f7d231c2..3593da262b0e1f16fee0ea1ed7c63ba3cf736b47 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 2d191d03326ee5caa8d6cfa41b17c5b99389b549..e9898023bf1b1a230ced8bdce035507c411f342b 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 4c258b99bf0bacb8603c5636b9cc4708745a5b2e..3efc6cf96f618d680beaa1f334b9285885b0ec3c 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 60cf2eecf75e5434f10b9c6a2443beb5931d1270..707c00965debca84e8e21bc3458ec1869692d01b 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 b638057bae5e95c563f0c2c5c9f5a0864f83fe66..8c8bd2a9a9c01d1a83965d15c57551dbfa0f3181 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 03c96b581b08af061207426d337d6b8e0a556fb4..407886ede4c0cbaf2418cb59d5651359a641cdff 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 b1a4c82b4e14a845c70331c9f8155427092ee28e..133cfd6009d7fa497f469f188515365f5b23f574 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 b9ac34dd5bbfe53956f54bdec2b7e8d7786fa301..69185edca659a71f3217897d0b224f687e5eba6f 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 07e880f9c4e7fe877078ac538099f25e8f67c80b..0b88a0977bec4bcaab4b2482882ace5eec38d065 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 0ec129ded42a5a1fc233d7725abc933f67ca6926..5e4bebb27c6683588a92708e9ca6df66b93ebcf0 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 88c1833b55dbf53cd44e6d964979d13c9cbe760d..6ea4707e63b52ec72c8a23ecaed7753fe98455c6 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 36c04db5e2706456a3fd891c83df6a82e48935ff..d1715175091cc80238d2e07706ec74464da9165f 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 db33a3d61821e79b2bf82404774e00dbc9362fb6..2cb086dedfc74ab4fbd28d716e4404c70dca82af 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 b2523574a84f2be9d3d22d7d7ed55d3e2b0cea4b..f47eaa2850c0dec6623311b6848629ab4a174684 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 f83fd281a148a60abb4489cc60d3b357d58655ca..ee2c922f6ec0392c43e51e1a4ffc7b981feb8eba 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 bcf4cd41636daf832a058ca45e2583a834f62c66..413d8f3d7b201378e98e29f9559bbdf51c5e2057 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 c18300f6b5022ab10a0008d5457ab5311c974c42..b98220799fa75b64c5047cce4ad7560c57b083c3 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 ed8f74401aad8a63c0af3b9000e8ceb69296c698..857b25020112e713894e54e91d8cc366ab5bb597 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 a6d52ba3e7fcf67c9af1c62eef8835b25f54eb8e..41e66fa5407bc6321656b2d4ff8480fd3a9eb07b 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 7f010902948d4806a8e805dbf7382d1566f0d653..9bfff3477a2be1f5deac2b741f8b92e86244345c 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 cb6a1588ba244057b15bfb75672f43cb00619c56..a615081c99dde40781a639c51c58602f168654b1 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 e9e53c88dd4125dadae64cefd08f42c13575059c..01d4d9d095d23747dc17052b8eac28e35b87129e 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 da55300c8bb1b511ba3f222d98732dc705d2b68d..dc3dfdf6e25b137b854d21e0e1b220607096cf22 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 42a137a2c8e45af47b63d73828d34ba982f0b9f8..a161110703ddc3c7bb901b655e18c8abc4a25dfc 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 fba6ac436ac2e19792817fe87ea7040f52440152..fea227482f1409fb8659b946361295ad0ead399b 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 36b9501195ebdb638a3924939c7e0b64ce5dc3df..2cbba2a449a0c22a7dc94ab032c75b3c38177493 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 d2766f66166e05096cc033bea06fe2214827da31..63d41d2bd077190c17490ec713f781c3550d188f 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 bedddb1a63f3209c891812feae968d2faa9c1757..a21d725c174f027ad6cb9b25b263516fd7a7ef01 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 2127c9757bffa428a0dfb0ad624eca3f9db1c1fb..9dce18f5d3396f20045537c45fa033a10ae0a985 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 7c8fcb78bb30433a9e333d81c86761da9f9a59a8..6aea674066c0da685dc6ca5cd415f4ddb79735b2 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 d27eaf7598aa258ead844ce9c84c6805d1e9bcab..d715f2009fef5ad6489f493a9164923e039c6b87 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 790c663aea45ed4cddb2bd8f7deaefab42359e37..7cf3898127ce7ec821f8f5eaa5bd551bf97251b2 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 2cdb95c2a63536b18b1a9bc1acb44b55c01380f7..761c7980c1d9cf9121ef263fc540a71ab33ef94c 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 37426cf4e3e47c2e834fd9fc16e69ff38a3ddeb4..7f84c92df36a220c1fdbf072e60693c4aabdc10e 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 6ef52a7adaef7b70876428039ff6aad136984e0a..592700ff94cb5ed0a2992aae348ca6415927288a 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 a1d1fa498933f5c8af31041a9a2c2994c3aa677e..8c2acc4026b2de5448d351a5eb3ee27bb462c093 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 1a8b35081d8bd6611de37bba375ed14e9bd48f0d..ab285f46242f9c82297b3569eda44f0343d185d5 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 6bfe829d1d91dbdc32b368331eaf99bef718e65e..ba7995959474229e6b0f093bcbedd6e073f96456 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 7b22a200f6824565762a9233e9097d6247a3d594..834f5be6d482f70776b1fe8a5e70410c2eeb1763 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 6f027d506517b6db5bcb79eabe8661b6449258a8..5e538291fac5feb7afcfaac38426daf2346ba9d1 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 356c619b5ded88d7b95148ff9e725edd139213eb..554e1b2cbaa5c40b14114da903dcc00e86015a80 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 e2834ce6caca7e364fb724be724a031902b1111e..7b36df41f372c9ef4b767b67f21e592f2c3d9b42 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 f2fe9231431f8057c92660e052de72ca4959f117..8c516780cd41c0d4279d51c97aee1e9d924dc1c8 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 3b8c7d602a085eba6694bf8742b881b36d979933..99408c74845e652918e7c2adeaacf1e1dda7cad1 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 66d6726a3088b2d14804d1f1c040798582d44b86..b47d5edb8f7ecf5c8319be30638c01d3be851742 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 1481d3388eabb4b0f237e8fcf4bc793538016767..5543ab94d1ceab7c3155e48a899e18728ca34b3a 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 8d04bb6ba0dc6eb26fc061b2995ea064a606614a..f41106716a9d13bfbf672ce21d09453b72cc8cb2 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 71803dd41cbbf05c9536092788132f1811b2dd26..44660dede66274b46e3920cf436e46344945d264 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 3b71e119f0cf1fbfd139246c1e9a43f354b70331..be365f1b2a1b95e175f6b47fcd7fb86cd3f1c497 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 706457a6060bf241ba3d61b9c9dbcab72e9177f3..2074095d998062857e8092eb155ea9927df3cb8f 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 7a9cbb6f18407f1360540f719730b82e1ebde62e..d84e0c5dc0c1675b535c23efb645a2f49f146c0a 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 a944f6ccb6c3cb27d65cb65cd02e83f13e61e94a..3fbc47224d38ea82371f8ca9869d3ceda2d8d712 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 e0af7107be3b6e9151e3e50c7677a1dede574db3..5995c25bfd13d7ca067462e8c200ae22fd087f0b 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 c1c3e0478114958e938dbd65d30cfed76968ffd9..45ea4008bca051ab6c67025e48b57424cf979110 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 8886a9f1fda46e684eecf8b4bd783f4a64212bda..6846f38409a72feea9564d7bb160410fadcba248 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 a910452094b24a66ddb85e2f2332a44a7e2cbe01..7c3a31b79e36042557195dda8cd7451cfe350582 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 600e959245e5281c8dfa414f178b72e4d54fc805..729c7b2adb71d6ebd1bef058144caa2358d10c39 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 a539a9bb8b06390632d47124d8e93d137deeaf36..dda2125836559ce1ca3a858094752c0e75dbcd05 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 a84a8ebf64127ee27d3744fa7fabffb7e0abcaff..44830e9aa71b8b65d8c97660c37f520c5cd43460 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 1f5a3eeacc7da7fdc59dd69e6aa73ad29d01c21e..229c0665e26b902954b977708564dc925ea3442d 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 954471322b6d21b06c49db37b09a15cbdb96a9ea..cb30619a43ef33f9da0224f26ed261c7f8e34dd3 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 08a29361c7ae0cec2af9b495f7aae13d22b630fd..488d3eacfe4fa2778db8f751611f5848312e8603 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 7a3f7fc91836db9abcd4ee8d5e77a9d9bf5a20dd..d28dde87f1476b3a98a308b60bf1fc7b774f0122 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 b3ecf70ad7aab29f88ee6c0d5332d5009bd71ac6..c0bc13e02ab2ced16c9487ec14e3db7b5fa70695 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 56f1199ab33ab4eafae77af2f399c0ada00dc4aa..235a5abfc2f940c3e9363d114f2daddfe9b76774 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 fdb40db7efb1c3159e8fb2bdcba149cd41d92858..8bdebd88e7439512df66689996dff964ebcb822c 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 de34370d21f655a8360565590a7df89dbb430b71..d6b0bc6988df7eba7efe44eb90d8be66f95c895c 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 644108e7a06c763e553c7056a557c76cd69ae022..35026faa9de3c219355855f7e69400d09c81dd0b 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 754fef6e99adc748012ffebbeb3e6121da4fbca6..94a93fc063c2f7b8271bf76882a5a61caf5f8208 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 d047677d724c836800f7ef636f81a4fbddf716f5..1ecbe8346b7ac7136d88300169248dd6b2123ded 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 bf64c89898b5427cda6edd9d91a69d13247bcce2..123a6b3b589484c84c02ef9efb562fbeb76ca081 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 f718bc215c343e9aef6b538001e9a220119bacfd..53d41144d67ade884c89cbf6ffd2d86d4eac8dbc 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 3af7ed39323972c9848cfc854c5ccb2632303fb4..488a717503489893089ff128e874e872996c8730 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 ff5117d24c861c014603dc0abc89ec7d562832a2..3ca8d9601d727933bbed2513956d3d23faed23d9 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 4039bba652f871c14682dead42f1deafbd4e1c60..6d2b74a3d0c4c95b6b7f89793b999c1694fbf59c 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 55d64fd5021af90f100e1d121d9521f61872f625..33459718e9463da781f02c86ebf391a32154e931 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 84849921dc3026da2cd9d1154caa7d37af37faa6..c6ad95079c7ecb565c01b7b14f08c6d2fcad9645 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 100e4b1114aaeb0d56ef245bfa2f1d491588599f..915cb11e7bfe57ba05671d8ef51b60ef23693b19 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 1c9b16cf904cd0f3ac8af9f30b1c5d37d49d1c9d..4954cc2952ae619813bd174397998d1cfe7d65a0 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 c0c6b2a0f68b1699ec1dac226043e024fabf0737..8730172d46a8c5bfa66b288f256fef12febdc305 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 e50bdfbb8cab3675435f78568545d2bbe8318238..26f3af6374fcc7f210c8dff157676c71530d6e99 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 ad746ec371177c3ba3d854c408c0fd5d69679956..fb2bda882470e183845affe2a18955da37ce528e 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 b4c9fc3b792373ee74d6b1fb08bdad11669969d3..15d348ae800fafb63f6c1c589c840362f46f9bc4 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 9b54b5f04aa18331e973e575781df6598e6c4e65..1e7cba47ed740ebf2b6fdd830b391ee5e9151cad 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 2d8011e276ee9b3cba563aea5321ee746b8e9954..a9536b95cf525616da7354bd63cfb012bca8292b 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 3c079a5af210582ff67ddcea5ebaf7a6a2872f33..9d4e07866d6b5343ab28252d711fa0b3a14d9394 100644 (file)
@@ -37,7 +37,7 @@ __gettimeofday (tv, tz)
 {
   if (tv == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 7536b1eeed772676e458bcef10762365ee4b9d1a..2dcae18f5b0ea04392681856773d848d4108d49d 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 9ac38a8b9f90c8ddf836b2af385a0d6590a38df6..8edcf594d84d98b93f1dea499105a28ee60af4cc 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 0c70dd21649fe8c71df449af77f5bdc83dd3e799..5197673cde295a5d94a12021911f37e50561a678 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 9f4f68d72d95b409fbcdd55faabb8858da4583fb..920136d4169019afd5e3491bd99c0e1bd3050cd2 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 c3aae36a7b615a53f160664efec0c4cef816fc36..111206f6631bd57dd2eda02e5256fce351760738 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 05cee5e5e0bb265e47f988a47b91d689a78aa1e6..95399577777e7ee78bf109b07c7c0d126d4d5234 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 53595f5b54dfe437eb7b39374f092ca2180191fa..539bf433025ebd5fea329e94f6d853ebe9949f41 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 66414c903942d4a9a315ea06e06f839c20e62298..9999021087bcff96f3d448a162f68becfa68eab3 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 3245f9cf9c096a70a309f64e8c72503700705cfb..c318081bacf948ef0971f26b5d92617bf21c39c7 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 441c643df81fa27e7fd1846681bd9ebdc5beecd4..37914e997ddfc4de5080e97b2e9beccd73fb4cda 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 f9ae47b6bb561bee661998f0fd5f3dec05946a3e..9a8d2de0e45d0fb90d755b795d092fba332a7c49 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 771315333a4139023e9fa40e93f527af5e64d9c9..49a55f38b49a8ac6cd9bc920294c25880c4e5ba6 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 4aef22ae325cf229e4e1c3484bcce8cda9012dcd..6a224e17339506042318402fafe49ebba7179839 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 20f78a08bb6736e2d788638f36a123332db8b44e..fd63a4bf694b60c3f255a7d2e4646e099580200e 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 14ee58cafb645d71e7251c28f57355e49a7e8a7a..9660724a39866d3c61e64b5f8658c373b80845c0 100644 (file)
@@ -37,7 +37,7 @@ __sysconf (name)
   switch (name)
     {
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
 
     case _SC_ARG_MAX:
index da58be51aeccb0f42b4ed6e45efd3c1ac5a415d4..b1a685c29a111d945c1e8e94ea5b7ae7b12122cb 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 0f088ec9151c0036b8bc12a2fe51b069876487d5..6fd698e2b88dbc18c122cba2e5012557f604c114 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 4f4c07e1df97d27965b076a2be81b40d8fbe713c..2ab5d66ee975feaa3f2beb8ed557b70135ac6cfc 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 7c7ed2428a628cacc76caa44f2ae229e1ea3a546..be82827d00d648f5244e72d7a5d3d35c7748c67b 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 e6172f1c97062e150328d8013ba7a6e142f74343..1fb4b047d4bcde50e496bea380cebf4dee787d82 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 38891c7e0176cd74ef10024210ca00261cec476c..813c595e1ddc8ad495f7881e4f1722bc9790d9d5 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 5eb084a7c92445bbe1700ee3ca82d613f654b13e..f805f10b7d09d35d707000efc8de7b1dd6d76057 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 59b607305fc0747b925a3ee819edb293e8e89635..7ef1a5f878083c8adcb47af0d1d40c26f6d2681e 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 cbabf5bf07aba735049990cf7b6d6f8f8a443c6c..9d7d779e044c9fa8cfe524117d521a8ba900c859 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 910e7933e7757d0516d7c58ff9d79dd744f363ad..87097d9cb0c53d90933529415f32d037d982f33c 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 284321d717efb6250f6b3bc2100a31ef1c41c602..40322a5e71adff16d6cb483c835f672f09de62ff 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 f0ae3888f623ccec1debb6f3985554b76beec409..d377dd5e5c8dbf89290ad85e9fd9d61ba10441de 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 d7f38f974b25a45b13bdca27e6519d32e544327c..ec74f776d9e6b4d274e3783e47213f32a9b68d76 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 429f2aaefb01d967d03d21eb1f8a701c148d0842..e9a774c0260e282548bea80fc2c0b333f02da796 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 06ddbb5c1210b2234e3dc98251e4f87c2e2ac9d1..6779ea06064b77aa02c901cf6ca23235874f4108 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 1b547f3ec4c41ca53c843db0f45972e3e244da44..0bed4d99f0ffc08314aa7dfd4ee8d424ee68b65b 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 933e2ef7a3a310cf770a81afc2ee4e1a1e58159b..3496121a17ecbec62f199d8fa43a986f9df91640 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 78cf673e7169b55c30a72838430964fd01a59e11..9c4e71fc2dfaec17f8cb6f772e058a7e0dc5c29c 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 38ad46aa8789f3932cf1b0bda986f7311abee5fb..7f4d8145b87d38d756435db553c044cf823cbe06 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 3a48ea2e17373124efa24d259899fcf331b0224a..a4ebbf01f75dc0fef85bee915d1d104e9283e87d 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 f73c98142a6ef4e2745d21dc1e2d232247f79918..7e5d825d3a13403e7000fafac106c74ee8df77d2 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 a906e1b32319d48a63e305b784bd80b1f6b2a10c..9380108283ee3f75e8543b18d87908775811ba38 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 3259d3e121bfd2de1a5baf4e5e3669167cd3c36f..e76566cb83bf62227ff43a4703647d995d5123cb 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 e9db1ed86f793743d429c6dfaed762cd65b67a92..32dd1891455186aba6b338073a26ebed2b8747b7 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 a18d3493299a4197e00e8492b294031189615386..f77010b66e4515bcde2ea9b7bdc7c3b47f38d420 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 c22192bd86fca4bdcbdc68dfb631c198c0c15bc6..b0df84a94b2a4980725d8b6cac352e69900f9093 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 efa80a708d4e062686ac37e35318c7487d83ba79..9374990c09944c5f2b9c39adc401d1184413822d 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 5fb2ed3e7d9db09dcfd762bde3e5c34e511beef9..20735563bbed44cb3385e67cd200b201f3680bb0 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 49300f3a0978d0e1bf27c83008d1e13888058fe1..0d642cbcea660dbef0d5d589bbafcfe24d0e00db 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 1025d686d755df48b3dbe80cd4501dca954edf43..5504c4745e8f4a6a85b3f32be03f5f5cc2e8850b 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 655ddaf2a534eb334abc77e66a24c2ab3d57724d..9d92b5449c25d68d52f9965655019a17568645c3 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 9ec19696f344f0b3dfc9523277a702a710c0d889..06707cdd6043350b669d8f80f1bb54f32bd5add5 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 f15a1bef3b1be04c2ec0fb1abb0c6f6ca212a31c..6c0f63e6e3bfd1fd6a79c3d28c30e732f9aa6801 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 a0f7aad47d6c885ad27c95c0aad6b295b6b77939..dd37b28892ed1202e733bb9a7b15af3deeb7c57a 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 11708086bf9569e7fd2812d869682e7f911b9e29..0a0f80a19da500ddd01176a5f626180e19526842 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 1769e0dd17f025a6560ac3dbd5395e1d3c9c0d5f..79296a77f41b99e8f19db3bc7c377b0b47266f34 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 680d23757e2cd804c1cf7410cbe24abd7ff9a4b8..61a5df30156ca7ff73652628c1af667ba3ae6008 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 ba36ed626a1fdbe93bc80d6fdec032d3d52418d2..8eb7700361ab2e7db6de615e331c1c691c225dce 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 e9640d2375a1cc4623d0b342ac726ceb14bcd2b2..4f59ad3480459e95cf874ddb61026413372c0ac9 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 43d4919c9b0ddb3124048869ff32e371fcfeeaae..f8c5c8021479718a0f29c5eb3e2f18b424ea44ff 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 4af1d0d42925dffc558d9392bf25d87b9517dcf5..16f7f11a06636e8b0a8a535bda20f770747d77e5 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 e35021a496dc22fbd0bbcf4fc2719fad018720e4..21839aab5a82195bf58f9ed9f1ba4cb2699f1d47 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 4ab921bfd19e2616b4db8b97ce2c39dacdfe58e4..3ce07395e2130d281100fe30507ab70312afd731 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 c0990f510ce1173f04c27f06977fb200dcf6bea6..0772ed5da549e6847bfa3eaf1b966ff5258d864b 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 bdd7858393acf26c213eb177d4f3059f58db5f49..d74f8264a7ce58fce2f8106996326a9c76733b0e 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 0b0b63afd0d4daf0158b3a521bc54793c85ec470..ffb95e7b136c071b139a8ed63746ce42440a1271 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 75880fd64768dc933df294b46409bb973c0a0f12..36b1369dad2b032594595fe8662454a439a4f3f1 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 5ef5ccd1b9ec66382128aceeb52cd33a59c2d4c4..9bc09000bf48c8fedac55656d59becbf8865ea69 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 84780da828e845e615c4e729cd8ea446211a8098..6091159d5cc13fd9dbf63f1287f2503cc90dcb3a 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 f9474dd4e2e27256b0ae8a3e6f766603690776e6..75d6bbc7df05447295af71a79be4b9adf1759b72 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 7c1eeff2cb5e3a0bed83fe6f293ecb1b94539a0e..4318a08ecb9c736b36c516a70c234e3f7a07d6c9 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 2aca49091edb9e30dd7ac413f04f4815a111d7c2..4318b5b65e44ba5c31442db26c049f3858d079ba 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 8cf890a4aa0a667c764c3336a005e3fff272d232..6e7793a72c657d6155fef58e0494ec4f55abbb5d 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 c2159df012253eb1bebe6808bade4b2622cd4934..5156bbd445c1c81499cddfa39740fef922567b32 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 e9c9b61ba679c428689ad784068d03f94c56c395..cf3dd916be6f13ff56b7151e5a8ec3a0ee0974de 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 6e4e611e5911c1658721b7c0fdf4db4ffa77502d..cbba8e44c5710b969ab0dd2bc21b3bc13627ecb4 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 a53e25bd96ba178b700fb69b221c07cd9f515c93..fab9f08c7557c06664f9d97bdabf3bace780f06c 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 f5f437576c5b7739ee1532fe238e09d6c187265b..7c470fa1db6f5833ae6c9631416363d7fa822673 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 f2bfa7696a7b41ef4aa0d24d5b7aaba68b19d369..a4e7204c167927a9362b11bf750566c5cb6485e4 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 f98d9663461b6ea86a8618f95c07710bf8c481f5..7d766d76393b124414e19a96915107e61ce79a55 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 8ff3827f51fdccad9b0e2c97587a96f1e0064e91..83c5755100b3bfa1584993473161d2fae4dbcf7f 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 1cf3c7bf26e7ed26f6096d9fc080574e41d0d130..d815f2da0e8ab0d28a44b3775655e3f6414aba2f 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 75b5488e0e98a16130a08ae01c1214cc97a3cb1d..77b4ebd4ede86a2c219e35821fc33c08c3603eb2 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 d350bfb84398b769afd5114c7461302e639e589c..484c159855fadddec5cbd3994b74f509fe5a2987 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 bf29c7c982925478f47bbb433fe48d0367bc2186..fa9bb75d41860551a7a561b3d721ffd916b60885 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 1ee441513dc635615d08f2770d8d079ce007ffd7..2c55df1a1573c617b8f91ee21844dd694fb34823 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 79497ca8aa1bd65e791baf743e0057479876caa1..85256ad7ed63bb689248422e567d5483ea829a91 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 44efc12c1006795fff41046fe0a78344fa3229a8..e6cada2fda02650b16fb95c68546c40ee4acaa16 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 270c90947b7978748b18fd698bd639079359ac09..c2926b10a5c8995d8303d3ab8d33022cc166f411 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 d6547c709b7401aa59bb903e6fca7ea30ae7d04c..e5cc73f575a5eaf2d17eeec398c5c22a1c78fa7e 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 eb6b43d834e6024fad1ecafd4e1feb6f84e55e9e..599fed24785e76f9f93b98e067a3f3a6ff75c6ec 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 a3f31448bc41b2f2c496061b7d7cd54a354af0a8..9e41e076a5d33408dd5c6cd9d4ac36d803a18678 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 6417c8d9d198d5dc7886cc5f6db9ce6e2ec1a264..c13ae7a0fca46b08ee079a74c6ef7a7e55ed5f7b 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 af474c5e4db0393de43d8c01ad2bbd3e5e3d884e..9ae0c8442c11a06f09eefc1fe7dd8096a32e1b12 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 a587e26e9e0eb54eae3a31bf31dba6864104bdd2..17bb2b8a2413fa85424864c59307adb1e165f422 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 ab34d8b09c68eafc799bf84206b32e4a77c2e9c8..e3ea53d79f4c969b35ff523c6da33e6d6c1a980f 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 c8fe700dedf6993153ecfae194fafb07fbd4255d..1d0781d8347517d2bda9e10af88c721ea1b1dbb0 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 74e4619df9a3a5559042f9ddb2be74a42e7a7151..f6f38f28004db2198c7cc5a27888c846d8ce96b6 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 ebdd2688bc4380f0113203e260e208a142ccd8c8..2c843e4c8e7794da8b5e59f97d998fb954df7791 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 b702dda29a2c6db0bc0b28ad44c78f802c6781b4..c06d075ffd51fa3f3e6f842b7c39d2f193c00b11 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 579ddab9b7c9d71134c29ad4c5bcd97205d84198..23d13cd0d000cab49dde34d5bfd0ef744e3cf12a 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 ae9510b313bd645b552967ad1978781418ba863d..45e9500a2873256e3df484ae347bada0a8e370f9 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 560efd83fcf48baf7c01647da3b7c2fff54038c4..5baf9e52a15790c5f36dbf2322e83e5d7c5711b3 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 b9a8b0e3c227e834effd0e51edc26d1df097860b..013b27c368a67fc0a5690c6b881f00fd750285ad 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 6e8424d4a3d3576af70ceb2ea33921c74b41cfa9..047760b527e3aa6ab334ab8edc4d5d6886aed326 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 ca2d77c220dc185d30b397efe79a054f158e510f..58c60e589e2921a8b78f5b1815171fbec63f779f 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 c5ea71374a901b93ef6fedb041dad37946b46d11..643223dc7fcc2959874ce5cca191ccdcdb34e013 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 6b7d4df9381b732ad5bb8a7f98daf0b5c919665d..c042b1ca40d04f08e784eb4f5820a1d008ca0e92 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 6d9c3660fb7afae111358c6b8fbcb7351a898132..e285cb5016e643fb93c8ea20b5851ae253d52c85 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 5729925ff38b259109de8d2b50774890b086a7a8..edbe2fc6d44238a02f7054d668d9e9f8f1b71c1a 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 e3dbacdfe392f97a6aabcab31cc17d30b0aed0cf..dbe2c7cb38ffc368cb2e1602910ec772bfd3cd64 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 9822b5f8b802f87bc4b16ae15add75d773933f12..251ea115200df883865295e6903a43e87d561d10 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 d8aa88283c9c3943d170dac4f0593f87d77f7990..eaf0d2f2c226e41417d63a16dc3d2b3c232a2093 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 1adf6c0215e6e62330b3ae2068c828a56def842f..47dd7125b39b2e0e2209450288360e6624e3ab8f 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 ad660232d7bd5cf84e996b57adc20c34c54e7bf6..06fe3de0c474f4ee7c10f35d904928a981aa46f2 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 e230c9d8a40b13db47e3f60ae95aac774694ebfd..f127eae91631929018bcd5c5fd1923b9cce67d84 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 cb669277b0583840a85afba35565519f0f9720f3..cda38cfee9405630c6ecad2f1e7e0f0904f87a5f 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 2626e4b4b83a438844e6e8a49a091331ad33fddd..81e54cd776e502f15a08993fd75a0e7f9c3ecad5 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 8212f096c1a8d77cc4eee8caeba9351ceba5e9ef..5c2eea700e39e985cd1bfad3c54476c4a4b996ad 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 3ee2b3dacdd1ff70ee16f3b1e6d7da98c86ad543..343c6d8a8bc690812e9c1651d8cce6ef92bfb194 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 3d5dfc55235ebd07b3c432bc6a26fd727f60488c..863824946d2e11d47a8a3de032cdaa615fbc481f 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 77d188017da2fe2f39f259fd1b9112e3c84c627c..04df3d9f7016e32b6acf297c09c3571611060ecc 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 a01c474422be2e44bf350f557f4229ad2d0008a8..21421b73f10c0dcf9afc15f64ca4858cd428388d 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 ba61e0f97a544591c08fa2592cb31395f55acd7c..55b674ec223b27caa3b13cdb5e6cbf1ad4db252f 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 97cdd50da0228e3be3ac8e71d8368f85ea141863..0995bb9654f3d63ca89419279f77febc85c595ff 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 5c3768a7e5b16cdd4f5163521c71147a4a6ea3f1..ae7f88f6a5724a9748945a7973fcda76056824eb 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 1407033114490aaada4cb7e5cbb0acd356fb6639..3d421d7cb23af65acacb9f779c565fa7a406ac35 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 af0d2723f8ac61dd32223fada0c4258d51fe0f1c..08c4b780ef701367168dfd5e7dd8e1ad751ac2d8 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 f0d7784d1ec9a4bd0028ab89ce018589bb56ebd9..f32a6b04c23e040dcf36a2c6688efbcf8d5c5553 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 1a544c38824106f2c7b4954843f128db75b6c284..92891fd518d98fdee49b0cba53eeb033c1aec06b 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 b2a7adde769258cb6becc55997093feb4bcf2032..8a885014bcf84b491d5772b114d95289aa07252d 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 acef99b112b6e3b7ffa9ff8b3b706491d7ecd002..c3ed56b2999bcf91d129e9d0fc051305e5da5f31 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 afa2c4735d1aa223ac3b2e4d3a8a76343e85ba0d..36f6f1b80f7e07c30e838999b0b7d706bf6dbbb1 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 40fc2c91c74e1fb85e0c0a57d825d24b94d5e950..9c7a65d2cefabb765a6287ab2de735903dc83845 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 ab8e1d4ed6fe8324afa691a90b416ba79a353b68..eb5538fd46dc4f43f6b4aaa7c2fe97aabc25845e 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 31fbbb1b059d2fee944774d17691ddc77cf91e2f..d3a2d57a2f0011cd9c0d28376db5741775cca896 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 3d845d8eaa50792f54b540b7be98c6fa09bbc14f..d50b4a5b2d8a4876e790dc0a9f6b72ce748e9ad6 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 ea89874f9266b81a3d75cac75216ac296bbde53d..cac49df7dedb2810a9b94b7cc9891d104541a833 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 014313216b83142fe36149573c68618df3b7cdc4..724f8f85784598b1ebce1f2a982eb34633fdb902 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 d210906dbda7e8ba94953a9b7f2e082bfe60fc44..1555706d0e0e744f3bb8afef3e0bf1f6b718a217 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 b640a8db0fa7056b8e4f7fed71ba13d5b18c1148..99c852569d1d4db8ca2106fb73234675ef4a6e49 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 03d6bf9613fe689f7a5baa7bfbee52a39ea77600..b537499b072ed4526501170d658d3f59f8e336e7 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 5cc05eb5cb7041a50b6085ff08e5e62c8c744159..8db83af97a0b88cc3bc3a843cff90c059d0e8e2f 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 21c9cfa1b2ea2635cc5c72d695299bb75edc86d1..e09ef4fba1d4edb7c171d71c34fb895bb928fc80 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 aca6d23791501366a9dd699d49eca6a8be6f1dcd..47973ed8960271941c0033b3fbb9e96e4f7f2768 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 eecff020843fcb3b5e752e6de6667f1ff0f938f0..27f463ca415d6d1465fc94f831ce96ed92074a01 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 c044e0aac0c4651bc1911cfb3a97f1c253116b13..a8a4d3cb36df3e663e0b1a0416c6c18a0910a595 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 e880d7908bb0d2fa78830eb8763c1a58d89cf61b..b0a8521c8648c84af67df453b4287ad435d690c5 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 295dc2bb5ec2326f1b2da5fcce8c2ecce8b471bc..94107ef89a938415e6de4f5a21df6b754cc1c3a2 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 d4f0ce9fa01c78db6259b21730ed6463e570dca9..1ad85c4cac50ab6d14046a45a38fbd3b9e06e629 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 828a261a136b7c01a89972e25d4ebbebda8a7af0..7e54ee42bebcbb74432936edb0944fc2fb0656d0 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 46d9ecde606c38efd5b806e040284b76dc1d7c47..0e9d07dc1a274655742011c35009b2128010cc56 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 0da92bcd2cce69624c42ea2ebc0dcfc01a083659..e908638b5e58221415a0475d722f6691aa0f01d0 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 bb648389085ac783a6355ffbc7185629c23cd5ec..9fe4921d5376a0bebd8f63f1714b81536977eb3a 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 7ff5af373173aef8dca4e4e0f1e13fc92132e580..cf76994cf5f78c9b3f118df4d42c95b866e29c90 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 370f10c91c660349df6781dbcdd62afbed28dddf..2f79194a23009ff2119f0212500ec8680cb74764 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 b81856128756c4eccdd16212ea24a4a311c40ae6..f23aacbda4503eb1b62a0113c42d15e369bda518 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 513c717b033683914600182df9d6b701a66bb703..c29bcc714969cb673261b39588ee7eec241d5d5d 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 98008e61385884ae53cff69f4bb8a3bdc1603821..b845c2e8647325691c5ff011e98e368ed05ef3fe 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 244ac15e1bacc5ab1cf34cac1789ef6f42a578ba..6c37285fbbed0d9b544f43198888d6fa198e2fbf 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 449aa62e1ed4b73aef1cc68d5c45b96690cc6aa2..fe40c8b51d15acce07997c6c1b71aa4e595f4fad 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 837f0adab46b785756618bce7fbac4f8c6a597a0..1c5e12fc75324bd176921730408319631015d8f3 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 8f2fe99400200659f1a669b88d2bf340e283ef9e..cf44af845636ce16256f1468fdc1d9d561cdc868 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 3ccf2717d4c4bcc41ba445797218d4461fe554e2..327bc8e19dd7f72d1e85658e8a3ad5eb337ae5ce 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 2bba8628e65152b637187685f5a748571a10d37f..29bf159fee212a0b668eb2468b597741a46e37da 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 3832185b9e7604778bd0acd5b4687b7b03f572f6..e921fd74bd2cbb5af081c09684e7eb9e8f05789f 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 2066e5216899a57b2dfa27589f8c569af82b3a96..12d1698985ef5977274ae7f84ef51808ee0f9c25 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 e26c88751c1622d6d9d28efa2e41573e2260cc7e..26353919a150b714e32b72cfd546af3a8921a4bb 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 052b45b9bc95f429d11f1e2b09c48568116b8fae..891141b481320322a1bb202075806a3af1f894cb 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 3429c67911abdead6ea52d7e052f2574ee43017b..573eb63ef69505a4bb3b40ddf58d0ec21c320492 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 998c055f50ddf527d847a3a5d0acb8d4a08f3a33..f318475718e4707c40e22cfa0b674fe96ee70e3e 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 e86e9a5898547521254ba528ad4ef058739012f0..53b318ec57554f9748f5bbd303ee0a517556db2a 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 df1adbbac7c184b4552a9e937c766da0dbcbf24d..a51eb48e2d560d82f8826fac052fd42d219d1665 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 c5955a014e0d6e593a8aa4124bd6653e7bcf4249..0fa96315cd7a218d9b3296ea729fe1682641fa2b 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 d12b93bc6d656d9f70d7c31745e7f39ef5c4bd59..30f24eea202cd8f2b0d10cdc3073c4f4f8d13edb 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 81fa5fb742c96a2a07b95ffafde5db3bc9d5d40d..aeb678910d58052ceab4229f6dd257752034d643 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 6ba70311841f725419997c98afa04e60cd0a7c3a..737257fa7fce5d9f6791118d97124ac1a2c044dd 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 01f58121d5d771a0643b0bb86dac93dfd030f346..b38b0bd98413c34f02facab86d24671d78d877d7 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 a406bc54d8f4bbb18fa5840be58d222d486dd45e..30e7b54bbb5ae8484e4ce486b10ae805f1709966 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 c69421506782c0e7b2c539f4bd448d9f310d946c..6527a3e0bb4987e1d5a6fc35f3f6beaa2afac3c8 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 255306e14261baf641dc0891157c9613e762ad7c..382a6cad2072060b332dcfa995ca08ca5494ba66 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 017dd08692c39925eed1cc2d6687febb775cc05f..0b31afd8be81e03490d6a5dbf99511fdf39b72c7 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 7640d2f67489776c2ed2850b3452a4b60ce72658..b6f9399bc32333cf9a477bd09ae4509994fdaf5f 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 2affcc76b84967ae55934099295b735c27f86ced..79b96235b742adeb686a436600c02c23d51daac1 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 9baf1ee4efd9f219b8d3e58b4f846e874f7af15c..3f0bb3a57b9b5953e5ad11509913462b3d515cb1 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 c1933afe387c369ddb6e8c26a1bef3b8828caf9f..546ca4b0c08dab995e952f041fca275de756342e 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 7d654cde5760b2c22dc1a7595350707117c6b1e9..7b94e88e47ad4b555f16f70cb293173caeea9556 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 34159259679dcc588156244ab8a9c491c620a132..122888619b2f33088ae544de8d9a9508ff0dd5ad 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 099f2279d26ff495a340e6713f82fb71d9f07f87..9d5629b06ccb47e37dadcfbfeefc5be6e2c40491 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 75a4613166f260e5cd9af57e3f14fdd597a91a4d..a3b37076ffd7093165eb16387436fe869a2c85f5 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 8affa6c15aed291d10285cf5545194c80f6f9c40..8cca7743b6ccdf24eb797fc9f9846ddcd1e51e95 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 d59ff90c9908eaf1c8711d02dc32c073296b16f8..63c5443701e4acb251c9af4aa3b428f6af1425fe 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 501d5321847400336c2a3f6f0fc7e3c9468d6804..cce3dd702bdc43e7b6a3b4f88570e5357f717104 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 7321140acdb9ae1a81db0f48bcacdc81119f84be..1344d45044fb2051c221cf59230c87a348ccc65d 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 01a547c2a54ee9233cb75d362a3e3a20a1d81f03..f348a5372baaa6bdfff3d0313a15a90ba01615bf 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 7c7469eee78b46f73418bf38a392d2966a9f70f9..320027f89c8d46aea08595fb67a495beeaedaa54 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 a15b2c11b42ca5b937ce3aadd59258133bb25b5c..f98f98803a477e1e1423ed8204dada8151c70c89 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 2bd9b4217fe6dd9fb13e9199acdaa75708417572..6ee587acb3a89cb793308903a54aa176694e5ad3 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 a307422d06a753fe5abdbba95bd6988e761bb774..54d23ee262780a684170d2a188b9f354c1a4843c 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 def44ed1a1eb748c0ee6704db386e2a36a2fe9cf..81096db731e323070e24164aa84cb60d05dad932 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 a89f683d549f733fd845945817be03a13b4ce42b..48623be13b9307832eef302b99393e252048985e 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 d4370e4b34ebd01e98f5b8df7dff5574bdab4fbf..7a2db5b4cc0d296daed49155ffaf50a458e3891b 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 ab4ae811ac9ebcd3e2102e4a0ef1a3b98e431d65..7bb5eab0fd7dbfbe6cde949c888334b0bf2b4eb9 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 a9da1e699ee779aa8f78ea21e920d5c62bc37a19..79f21c479059bc7108a3f5a3941d27b6bc2c9dec 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 da7ff85a833707ecff5e39385533d22971d72bcf..ce604f8cb4f219dd61e5a9731d3a89fc3a314704 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 af8e24dc64741df70a2fb24c27bbb199e3bd387e..62505a7d684ca213bba8272e6e1337ab7a36fa37 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 88c7120a27f59e313fdde899e3feca2cc06645c6..9ba448f586f575ea33ea45aea753279a67581f40 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 26f550db87b637f4d4a9be818e4b8fa08b58cac1..52017cbbdee6ff208b9a21360a61e6b8e8c8c55d 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 bc9b4b50f2f6ee4d40afc5070f4719eaee0bcafc..938e08f50e679cefaab4c67a999cbce668558bcb 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 e49bc31ee3ebbdbb95bc83a3d33b9397195b7f87..d7486737fa44f4d345f4b05d5dc8c21dc2180552 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 9d412011f91ea6215d70351b9ab5c6fcdb288ac4..c16582d9b39d443f014a72c44c293b890c98cc4f 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 1aa2feeae6a090e9d47f99d6c255832c0816dcf8..72a93b2b9a6b68d6fe8c799371719558c2ff6d0c 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 231e762808dae6c82c0e684b46f6a299904dd90e..4a58dd89242e7d9c679138c63c5a205e0da147af 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 dec67c2cc3ef7e3c15149357f6fca41432340402..e4fd33b9ee743f05ab775b2a0e218cf357819845 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 d082bbcd5389156424b1ec1580da4ab2fa095932..66e26501495a3aed27338a1fab3bc5c605c220ef 100644 (file)
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.  */
 int
 swapoff (const char *path)
 {
-  errno = ENOSYS;
+  __set_errno (ENOSYS);
   return -1;
 }
 
index 825f353a8895a89348a55c5e31efd5606dca54f0..d990befb0ae9667e977cdde88db9092b3cc61a60 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 c8e6f1242a230836e11b8e7c27647c5696308402..d02e218d2b5c964be22426449ce2fd52e93f916f 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 34ddf2f0de1abbab2332dddbd9474689840d5502..b775ee8dd2f9f18c7e7e9d4e4aef01a25d65f025 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 d2a5b3ca3394aae9cbcdc49516d6170d94321621..f08ab3d851f0edd6b745af8d05351debef9e6beb 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 1351b48fe0a303950fff50933ed3d60cabafc663..43ad6d93a9a6824e20dd2caf4b7206414a8084c0 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 c74823a7a43fddee998891163b9cc623f2566054..75976c2d3d72576eda5872d978896d6aacd62b01 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 75c0747a1e8572e37f04f94ca485117cdcdec12c..8cb192d7ed9a8d911d84f8a5fbdc6e0f6b871dc6 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 20f2b86195d0984670857d9aa7016a44400dae1e..4d52f340098232fd3a49a59e0c7671fdf37306e1 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 5ccc9d56467a93653e0b2c86e83d121c0b934aca..1dbda79719c16d0cebe35f4179fb8c867e805e93 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 3e9f7efa3a5f13366136687e63dbeb985e814151..16cc1c4d91f1e91ed66c1b55689bb5ba90255280 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 70208491edf596bb67ed7fbf7523b77c29d45f9f..da6e545499ca58a3dd25a13d2facc8944df388a0 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 1e1ebfa92300ea478b3cc3f59cd96e1356ecf207..3b901a9662cca1990715cbd3dc05fbff1a2f6cad 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 6d8be7403c2d33d569c8f37ff626916c36c509a1..80ee6f4d5329ea2ee70bca30238324b492a4f4a7 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 89ee7d7c32da4e44124fbcd56f92cf1470f6d999..ce1dae094f6e15c4af452b6129b26cce166bad97 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 3dbe34e29cd11b7d1f3ae3adf4f9d59444e947cc..3a97fef9751dd03ea11c642e8dd41c00505bd12b 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 ce00e09fb409752dbbc13483bd158360a2080fac..811ce740009fbf6d4b81a7ce2e2671b7d518a722 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 42b1c32022951c5eba30e2a46fab54c9758f5c52..939c70fb0d4731dad73aca4c2bcefdb5aebecd3e 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 cb208bcf0b2a6bc00ef1dd73e16f403996770a26..d410be3894c607f44ed58e0c0a28aaf618fa691b 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 2b47ec2f1d2d79605da931e1f954cdb359a2bf7b..ab33dcae3320db21c4a0ed7c7e9c4876089f1965 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 13673327922cc54de27456e3340411586ff91585..1134c6a4d9bca0f8550a226f8f3c5ac20abf9681 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 a243e85053530913cdc94313f84970a97250095a..0d251f4ee00da8c5b63d22cabc5a4022734e474c 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 67350d9ed3f8cdac0858060f02db1b0c550cbb29..7a05629c43e2bdd7c4e9faeebfbb9084d5f706d6 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 ead365b157192ca038b87cbeddfac3f417375d08..ffc4e51853dedfcb6666aae7541e99a0c51d29bb 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 84633c4e14d0475e8167007b996e50bc87abb778..e633a6aeed3ec2640cd335a050e33369d2bb67bc 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 18c85b74b71d941cb4d1ebfc2f09103127698c43..fea20c2972759466e65d5387f3d719c2f6dc89d0 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 7f8e249f27e5c43afea56d6519a2367ff6a1aaf9..6fe7c9de002c7895934e53a870a08106e1995a59 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 c1cae9c7c61e2ad264728f1fe0ab3e25c7cd1f41..4f3f232f6300119e9855045aa844e1e63de77657 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 baa98fd5e8829f7a9ff9f4a445a95d91646a96cb..8e909f9f4082420a77296a7e5fe4989ebb30c2fb 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 641960dd1b9444b03d6f858b3021edc4e592c91f..374ed1d1404ae54749b8e8def1f6341307c81202 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 5afc3d7eb442d71bdbd1440c1efb4bee58681633..824f2412ee60c67e930f82883c4ad75ff33805be 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 6a7a99436558b12fe88b6cad2059195e6b161a09..532fd643873bcdbdb07c565f8117dbeb2e0e8520 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 97b78417b61bc85fda49c6692484b2004dc59488..a41a2471a8e6682a5a8aa7c9d4c1e45b73415a26 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 c1640dde8acd19001a8f8d34d209ce9a7039bbea..b5ea8e37b5075ebbc7e9e0887e2be027a64f1f14 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 2062d4b2cc6a45f75ec579b19511564bd61d0cc0..bf273438ca3b81887d2517a6d95b53f376b4c7b6 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 22eb019eb590e404d3d9f55e072dd0814ccb3dd9..09ba5a8f92b008c4bb79170153e8d9af7768a211 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 deb4851e060e4aaf57c513e43ac14b8ef27fce9b..69778c376f90009de14db3c9574bdcc8f596abd3 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 f1d574948db7d95c81df6fc3e65e2b2cc35134e9..593880c0e994fba4b0df3c8ef00bb3cba646b35d 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 6d365cbe0cd1220693e1f8fb2b758d846f9c5912..48d8b4f11332505d472c2b747147b7a3237fcf89 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 ad67aa9fec0ecf25fdfd1244588f9f29a4e11296..a487062fdf325db4c780a76272269dce5ae35d65 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 dcfdd9c47fd44acdd308383a50f46af3a02dbb5d..c2a9c084131ab129c6d40b97fa2b0256e840b1c3 100644 (file)
 #endif /* __USE_BSD */
 
 
+#define __set_errno(val) errno = (val)
+
 #endif /* <errno.h> included.  */
index ac7c9cd2a1030900d0c9e928d402ffacca9fcc80..feaa652aa7478555eaf59d73cce8976442e2f5a9 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 a29a99f9b962e25c077412f21a2256ae95c46944..29225f86384eb74a282d5f84932c232b06934ffe 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 b5a34c32d045707851ecc359ac5c696379435e22..2a21e3cef88238c35dbb3116d4ee232f2eca0d40 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 c3e80eb1c33d71ea1abd16fc5da2d2cfd1a0deac..f6e34e865b7712cbe5c58cc84263a2af4690bd9f 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 c4a3780f6dab4a936fe82eaf26d538ee56d66178..420751bfc186e6bcd118458404ac4c3012440bce 100644 (file)
@@ -26,7 +26,7 @@ setegid (gid)
 {
   if (gid == (gid_t) ~0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index f6aa37f153d0bdc79afec0fbe26dbdc770000878..06fd1a3f29faf8f7b37c6b83599f8170e24bac82 100644 (file)
@@ -26,7 +26,7 @@ seteuid (uid)
 {
   if (uid == (uid_t) ~0)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index e05769458967b5e6691e30c62549b242f11593a2..1da7865ac6ae67bde0154678dccb8883b146d703 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 aa1c53f6cd2ab74fc617bac886af96e47826f78c..f20968d68e9eadd8776cf6c3f1704c9a8718891d 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 31ebb743a819d89acc276735f4f1dd1b06545186..3421eb4f31e03b19cef3a5e53f00c32e7ff8ac66 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 fff56a950f7958015e678b22478225995c023067..4c045aa663f6d679e3ba43aeadda382bb6f1b094 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 32a2c2047eaa5fe98b04d3b4be99298c0096d391..db9ffb51358c8ecaa2438c117e4a737763849778 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 54f62933a82b38b41d06405731950983535ff541..11ce1945ff16894be65be3de9a05b439b59fc034 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 1c09d55dabbd1687c8afd3e6ec42a8527f485903..de6870a51d1f9b20a1cceca4cc490244a318b2f9 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 f88951ff9dc671df5f142029cef9115e27460302..f825d41ab8a13e2cf33eabe8425127688b5530bd 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 c9ed18d4f83ca651c0ca1b7d93549a9573cbcf71..84bc06813d71142aec38e3b0cd2a9ce6f07b8de1 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 06de144a45ac460b55eb3d0d3cc46886d699a0b7..1919d6d9eaaa18bef7c797b979ed9562ce5b5e26 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 46454b8229ad5e9fc81ba8bf0816fb2cf6323e80..14f7db8dad50e2f0c0a13b3a4c3978162f039e6f 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 0e6e3785ddc64dacfd0c2b09a6b3dc31cfed53d4..5d17bd5dde4b05a4c1667fb5be7845c8fa8fd17e 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 e731d830f607de5666c9445eabd9fdc9ecb06f26..770bc98b799421005a0b88d14fb165f5752f374f 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 edf3e90972b316962be14fa668b7247bbffbc730..8277ce5a7633d2ecd5b509adc0133c0019ba7da0 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 912faf42e2b9ceb7d14659dbde34f9d413443267..f90692a11ca0bf65409e61b08e67cdbbc650d6dd 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 24bcbb4e00f51aa9dc93b3d9a5af3d3dd4e724c3..aec58852521b761cf99df663807ceb18b10e744a 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 a9f3c5bbbee16251dc6c9c68036f2de55af1c30e..a24c1c5ce8527629e85f06daf85732ea7b324f80 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 5b938a8272dccb738d32552e68f7d92d53a0a5d4..a46d47ac35e1593296e1a19429736ea5df7c4da8 100644 (file)
@@ -32,7 +32,7 @@ __closedir (DIR *dirp)
 
   if (dirp == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
index 499a0838ac8b47842475188ce4ced75de9bee5c4..f33279979ad60baaffef7805704aa2dab5ac4816 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 b2fafb958e234f50e9410ccfbeb68c8225371789..a073dd2b3aca42443c2c4c91b8286cf9feaa7066 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 348321a492c589aeef3d6031aaf729967aa59f87..7d768267c42290f332f9dc6e78deb8495b296545 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 522d3fd052b44b48ff9bbb4980ed3ab77be85d33..29cab5177c8af8240f6c37bd2016877eeca2f3be 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 485faa13c2db712b2e4966ec9a9667fd1f52eaba..6dec0dc5b513a9c0933903225289a8f9c39226ee 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 e23ffa46f51572ce67c8ecc75f117729bf473260..ef985f2d2f83d410291e3a12e168d279d8f6e53e 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 154a9d3a59b834b608b25be396b08b0b87c03495..f80b2c7518b9f24d77036bc1d7c7dd3227cf8a4d 100644 (file)
@@ -53,7 +53,7 @@ getlogin_r (name, name_len)
 
     if (result < 0)
       {
-       errno = err;
+       __set_errno (err);
        return err;
       }
   }
index 16713f9e48bdeff443bb6544175c59cbaef2994a..ff87f9a74f511195dc7ac2132509c1bcec4e9265 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 2211e8fa3cecdf55f446afbfa39280406e19e748..a5f44e465bc5b03852a97c56b17e8c116de83a09 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 01f1412adf20f2985430674be649ab8b131f5a41..d5a44e5d640a928eac481593c673e00753e73186 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 5389f65e89b087f462196f95f73fd250cfbc2e15..b40aedbc825f7b5bae59b9481cca5622bc583c56 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 7161cec6e91b40fcc8e5557f3243460167bb7096..c38c8d478a2d884d5f61fc552d821310560e4446 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 46f2caff87589d94a26f9a6882963876c9221fbf..491469bcd1d3944d513fcd217fd54b028240cb1e 100644 (file)
@@ -36,7 +36,7 @@ __readdir (DIR *dirp)
 
   if (dirp == NULL || dirp->data == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 52a130ce3e645ae1f6b9919856b2d08756e69b1e..7bb40211c1ee05d1f5628cf5ad5cc5236c31315c 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 f8567d21038200afc1f2bd2a8ebf3ba6b979d432..6c18b5c09c40fe6167ff532596252d452e608c22 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 e58bb3804d1f3823d686c2a30379824c7d99d2a2..8112d2142aa975224b2f453d85d6f318c37a3c4d 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 be928e8f39c700b7f8f0ad9296941d20cdc27e61..869a28ad2ea80a59027e2988a879d3c9fa395092 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 0da9d17b0761e6330389eecaaf54a820ddaa7be5..fba12457302fb3a2effc87fc20c547ae262ba0ee 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 70a94318901fc05f6c770a6b6be05ff589c15695..6ba62197914c1ebd3cf8d933641e85357c0a245a 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 a6329534235cb31094203420ded3db3e690fe531..322813a7ddba0d9d31b840ba849f45bd20830d2b 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 cd86f85244cd222aa0a493c31f935847cdb7aef4..b11d27b6ed829536e8de7d7147f0cbe13e30bde2 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 33220df5f6934044dd258073729c8987b4f8a55e..7cfa06db66bef94eef21c779e4f06151775d3c65 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 44a0cbbdb5cfadc14592e7342a218951911e3ffd..be42ed337c86bfd6fbf5692a964e8791d58c8793 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 731059e600715357d3cf67cba0597607b98ef585..924fc473b2bfb1ea533182e0808d5ad67561c2ae 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 868819e6b36ff5546aa6f027f7ef4164dd9c551a..8a7055aa6a9078dd71e7d30f30757b392a09324c 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 2883441c5bc0d29e35aac1066b447163a3eea503..a1d141b14258fcb0ade98b92b35a22629be1184c 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 4b7720d41483cc53d68441e4151a6d0858b596c1..8a01fff073f379ec56dfcf166e42522020428b64 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 81946b422f48b752d2de4ce5f508fa36b4a908cf..c4c6fd78f62476e4d14b083352f014282593a60f 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 f9e92dde5efbe984352cc0aa162a2eccabd75d58..d11c3c40d98df1fc4e791d560b11e43f0a18e036 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 58e637eed50dd510029707d27b4432d4c14ebdc8..f3ecd4bd15d1c130be15c6533320a64a5c5b4375 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 0f3e31dbcef847cab71e180eef3335111b04f3c7..213af51548ea7b99aa5df327527c66263bec39b2 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 cbd7b5553b110634e7d42fda4eeeeecf803023ff..1bf20bd71852f304b05da247541432cb21167f6a 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 3fd547545eb055b9a39410d6c9f55ab774424e76..402dfc56f7b5cf198937dada0561a80a1b8c1f5e 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 b47e167159544551c16b29295f224eafaa90f851..407c2d393cdd358e6ebd52d68b7ca615975fc47b 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 9de750c326bdabaace22328ed1d3b59651d8be7a..cfc9b04af0669e27a587d64f3f4486bd622c0390 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 32cc990119eb219965ad5a6cabbd5dd0f6182f4e..ede413a43c60c39c86b91a1b2727c7ebe017d94c 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 53510b9648f6e497979f1f4bdda711da9cc1d740..1aeda8224a5bd9b044e7be070e7db2a76b383881 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 0ad48a23d8460ed3289199f166a4e752f7f1fba3..9dd5e2f26913b0b30527d8a360a777e693e247c0 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 d9dd3d100a769e09da35734812be11c83da8113d..3601b5f357067b9fd704200959f71a02b825038d 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 20cc809c6f7494f8811730f7fa21429ff425066e..bd561b6d9ead6739d721b12dc7dd2027b61675ba 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 2b1193085ad24198d40cdd681d933ae250819954..7493eaf5f3208aac6634b0c97dc480135393cd59 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 d4ee06bf1bb3e8d704fdd7cfa1effbf6bac0621b..bbb98a49dbeb0c129d85bd9eb88f199e0cd7257d 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 be4158e16e5505ba6d10a6f2ab2e80e92e803dd9..2b005e39d6852afbc415b708741525d39a1f067c 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 1217c6beee5de3bb0bfc793229fe8a7800692e09..147f796a6cef620177b3206116b84026d9941997 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 ebb42cf756aba48eccd39b7642ba319c1f2232f2..eafaec728932db4f0b9de82748d03d8bba4674a0 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 68fd7a18469994bc8a9c42c870de24f1c430d066..37893fa649fe06994cda9c6b1ec1235d157b2797 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 81d660fe64891c78ddbeee85df6f0edf95d89205..cd0e84480f440f280feb3c1b6baa107757f11c16 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 f54df4bf6bd5dc84fd40f1f5474a303c1d412326..586a374ce95319466c1c73fcc09b7be51842e3d5 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 37144799e40078b4df14f7467e21ec78aaf61fa8..92bd7aa3c7e7136ed01d3cafdd5d879ab4e7531e 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 fecb40dd820d4f6701e4960a5e3a1e8e81d1a60a..ac9e79731d3174927d3906e7a25aef94318b2eaa 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 88574a5c4bbfcc2945d343900223033f83bef700..47250425ef11bbbae3139887ba4a4f2e6fb2ace3 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 dd914a295521015ca814b6d924e99a43155a5084..cd98e0cd678dbf373bbad2fcb7dc4c5f5a0ed93f 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 78fe2c542a0250091c76a8e6c686566ad3fa07ca..614b52a57c45f1c9c3b527bb91983b9905fbc4d8 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 230a258e420c0b8ccfed9647f098b310dbeed73d..76d0192e5b4f00ea02b5f931be80fa617053584f 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 81c794a435516d7f5a91c33082e686af52b727c0..21bd3f48bd7232f48077ae43dc0f029bb2a4ef6c 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 3b1b112234471abade3376301eb82e2b6bd8b18b..1a53c88cf2483d90842746c47fbe0ebc1505642c 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 bb20a3aedc7bc52c645b11153eb4c617497a8b21..25bc9de04c4f510112ee2bba7c7bd68c967d6656 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 2a780304d62fb13d6259793231f48ff61de5a03a..ce243e64b4cd55daa7575ce88e2769eb10b60d39 100644 (file)
@@ -50,7 +50,7 @@ __localtime_r (timer, tp)
 
   if (timer == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
index 7837373aed657707f3d70e125e65a6033336cb69..9d23cf71830b370a9f5ab61c585aa8241d14ba3b 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 056f7be5178223559727b4bcf3ea43f1919a7391..efd382b4c674c5704eca15c19c2d3c2f2f974be1 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 27906957e90b4c069c99637ded836a0f1db136a6..d8c6da6910384667ea440bf2898a65df06a0f320 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 d7305d69047d929570cb1705534ff1d95b3ae806..276d125c3860227a79d0c6b0f88412ebea57bf5c 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 052a5b951b1c4d92f760988f487f758937881786..f5d9f7e1ca5501104ad4f14cacb31dd799b766ac 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 fb50a1173281a3bcb26cf04a93529c0660e49b09..f01491450c04be82b9e59e98a4446291ecf188af 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 999e291eb26838ce442a02d947a6dcff5cc2c0f4..ac54e743beb4c0991fbda3375896dcf1a637aca2 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 42df61923b4374b11ce407027bf89da22d1ad80f..553c431aa23ce27d2bfc24e2b18418eb15a848b6 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