diff options
author | Ulrich Drepper <drepper@redhat.com> | 1996-09-27 03:45:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1996-09-27 03:45:24 +0000 |
commit | c40298232a7ed3fb1b64eb4ffe352829deb79694 (patch) | |
tree | 6e5105602f9339c8a17b835ddc0318cd2c698b2c | |
parent | d022f6ab9f45c66478e6b3e45b3f9b3de12e090d (diff) | |
download | glibc-c40298232a7ed3fb1b64eb4ffe352829deb79694.tar glibc-c40298232a7ed3fb1b64eb4ffe352829deb79694.tar.gz glibc-c40298232a7ed3fb1b64eb4ffe352829deb79694.tar.bz2 glibc-c40298232a7ed3fb1b64eb4ffe352829deb79694.zip |
update from main archivecvs/libc-960927
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, 3971 insertions, 2363 deletions
@@ -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. @@ -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?'' ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ [Q1] ``What systems does the GNU C Library run on?'' @@ -425,12 +433,119 @@ to use this feature. ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +[Q16] ``When I use GNU libc on my Linux system by linking against + to libc.so which comes with glibc all I get is a core dump.'' + +[A16] {UD} It is not enough to simply link against the GNU libc +library itself. The GNU C library comes with its own dynamic linker +which really conforms to the ELF API standard. This dynamic linker +must be used. + +Normally this is done by the compiler. The gcc will use + + -dynamic-linker /lib/ld-linux.so.1 + +unless the user specifies her/himself a -dynamic-linker argument. But +this is not the correct name for the GNU dynamic linker. The correct +name is /lib/ld.so.1 which is the name specified in the SVr4 ABi. + +To change your environment to use GNU libc for compiling you need to +change the `specs' file of your gcc. This file is normally found at + + /usr/lib/gcc-lib/<arch>/<version>/specs + +In this file you have to change a few things: + +- change `ld-linux.so.1' to `ld.so.1' + +- remove all expression `%{...:-lgmon}'; there is no libgmon in glibc + + +Things are getting a bit more complicated if you have GNU libc +installed in some other place than /usr, i.e., if you do not want to +use it instead of the old libc. In this case the needed startup files +and libraries are not found in the regular places. So the specs file +must tell the compiler and linker exactly what to use. Here is for +example the gcc-2.7.2 specs file when GNU libc is installed at +/home/gnu: + +----------------------------------------------------------------------- +*asm: +%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} + +*asm_final: +%{pipe:-} + +*cpp: +%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} -I/home/gnu/include + +*cc1: + + +*cc1plus: + + +*endfile: +%{!shared:crtend.o%s} %{shared:crtendS.o%s} /home/gnu/lib/crtn.o%s + +*link: +-m elf_i386 -rpath=/home/gnu/lib -L/home/gnu/lib %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld.so.1}} %{static:-static}}} + +*lib: +%{!shared: %{mieee-fp:-lieee} %{p:-lc_p} %{!p:%{pg:-lc_p} %{!pg:-lc}}} + +*libgcc: +%{!shared:-lgcc} + +*startfile: +%{!shared: %{pg:/home/gnu/lib/gcrt1.o%s} %{!pg:%{p:/home/gnu/lib/gcrt1.o} %{!p:/home/gnu/lib/crt1.o%s}}} /home/gnu/lib/crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s} + +*switches_need_spaces: + + +*signed_char: +%{funsigned-char:-D__CHAR_UNSIGNED__} + +*predefines: +-D__ELF__ -Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386) + +*cross_compile: +0 + +*multilib: +. ; + +----------------------------------------------------------------------- + +Future versions of GCC will automatically provide the correct specs. + + +~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +[Q17] ``Looking through the shared libc file I haven't found the + functions `stat', `lstat', `fstat', and `mknod' and while + linking on my Linux system I get error messages. How is + this supposed to work?'' + +[A17] {RM} Believe it or not, stat and lstat (and fstat, and mknod) +are supposed to be undefined references in libc.so.6! Your problem is +probably a missing or incorrect /usr/lib/libc.so file; note that this +is a small text file now, not a symlink to libc.so.6. It should look +something like this: + +GROUP ( libc.so.6 ld.so.1 libc.a ) + + +{UD} The Linux ldconfig file probably generates a link libc.so -> +libc.so.6 in /lib. This is not correct. There must not be such a +link. The linker script with the above contents is placed in +/usr/lib which is enough for the linker. + + +~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 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> Local Variables: @@ -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 $@ -$(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 diff --git a/catgets/gencat.c b/catgets/gencat.c index 7ba9258be3..7fe159e5b9 100644 --- a/catgets/gencat.c +++ b/catgets/gencat.c @@ -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); diff --git a/csu/initfini.c b/csu/initfini.c index f816e08169..cb2ba5308e 100644 --- a/csu/initfini.c +++ b/csu/initfini.c @@ -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. */ diff --git a/db/makedb.c b/db/makedb.c index cfe6aed157..5c0d659f1a 100644 --- a/db/makedb.c +++ b/db/makedb.c @@ -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); diff --git a/dirent/scandir.c b/dirent/scandir.c index 6907f0873f..cffe5056ac 100644 --- a/dirent/scandir.c +++ b/dirent/scandir.c @@ -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) diff --git a/elf/dl-load.c b/elf/dl-load.c index b56303fa4a..9dfc961a2f 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -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; } diff --git a/elf/rtld.c b/elf/rtld.c index 0736218536..58676924e5 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -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. */ diff --git a/inet/rcmd.c b/inet/rcmd.c index 00fa965fd7..1c63e952dc 100644 --- a/inet/rcmd.c +++ b/inet/rcmd.c @@ -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); } } diff --git a/intl/dcgettext.c b/intl/dcgettext.c index 7bbe170b76..592f724eb1 100644 --- a/intl/dcgettext.c +++ b/intl/dcgettext.c @@ -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; } } diff --git a/io/creat.c b/io/creat.c index ee935c87a4..1e1717b40b 100644 --- a/io/creat.c +++ b/io/creat.c @@ -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); } @@ -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; @@ -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); } } diff --git a/io/getwd.c b/io/getwd.c index 8a8d01a28e..00825ee0b0 100644 --- a/io/getwd.c +++ b/io/getwd.c @@ -37,7 +37,7 @@ getwd (buf) if (buf == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } diff --git a/io/lockf.c b/io/lockf.c index 91664197ae..c391243e97 100644 --- a/io/lockf.c +++ b/io/lockf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/libio/Makefile b/libio/Makefile index 902d63f21c..ba64fc7752 100644 --- a/libio/Makefile +++ b/libio/Makefile @@ -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))) diff --git a/libio/fileops.c b/libio/fileops.c index a3138afd16..b4bd5ce7cd 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -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] == '+')) { diff --git a/libio/genops.c b/libio/genops.c index 818e740851..7c2dcba7b4 100644 --- a/libio/genops.c +++ b/libio/genops.c @@ -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); diff --git a/libio/iofdopen.c b/libio/iofdopen.c index 797192eaae..67c629c583 100644 --- a/libio/iofdopen.c +++ b/libio/iofdopen.c @@ -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] == '+')) diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c index c45cfacb06..4cec7a73d8 100644 --- a/libio/iofgetpos.c +++ b/libio/iofgetpos.c @@ -41,7 +41,7 @@ _IO_fgetpos (fp, posp) { #ifdef EIO if (errno == 0) - errno = EIO; + __set_errno (EIO); #endif return EOF; } diff --git a/libio/iofsetpos.c b/libio/iofsetpos.c index 96c3a7a2a0..9013606e72 100644 --- a/libio/iofsetpos.c +++ b/libio/iofsetpos.c @@ -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; } diff --git a/libio/ioftell.c b/libio/ioftell.c index 12b90b37f5..ec3b1a2f2e 100644 --- a/libio/ioftell.c +++ b/libio/ioftell.c @@ -40,7 +40,7 @@ _IO_ftell (fp) { #ifdef EIO if (errno == 0) - errno = EIO; + __set_errno (EIO); #endif return -1L; } diff --git a/libio/iogetdelim.c b/libio/iogetdelim.c index 0acd76e6c5..da6efa459a 100644 --- a/libio/iogetdelim.c +++ b/libio/iogetdelim.c @@ -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); diff --git a/libio/libioP.h b/libio/libioP.h index f5e6dc5a0e..d3c871fbeb 100644 --- a/libio/libioP.h +++ b/libio/libioP.h @@ -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 diff --git a/locale/C-time.c b/locale/C-time.c index b03ff498ab..dbb51f383b 100644 --- a/locale/C-time.c +++ b/locale/C-time.c @@ -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 }, } }; diff --git a/locale/categories.def b/locale/categories.def index 5e72319774..664fc901c4 100644 --- a/locale/categories.def +++ b/locale/categories.def @@ -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 diff --git a/locale/langinfo.h b/locale/langinfo.h index 82bd51024a..4df8df7a45 100644 --- a/locale/langinfo.h +++ b/locale/langinfo.h @@ -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, diff --git a/locale/lc-time.c b/locale/lc-time.c index 7b84f99dc2..f4fe561cb9 100644 --- a/locale/lc-time.c +++ b/locale/lc-time.c @@ -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; +} diff --git a/locale/loadlocale.c b/locale/loadlocale.c index 5894b074de..474a73cf6e 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -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) diff --git a/locale/localeinfo.h b/locale/localeinfo.h index 0646f0e8db..335e866f91 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h @@ -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; diff --git a/locale/nl_langinfo.c b/locale/nl_langinfo.c index a9fa4238c2..1c42e14a4a 100644 --- a/locale/nl_langinfo.c +++ b/locale/nl_langinfo.c @@ -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; } diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c index 75f6021109..1b118ae14c 100644 --- a/locale/programs/ld-time.c +++ b/locale/programs/ld-time.c @@ -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; diff --git a/locale/programs/locale.c b/locale/programs/locale.c index ea15c87638..667afbd188 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -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); diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c index 1eae6e75d0..ff9248e317 100644 --- a/locale/programs/localedef.c +++ b/locale/programs/localedef.c @@ -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 diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c index 63ebc4b856..97629e5132 100644 --- a/locale/programs/locfile.c +++ b/locale/programs/locfile.c @@ -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")); diff --git a/locale/setlocale.c b/locale/setlocale.c index d0d9223733..76320f8a32 100644 --- a/locale/setlocale.c +++ b/locale/setlocale.c @@ -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; } diff --git a/login/getutid_r.c b/login/getutid_r.c index 00dbec40c8..81070157a4 100644 --- a/login/getutid_r.c +++ b/login/getutid_r.c @@ -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 } diff --git a/login/getutline_r.c b/login/getutline_r.c index e5c41966c6..e88267decb 100644 --- a/login/getutline_r.c +++ b/login/getutline_r.c @@ -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; } diff --git a/login/login.c b/login/login.c index a53613f238..00b176a104 100644 --- a/login/login.c +++ b/login/login.c @@ -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; } } diff --git a/login/pututline_r.c b/login/pututline_r.c index 55436bf2b8..42ea3cd778 100644 --- a/login/pututline_r.c +++ b/login/pututline_r.c @@ -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 diff --git a/misc/Makefile b/misc/Makefile index 343cc3ee62..00f5f785be 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -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 diff --git a/misc/efgcvt_r.c b/misc/efgcvt_r.c index cbd5c271ba..7f80242580 100644 --- a/misc/efgcvt_r.c +++ b/misc/efgcvt_r.c @@ -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 index 0000000000..d8676a851b --- /dev/null +++ b/misc/force-wrapper.c @@ -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; diff --git a/misc/hsearch_r.c b/misc/hsearch_r.c index 151bb31efc..95813e4bfb 100644 --- a/misc/hsearch_r.c +++ b/misc/hsearch_r.c @@ -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; } diff --git a/misc/mntent.h b/misc/mntent.h index 8fa93f721b..150ad6dc2d 100644 --- a/misc/mntent.h +++ b/misc/mntent.h @@ -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)); diff --git a/nss/nss_dns/dns-host.c b/nss/nss_dns/dns-host.c index d9bf4d7be5..9a01c9f545 100644 --- a/nss/nss_dns/dns-host.c +++ b/nss/nss_dns/dns-host.c @@ -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; } diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c index da4ad1f2a5..404a9f9750 100644 --- a/nss/nss_files/files-XXX.c +++ b/nss/nss_files/files-XXX.c @@ -146,7 +146,7 @@ internal_getent (struct STRUCTURE *result, if (buflen < (int) sizeof *data + 1) { - errno = ERANGE; + __set_errno (ERANGE); return NSS_STATUS_TRYAGAIN; } diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c index ece253d017..9cfa579ea4 100644 --- a/nss/nss_files/files-parse.c +++ b/nss/nss_files/files-parse.c @@ -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') diff --git a/nss/nsswitch.c b/nss/nsswitch.c index 79c9d2706d..f49ddb95a6 100644 --- a/nss/nsswitch.c +++ b/nss/nsswitch.c @@ -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; } diff --git a/po/Makefile b/po/Makefile index 30721d11a0..2b12628a72 100644 --- a/po/Makefile +++ b/po/Makefile @@ -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 diff --git a/posix/confstr.c b/posix/confstr.c index 5b4a7bea93..b511ea0ab8 100644 --- a/posix/confstr.c +++ b/posix/confstr.c @@ -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; } diff --git a/posix/execvp.c b/posix/execvp.c index a1fcb791fa..400e082937 100644 --- a/posix/execvp.c +++ b/posix/execvp.c @@ -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; diff --git a/posix/glob.c b/posix/glob.c index 76060e1425..b8820cee94 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -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. */ - diff --git a/pwd/getpw.c b/pwd/getpw.c index 5bd5c8267a..0bd2ab9d0d 100644 --- a/pwd/getpw.c +++ b/pwd/getpw.c @@ -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; } diff --git a/pwd/putpwent.c b/pwd/putpwent.c index ad8a81b3a3..2761cf8801 100644 --- a/pwd/putpwent.c +++ b/pwd/putpwent.c @@ -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; } diff --git a/resolv/inet_net_ntop.c b/resolv/inet_net_ntop.c index 80abefcba7..497b0af7c6 100644 --- a/resolv/inet_net_ntop.c +++ b/resolv/inet_net_ntop.c @@ -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); } diff --git a/resolv/inet_net_pton.c b/resolv/inet_net_pton.c index ea9b2d4b55..7c863492d7 100644 --- a/resolv/inet_net_pton.c +++ b/resolv/inet_net_pton.c @@ -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); } diff --git a/resolv/inet_neta.c b/resolv/inet_neta.c index ff92d5f2dc..27908d4a47 100644 --- a/resolv/inet_neta.c +++ b/resolv/inet_neta.c @@ -77,6 +77,6 @@ inet_neta(src, dst, size) return (odst); emsgsize: - errno = EMSGSIZE; + __set_errno (EMSGSIZE); return (NULL); } diff --git a/resolv/inet_ntop.c b/resolv/inet_ntop.c index a378f3a383..bbdabd0fe0 100644 --- a/resolv/inet_ntop.c +++ b/resolv/inet_ntop.c @@ -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); diff --git a/resolv/inet_pton.c b/resolv/inet_pton.c index 2315de59cd..3593da262b 100644 --- a/resolv/inet_pton.c +++ b/resolv/inet_pton.c @@ -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 */ diff --git a/resolv/res_query.c b/resolv/res_query.c index 2d191d0332..e9898023bf 100644 --- a/resolv/res_query.c +++ b/resolv/res_query.c @@ -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++) diff --git a/resolv/res_send.c b/resolv/res_send.c index 4c258b99bf..3efc6cf96f 100644 --- a/resolv/res_send.c +++ b/resolv/res_send.c @@ -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); } diff --git a/shadow/lckpwdf.c b/shadow/lckpwdf.c index 60cf2eecf7..707c00965d 100644 --- a/shadow/lckpwdf.c +++ b/shadow/lckpwdf.c @@ -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. */ diff --git a/shadow/putspent.c b/shadow/putspent.c index b638057bae..8c8bd2a9a9 100644 --- a/shadow/putspent.c +++ b/shadow/putspent.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; diff --git a/shadow/sgetspent_r.c b/shadow/sgetspent_r.c index 03c96b581b..407886ede4 100644 --- a/shadow/sgetspent_r.c +++ b/shadow/sgetspent_r.c @@ -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; } ) diff --git a/shadow/shadow.h b/shadow/shadow.h index b1a4c82b4e..133cfd6009 100644 --- a/shadow/shadow.h +++ b/shadow/shadow.h @@ -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. */ }; diff --git a/signal/sigaddset.c b/signal/sigaddset.c index b9ac34dd5b..69185edca6 100644 --- a/signal/sigaddset.c +++ b/signal/sigaddset.c @@ -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; } diff --git a/signal/sigdelset.c b/signal/sigdelset.c index 07e880f9c4..0b88a0977b 100644 --- a/signal/sigdelset.c +++ b/signal/sigdelset.c @@ -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; } diff --git a/signal/sigempty.c b/signal/sigempty.c index 0ec129ded4..5e4bebb27c 100644 --- a/signal/sigempty.c +++ b/signal/sigempty.c @@ -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; } diff --git a/signal/sigfillset.c b/signal/sigfillset.c index 88c1833b55..6ea4707e63 100644 --- a/signal/sigfillset.c +++ b/signal/sigfillset.c @@ -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; } diff --git a/signal/sigismem.c b/signal/sigismem.c index 36c04db5e2..d171517509 100644 --- a/signal/sigismem.c +++ b/signal/sigismem.c @@ -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; } diff --git a/stdio-common/reg-printf.c b/stdio-common/reg-printf.c index db33a3d618..2cb086dedf 100644 --- a/stdio-common/reg-printf.c +++ b/stdio-common/reg-printf.c @@ -35,7 +35,7 @@ __register_printf_function (spec, converter, arginfo) { if (spec < 0 || spec > (int) UCHAR_MAX) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index b2523574a8..f47eaa2850 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -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. */ diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index f83fd281a1..ee2c922f6e 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -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) diff --git a/stdio/fclose.c b/stdio/fclose.c index bcf4cd4163..413d8f3d7b 100644 --- a/stdio/fclose.c +++ b/stdio/fclose.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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) diff --git a/stdio/feof.c b/stdio/feof.c index c18300f6b5..b98220799f 100644 --- a/stdio/feof.c +++ b/stdio/feof.c @@ -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; } diff --git a/stdio/ferror.c b/stdio/ferror.c index ed8f74401a..857b250201 100644 --- a/stdio/ferror.c +++ b/stdio/ferror.c @@ -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; } diff --git a/stdio/fflush.c b/stdio/fflush.c index a6d52ba3e7..41e66fa540 100644 --- a/stdio/fflush.c +++ b/stdio/fflush.c @@ -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); } diff --git a/stdio/fgetc.c b/stdio/fgetc.c index 7f01090294..9bfff3477a 100644 --- a/stdio/fgetc.c +++ b/stdio/fgetc.c @@ -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); } diff --git a/stdio/fgetpos.c b/stdio/fgetpos.c index cb6a1588ba..a615081c99 100644 --- a/stdio/fgetpos.c +++ b/stdio/fgetpos.c @@ -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; } diff --git a/stdio/fgets.c b/stdio/fgets.c index e9e53c88dd..01d4d9d095 100644 --- a/stdio/fgets.c +++ b/stdio/fgets.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/stdio/fileno.c b/stdio/fileno.c index da55300c8b..dc3dfdf6e2 100644 --- a/stdio/fileno.c +++ b/stdio/fileno.c @@ -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; } diff --git a/stdio/fmemopen.c b/stdio/fmemopen.c index 42a137a2c8..a161110703 100644 --- a/stdio/fmemopen.c +++ b/stdio/fmemopen.c @@ -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; } diff --git a/stdio/fopen.c b/stdio/fopen.c index fba6ac436a..fea227482f 100644 --- a/stdio/fopen.c +++ b/stdio/fopen.c @@ -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) /* 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; } diff --git a/stdio/fputc.c b/stdio/fputc.c index 36b9501195..2cbba2a449 100644 --- a/stdio/fputc.c +++ b/stdio/fputc.c @@ -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); } diff --git a/stdio/fread.c b/stdio/fread.c index d2766f6616..63d41d2bd0 100644 --- a/stdio/fread.c +++ b/stdio/fread.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; diff --git a/stdio/freopen.c b/stdio/freopen.c index bedddb1a63..a21d725c17 100644 --- a/stdio/freopen.c +++ b/stdio/freopen.c @@ -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; } diff --git a/stdio/fseek.c b/stdio/fseek.c index 2127c9757b..9dce18f5d3 100644 --- a/stdio/fseek.c +++ b/stdio/fseek.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/stdio/fsetpos.c b/stdio/fsetpos.c index 7c8fcb78bb..6aea674066 100644 --- a/stdio/fsetpos.c +++ b/stdio/fsetpos.c @@ -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); } diff --git a/stdio/ftell.c b/stdio/ftell.c index d27eaf7598..d715f2009f 100644 --- a/stdio/ftell.c +++ b/stdio/ftell.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,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; } diff --git a/stdio/fwrite.c b/stdio/fwrite.c index 790c663aea..7cf3898127 100644 --- a/stdio/fwrite.c +++ b/stdio/fwrite.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/stdio/getdelim.c b/stdio/getdelim.c index 2cdb95c2a6..761c7980c1 100644 --- a/stdio/getdelim.c +++ b/stdio/getdelim.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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) diff --git a/stdio/gets.c b/stdio/gets.c index 37426cf4e3..7f84c92df3 100644 --- a/stdio/gets.c +++ b/stdio/gets.c @@ -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 diff --git a/stdio/glue.c b/stdio/glue.c index 6ef52a7ada..592700ff94 100644 --- a/stdio/glue.c +++ b/stdio/glue.c @@ -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; } } diff --git a/stdio/internals.c b/stdio/internals.c index a1d1fa4989..8c2acc4026 100644 --- a/stdio/internals.c +++ b/stdio/internals.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; diff --git a/stdio/memstream.c b/stdio/memstream.c index 1a8b35081d..ab285f4624 100644 --- a/stdio/memstream.c +++ b/stdio/memstream.c @@ -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; diff --git a/stdio/setvbuf.c b/stdio/setvbuf.c index 6bfe829d1d..ba79959594 100644 --- a/stdio/setvbuf.c +++ b/stdio/setvbuf.c @@ -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; diff --git a/stdio/ungetc.c b/stdio/ungetc.c index 7b22a200f6..834f5be6d4 100644 --- a/stdio/ungetc.c +++ b/stdio/ungetc.c @@ -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; } diff --git a/stdio/vsscanf.c b/stdio/vsscanf.c index 6f027d5065..5e538291fa 100644 --- a/stdio/vsscanf.c +++ b/stdio/vsscanf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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); } diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c index 356c619b5d..554e1b2cba 100644 --- a/stdlib/canonicalize.c +++ b/stdlib/canonicalize.c @@ -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; } diff --git a/stdlib/msort.c b/stdlib/msort.c index e2834ce6ca..7b36df41f3 100644 --- a/stdlib/msort.c +++ b/stdlib/msort.c @@ -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); } } diff --git a/stdlib/random_r.c b/stdlib/random_r.c index f2fe923143..8c516780cd 100644 --- a/stdlib/random_r.c +++ b/stdlib/random_r.c @@ -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; } diff --git a/stdlib/strfmon.c b/stdlib/strfmon.c index 3b8c7d602a..99408c7484 100644 --- a/stdlib/strfmon.c +++ b/stdlib/strfmon.c @@ -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; } diff --git a/stdlib/strtod.c b/stdlib/strtod.c index 66d6726a30..b47d5edb8f 100644 --- a/stdlib/strtod.c +++ b/stdlib/strtod.c @@ -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; } diff --git a/stdlib/strtol.c b/stdlib/strtol.c index 1481d3388e..5543ab94d1 100644 --- a/stdlib/strtol.c +++ b/stdlib/strtol.c @@ -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 diff --git a/stdlib/test-canon.c b/stdlib/test-canon.c index 8d04bb6ba0..f41106716a 100644 --- a/stdlib/test-canon.c +++ b/stdlib/test-canon.c @@ -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; } diff --git a/sunrpc/bindrsvprt.c b/sunrpc/bindrsvprt.c index 71803dd41c..44660dede6 100644 --- a/sunrpc/bindrsvprt.c +++ b/sunrpc/bindrsvprt.c @@ -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) { diff --git a/sunrpc/clnt_tcp.c b/sunrpc/clnt_tcp.c index 3b71e119f0..be365f1b2a 100644 --- a/sunrpc/clnt_tcp.c +++ b/sunrpc/clnt_tcp.c @@ -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(); diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c index 706457a606..2074095d99 100644 --- a/sunrpc/clnt_udp.c +++ b/sunrpc/clnt_udp.c @@ -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; diff --git a/sunrpc/pm_getmaps.c b/sunrpc/pm_getmaps.c index 7a9cbb6f18..d84e0c5dc0 100644 --- a/sunrpc/pm_getmaps.c +++ b/sunrpc/pm_getmaps.c @@ -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. diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c index a944f6ccb6..3fbc47224d 100644 --- a/sunrpc/pmap_rmt.c +++ b/sunrpc/pmap_rmt.c @@ -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); } - diff --git a/sunrpc/svc.c b/sunrpc/svc.c index e0af7107be..5995c25bfd 100644 --- a/sunrpc/svc.c +++ b/sunrpc/svc.c @@ -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))) { diff --git a/sunrpc/svc_run.c b/sunrpc/svc_run.c index c1c3e04781..45ea4008bc 100644 --- a/sunrpc/svc_run.c +++ b/sunrpc/svc_run.c @@ -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 diff --git a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c index 8886a9f1fd..6846f38409 100644 --- a/sunrpc/svc_tcp.c +++ b/sunrpc/svc_tcp.c @@ -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 diff --git a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c index a910452094..7c3a31b79e 100644 --- a/sunrpc/svc_udp.c +++ b/sunrpc/svc_udp.c @@ -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); } - diff --git a/sysdeps/generic/ftime.c b/sysdeps/generic/ftime.c index 600e959245..729c7b2adb 100644 --- a/sysdeps/generic/ftime.c +++ b/sysdeps/generic/ftime.c @@ -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; } diff --git a/sysdeps/generic/pty.c b/sysdeps/generic/pty.c index a539a9bb8b..dda2125836 100644 --- a/sysdeps/generic/pty.c +++ b/sysdeps/generic/pty.c @@ -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); diff --git a/sysdeps/generic/setenv.c b/sysdeps/generic/setenv.c index a84a8ebf64..44830e9aa7 100644 --- a/sysdeps/generic/setenv.c +++ b/sysdeps/generic/setenv.c @@ -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; } diff --git a/sysdeps/generic/speed.c b/sysdeps/generic/speed.c index 1f5a3eeacc..229c0665e2 100644 --- a/sysdeps/generic/speed.c +++ b/sysdeps/generic/speed.c @@ -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; } diff --git a/sysdeps/generic/strtok.c b/sysdeps/generic/strtok.c index 954471322b..cb30619a43 100644 --- a/sysdeps/generic/strtok.c +++ b/sysdeps/generic/strtok.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 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); diff --git a/sysdeps/generic/strtok_r.c b/sysdeps/generic/strtok_r.c index 08a29361c7..488d3eacfe 100644 --- a/sysdeps/generic/strtok_r.c +++ b/sysdeps/generic/strtok_r.c @@ -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); diff --git a/sysdeps/generic/sysd-stdio.c b/sysdeps/generic/sysd-stdio.c index 7a3f7fc918..d28dde87f1 100644 --- a/sysdeps/generic/sysd-stdio.c +++ b/sysdeps/generic/sysd-stdio.c @@ -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. */ diff --git a/sysdeps/generic/uname.c b/sysdeps/generic/uname.c index b3ecf70ad7..c0bc13e02a 100644 --- a/sysdeps/generic/uname.c +++ b/sysdeps/generic/uname.c @@ -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; diff --git a/sysdeps/generic/vlimit.c b/sysdeps/generic/vlimit.c index 56f1199ab3..235a5abfc2 100644 --- a/sysdeps/generic/vlimit.c +++ b/sysdeps/generic/vlimit.c @@ -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; } diff --git a/sysdeps/generic/waitstatus.h b/sysdeps/generic/waitstatus.h index fdb40db7ef..8bdebd88e7 100644 --- a/sysdeps/generic/waitstatus.h +++ b/sysdeps/generic/waitstatus.h @@ -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 diff --git a/sysdeps/i386/fpu/__math.h b/sysdeps/i386/fpu/__math.h index de34370d21..d6b0bc6988 100644 --- a/sysdeps/i386/fpu/__math.h +++ b/sysdeps/i386/fpu/__math.h @@ -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; } diff --git a/sysdeps/libm-ieee754/k_standard.c b/sysdeps/libm-ieee754/k_standard.c index 644108e7a0..35026faa9d 100644 --- a/sysdeps/libm-ieee754/k_standard.c +++ b/sysdeps/libm-ieee754/k_standard.c @@ -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; } diff --git a/sysdeps/libm-ieee754/s_ldexp.c b/sysdeps/libm-ieee754/s_ldexp.c index 754fef6e99..94a93fc063 100644 --- a/sysdeps/libm-ieee754/s_ldexp.c +++ b/sysdeps/libm-ieee754/s_ldexp.c @@ -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) diff --git a/sysdeps/libm-ieee754/s_ldexpf.c b/sysdeps/libm-ieee754/s_ldexpf.c index d047677d72..1ecbe8346b 100644 --- a/sysdeps/libm-ieee754/s_ldexpf.c +++ b/sysdeps/libm-ieee754/s_ldexpf.c @@ -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) diff --git a/sysdeps/libm-ieee754/s_ldexpl.c b/sysdeps/libm-ieee754/s_ldexpl.c index bf64c89898..123a6b3b58 100644 --- a/sysdeps/libm-ieee754/s_ldexpl.c +++ b/sysdeps/libm-ieee754/s_ldexpl.c @@ -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) diff --git a/sysdeps/libm-ieee754/w_scalb.c b/sysdeps/libm-ieee754/w_scalb.c index f718bc215c..53d41144d6 100644 --- a/sysdeps/libm-ieee754/w_scalb.c +++ b/sysdeps/libm-ieee754/w_scalb.c @@ -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) diff --git a/sysdeps/libm-ieee754/w_scalbf.c b/sysdeps/libm-ieee754/w_scalbf.c index 3af7ed3932..488a717503 100644 --- a/sysdeps/libm-ieee754/w_scalbf.c +++ b/sysdeps/libm-ieee754/w_scalbf.c @@ -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) diff --git a/sysdeps/libm-ieee754/w_scalbl.c b/sysdeps/libm-ieee754/w_scalbl.c index ff5117d24c..3ca8d9601d 100644 --- a/sysdeps/libm-ieee754/w_scalbl.c +++ b/sysdeps/libm-ieee754/w_scalbl.c @@ -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 diff --git a/sysdeps/m68k/fpu/s_scalbn.c b/sysdeps/m68k/fpu/s_scalbn.c index 4039bba652..6d2b74a3d0 100644 --- a/sysdeps/m68k/fpu/s_scalbn.c +++ b/sysdeps/m68k/fpu/s_scalbn.c @@ -22,7 +22,6 @@ Cambridge, MA 02139, USA. */ #ifndef FUNC #define FUNC scalbn -#include <s_ldexp.c> #endif #ifndef float_type #define float_type double diff --git a/sysdeps/m68k/fpu/s_scalbnf.c b/sysdeps/m68k/fpu/s_scalbnf.c index 55d64fd502..33459718e9 100644 --- a/sysdeps/m68k/fpu/s_scalbnf.c +++ b/sysdeps/m68k/fpu/s_scalbnf.c @@ -1,6 +1,5 @@ #ifndef FUNC #define FUNC scalbnf -#include <s_ldexpf.c> #endif #define float_type float #include <s_scalbn.c> diff --git a/sysdeps/m68k/fpu/s_scalbnl.c b/sysdeps/m68k/fpu/s_scalbnl.c index 84849921dc..c6ad95079c 100644 --- a/sysdeps/m68k/fpu/s_scalbnl.c +++ b/sysdeps/m68k/fpu/s_scalbnl.c @@ -1,6 +1,5 @@ #ifndef FUNC #define FUNC scalbnl -#include <s_ldexpl.c> #endif #define float_type long double #include <s_scalbn.c> diff --git a/sysdeps/mach/hurd/errnos.awk b/sysdeps/mach/hurd/errnos.awk index 100e4b1114..915cb11e7b 100644 --- a/sysdeps/mach/hurd/errnos.awk +++ b/sysdeps/mach/hurd/errnos.awk @@ -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 ""; diff --git a/sysdeps/mach/libc-lock.h b/sysdeps/mach/libc-lock.h index 1c9b16cf90..4954cc2952 100644 --- a/sysdeps/mach/libc-lock.h +++ b/sysdeps/mach/libc-lock.h @@ -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; diff --git a/sysdeps/posix/dup2.c b/sysdeps/posix/dup2.c index c0c6b2a0f6..8730172d46 100644 --- a/sysdeps/posix/dup2.c +++ b/sysdeps/posix/dup2.c @@ -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); } diff --git a/sysdeps/posix/euidaccess.c b/sysdeps/posix/euidaccess.c index e50bdfbb8c..26f3af6374 100644 --- a/sysdeps/posix/euidaccess.c +++ b/sysdeps/posix/euidaccess.c @@ -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; } diff --git a/sysdeps/posix/fdopen.c b/sysdeps/posix/fdopen.c index ad746ec371..fb2bda8824 100644 --- a/sysdeps/posix/fdopen.c +++ b/sysdeps/posix/fdopen.c @@ -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; diff --git a/sysdeps/posix/flock.c b/sysdeps/posix/flock.c index b4c9fc3b79..15d348ae80 100644 --- a/sysdeps/posix/flock.c +++ b/sysdeps/posix/flock.c @@ -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; } diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c index 9b54b5f04a..1e7cba47ed 100644 --- a/sysdeps/posix/fpathconf.c +++ b/sysdeps/posix/fpathconf.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c index 2d8011e276..a9536b95cf 100644 --- a/sysdeps/posix/getcwd.c +++ b/sysdeps/posix/getcwd.c @@ -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]; diff --git a/sysdeps/posix/gettimeofday.c b/sysdeps/posix/gettimeofday.c index 3c079a5af2..9d4e07866d 100644 --- a/sysdeps/posix/gettimeofday.c +++ b/sysdeps/posix/gettimeofday.c @@ -37,7 +37,7 @@ __gettimeofday (tv, tz) { if (tv == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/posix/isatty.c b/sysdeps/posix/isatty.c index 7536b1eeed..2dcae18f5b 100644 --- a/sysdeps/posix/isatty.c +++ b/sysdeps/posix/isatty.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/posix/isfdtype.c b/sysdeps/posix/isfdtype.c index 9ac38a8b9f..8edcf594d8 100644 --- a/sysdeps/posix/isfdtype.c +++ b/sysdeps/posix/isfdtype.c @@ -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; diff --git a/sysdeps/posix/killpg.c b/sysdeps/posix/killpg.c index 0c70dd2164..5197673cde 100644 --- a/sysdeps/posix/killpg.c +++ b/sysdeps/posix/killpg.c @@ -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; } diff --git a/sysdeps/posix/mkstemp.c b/sysdeps/posix/mkstemp.c index 9f4f68d72d..920136d416 100644 --- a/sysdeps/posix/mkstemp.c +++ b/sysdeps/posix/mkstemp.c @@ -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; } diff --git a/sysdeps/posix/mktemp.c b/sysdeps/posix/mktemp.c index c3aae36a7b..111206f663 100644 --- a/sysdeps/posix/mktemp.c +++ b/sysdeps/posix/mktemp.c @@ -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; } diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c index 05cee5e5e0..9539957777 100644 --- a/sysdeps/posix/pathconf.c +++ b/sysdeps/posix/pathconf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; diff --git a/sysdeps/posix/pipestream.c b/sysdeps/posix/pipestream.c index 53595f5b54..539bf43302 100644 --- a/sysdeps/posix/pipestream.c +++ b/sysdeps/posix/pipestream.c @@ -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; diff --git a/sysdeps/posix/remove.c b/sysdeps/posix/remove.c index 66414c9039..9999021087 100644 --- a/sysdeps/posix/remove.c +++ b/sysdeps/posix/remove.c @@ -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; } diff --git a/sysdeps/posix/rename.c b/sysdeps/posix/rename.c index 3245f9cf9c..c318081bac 100644 --- a/sysdeps/posix/rename.c +++ b/sysdeps/posix/rename.c @@ -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; diff --git a/sysdeps/posix/sigintr.c b/sysdeps/posix/sigintr.c index 441c643df8..37914e997d 100644 --- a/sysdeps/posix/sigintr.c +++ b/sysdeps/posix/sigintr.c @@ -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 } diff --git a/sysdeps/posix/signal.c b/sysdeps/posix/signal.c index f9ae47b6bb..9a8d2de0e4 100644 --- a/sysdeps/posix/signal.c +++ b/sysdeps/posix/signal.c @@ -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; } diff --git a/sysdeps/posix/sigsuspend.c b/sysdeps/posix/sigsuspend.c index 771315333a..49a55f38b4 100644 --- a/sysdeps/posix/sigsuspend.c +++ b/sysdeps/posix/sigsuspend.c @@ -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; } diff --git a/sysdeps/posix/sigvec.c b/sysdeps/posix/sigvec.c index 4aef22ae32..6a224e1733 100644 --- a/sysdeps/posix/sigvec.c +++ b/sysdeps/posix/sigvec.c @@ -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 } diff --git a/sysdeps/posix/sleep.c b/sysdeps/posix/sleep.c index 20f78a08bb..fd63a4bf69 100644 --- a/sysdeps/posix/sleep.c +++ b/sysdeps/posix/sleep.c @@ -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; } diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c index 14ee58cafb..9660724a39 100644 --- a/sysdeps/posix/sysconf.c +++ b/sysdeps/posix/sysconf.c @@ -37,7 +37,7 @@ __sysconf (name) switch (name) { default: - errno = EINVAL; + __set_errno (EINVAL); return -1; case _SC_ARG_MAX: diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c index da58be51ae..b1a685c29a 100644 --- a/sysdeps/posix/system.c +++ b/sysdeps/posix/system.c @@ -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) diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c index 0f088ec915..6fd698e2b8 100644 --- a/sysdeps/posix/tempname.c +++ b/sysdeps/posix/tempname.c @@ -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; } diff --git a/sysdeps/posix/truncate.c b/sysdeps/posix/truncate.c index 4f4c07e1df..2ab5d66ee9 100644 --- a/sysdeps/posix/truncate.c +++ b/sysdeps/posix/truncate.c @@ -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; } diff --git a/sysdeps/posix/ttyname.c b/sysdeps/posix/ttyname.c index 7c7ed2428a..be82827d00 100644 --- a/sysdeps/posix/ttyname.c +++ b/sysdeps/posix/ttyname.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/posix/ttyname_r.c b/sysdeps/posix/ttyname_r.c index e6172f1c97..1fb4b047d4 100644 --- a/sysdeps/posix/ttyname_r.c +++ b/sysdeps/posix/ttyname_r.c @@ -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) diff --git a/sysdeps/posix/wait.c b/sysdeps/posix/wait.c index 38891c7e01..813c595e1d 100644 --- a/sysdeps/posix/wait.c +++ b/sysdeps/posix/wait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/posix/wait3.c b/sysdeps/posix/wait3.c index 5eb084a7c9..f805f10b7d 100644 --- a/sysdeps/posix/wait3.c +++ b/sysdeps/posix/wait3.c @@ -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); diff --git a/sysdeps/standalone/close.c b/sysdeps/standalone/close.c index 59b607305f..7ef1a5f878 100644 --- a/sysdeps/standalone/close.c +++ b/sysdeps/standalone/close.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/standalone/m68k/m68020/start.S b/sysdeps/standalone/m68k/m68020/start.S index cbabf5bf07..9d7d779e04 100644 --- a/sysdeps/standalone/m68k/m68020/start.S +++ b/sysdeps/standalone/m68k/m68020/start.S @@ -1,19 +1,19 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1996 Free Software Foundation, Inc. Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil), On-Line Applications Research Corporation. - + This file is part of the GNU C Library. - + The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - + You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, @@ -43,7 +43,7 @@ _M68Kvec: | standard location for vectors .space 4088 | to avoid initial intr stack | from 135BUG on MVME13? as entry | and start code at 0x4000 -around: +around: move.w %sr,initial_sr | save initial values movec %isp,%a0 movel %a0,initial_isp @@ -53,19 +53,19 @@ around: movel %a0,initial_msp oriw #0x0700,%sr | INTERRUPTS OFF!!! - + | | zero out uninitialized data area | zerobss: - moveal #end,%a0 | find end of .bss - moveal #_bss_start,%a1 | find beginning of .bss + moveal #end,%a0 | find end of .bss + moveal #_bss_start,%a1 | find beginning of .bss movel #0,%d0 loop: movel #0,%a1@+ | to zero out uninitialized cmpal %a0,%a1 - jlt loop | loop until _end reached + jlt loop | loop until _end reached movel #heap_size,__C_heap_size | set ___C_heap_size movel #heap_memory,__C_heap_start | set ___C_heap_start @@ -77,14 +77,14 @@ loop: movel #0,%a1@+ | to zero out uninitialized movw #0x3000,%sr | SUPV MODE,INTERRUPTS ON!!! #ifdef NEED_UNDERSCORES - jsr __Board_Initialize | initialize the board + jsr __Board_Initialize | initialize the board #else - jsr _Board_Initialize | initialize the board + jsr _Board_Initialize | initialize the board #endif - move.l #0,%sp@- | envp = NULL - move.l #0,%sp@- | argv = NULL - move.l #0,%sp@- | argc = NULL + move.l #0,%sp@- | envp = NULL + move.l #0,%sp@- | argv = NULL + move.l #0,%sp@- | argc = NULL #ifdef NEED_UNDERSCORES jsr ___libc_init | initialize the library and | call main @@ -93,8 +93,8 @@ loop: movel #0,%a1@+ | to zero out uninitialized | call main #endif add.l #12,%sp - - move.l #0,%sp@- | argc = NULL + + move.l #0,%sp@- | argc = NULL jsr __exit | call the Board specific exit addq.l #4,%sp @@ -121,7 +121,7 @@ _name##: .space _space #define DECLARE_LABEL(_name) \ .globl _name ; \ -_name##: +_name##: #define DECLARE_PTR(_name) DECLARE_SPACE(_name,4,2) #define DECLARE_U32(_name) DECLARE_SPACE(_name,4,2) @@ -139,6 +139,7 @@ DECLARE_U16(initial_sr) DECLARE_LABEL(_environ) DECLARE_PTR(environ) +DECLARE_LABEL(__errno) DECLARE_LABEL(_errno) DECLARE_U32(errno) diff --git a/sysdeps/standalone/open.c b/sysdeps/standalone/open.c index 910e7933e7..87097d9cb0 100644 --- a/sysdeps/standalone/open.c +++ b/sysdeps/standalone/open.c @@ -1,7 +1,7 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. - + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,7 +19,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; diff --git a/sysdeps/standalone/read.c b/sysdeps/standalone/read.c index 284321d717..40322a5e71 100644 --- a/sysdeps/standalone/read.c +++ b/sysdeps/standalone/read.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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) diff --git a/sysdeps/standalone/write.c b/sysdeps/standalone/write.c index f0ae3888f6..d377dd5e5c 100644 --- a/sysdeps/standalone/write.c +++ b/sysdeps/standalone/write.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Ported to standalone by Joel Sherrill jsherril@redstone-emh2.army.mil, On-Line Applications Research Corporation. @@ -19,7 +19,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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) diff --git a/sysdeps/stub/__longjmp.c b/sysdeps/stub/__longjmp.c index d7f38f974b..ec74f776d9 100644 --- a/sysdeps/stub/__longjmp.c +++ b/sysdeps/stub/__longjmp.c @@ -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. */ } diff --git a/sysdeps/stub/accept.c b/sysdeps/stub/accept.c index 429f2aaefb..e9a774c026 100644 --- a/sysdeps/stub/accept.c +++ b/sysdeps/stub/accept.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/access.c b/sysdeps/stub/access.c index 06ddbb5c12..6779ea0606 100644 --- a/sysdeps/stub/access.c +++ b/sysdeps/stub/access.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/acct.c b/sysdeps/stub/acct.c index 1b547f3ec4..0bed4d99f0 100644 --- a/sysdeps/stub/acct.c +++ b/sysdeps/stub/acct.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/adjtime.c b/sysdeps/stub/adjtime.c index 933e2ef7a3..3496121a17 100644 --- a/sysdeps/stub/adjtime.c +++ b/sysdeps/stub/adjtime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/alarm.c b/sysdeps/stub/alarm.c index 78cf673e71..9c4e71fc2d 100644 --- a/sysdeps/stub/alarm.c +++ b/sysdeps/stub/alarm.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/bind.c b/sysdeps/stub/bind.c index 38ad46aa87..7f4d8145b8 100644 --- a/sysdeps/stub/bind.c +++ b/sysdeps/stub/bind.c @@ -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; } diff --git a/sysdeps/stub/brk.c b/sysdeps/stub/brk.c index 3a48ea2e17..a4ebbf01f7 100644 --- a/sysdeps/stub/brk.c +++ b/sysdeps/stub/brk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/chdir.c b/sysdeps/stub/chdir.c index f73c98142a..7e5d825d3a 100644 --- a/sysdeps/stub/chdir.c +++ b/sysdeps/stub/chdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/chflags.c b/sysdeps/stub/chflags.c index a906e1b323..9380108283 100644 --- a/sysdeps/stub/chflags.c +++ b/sysdeps/stub/chflags.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/chmod.c b/sysdeps/stub/chmod.c index 3259d3e121..e76566cb83 100644 --- a/sysdeps/stub/chmod.c +++ b/sysdeps/stub/chmod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/chown.c b/sysdeps/stub/chown.c index e9db1ed86f..32dd189145 100644 --- a/sysdeps/stub/chown.c +++ b/sysdeps/stub/chown.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/chroot.c b/sysdeps/stub/chroot.c index a18d349329..f77010b66e 100644 --- a/sysdeps/stub/chroot.c +++ b/sysdeps/stub/chroot.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/clock.c b/sysdeps/stub/clock.c index c22192bd86..b0df84a94b 100644 --- a/sysdeps/stub/clock.c +++ b/sysdeps/stub/clock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/close.c b/sysdeps/stub/close.c index efa80a708d..9374990c09 100644 --- a/sysdeps/stub/close.c +++ b/sysdeps/stub/close.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/closedir.c b/sysdeps/stub/closedir.c index 5fb2ed3e7d..20735563bb 100644 --- a/sysdeps/stub/closedir.c +++ b/sysdeps/stub/closedir.c @@ -26,7 +26,7 @@ Cambridge, MA 02139, USA. */ int __closedir (DIR *dirp) { - errno = ENOSYS; + __set_errno (ENOSYS); return -1; } weak_alias (__closedir, closedir) diff --git a/sysdeps/stub/connect.c b/sysdeps/stub/connect.c index 49300f3a09..0d642cbcea 100644 --- a/sysdeps/stub/connect.c +++ b/sysdeps/stub/connect.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/stub/ctermid.c b/sysdeps/stub/ctermid.c index 1025d686d7..5504c4745e 100644 --- a/sysdeps/stub/ctermid.c +++ b/sysdeps/stub/ctermid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/cuserid.c b/sysdeps/stub/cuserid.c index 655ddaf2a5..9d92b5449c 100644 --- a/sysdeps/stub/cuserid.c +++ b/sysdeps/stub/cuserid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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; } diff --git a/sysdeps/stub/dirfd.c b/sysdeps/stub/dirfd.c index 9ec19696f3..06707cdd60 100644 --- a/sysdeps/stub/dirfd.c +++ b/sysdeps/stub/dirfd.c @@ -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; } diff --git a/sysdeps/stub/dup.c b/sysdeps/stub/dup.c index f15a1bef3b..6c0f63e6e3 100644 --- a/sysdeps/stub/dup.c +++ b/sysdeps/stub/dup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/dup2.c b/sysdeps/stub/dup2.c index a0f7aad47d..dd37b28892 100644 --- a/sysdeps/stub/dup2.c +++ b/sysdeps/stub/dup2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/errnos.h b/sysdeps/stub/errnos.h index 11708086bf..0a0f80a19d 100644 --- a/sysdeps/stub/errnos.h +++ b/sysdeps/stub/errnos.h @@ -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) diff --git a/sysdeps/stub/euidaccess.c b/sysdeps/stub/euidaccess.c index 1769e0dd17..79296a77f4 100644 --- a/sysdeps/stub/euidaccess.c +++ b/sysdeps/stub/euidaccess.c @@ -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) diff --git a/sysdeps/stub/execve.c b/sysdeps/stub/execve.c index 680d23757e..61a5df3015 100644 --- a/sysdeps/stub/execve.c +++ b/sysdeps/stub/execve.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/fchdir.c b/sysdeps/stub/fchdir.c index ba36ed626a..8eb7700361 100644 --- a/sysdeps/stub/fchdir.c +++ b/sysdeps/stub/fchdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/fchflags.c b/sysdeps/stub/fchflags.c index e9640d2375..4f59ad3480 100644 --- a/sysdeps/stub/fchflags.c +++ b/sysdeps/stub/fchflags.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/fchmod.c b/sysdeps/stub/fchmod.c index 43d4919c9b..f8c5c80214 100644 --- a/sysdeps/stub/fchmod.c +++ b/sysdeps/stub/fchmod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/fchown.c b/sysdeps/stub/fchown.c index 4af1d0d429..16f7f11a06 100644 --- a/sysdeps/stub/fchown.c +++ b/sysdeps/stub/fchown.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/fcntl.c b/sysdeps/stub/fcntl.c index e35021a496..21839aab5a 100644 --- a/sysdeps/stub/fcntl.c +++ b/sysdeps/stub/fcntl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/fdopen.c b/sysdeps/stub/fdopen.c index 4ab921bfd1..3ce07395e2 100644 --- a/sysdeps/stub/fdopen.c +++ b/sysdeps/stub/fdopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/fexecve.c b/sysdeps/stub/fexecve.c index c0990f510c..0772ed5da5 100644 --- a/sysdeps/stub/fexecve.c +++ b/sysdeps/stub/fexecve.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/stub/flock.c b/sysdeps/stub/flock.c index bdd7858393..d74f8264a7 100644 --- a/sysdeps/stub/flock.c +++ b/sysdeps/stub/flock.c @@ -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; } diff --git a/sysdeps/stub/fork.c b/sysdeps/stub/fork.c index 0b0b63afd0..ffb95e7b13 100644 --- a/sysdeps/stub/fork.c +++ b/sysdeps/stub/fork.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/fpathconf.c b/sysdeps/stub/fpathconf.c index 75880fd647..36b1369dad 100644 --- a/sysdeps/stub/fpathconf.c +++ b/sysdeps/stub/fpathconf.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/stub/fstatfs.c b/sysdeps/stub/fstatfs.c index 5ef5ccd1b9..9bc09000bf 100644 --- a/sysdeps/stub/fstatfs.c +++ b/sysdeps/stub/fstatfs.c @@ -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) - diff --git a/sysdeps/stub/fsync.c b/sysdeps/stub/fsync.c index 84780da828..6091159d5c 100644 --- a/sysdeps/stub/fsync.c +++ b/sysdeps/stub/fsync.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/ftruncate.c b/sysdeps/stub/ftruncate.c index f9474dd4e2..75d6bbc7df 100644 --- a/sysdeps/stub/ftruncate.c +++ b/sysdeps/stub/ftruncate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/fxstat.c b/sysdeps/stub/fxstat.c index 7c1eeff2cb..4318a08ecb 100644 --- a/sysdeps/stub/fxstat.c +++ b/sysdeps/stub/fxstat.c @@ -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) diff --git a/sysdeps/stub/getcwd.c b/sysdeps/stub/getcwd.c index 2aca49091e..4318b5b65e 100644 --- a/sysdeps/stub/getcwd.c +++ b/sysdeps/stub/getcwd.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/getdents.c b/sysdeps/stub/getdents.c index 8cf890a4aa..6e7793a72c 100644 --- a/sysdeps/stub/getdents.c +++ b/sysdeps/stub/getdents.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/getdomain.c b/sysdeps/stub/getdomain.c index c2159df012..5156bbd445 100644 --- a/sysdeps/stub/getdomain.c +++ b/sysdeps/stub/getdomain.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/stub/getdtsz.c b/sysdeps/stub/getdtsz.c index e9c9b61ba6..cf3dd916be 100644 --- a/sysdeps/stub/getdtsz.c +++ b/sysdeps/stub/getdtsz.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/getegid.c b/sysdeps/stub/getegid.c index 6e4e611e59..cbba8e44c5 100644 --- a/sysdeps/stub/getegid.c +++ b/sysdeps/stub/getegid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/getenv.c b/sysdeps/stub/getenv.c index a53e25bd96..fab9f08c75 100644 --- a/sysdeps/stub/getenv.c +++ b/sysdeps/stub/getenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/geteuid.c b/sysdeps/stub/geteuid.c index f5f437576c..7c470fa1db 100644 --- a/sysdeps/stub/geteuid.c +++ b/sysdeps/stub/geteuid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/getgid.c b/sysdeps/stub/getgid.c index f2bfa7696a..a4e7204c16 100644 --- a/sysdeps/stub/getgid.c +++ b/sysdeps/stub/getgid.c @@ -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) diff --git a/sysdeps/stub/getgroups.c b/sysdeps/stub/getgroups.c index f98d966346..7d766d7639 100644 --- a/sysdeps/stub/getgroups.c +++ b/sysdeps/stub/getgroups.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/gethostid.c b/sysdeps/stub/gethostid.c index 8ff3827f51..83c5755100 100644 --- a/sysdeps/stub/gethostid.c +++ b/sysdeps/stub/gethostid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/gethostname.c b/sysdeps/stub/gethostname.c index 1cf3c7bf26..d815f2da0e 100644 --- a/sysdeps/stub/gethostname.c +++ b/sysdeps/stub/gethostname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/getitimer.c b/sysdeps/stub/getitimer.c index 75b5488e0e..77b4ebd4ed 100644 --- a/sysdeps/stub/getitimer.c +++ b/sysdeps/stub/getitimer.c @@ -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) diff --git a/sysdeps/stub/getlogin.c b/sysdeps/stub/getlogin.c index d350bfb843..484c159855 100644 --- a/sysdeps/stub/getlogin.c +++ b/sysdeps/stub/getlogin.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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; } diff --git a/sysdeps/stub/getlogin_r.c b/sysdeps/stub/getlogin_r.c index bf29c7c982..fa9bb75d41 100644 --- a/sysdeps/stub/getlogin_r.c +++ b/sysdeps/stub/getlogin_r.c @@ -28,7 +28,7 @@ getlogin_r (name, name_len) char *name; size_t name_len; { - errno = ENOSYS; + __set_errno (ENOSYS); return errno; } diff --git a/sysdeps/stub/getpagesize.c b/sysdeps/stub/getpagesize.c index 1ee441513d..2c55df1a15 100644 --- a/sysdeps/stub/getpagesize.c +++ b/sysdeps/stub/getpagesize.c @@ -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) diff --git a/sysdeps/stub/getpeername.c b/sysdeps/stub/getpeername.c index 79497ca8aa..85256ad7ed 100644 --- a/sysdeps/stub/getpeername.c +++ b/sysdeps/stub/getpeername.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/getpgid.c b/sysdeps/stub/getpgid.c index 44efc12c10..e6cada2fda 100644 --- a/sysdeps/stub/getpgid.c +++ b/sysdeps/stub/getpgid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/getpid.c b/sysdeps/stub/getpid.c index 270c90947b..c2926b10a5 100644 --- a/sysdeps/stub/getpid.c +++ b/sysdeps/stub/getpid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/getppid.c b/sysdeps/stub/getppid.c index d6547c709b..e5cc73f575 100644 --- a/sysdeps/stub/getppid.c +++ b/sysdeps/stub/getppid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/getpriority.c b/sysdeps/stub/getpriority.c index eb6b43d834..599fed2478 100644 --- a/sysdeps/stub/getpriority.c +++ b/sysdeps/stub/getpriority.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/getrlimit.c b/sysdeps/stub/getrlimit.c index a3f31448bc..9e41e076a5 100644 --- a/sysdeps/stub/getrlimit.c +++ b/sysdeps/stub/getrlimit.c @@ -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) diff --git a/sysdeps/stub/getrusage.c b/sysdeps/stub/getrusage.c index 6417c8d9d1..c13ae7a0fc 100644 --- a/sysdeps/stub/getrusage.c +++ b/sysdeps/stub/getrusage.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/getsid.c b/sysdeps/stub/getsid.c index af474c5e4d..9ae0c8442c 100644 --- a/sysdeps/stub/getsid.c +++ b/sysdeps/stub/getsid.c @@ -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; } diff --git a/sysdeps/stub/getsockname.c b/sysdeps/stub/getsockname.c index a587e26e9e..17bb2b8a24 100644 --- a/sysdeps/stub/getsockname.c +++ b/sysdeps/stub/getsockname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/getsockopt.c b/sysdeps/stub/getsockopt.c index ab34d8b09c..e3ea53d79f 100644 --- a/sysdeps/stub/getsockopt.c +++ b/sysdeps/stub/getsockopt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/getsysstats.c b/sysdeps/stub/getsysstats.c index c8fe700ded..1d0781d834 100644 --- a/sysdeps/stub/getsysstats.c +++ b/sysdeps/stub/getsysstats.c @@ -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) diff --git a/sysdeps/stub/gettimeofday.c b/sysdeps/stub/gettimeofday.c index 74e4619df9..f6f38f2800 100644 --- a/sysdeps/stub/gettimeofday.c +++ b/sysdeps/stub/gettimeofday.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/getuid.c b/sysdeps/stub/getuid.c index ebdd2688bc..2c843e4c8e 100644 --- a/sysdeps/stub/getuid.c +++ b/sysdeps/stub/getuid.c @@ -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) diff --git a/sysdeps/stub/gtty.c b/sysdeps/stub/gtty.c index b702dda29a..c06d075ffd 100644 --- a/sysdeps/stub/gtty.c +++ b/sysdeps/stub/gtty.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/ioctl.c b/sysdeps/stub/ioctl.c index 579ddab9b7..23d13cd0d0 100644 --- a/sysdeps/stub/ioctl.c +++ b/sysdeps/stub/ioctl.c @@ -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) diff --git a/sysdeps/stub/isatty.c b/sysdeps/stub/isatty.c index ae9510b313..45e9500a28 100644 --- a/sysdeps/stub/isatty.c +++ b/sysdeps/stub/isatty.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/isfdtype.c b/sysdeps/stub/isfdtype.c index 560efd83fc..5baf9e52a1 100644 --- a/sysdeps/stub/isfdtype.c +++ b/sysdeps/stub/isfdtype.c @@ -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) diff --git a/sysdeps/stub/kill.c b/sysdeps/stub/kill.c index b9a8b0e3c2..013b27c368 100644 --- a/sysdeps/stub/kill.c +++ b/sysdeps/stub/kill.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/killpg.c b/sysdeps/stub/killpg.c index 6e8424d4a3..047760b527 100644 --- a/sysdeps/stub/killpg.c +++ b/sysdeps/stub/killpg.c @@ -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; } diff --git a/sysdeps/stub/libc-lock.h b/sysdeps/stub/libc-lock.h index ca2d77c220..58c60e589e 100644 --- a/sysdeps/stub/libc-lock.h +++ b/sysdeps/stub/libc-lock.h @@ -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. */ diff --git a/sysdeps/stub/link.c b/sysdeps/stub/link.c index c5ea71374a..643223dc7f 100644 --- a/sysdeps/stub/link.c +++ b/sysdeps/stub/link.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/listen.c b/sysdeps/stub/listen.c index 6b7d4df938..c042b1ca40 100644 --- a/sysdeps/stub/listen.c +++ b/sysdeps/stub/listen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/lseek.c b/sysdeps/stub/lseek.c index 6d9c3660fb..e285cb5016 100644 --- a/sysdeps/stub/lseek.c +++ b/sysdeps/stub/lseek.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/lxstat.c b/sysdeps/stub/lxstat.c index 5729925ff3..edbe2fc6d4 100644 --- a/sysdeps/stub/lxstat.c +++ b/sysdeps/stub/lxstat.c @@ -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) diff --git a/sysdeps/stub/madvise.c b/sysdeps/stub/madvise.c index e3dbacdfe3..dbe2c7cb38 100644 --- a/sysdeps/stub/madvise.c +++ b/sysdeps/stub/madvise.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/mkdir.c b/sysdeps/stub/mkdir.c index 9822b5f8b8..251ea11520 100644 --- a/sysdeps/stub/mkdir.c +++ b/sysdeps/stub/mkdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/mkfifo.c b/sysdeps/stub/mkfifo.c index d8aa88283c..eaf0d2f2c2 100644 --- a/sysdeps/stub/mkfifo.c +++ b/sysdeps/stub/mkfifo.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/mkstemp.c b/sysdeps/stub/mkstemp.c index 1adf6c0215..47dd7125b3 100644 --- a/sysdeps/stub/mkstemp.c +++ b/sysdeps/stub/mkstemp.c @@ -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; } diff --git a/sysdeps/stub/mktemp.c b/sysdeps/stub/mktemp.c index ad660232d7..06fe3de0c4 100644 --- a/sysdeps/stub/mktemp.c +++ b/sysdeps/stub/mktemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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; } diff --git a/sysdeps/stub/mmap.c b/sysdeps/stub/mmap.c index e230c9d8a4..f127eae916 100644 --- a/sysdeps/stub/mmap.c +++ b/sysdeps/stub/mmap.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/morecore.c b/sysdeps/stub/morecore.c index cb669277b0..cda38cfee9 100644 --- a/sysdeps/stub/morecore.c +++ b/sysdeps/stub/morecore.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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; } diff --git a/sysdeps/stub/mprotect.c b/sysdeps/stub/mprotect.c index 2626e4b4b8..81e54cd776 100644 --- a/sysdeps/stub/mprotect.c +++ b/sysdeps/stub/mprotect.c @@ -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) diff --git a/sysdeps/stub/msgctl.c b/sysdeps/stub/msgctl.c index 8212f096c1..5c2eea700e 100644 --- a/sysdeps/stub/msgctl.c +++ b/sysdeps/stub/msgctl.c @@ -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; } diff --git a/sysdeps/stub/msgget.c b/sysdeps/stub/msgget.c index 3ee2b3dacd..343c6d8a8b 100644 --- a/sysdeps/stub/msgget.c +++ b/sysdeps/stub/msgget.c @@ -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; } diff --git a/sysdeps/stub/msgrcv.c b/sysdeps/stub/msgrcv.c index 3d5dfc5523..863824946d 100644 --- a/sysdeps/stub/msgrcv.c +++ b/sysdeps/stub/msgrcv.c @@ -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; } diff --git a/sysdeps/stub/msgsnd.c b/sysdeps/stub/msgsnd.c index 77d188017d..04df3d9f70 100644 --- a/sysdeps/stub/msgsnd.c +++ b/sysdeps/stub/msgsnd.c @@ -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; } diff --git a/sysdeps/stub/msync.c b/sysdeps/stub/msync.c index a01c474422..21421b73f1 100644 --- a/sysdeps/stub/msync.c +++ b/sysdeps/stub/msync.c @@ -27,7 +27,7 @@ Cambridge, MA 02139, USA. */ int msync (caddr_t addr, size_t len) { - errno = ENOSYS; + __set_errno (ENOSYS); return -1; } diff --git a/sysdeps/stub/munmap.c b/sysdeps/stub/munmap.c index ba61e0f97a..55b674ec22 100644 --- a/sysdeps/stub/munmap.c +++ b/sysdeps/stub/munmap.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,7 +26,7 @@ Cambridge, MA 02139, USA. */ int __munmap (caddr_t addr, size_t len) { - errno = ENOSYS; + __set_errno (ENOSYS); return -1; } diff --git a/sysdeps/stub/nanosleep.c b/sysdeps/stub/nanosleep.c index 97cdd50da0..0995bb9654 100644 --- a/sysdeps/stub/nanosleep.c +++ b/sysdeps/stub/nanosleep.c @@ -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) diff --git a/sysdeps/stub/nice.c b/sysdeps/stub/nice.c index 5c3768a7e5..ae7f88f6a5 100644 --- a/sysdeps/stub/nice.c +++ b/sysdeps/stub/nice.c @@ -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; } diff --git a/sysdeps/stub/nlist.c b/sysdeps/stub/nlist.c index 1407033114..3d421d7cb2 100644 --- a/sysdeps/stub/nlist.c +++ b/sysdeps/stub/nlist.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/open.c b/sysdeps/stub/open.c index af0d2723f8..08c4b780ef 100644 --- a/sysdeps/stub/open.c +++ b/sysdeps/stub/open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/opendir.c b/sysdeps/stub/opendir.c index f0d7784d1e..f32a6b04c2 100644 --- a/sysdeps/stub/opendir.c +++ b/sysdeps/stub/opendir.c @@ -25,7 +25,7 @@ Cambridge, MA 02139, USA. */ DIR * __opendir (const char *name) { - errno = ENOSYS; + __set_errno (ENOSYS); return NULL; } weak_alias (__opendir, opendir) diff --git a/sysdeps/stub/pathconf.c b/sysdeps/stub/pathconf.c index 1a544c3882..92891fd518 100644 --- a/sysdeps/stub/pathconf.c +++ b/sysdeps/stub/pathconf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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); diff --git a/sysdeps/stub/pause.c b/sysdeps/stub/pause.c index b2a7adde76..8a885014bc 100644 --- a/sysdeps/stub/pause.c +++ b/sysdeps/stub/pause.c @@ -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; } diff --git a/sysdeps/stub/pipe.c b/sysdeps/stub/pipe.c index acef99b112..c3ed56b299 100644 --- a/sysdeps/stub/pipe.c +++ b/sysdeps/stub/pipe.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/pipestream.c b/sysdeps/stub/pipestream.c index afa2c4735d..36f6f1b80f 100644 --- a/sysdeps/stub/pipestream.c +++ b/sysdeps/stub/pipestream.c @@ -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; } /* 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; } diff --git a/sysdeps/stub/poll.c b/sysdeps/stub/poll.c index 40fc2c91c7..9c7a65d2ce 100644 --- a/sysdeps/stub/poll.c +++ b/sysdeps/stub/poll.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -31,7 +31,7 @@ poll (fds, nfds, timeout) unsigned long int nfds; int timeout; { - errno = ENOSYS; + __set_errno (ENOSYS); return -1; } diff --git a/sysdeps/stub/profil.c b/sysdeps/stub/profil.c index ab8e1d4ed6..eb5538fd46 100644 --- a/sysdeps/stub/profil.c +++ b/sysdeps/stub/profil.c @@ -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) diff --git a/sysdeps/stub/ptrace.c b/sysdeps/stub/ptrace.c index 31fbbb1b05..d3a2d57a2f 100644 --- a/sysdeps/stub/ptrace.c +++ b/sysdeps/stub/ptrace.c @@ -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; } diff --git a/sysdeps/stub/putenv.c b/sysdeps/stub/putenv.c index 3d845d8eaa..d50b4a5b2d 100644 --- a/sysdeps/stub/putenv.c +++ b/sysdeps/stub/putenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/raise.c b/sysdeps/stub/raise.c index ea89874f92..cac49df7de 100644 --- a/sysdeps/stub/raise.c +++ b/sysdeps/stub/raise.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/read.c b/sysdeps/stub/read.c index 014313216b..724f8f8578 100644 --- a/sysdeps/stub/read.c +++ b/sysdeps/stub/read.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/readdir.c b/sysdeps/stub/readdir.c index d210906dbd..1555706d0e 100644 --- a/sysdeps/stub/readdir.c +++ b/sysdeps/stub/readdir.c @@ -24,7 +24,7 @@ Cambridge, MA 02139, USA. */ struct dirent * __readdir (DIR *dirp) { - errno = ENOSYS; + __set_errno (ENOSYS); return NULL; } weak_alias (__readdir, readdir) diff --git a/sysdeps/stub/readlink.c b/sysdeps/stub/readlink.c index b640a8db0f..99c852569d 100644 --- a/sysdeps/stub/readlink.c +++ b/sysdeps/stub/readlink.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/readv.c b/sysdeps/stub/readv.c index 03d6bf9613..b537499b07 100644 --- a/sysdeps/stub/readv.c +++ b/sysdeps/stub/readv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/reboot.c b/sysdeps/stub/reboot.c index 5cc05eb5cb..8db83af97a 100644 --- a/sysdeps/stub/reboot.c +++ b/sysdeps/stub/reboot.c @@ -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; } diff --git a/sysdeps/stub/recv.c b/sysdeps/stub/recv.c index 21c9cfa1b2..e09ef4fba1 100644 --- a/sysdeps/stub/recv.c +++ b/sysdeps/stub/recv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/recvfrom.c b/sysdeps/stub/recvfrom.c index aca6d23791..47973ed896 100644 --- a/sysdeps/stub/recvfrom.c +++ b/sysdeps/stub/recvfrom.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/recvmsg.c b/sysdeps/stub/recvmsg.c index eecff02084..27f463ca41 100644 --- a/sysdeps/stub/recvmsg.c +++ b/sysdeps/stub/recvmsg.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/remove.c b/sysdeps/stub/remove.c index c044e0aac0..a8a4d3cb36 100644 --- a/sysdeps/stub/remove.c +++ b/sysdeps/stub/remove.c @@ -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; } diff --git a/sysdeps/stub/rename.c b/sysdeps/stub/rename.c index e880d7908b..b0a8521c86 100644 --- a/sysdeps/stub/rename.c +++ b/sysdeps/stub/rename.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/revoke.c b/sysdeps/stub/revoke.c index 295dc2bb5e..94107ef89a 100644 --- a/sysdeps/stub/revoke.c +++ b/sysdeps/stub/revoke.c @@ -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) diff --git a/sysdeps/stub/rewinddir.c b/sysdeps/stub/rewinddir.c index d4f0ce9fa0..1ad85c4cac 100644 --- a/sysdeps/stub/rewinddir.c +++ b/sysdeps/stub/rewinddir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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. */ } diff --git a/sysdeps/stub/rmdir.c b/sysdeps/stub/rmdir.c index 828a261a13..7e54ee42be 100644 --- a/sysdeps/stub/rmdir.c +++ b/sysdeps/stub/rmdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/sbrk.c b/sysdeps/stub/sbrk.c index 46d9ecde60..0e9d07dc1a 100644 --- a/sysdeps/stub/sbrk.c +++ b/sysdeps/stub/sbrk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/sched_getp.c b/sysdeps/stub/sched_getp.c index 0da92bcd2c..e908638b5e 100644 --- a/sysdeps/stub/sched_getp.c +++ b/sysdeps/stub/sched_getp.c @@ -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) diff --git a/sysdeps/stub/sched_gets.c b/sysdeps/stub/sched_gets.c index bb64838908..9fe4921d53 100644 --- a/sysdeps/stub/sched_gets.c +++ b/sysdeps/stub/sched_gets.c @@ -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) diff --git a/sysdeps/stub/sched_primax.c b/sysdeps/stub/sched_primax.c index 7ff5af3731..cf76994cf5 100644 --- a/sysdeps/stub/sched_primax.c +++ b/sysdeps/stub/sched_primax.c @@ -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) diff --git a/sysdeps/stub/sched_primin.c b/sysdeps/stub/sched_primin.c index 370f10c91c..2f79194a23 100644 --- a/sysdeps/stub/sched_primin.c +++ b/sysdeps/stub/sched_primin.c @@ -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) diff --git a/sysdeps/stub/sched_rr_gi.c b/sysdeps/stub/sched_rr_gi.c index b818561287..f23aacbda4 100644 --- a/sysdeps/stub/sched_rr_gi.c +++ b/sysdeps/stub/sched_rr_gi.c @@ -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) diff --git a/sysdeps/stub/sched_setp.c b/sysdeps/stub/sched_setp.c index 513c717b03..c29bcc7149 100644 --- a/sysdeps/stub/sched_setp.c +++ b/sysdeps/stub/sched_setp.c @@ -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) diff --git a/sysdeps/stub/sched_sets.c b/sysdeps/stub/sched_sets.c index 98008e6138..b845c2e864 100644 --- a/sysdeps/stub/sched_sets.c +++ b/sysdeps/stub/sched_sets.c @@ -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) diff --git a/sysdeps/stub/sched_yield.c b/sysdeps/stub/sched_yield.c index 244ac15e1b..6c37285fbb 100644 --- a/sysdeps/stub/sched_yield.c +++ b/sysdeps/stub/sched_yield.c @@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */ int __sched_yield (void) { - errno = ENOSYS; + __set_errno (ENOSYS); return -1; } stub_warning (sched_yield) diff --git a/sysdeps/stub/seekdir.c b/sysdeps/stub/seekdir.c index 449aa62e1e..fe40c8b51d 100644 --- a/sysdeps/stub/seekdir.c +++ b/sysdeps/stub/seekdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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); } diff --git a/sysdeps/stub/select.c b/sysdeps/stub/select.c index 837f0adab4..1c5e12fc75 100644 --- a/sysdeps/stub/select.c +++ b/sysdeps/stub/select.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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) diff --git a/sysdeps/stub/semctl.c b/sysdeps/stub/semctl.c index 8f2fe99400..cf44af8456 100644 --- a/sysdeps/stub/semctl.c +++ b/sysdeps/stub/semctl.c @@ -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; } diff --git a/sysdeps/stub/semget.c b/sysdeps/stub/semget.c index 3ccf2717d4..327bc8e19d 100644 --- a/sysdeps/stub/semget.c +++ b/sysdeps/stub/semget.c @@ -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; } diff --git a/sysdeps/stub/semop.c b/sysdeps/stub/semop.c index 2bba8628e6..29bf159fee 100644 --- a/sysdeps/stub/semop.c +++ b/sysdeps/stub/semop.c @@ -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; } diff --git a/sysdeps/stub/send.c b/sysdeps/stub/send.c index 3832185b9e..e921fd74bd 100644 --- a/sysdeps/stub/send.c +++ b/sysdeps/stub/send.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/sendmsg.c b/sysdeps/stub/sendmsg.c index 2066e52168..12d1698985 100644 --- a/sysdeps/stub/sendmsg.c +++ b/sysdeps/stub/sendmsg.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/sendto.c b/sysdeps/stub/sendto.c index e26c88751c..26353919a1 100644 --- a/sysdeps/stub/sendto.c +++ b/sysdeps/stub/sendto.c @@ -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; } diff --git a/sysdeps/stub/setdomain.c b/sysdeps/stub/setdomain.c index 052b45b9bc..891141b481 100644 --- a/sysdeps/stub/setdomain.c +++ b/sysdeps/stub/setdomain.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,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; } diff --git a/sysdeps/stub/setegid.c b/sysdeps/stub/setegid.c index 3429c67911..573eb63ef6 100644 --- a/sysdeps/stub/setegid.c +++ b/sysdeps/stub/setegid.c @@ -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; } diff --git a/sysdeps/stub/setenv.c b/sysdeps/stub/setenv.c index 998c055f50..f318475718 100644 --- a/sysdeps/stub/setenv.c +++ b/sysdeps/stub/setenv.c @@ -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; } diff --git a/sysdeps/stub/seteuid.c b/sysdeps/stub/seteuid.c index e86e9a5898..53b318ec57 100644 --- a/sysdeps/stub/seteuid.c +++ b/sysdeps/stub/seteuid.c @@ -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; } diff --git a/sysdeps/stub/setgid.c b/sysdeps/stub/setgid.c index df1adbbac7..a51eb48e2d 100644 --- a/sysdeps/stub/setgid.c +++ b/sysdeps/stub/setgid.c @@ -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) diff --git a/sysdeps/stub/setgroups.c b/sysdeps/stub/setgroups.c index c5955a014e..0fa96315cd 100644 --- a/sysdeps/stub/setgroups.c +++ b/sysdeps/stub/setgroups.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/sethostid.c b/sysdeps/stub/sethostid.c index d12b93bc6d..30f24eea20 100644 --- a/sysdeps/stub/sethostid.c +++ b/sysdeps/stub/sethostid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/sethostname.c b/sysdeps/stub/sethostname.c index 81fa5fb742..aeb678910d 100644 --- a/sysdeps/stub/sethostname.c +++ b/sysdeps/stub/sethostname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/setitimer.c b/sysdeps/stub/setitimer.c index 6ba7031184..737257fa7f 100644 --- a/sysdeps/stub/setitimer.c +++ b/sysdeps/stub/setitimer.c @@ -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) diff --git a/sysdeps/stub/setjmp.c b/sysdeps/stub/setjmp.c index 01f58121d5..b38b0bd984 100644 --- a/sysdeps/stub/setjmp.c +++ b/sysdeps/stub/setjmp.c @@ -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; } diff --git a/sysdeps/stub/setlogin.c b/sysdeps/stub/setlogin.c index a406bc54d8..30e7b54bbb 100644 --- a/sysdeps/stub/setlogin.c +++ b/sysdeps/stub/setlogin.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/setpgid.c b/sysdeps/stub/setpgid.c index c694215067..6527a3e0bb 100644 --- a/sysdeps/stub/setpgid.c +++ b/sysdeps/stub/setpgid.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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) diff --git a/sysdeps/stub/setpriority.c b/sysdeps/stub/setpriority.c index 255306e142..382a6cad20 100644 --- a/sysdeps/stub/setpriority.c +++ b/sysdeps/stub/setpriority.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/setregid.c b/sysdeps/stub/setregid.c index 017dd08692..0b31afd8be 100644 --- a/sysdeps/stub/setregid.c +++ b/sysdeps/stub/setregid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/setreuid.c b/sysdeps/stub/setreuid.c index 7640d2f674..b6f9399bc3 100644 --- a/sysdeps/stub/setreuid.c +++ b/sysdeps/stub/setreuid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/setrlimit.c b/sysdeps/stub/setrlimit.c index 2affcc76b8..79b96235b7 100644 --- a/sysdeps/stub/setrlimit.c +++ b/sysdeps/stub/setrlimit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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; diff --git a/sysdeps/stub/setsid.c b/sysdeps/stub/setsid.c index 9baf1ee4ef..3f0bb3a57b 100644 --- a/sysdeps/stub/setsid.c +++ b/sysdeps/stub/setsid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/setsockopt.c b/sysdeps/stub/setsockopt.c index c1933afe38..546ca4b0c0 100644 --- a/sysdeps/stub/setsockopt.c +++ b/sysdeps/stub/setsockopt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/settimeofday.c b/sysdeps/stub/settimeofday.c index 7d654cde57..7b94e88e47 100644 --- a/sysdeps/stub/settimeofday.c +++ b/sysdeps/stub/settimeofday.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/setuid.c b/sysdeps/stub/setuid.c index 3415925967..122888619b 100644 --- a/sysdeps/stub/setuid.c +++ b/sysdeps/stub/setuid.c @@ -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) diff --git a/sysdeps/stub/shmat.c b/sysdeps/stub/shmat.c index 099f2279d2..9d5629b06c 100644 --- a/sysdeps/stub/shmat.c +++ b/sysdeps/stub/shmat.c @@ -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; } diff --git a/sysdeps/stub/shmctl.c b/sysdeps/stub/shmctl.c index 75a4613166..a3b37076ff 100644 --- a/sysdeps/stub/shmctl.c +++ b/sysdeps/stub/shmctl.c @@ -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; } diff --git a/sysdeps/stub/shmdt.c b/sysdeps/stub/shmdt.c index 8affa6c15a..8cca7743b6 100644 --- a/sysdeps/stub/shmdt.c +++ b/sysdeps/stub/shmdt.c @@ -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; } diff --git a/sysdeps/stub/shmget.c b/sysdeps/stub/shmget.c index d59ff90c99..63c5443701 100644 --- a/sysdeps/stub/shmget.c +++ b/sysdeps/stub/shmget.c @@ -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; } diff --git a/sysdeps/stub/shutdown.c b/sysdeps/stub/shutdown.c index 501d532184..cce3dd702b 100644 --- a/sysdeps/stub/shutdown.c +++ b/sysdeps/stub/shutdown.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/sigaction.c b/sysdeps/stub/sigaction.c index 7321140acd..1344d45044 100644 --- a/sysdeps/stub/sigaction.c +++ b/sysdeps/stub/sigaction.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/sigaltstack.c b/sysdeps/stub/sigaltstack.c index 01a547c2a5..f348a5372b 100644 --- a/sysdeps/stub/sigaltstack.c +++ b/sysdeps/stub/sigaltstack.c @@ -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; } diff --git a/sysdeps/stub/sigblock.c b/sysdeps/stub/sigblock.c index 7c7469eee7..320027f89c 100644 --- a/sysdeps/stub/sigblock.c +++ b/sysdeps/stub/sigblock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/sigintr.c b/sysdeps/stub/sigintr.c index a15b2c11b4..f98f98803a 100644 --- a/sysdeps/stub/sigintr.c +++ b/sysdeps/stub/sigintr.c @@ -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; } diff --git a/sysdeps/stub/signal.c b/sysdeps/stub/signal.c index 2bd9b4217f..6ee587acb3 100644 --- a/sysdeps/stub/signal.c +++ b/sysdeps/stub/signal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/sigpause.c b/sysdeps/stub/sigpause.c index a307422d06..54d23ee262 100644 --- a/sysdeps/stub/sigpause.c +++ b/sysdeps/stub/sigpause.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/sigpending.c b/sysdeps/stub/sigpending.c index def44ed1a1..81096db731 100644 --- a/sysdeps/stub/sigpending.c +++ b/sysdeps/stub/sigpending.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/sigprocmask.c b/sysdeps/stub/sigprocmask.c index a89f683d54..48623be13b 100644 --- a/sysdeps/stub/sigprocmask.c +++ b/sysdeps/stub/sigprocmask.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/sigreturn.c b/sysdeps/stub/sigreturn.c index d4370e4b34..7a2db5b4cc 100644 --- a/sysdeps/stub/sigreturn.c +++ b/sysdeps/stub/sigreturn.c @@ -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) diff --git a/sysdeps/stub/sigsetmask.c b/sysdeps/stub/sigsetmask.c index ab4ae811ac..7bb5eab0fd 100644 --- a/sysdeps/stub/sigsetmask.c +++ b/sysdeps/stub/sigsetmask.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/sigstack.c b/sysdeps/stub/sigstack.c index a9da1e699e..79f21c4790 100644 --- a/sysdeps/stub/sigstack.c +++ b/sysdeps/stub/sigstack.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/sigsuspend.c b/sysdeps/stub/sigsuspend.c index da7ff85a83..ce604f8cb4 100644 --- a/sysdeps/stub/sigsuspend.c +++ b/sysdeps/stub/sigsuspend.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/sigvec.c b/sysdeps/stub/sigvec.c index af8e24dc64..62505a7d68 100644 --- a/sysdeps/stub/sigvec.c +++ b/sysdeps/stub/sigvec.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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) diff --git a/sysdeps/stub/sleep.c b/sysdeps/stub/sleep.c index 88c7120a27..9ba448f586 100644 --- a/sysdeps/stub/sleep.c +++ b/sysdeps/stub/sleep.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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; } diff --git a/sysdeps/stub/socket.c b/sysdeps/stub/socket.c index 26f550db87..52017cbbde 100644 --- a/sysdeps/stub/socket.c +++ b/sysdeps/stub/socket.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/stub/socketpair.c b/sysdeps/stub/socketpair.c index bc9b4b50f2..938e08f50e 100644 --- a/sysdeps/stub/socketpair.c +++ b/sysdeps/stub/socketpair.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/stub/sstk.c b/sysdeps/stub/sstk.c index e49bc31ee3..d7486737fa 100644 --- a/sysdeps/stub/sstk.c +++ b/sysdeps/stub/sstk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/start.c b/sysdeps/stub/start.c index 9d412011f9..c16582d9b3 100644 --- a/sysdeps/stub/start.c +++ b/sysdeps/stub/start.c @@ -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) diff --git a/sysdeps/stub/statfs.c b/sysdeps/stub/statfs.c index 1aa2feeae6..72a93b2b9a 100644 --- a/sysdeps/stub/statfs.c +++ b/sysdeps/stub/statfs.c @@ -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) - diff --git a/sysdeps/stub/stime.c b/sysdeps/stub/stime.c index 231e762808..4a58dd8924 100644 --- a/sysdeps/stub/stime.c +++ b/sysdeps/stub/stime.c @@ -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; } diff --git a/sysdeps/stub/stty.c b/sysdeps/stub/stty.c index dec67c2cc3..e4fd33b9ee 100644 --- a/sysdeps/stub/stty.c +++ b/sysdeps/stub/stty.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/swapoff.c b/sysdeps/stub/swapoff.c index d082bbcd53..66e2650149 100644 --- a/sysdeps/stub/swapoff.c +++ b/sysdeps/stub/swapoff.c @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. */ int swapoff (const char *path) { - errno = ENOSYS; + __set_errno (ENOSYS); return -1; } diff --git a/sysdeps/stub/swapon.c b/sysdeps/stub/swapon.c index 825f353a88..d990befb0a 100644 --- a/sysdeps/stub/swapon.c +++ b/sysdeps/stub/swapon.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/symlink.c b/sysdeps/stub/symlink.c index c8e6f1242a..d02e218d2b 100644 --- a/sysdeps/stub/symlink.c +++ b/sysdeps/stub/symlink.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/sync.c b/sysdeps/stub/sync.c index 34ddf2f0de..b775ee8dd2 100644 --- a/sysdeps/stub/sync.c +++ b/sysdeps/stub/sync.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/syscall.c b/sysdeps/stub/syscall.c index d2a5b3ca33..f08ab3d851 100644 --- a/sysdeps/stub/syscall.c +++ b/sysdeps/stub/syscall.c @@ -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; } diff --git a/sysdeps/stub/sysconf.c b/sysdeps/stub/sysconf.c index 1351b48fe0..43ad6d93a9 100644 --- a/sysdeps/stub/sysconf.c +++ b/sysdeps/stub/sysconf.c @@ -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; } diff --git a/sysdeps/stub/sysd-stdio.c b/sysdeps/stub/sysd-stdio.c index c74823a7a4..75976c2d3d 100644 --- a/sysdeps/stub/sysd-stdio.c +++ b/sysdeps/stub/sysd-stdio.c @@ -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; } diff --git a/sysdeps/stub/system.c b/sysdeps/stub/system.c index 75c0747a1e..8cb192d7ed 100644 --- a/sysdeps/stub/system.c +++ b/sysdeps/stub/system.c @@ -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) diff --git a/sysdeps/stub/tcdrain.c b/sysdeps/stub/tcdrain.c index 20f2b86195..4d52f34009 100644 --- a/sysdeps/stub/tcdrain.c +++ b/sysdeps/stub/tcdrain.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/tcflow.c b/sysdeps/stub/tcflow.c index 5ccc9d5646..1dbda79719 100644 --- a/sysdeps/stub/tcflow.c +++ b/sysdeps/stub/tcflow.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/tcflush.c b/sysdeps/stub/tcflush.c index 3e9f7efa3a..16cc1c4d91 100644 --- a/sysdeps/stub/tcflush.c +++ b/sysdeps/stub/tcflush.c @@ -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. */ diff --git a/sysdeps/stub/tcgetattr.c b/sysdeps/stub/tcgetattr.c index 70208491ed..da6e545499 100644 --- a/sysdeps/stub/tcgetattr.c +++ b/sysdeps/stub/tcgetattr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/tcgetpgrp.c b/sysdeps/stub/tcgetpgrp.c index 1e1ebfa923..3b901a9662 100644 --- a/sysdeps/stub/tcgetpgrp.c +++ b/sysdeps/stub/tcgetpgrp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/tcsendbrk.c b/sysdeps/stub/tcsendbrk.c index 6d8be7403c..80ee6f4d53 100644 --- a/sysdeps/stub/tcsendbrk.c +++ b/sysdeps/stub/tcsendbrk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/tcsetattr.c b/sysdeps/stub/tcsetattr.c index 89ee7d7c32..ce1dae094f 100644 --- a/sysdeps/stub/tcsetattr.c +++ b/sysdeps/stub/tcsetattr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) { diff --git a/sysdeps/stub/tcsetpgrp.c b/sysdeps/stub/tcsetpgrp.c index 3dbe34e29c..3a97fef975 100644 --- a/sysdeps/stub/tcsetpgrp.c +++ b/sysdeps/stub/tcsetpgrp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/telldir.c b/sysdeps/stub/telldir.c index ce00e09fb4..811ce74000 100644 --- a/sysdeps/stub/telldir.c +++ b/sysdeps/stub/telldir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/tempname.c b/sysdeps/stub/tempname.c index 42b1c32022..939c70fb0d 100644 --- a/sysdeps/stub/tempname.c +++ b/sysdeps/stub/tempname.c @@ -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; } diff --git a/sysdeps/stub/time.c b/sysdeps/stub/time.c index cb208bcf0b..d410be3894 100644 --- a/sysdeps/stub/time.c +++ b/sysdeps/stub/time.c @@ -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; diff --git a/sysdeps/stub/times.c b/sysdeps/stub/times.c index 2b47ec2f1d..ab33dcae33 100644 --- a/sysdeps/stub/times.c +++ b/sysdeps/stub/times.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/truncate.c b/sysdeps/stub/truncate.c index 1367332792..1134c6a4d9 100644 --- a/sysdeps/stub/truncate.c +++ b/sysdeps/stub/truncate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/ttyname.c b/sysdeps/stub/ttyname.c index a243e85053..0d251f4ee0 100644 --- a/sysdeps/stub/ttyname.c +++ b/sysdeps/stub/ttyname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/ttyname_r.c b/sysdeps/stub/ttyname_r.c index 67350d9ed3..7a05629c43 100644 --- a/sysdeps/stub/ttyname_r.c +++ b/sysdeps/stub/ttyname_r.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,7 +28,7 @@ ttyname_r (fd, buf, buflen) char *buf; int buflen; { - errno = ENOSYS; + __set_errno (ENOSYS); return -1; } diff --git a/sysdeps/stub/ualarm.c b/sysdeps/stub/ualarm.c index ead365b157..ffc4e51853 100644 --- a/sysdeps/stub/ualarm.c +++ b/sysdeps/stub/ualarm.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file 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; } diff --git a/sysdeps/stub/ulimit.c b/sysdeps/stub/ulimit.c index 84633c4e14..e633a6aeed 100644 --- a/sysdeps/stub/ulimit.c +++ b/sysdeps/stub/ulimit.c @@ -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) diff --git a/sysdeps/stub/umask.c b/sysdeps/stub/umask.c index 18c85b74b7..fea20c2972 100644 --- a/sysdeps/stub/umask.c +++ b/sysdeps/stub/umask.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/unlink.c b/sysdeps/stub/unlink.c index 7f8e249f27..6fe7c9de00 100644 --- a/sysdeps/stub/unlink.c +++ b/sysdeps/stub/unlink.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/usleep.c b/sysdeps/stub/usleep.c index c1cae9c7c6..4f3f232f63 100644 --- a/sysdeps/stub/usleep.c +++ b/sysdeps/stub/usleep.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/stub/ustat.c b/sysdeps/stub/ustat.c index baa98fd5e8..8e909f9f40 100644 --- a/sysdeps/stub/ustat.c +++ b/sysdeps/stub/ustat.c @@ -26,7 +26,7 @@ ustat (dev, ust) dev_t dev; struct ustat * ust; { - errno = ENOSYS; + __set_errno (ENOSYS); return -1; } stub_warning (ustat) diff --git a/sysdeps/stub/utime.c b/sysdeps/stub/utime.c index 641960dd1b..374ed1d140 100644 --- a/sysdeps/stub/utime.c +++ b/sysdeps/stub/utime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/utimes.c b/sysdeps/stub/utimes.c index 5afc3d7eb4..824f2412ee 100644 --- a/sysdeps/stub/utimes.c +++ b/sysdeps/stub/utimes.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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; } diff --git a/sysdeps/stub/vhangup.c b/sysdeps/stub/vhangup.c index 6a7a994365..532fd64387 100644 --- a/sysdeps/stub/vhangup.c +++ b/sysdeps/stub/vhangup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/wait.c b/sysdeps/stub/wait.c index 97b78417b6..a41a2471a8 100644 --- a/sysdeps/stub/wait.c +++ b/sysdeps/stub/wait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/wait3.c b/sysdeps/stub/wait3.c index c1640dde8a..b5ea8e37b5 100644 --- a/sysdeps/stub/wait3.c +++ b/sysdeps/stub/wait3.c @@ -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) diff --git a/sysdeps/stub/wait4.c b/sysdeps/stub/wait4.c index 2062d4b2cc..bf273438ca 100644 --- a/sysdeps/stub/wait4.c +++ b/sysdeps/stub/wait4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/stub/waitpid.c b/sysdeps/stub/waitpid.c index 22eb019eb5..09ba5a8f92 100644 --- a/sysdeps/stub/waitpid.c +++ b/sysdeps/stub/waitpid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/stub/write.c b/sysdeps/stub/write.c index deb4851e06..69778c376f 100644 --- a/sysdeps/stub/write.c +++ b/sysdeps/stub/write.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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) diff --git a/sysdeps/stub/writev.c b/sysdeps/stub/writev.c index f1d574948d..593880c0e9 100644 --- a/sysdeps/stub/writev.c +++ b/sysdeps/stub/writev.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/stub/xmknod.c b/sysdeps/stub/xmknod.c index 6d365cbe0c..48d8b4f113 100644 --- a/sysdeps/stub/xmknod.c +++ b/sysdeps/stub/xmknod.c @@ -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) diff --git a/sysdeps/stub/xstat.c b/sysdeps/stub/xstat.c index ad67aa9fec..a487062fdf 100644 --- a/sysdeps/stub/xstat.c +++ b/sysdeps/stub/xstat.c @@ -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) diff --git a/sysdeps/unix/bsd/bsd4.4/errnos.h b/sysdeps/unix/bsd/bsd4.4/errnos.h index dcfdd9c47f..c2a9c08413 100644 --- a/sysdeps/unix/bsd/bsd4.4/errnos.h +++ b/sysdeps/unix/bsd/bsd4.4/errnos.h @@ -165,4 +165,6 @@ #endif /* __USE_BSD */ +#define __set_errno(val) errno = (val) + #endif /* <errno.h> included. */ diff --git a/sysdeps/unix/bsd/bsd4.4/tcdrain.c b/sysdeps/unix/bsd/bsd4.4/tcdrain.c index ac7c9cd2a1..feaa652aa7 100644 --- a/sysdeps/unix/bsd/bsd4.4/tcdrain.c +++ b/sysdeps/unix/bsd/bsd4.4/tcdrain.c @@ -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) diff --git a/sysdeps/unix/bsd/bsd4.4/wait.c b/sysdeps/unix/bsd/bsd4.4/wait.c index a29a99f9b9..29225f8638 100644 --- a/sysdeps/unix/bsd/bsd4.4/wait.c +++ b/sysdeps/unix/bsd/bsd4.4/wait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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) diff --git a/sysdeps/unix/bsd/bsd4.4/waitpid.c b/sysdeps/unix/bsd/bsd4.4/waitpid.c index b5a34c32d0..2a21e3cef8 100644 --- a/sysdeps/unix/bsd/bsd4.4/waitpid.c +++ b/sysdeps/unix/bsd/bsd4.4/waitpid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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) diff --git a/sysdeps/unix/bsd/isatty.c b/sysdeps/unix/bsd/isatty.c index c3e80eb1c3..f6e34e865b 100644 --- a/sysdeps/unix/bsd/isatty.c +++ b/sysdeps/unix/bsd/isatty.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/unix/bsd/setegid.c b/sysdeps/unix/bsd/setegid.c index c4a3780f6d..420751bfc1 100644 --- a/sysdeps/unix/bsd/setegid.c +++ b/sysdeps/unix/bsd/setegid.c @@ -26,7 +26,7 @@ setegid (gid) { if (gid == (gid_t) ~0) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/bsd/seteuid.c b/sysdeps/unix/bsd/seteuid.c index f6aa37f153..06fd1a3f29 100644 --- a/sysdeps/unix/bsd/seteuid.c +++ b/sysdeps/unix/bsd/seteuid.c @@ -26,7 +26,7 @@ seteuid (uid) { if (uid == (uid_t) ~0) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/bsd/setsid.c b/sysdeps/unix/bsd/setsid.c index e057694589..1da7865ac6 100644 --- a/sysdeps/unix/bsd/setsid.c +++ b/sysdeps/unix/bsd/setsid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; } diff --git a/sysdeps/unix/bsd/sigaction.c b/sysdeps/unix/bsd/sigaction.c index aa1c53f6cd..f20968d68e 100644 --- a/sysdeps/unix/bsd/sigaction.c +++ b/sysdeps/unix/bsd/sigaction.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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)); diff --git a/sysdeps/unix/bsd/sigprocmask.c b/sysdeps/unix/bsd/sigprocmask.c index 31ebb743a8..3421eb4f31 100644 --- a/sysdeps/unix/bsd/sigprocmask.c +++ b/sysdeps/unix/bsd/sigprocmask.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.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; diff --git a/sysdeps/unix/bsd/sigsuspend.c b/sysdeps/unix/bsd/sigsuspend.c index fff56a950f..4c045aa663 100644 --- a/sysdeps/unix/bsd/sigsuspend.c +++ b/sysdeps/unix/bsd/sigsuspend.c @@ -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); } diff --git a/sysdeps/unix/bsd/sun/m68k/sigtramp.c b/sysdeps/unix/bsd/sun/m68k/sigtramp.c index 32a2c2047e..db9ffb5135 100644 --- a/sysdeps/unix/bsd/sun/m68k/sigtramp.c +++ b/sysdeps/unix/bsd/sun/m68k/sigtramp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,8 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/unix/bsd/sun/sparc/sigtramp.c b/sysdeps/unix/bsd/sun/sparc/sigtramp.c index 54f62933a8..11ce1945ff 100644 --- a/sysdeps/unix/bsd/sun/sparc/sigtramp.c +++ b/sysdeps/unix/bsd/sun/sparc/sigtramp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,8 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/unix/bsd/sun/sunos4/speed.c b/sysdeps/unix/bsd/sun/sunos4/speed.c index 1c09d55dab..de6870a51d 100644 --- a/sysdeps/unix/bsd/sun/sunos4/speed.c +++ b/sysdeps/unix/bsd/sun/sunos4/speed.c @@ -1,5 +1,5 @@ /* `struct termios' speed frobnication functions. SunOS 4 version. -Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,12 +17,11 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c b/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c index f88951ff9d..f825d41ab8 100644 --- a/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c +++ b/sysdeps/unix/bsd/sun/sunos4/tcsetattr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/unix/bsd/tcdrain.c b/sysdeps/unix/bsd/tcdrain.c index c9ed18d4f8..84bc06813d 100644 --- a/sysdeps/unix/bsd/tcdrain.c +++ b/sysdeps/unix/bsd/tcdrain.c @@ -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) diff --git a/sysdeps/unix/bsd/tcflow.c b/sysdeps/unix/bsd/tcflow.c index 06de144a45..1919d6d9ea 100644 --- a/sysdeps/unix/bsd/tcflow.c +++ b/sysdeps/unix/bsd/tcflow.c @@ -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; } } diff --git a/sysdeps/unix/bsd/tcflush.c b/sysdeps/unix/bsd/tcflush.c index 46454b8229..14f7db8dad 100644 --- a/sysdeps/unix/bsd/tcflush.c +++ b/sysdeps/unix/bsd/tcflush.c @@ -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; } diff --git a/sysdeps/unix/bsd/tcgetattr.c b/sysdeps/unix/bsd/tcgetattr.c index 0e6e3785dd..5d17bd5dde 100644 --- a/sysdeps/unix/bsd/tcgetattr.c +++ b/sysdeps/unix/bsd/tcgetattr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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; } diff --git a/sysdeps/unix/bsd/tcsetattr.c b/sysdeps/unix/bsd/tcsetattr.c index e731d830f6..770bc98b79 100644 --- a/sysdeps/unix/bsd/tcsetattr.c +++ b/sysdeps/unix/bsd/tcsetattr.c @@ -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, <chars) < 0 || + if (__ioctl (fd, TIOCGETP, &buf) < 0 || + __ioctl (fd, TIOCGETC, &tchars) < 0 || + __ioctl (fd, TIOCGLTC, <chars) < 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, <chars) < 0 || + if (__ioctl (fd, TIOCSETP, &buf) < 0 || + __ioctl (fd, TIOCSETC, &tchars) < 0 || + __ioctl (fd, TIOCSLTC, <chars) < 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; } diff --git a/sysdeps/unix/bsd/times.c b/sysdeps/unix/bsd/times.c index edf3e90972..8277ce5a76 100644 --- a/sysdeps/unix/bsd/times.c +++ b/sysdeps/unix/bsd/times.c @@ -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) diff --git a/sysdeps/unix/bsd/ulimit.c b/sysdeps/unix/bsd/ulimit.c index 912faf42e2..f90692a11c 100644 --- a/sysdeps/unix/bsd/ulimit.c +++ b/sysdeps/unix/bsd/ulimit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see 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; } } diff --git a/sysdeps/unix/bsd/ultrix4/mips/start.S b/sysdeps/unix/bsd/ultrix4/mips/start.S index 24bcbb4e00..aec5885252 100644 --- a/sysdeps/unix/bsd/ultrix4/mips/start.S +++ b/sysdeps/unix/bsd/ultrix4/mips/start.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@zen.org). The GNU C Library is free software; you can redistribute it and/or @@ -18,6 +18,7 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> +__errno: .comm errno, 4 ENTRY(__start) diff --git a/sysdeps/unix/bsd/ultrix4/sysconf.c b/sysdeps/unix/bsd/ultrix4/sysconf.c index a9f3c5bbbe..a24c1c5ce8 100644 --- a/sysdeps/unix/bsd/ultrix4/sysconf.c +++ b/sysdeps/unix/bsd/ultrix4/sysconf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc. Contributed by Ian Lance Taylor (ian@airs.com). The GNU C Library is free software; you can redistribute it and/or @@ -20,20 +20,19 @@ Cambridge, MA 02139, USA. */ value for _SC_CHILD_MAX. Everything else is from <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); diff --git a/sysdeps/unix/closedir.c b/sysdeps/unix/closedir.c index 5b938a8272..a46d47ac35 100644 --- a/sysdeps/unix/closedir.c +++ b/sysdeps/unix/closedir.c @@ -32,7 +32,7 @@ __closedir (DIR *dirp) if (dirp == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/common/lxstat.c b/sysdeps/unix/common/lxstat.c index 499a0838ac..f33279979a 100644 --- a/sysdeps/unix/common/lxstat.c +++ b/sysdeps/unix/common/lxstat.c @@ -28,7 +28,7 @@ __lxstat (int vers, const char *file, struct stat *buf) { if (vers != _STAT_VER) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/common/pause.c b/sysdeps/unix/common/pause.c index b2fafb958e..a073dd2b3a 100644 --- a/sysdeps/unix/common/pause.c +++ b/sysdeps/unix/common/pause.c @@ -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) diff --git a/sysdeps/unix/common/tcsendbrk.c b/sysdeps/unix/common/tcsendbrk.c index 348321a492..7d768267c4 100644 --- a/sysdeps/unix/common/tcsendbrk.c +++ b/sysdeps/unix/common/tcsendbrk.c @@ -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 } - diff --git a/sysdeps/unix/fxstat.c b/sysdeps/unix/fxstat.c index 522d3fd052..29cab5177c 100644 --- a/sysdeps/unix/fxstat.c +++ b/sysdeps/unix/fxstat.c @@ -29,7 +29,7 @@ __fxstat (int vers, int fd, struct stat *buf) { if (vers != _STAT_VER) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/sysdeps/unix/getdents.c b/sysdeps/unix/getdents.c index 485faa13c2..6dec0dc5b5 100644 --- a/sysdeps/unix/getdents.c +++ b/sysdeps/unix/getdents.c @@ -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) - diff --git a/sysdeps/unix/getlogin.c b/sysdeps/unix/getlogin.c index e23ffa46f5..ef985f2d2f 100644 --- a/sysdeps/unix/getlogin.c +++ b/sysdeps/unix/getlogin.c @@ -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 diff --git a/sysdeps/unix/getlogin_r.c b/sysdeps/unix/getlogin_r.c index 154a9d3a59..f80b2c7518 100644 --- a/sysdeps/unix/getlogin_r.c +++ b/sysdeps/unix/getlogin_r.c @@ -53,7 +53,7 @@ getlogin_r (name, name_len) if (result < 0) { - errno = err; + __set_errno (err); return err; } } diff --git a/sysdeps/unix/mkdir.c b/sysdeps/unix/mkdir.c index 16713f9e48..ff87f9a74f 100644 --- a/sysdeps/unix/mkdir.c +++ b/sysdeps/unix/mkdir.c @@ -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 diff --git a/sysdeps/unix/mman/syscalls.list b/sysdeps/unix/mman/syscalls.list index 2211e8fa3c..a5f44e465b 100644 --- a/sysdeps/unix/mman/syscalls.list +++ b/sysdeps/unix/mman/syscalls.list @@ -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 diff --git a/sysdeps/unix/nice.c b/sysdeps/unix/nice.c index 01f1412adf..d5a44e5d64 100644 --- a/sysdeps/unix/nice.c +++ b/sysdeps/unix/nice.c @@ -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); diff --git a/sysdeps/unix/nlist.c b/sysdeps/unix/nlist.c index 5389f65e89..b40aedbc82 100644 --- a/sysdeps/unix/nlist.c +++ b/sysdeps/unix/nlist.c @@ -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; } diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c index 7161cec6e9..c38c8d478a 100644 --- a/sysdeps/unix/opendir.c +++ b/sysdeps/unix/opendir.c @@ -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; } diff --git a/sysdeps/unix/readdir.c b/sysdeps/unix/readdir.c index 46f2caff87..491469bcd1 100644 --- a/sysdeps/unix/readdir.c +++ b/sysdeps/unix/readdir.c @@ -36,7 +36,7 @@ __readdir (DIR *dirp) if (dirp == NULL || dirp->data == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } diff --git a/sysdeps/unix/rmdir.c b/sysdeps/unix/rmdir.c index 52a130ce3e..7bb40211c1 100644 --- a/sysdeps/unix/rmdir.c +++ b/sysdeps/unix/rmdir.c @@ -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; diff --git a/sysdeps/unix/sparc/start.c b/sysdeps/unix/sparc/start.c index f8567d2103..6c18b5c09c 100644 --- a/sysdeps/unix/sparc/start.c +++ b/sysdeps/unix/sparc/start.c @@ -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); diff --git a/sysdeps/unix/start.c b/sysdeps/unix/start.c index e58bb3804d..8112d2142a 100644 --- a/sysdeps/unix/start.c +++ b/sysdeps/unix/start.c @@ -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 diff --git a/sysdeps/unix/stime.c b/sysdeps/unix/stime.c index be928e8f39..869a28ad2e 100644 --- a/sysdeps/unix/stime.c +++ b/sysdeps/unix/stime.c @@ -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; } diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list index 0da9d17b07..fba1245730 100644 --- a/sysdeps/unix/syscalls.list +++ b/sysdeps/unix/syscalls.list @@ -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 diff --git a/sysdeps/unix/sysv/irix4/getpriority.c b/sysdeps/unix/sysv/irix4/getpriority.c index 70a9431890..6ba6219791 100644 --- a/sysdeps/unix/sysv/irix4/getpriority.c +++ b/sysdeps/unix/sysv/irix4/getpriority.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/unix/sysv/irix4/setpriority.c b/sysdeps/unix/sysv/irix4/setpriority.c index a632953423..322813a7dd 100644 --- a/sysdeps/unix/sysv/irix4/setpriority.c +++ b/sysdeps/unix/sysv/irix4/setpriority.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,14 +16,15 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } - diff --git a/sysdeps/unix/sysv/irix4/start.c b/sysdeps/unix/sysv/irix4/start.c index cd86f85244..b11d27b6ed 100644 --- a/sysdeps/unix/sysv/irix4/start.c +++ b/sysdeps/unix/sysv/irix4/start.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,7 +28,8 @@ Cambridge, MA 02139, USA. */ /* The first piece of initialized data. */ int __data_start = 0; -VOLATILE int errno = 0; +VOLATILE int __errno = 0; +strong_alias (__errno, errno) extern void EXFUN(__libc_init, (int argc, char **argv, char **envp)); extern int EXFUN(main, (int argc, char **argv, char **envp)); diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 33220df5f6..7cfa06db66 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -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 diff --git a/sysdeps/unix/sysv/linux/adjtime.c b/sysdeps/unix/sysv/linux/adjtime.c index 44a0cbbdb5..be42ed337c 100644 --- a/sysdeps/unix/sysv/linux/adjtime.c +++ b/sysdeps/unix/sysv/linux/adjtime.c @@ -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; diff --git a/sysdeps/unix/sysv/linux/alpha/ioperm.c b/sysdeps/unix/sysv/linux/alpha/ioperm.c index 731059e600..924fc473b2 100644 --- a/sysdeps/unix/sysv/linux/alpha/ioperm.c +++ b/sysdeps/unix/sysv/linux/alpha/ioperm.c @@ -326,7 +326,7 @@ init_iosys (void) fprintf(stderr, "ioperm.init_iosys(): Unable to determine system type.\n" "\t(May need " PATH_ALPHA_SYSTYPE " symlink?)\n"); - errno = ENODEV; + __set_errno (ENODEV); return -1; } } @@ -349,7 +349,7 @@ init_iosys (void) } /* systype is not a know platform name... */ - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -366,7 +366,7 @@ _ioperm (unsigned long from, unsigned long num, int turn_on) /* this test isn't as silly as it may look like; consider overflows! */ if (from >= MAX_PORT || from + num > MAX_PORT) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -391,7 +391,7 @@ _ioperm (unsigned long from, unsigned long num, int turn_on) case IOSYS_APECS: base = APECS_IO_BASE; break; case IOSYS_CIA: base = CIA_IO_BASE; break; default: - errno = ENODEV; + __set_errno (ENODEV); return -1; } addr = port_to_cpu_addr (from, io.sys, 1); @@ -425,7 +425,7 @@ _iopl (unsigned int level) { if (level > 3) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } if (level) diff --git a/sysdeps/unix/sysv/linux/errnos.h b/sysdeps/unix/sysv/linux/errnos.h index 868819e6b3..8a7055aa6a 100644 --- a/sysdeps/unix/sysv/linux/errnos.h +++ b/sysdeps/unix/sysv/linux/errnos.h @@ -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 diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c index 2883441c5b..a1d141b142 100644 --- a/sysdeps/unix/sysv/linux/gethostid.c +++ b/sysdeps/unix/sysv/linux/gethostid.c @@ -32,7 +32,7 @@ sethostid (id) /* Test for appropriate rights to set host ID. */ if (geteuid () || getuid ()) { - errno = EPERM; + __set_errno (EPERM); return -1; } diff --git a/sysdeps/unix/sysv/linux/gethostname.c b/sysdeps/unix/sysv/linux/gethostname.c index 4b7720d414..8a01fff073 100644 --- a/sysdeps/unix/sysv/linux/gethostname.c +++ b/sysdeps/unix/sysv/linux/gethostname.c @@ -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; } diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c index 81946b422f..c4c6fd78f6 100644 --- a/sysdeps/unix/sysv/linux/getsysstats.c +++ b/sysdeps/unix/sysv/linux/getsysstats.c @@ -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; } diff --git a/sysdeps/unix/sysv/linux/i386/brk.c b/sysdeps/unix/sysv/linux/i386/brk.c index f9e92dde5e..d11c3c40d9 100644 --- a/sysdeps/unix/sysv/linux/i386/brk.c +++ b/sysdeps/unix/sysv/linux/i386/brk.c @@ -45,11 +45,10 @@ __brk (void *addr) if (newbrk < addr) { - errno = ENOMEM; + __set_errno (ENOMEM); return -1; } return 0; } weak_alias (__brk, brk) - diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c index 58e637eed5..f3ecd4bd15 100644 --- a/sysdeps/unix/sysv/linux/i386/sigaction.c +++ b/sysdeps/unix/sysv/linux/i386/sigaction.c @@ -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; diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.S b/sysdeps/unix/sysv/linux/i386/sysdep.S index 0f3e31dbce..213af51548 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.S +++ b/sysdeps/unix/sysv/linux/i386/sysdep.S @@ -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 diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index cbd7b5553b..1bf20bd718 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -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; \ diff --git a/sysdeps/unix/sysv/linux/m68k/brk.c b/sysdeps/unix/sysv/linux/m68k/brk.c index 3fd547545e..402dfc56f7 100644 --- a/sysdeps/unix/sysv/linux/m68k/brk.c +++ b/sysdeps/unix/sysv/linux/m68k/brk.c @@ -42,11 +42,10 @@ __brk (void *addr) if (newbrk < addr) { - errno = ENOMEM; + __set_errno (ENOMEM); return -1; } return 0; } weak_alias (__brk, brk) - diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.S b/sysdeps/unix/sysv/linux/m68k/sysdep.S index b47e167159..407c2d393c 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.S +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.S @@ -16,6 +16,8 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <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 diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index 9de750c326..cfc9b04af0 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -86,7 +86,7 @@ syscall_error: \ neg.l %d0; \ move.l %d0, (%a0); \ move.l %d0, -(%sp); \ - jbsr __errno_location@PLTPC \ + jbsr __errno_location@PLTPC; \ move.l (%sp)+, (%a0); \ move.l POUND -1, %d0; \ /* Copy return value to %a0 for syscalls that are declared to return \ diff --git a/sysdeps/unix/sysv/linux/ptrace.c b/sysdeps/unix/sysv/linux/ptrace.c index 32cc990119..ede413a43c 100644 --- a/sysdeps/unix/sysv/linux/ptrace.c +++ b/sysdeps/unix/sysv/linux/ptrace.c @@ -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; } diff --git a/sysdeps/unix/sysv/linux/sigsuspend.c b/sysdeps/unix/sysv/linux/sigsuspend.c index 53510b9648..1aeda8224a 100644 --- a/sysdeps/unix/sysv/linux/sigsuspend.c +++ b/sysdeps/unix/sysv/linux/sigsuspend.c @@ -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 index 0000000000..1094df5129 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sleep.c @@ -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; +} diff --git a/sysdeps/unix/sysv/linux/speed.c b/sysdeps/unix/sysv/linux/speed.c index 0ad48a23d8..9dd5e2f269 100644 --- a/sysdeps/unix/sysv/linux/speed.c +++ b/sysdeps/unix/sysv/linux/speed.c @@ -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 index 0000000000..43006438e3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sys/debugreg.h @@ -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 index 0000000000..33b873f49c --- /dev/null +++ b/sysdeps/unix/sysv/linux/sys/kd.h @@ -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 index 0000000000..098fae1c33 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sys/soundcard.h @@ -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 index 0000000000..834abfbc8f --- /dev/null +++ b/sysdeps/unix/sysv/linux/sys/vt.h @@ -0,0 +1 @@ +#include <linux/vt.h> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index d9dd3d100a..3601b5f357 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -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 diff --git a/sysdeps/unix/sysv/linux/tcdrain.c b/sysdeps/unix/sysv/linux/tcdrain.c index 20cc809c6f..bd561b6d9e 100644 --- a/sysdeps/unix/sysv/linux/tcdrain.c +++ b/sysdeps/unix/sysv/linux/tcdrain.c @@ -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) diff --git a/sysdeps/unix/sysv/linux/ulimit.c b/sysdeps/unix/sysv/linux/ulimit.c index 2b1193085a..7493eaf5f3 100644 --- a/sysdeps/unix/sysv/linux/ulimit.c +++ b/sysdeps/unix/sysv/linux/ulimit.c @@ -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; } } diff --git a/sysdeps/unix/sysv/linux/waitpid.c b/sysdeps/unix/sysv/linux/waitpid.c index d4ee06bf1b..bbb98a49db 100644 --- a/sysdeps/unix/sysv/linux/waitpid.c +++ b/sysdeps/unix/sysv/linux/waitpid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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) diff --git a/sysdeps/unix/sysv/setrlimit.c b/sysdeps/unix/sysv/setrlimit.c index be4158e16e..2b005e39d6 100644 --- a/sysdeps/unix/sysv/setrlimit.c +++ b/sysdeps/unix/sysv/setrlimit.c @@ -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; } } diff --git a/sysdeps/unix/sysv/settimeofday.c b/sysdeps/unix/sysv/settimeofday.c index 1217c6beee..147f796a6c 100644 --- a/sysdeps/unix/sysv/settimeofday.c +++ b/sysdeps/unix/sysv/settimeofday.c @@ -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; } diff --git a/sysdeps/unix/sysv/sigaction.c b/sysdeps/unix/sysv/sigaction.c index ebb42cf756..eafaec7289 100644 --- a/sysdeps/unix/sysv/sigaction.c +++ b/sysdeps/unix/sysv/sigaction.c @@ -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; } diff --git a/sysdeps/unix/sysv/sysv4/sigaction.c b/sysdeps/unix/sysv/sysv4/sigaction.c index 68fd7a1846..37893fa649 100644 --- a/sysdeps/unix/sysv/sysv4/sigaction.c +++ b/sysdeps/unix/sysv/sysv4/sigaction.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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; } diff --git a/sysdeps/unix/sysv/sysv4/sysconf.c b/sysdeps/unix/sysv/sysv4/sysconf.c index 81d660fe64..cd0e84480f 100644 --- a/sysdeps/unix/sysv/sysv4/sysconf.c +++ b/sysdeps/unix/sysv/sysv4/sysconf.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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: diff --git a/sysdeps/unix/sysv/sysv4/waitpid.c b/sysdeps/unix/sysv/sysv4/waitpid.c index f54df4bf6b..586a374ce9 100644 --- a/sysdeps/unix/sysv/sysv4/waitpid.c +++ b/sysdeps/unix/sysv/sysv4/waitpid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. Contributed by Brendan Kehoe (brendan@zen.org). The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <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) diff --git a/sysdeps/unix/sysv/tcdrain.c b/sysdeps/unix/sysv/tcdrain.c index 37144799e4..92bd7aa3c7 100644 --- a/sysdeps/unix/sysv/tcdrain.c +++ b/sysdeps/unix/sysv/tcdrain.c @@ -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) diff --git a/sysdeps/unix/sysv/tcflow.c b/sysdeps/unix/sysv/tcflow.c index fecb40dd82..ac9e79731d 100644 --- a/sysdeps/unix/sysv/tcflow.c +++ b/sysdeps/unix/sysv/tcflow.c @@ -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; } } diff --git a/sysdeps/unix/sysv/tcflush.c b/sysdeps/unix/sysv/tcflush.c index 88574a5c4b..47250425ef 100644 --- a/sysdeps/unix/sysv/tcflush.c +++ b/sysdeps/unix/sysv/tcflush.c @@ -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; } } diff --git a/sysdeps/unix/sysv/tcgetattr.c b/sysdeps/unix/sysv/tcgetattr.c index dd914a2955..cd98e0cd67 100644 --- a/sysdeps/unix/sysv/tcgetattr.c +++ b/sysdeps/unix/sysv/tcgetattr.c @@ -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; } diff --git a/sysdeps/unix/sysv/tcsendbrk.c b/sysdeps/unix/sysv/tcsendbrk.c index 78fe2c542a..614b52a57c 100644 --- a/sysdeps/unix/sysv/tcsendbrk.c +++ b/sysdeps/unix/sysv/tcsendbrk.c @@ -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; } diff --git a/sysdeps/unix/sysv/tcsetattr.c b/sysdeps/unix/sysv/tcsetattr.c index 230a258e42..76d0192e5b 100644 --- a/sysdeps/unix/sysv/tcsetattr.c +++ b/sysdeps/unix/sysv/tcsetattr.c @@ -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; } diff --git a/sysdeps/unix/xmknod.c b/sysdeps/unix/xmknod.c index 81c794a435..21bd3f48bd 100644 --- a/sysdeps/unix/xmknod.c +++ b/sysdeps/unix/xmknod.c @@ -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; } diff --git a/sysdeps/unix/xstat.c b/sysdeps/unix/xstat.c index 3b1b112234..1a53c88cf2 100644 --- a/sysdeps/unix/xstat.c +++ b/sysdeps/unix/xstat.c @@ -28,7 +28,7 @@ __xstat (int vers, const char *file, struct stat *buf) { if (vers != _STAT_VER) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } diff --git a/time/asctime.c b/time/asctime.c index bb20a3aedc..25bc9de04c 100644 --- a/time/asctime.c +++ b/time/asctime.c @@ -39,7 +39,7 @@ __asctime_r (const struct tm *tp, char *buf) { if (tp == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } diff --git a/time/localtime.c b/time/localtime.c index 2a780304d6..ce243e64b4 100644 --- a/time/localtime.c +++ b/time/localtime.c @@ -50,7 +50,7 @@ __localtime_r (timer, tp) if (timer == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } diff --git a/time/strftime.c b/time/strftime.c index 7837373aed..9d23cf7183 100644 --- a/time/strftime.c +++ b/time/strftime.c @@ -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) diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c index 056f7be517..efd382b4c6 100644 --- a/wcsmbs/mbrtowc.c +++ b/wcsmbs/mbrtowc.c @@ -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; } diff --git a/wcsmbs/mbsnrtowcs.c b/wcsmbs/mbsnrtowcs.c index 27906957e9..d8c6da6910 100644 --- a/wcsmbs/mbsnrtowcs.c +++ b/wcsmbs/mbsnrtowcs.c @@ -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; } diff --git a/wcsmbs/mbsrtowcs.c b/wcsmbs/mbsrtowcs.c index d7305d6904..276d125c38 100644 --- a/wcsmbs/mbsrtowcs.c +++ b/wcsmbs/mbsrtowcs.c @@ -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; } diff --git a/wcsmbs/wcrtomb.c b/wcsmbs/wcrtomb.c index 052a5b951b..f5d9f7e1ca 100644 --- a/wcsmbs/wcrtomb.c +++ b/wcsmbs/wcrtomb.c @@ -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; } diff --git a/wcsmbs/wcsnrtombs.c b/wcsmbs/wcsnrtombs.c index fb50a11732..f01491450c 100644 --- a/wcsmbs/wcsnrtombs.c +++ b/wcsmbs/wcsnrtombs.c @@ -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; } diff --git a/wcsmbs/wcsrtombs.c b/wcsmbs/wcsrtombs.c index 999e291eb2..ac54e743be 100644 --- a/wcsmbs/wcsrtombs.c +++ b/wcsmbs/wcsrtombs.c @@ -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; } diff --git a/wcsmbs/wcstok.c b/wcsmbs/wcstok.c index 42df61923b..553c431aa2 100644 --- a/wcsmbs/wcstok.c +++ b/wcsmbs/wcstok.c @@ -34,7 +34,7 @@ wcstok (wcs, delim, save_ptr) if (wcs == NULL) if (*save_ptr == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } else |