+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.
libc anymore?''
[Q15] ``What are these `add-ons'?''
+
+[Q16] ``When I use GNU libc on my Linux system by linking against
+ to libc.so which comes with glibc all I get is a core dump.''
+
+[Q17] ``Looking through the shared libc file I haven't found the
+ functions `stat', `lstat', `fstat', and `mknod' and while
+ linking on my Linux system I get error messages. How is
+ this supposed to work?''
\f
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
[Q1] ``What systems does the GNU C Library run on?''
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+[Q16] ``When I use GNU libc on my Linux system by linking against
+ to libc.so which comes with glibc all I get is a core dump.''
+
+[A16] {UD} It is not enough to simply link against the GNU libc
+library itself. The GNU C library comes with its own dynamic linker
+which really conforms to the ELF API standard. This dynamic linker
+must be used.
+
+Normally this is done by the compiler. The gcc will use
+
+ -dynamic-linker /lib/ld-linux.so.1
+
+unless the user specifies her/himself a -dynamic-linker argument. But
+this is not the correct name for the GNU dynamic linker. The correct
+name is /lib/ld.so.1 which is the name specified in the SVr4 ABi.
+
+To change your environment to use GNU libc for compiling you need to
+change the `specs' file of your gcc. This file is normally found at
+
+ /usr/lib/gcc-lib/<arch>/<version>/specs
+
+In this file you have to change a few things:
+
+- change `ld-linux.so.1' to `ld.so.1'
+
+- remove all expression `%{...:-lgmon}'; there is no libgmon in glibc
+
+
+Things are getting a bit more complicated if you have GNU libc
+installed in some other place than /usr, i.e., if you do not want to
+use it instead of the old libc. In this case the needed startup files
+and libraries are not found in the regular places. So the specs file
+must tell the compiler and linker exactly what to use. Here is for
+example the gcc-2.7.2 specs file when GNU libc is installed at
+/home/gnu:
+
+-----------------------------------------------------------------------
+*asm:
+%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}
+
+*asm_final:
+%{pipe:-}
+
+*cpp:
+%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE} -I/home/gnu/include
+
+*cc1:
+
+
+*cc1plus:
+
+
+*endfile:
+%{!shared:crtend.o%s} %{shared:crtendS.o%s} /home/gnu/lib/crtn.o%s
+
+*link:
+-m elf_i386 -rpath=/home/gnu/lib -L/home/gnu/lib %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld.so.1}} %{static:-static}}}
+
+*lib:
+%{!shared: %{mieee-fp:-lieee} %{p:-lc_p} %{!p:%{pg:-lc_p} %{!pg:-lc}}}
+
+*libgcc:
+%{!shared:-lgcc}
+
+*startfile:
+%{!shared: %{pg:/home/gnu/lib/gcrt1.o%s} %{!pg:%{p:/home/gnu/lib/gcrt1.o} %{!p:/home/gnu/lib/crt1.o%s}}} /home/gnu/lib/crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}
+
+*switches_need_spaces:
+
+
+*signed_char:
+%{funsigned-char:-D__CHAR_UNSIGNED__}
+
+*predefines:
+-D__ELF__ -Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386)
+
+*cross_compile:
+0
+
+*multilib:
+. ;
+
+-----------------------------------------------------------------------
+
+Future versions of GCC will automatically provide the correct specs.
+
+
+~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
+[Q17] ``Looking through the shared libc file I haven't found the
+ functions `stat', `lstat', `fstat', and `mknod' and while
+ linking on my Linux system I get error messages. How is
+ this supposed to work?''
+
+[A17] {RM} Believe it or not, stat and lstat (and fstat, and mknod)
+are supposed to be undefined references in libc.so.6! Your problem is
+probably a missing or incorrect /usr/lib/libc.so file; note that this
+is a small text file now, not a symlink to libc.so.6. It should look
+something like this:
+
+GROUP ( libc.so.6 ld.so.1 libc.a )
+
+
+{UD} The Linux ldconfig file probably generates a link libc.so ->
+libc.so.6 in /lib. This is not correct. There must not be such a
+link. The linker script with the above contents is placed in
+/usr/lib which is enough for the linker.
+
+
+~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
\f
Answers were given by:
{UD} Ulrich Drepper, <drepper@cygnus.com>
{DMT} David Mosberger-Tang, <davidm@AZStarNet.com>
-
-Amended by:
{RM} Roland McGrath, <roland@gnu.ai.mit.edu>
\f
Local Variables:
lib: $(common-objpfx)libc.so
endif
-$(objpfx)sysd-dirs: $(+sysdir_pfx)config.make
- (echo define sysdep-subdirs; \
- for sysdir in $(config-sysdirs); do \
- case $$sysdir in \
- /*) dir=$$sysdir ;; \
- *) dir=$(..)$$sysdir ;; \
- esac; \
- if [ -r $$dir/Subdirs ]; then \
- sed 's/#.*$$//' $$dir/Subdirs; \
- else true; \
- fi; \
- done; \
+all-Subdirs-files = $(wildcard $(addsuffix /Subdirs, $(config-sysdirs)))
+$(objpfx)sysd-dirs: $(+sysdir_pfx)config.make $(all-Subdirs-files)
+ (echo define sysdep-subdirs; \
+ sed 's/#.*$$//' $(all-Subdirs-files) /dev/null; \
echo endef) > $@-tmp
- mv -f $@-tmp $@
+ mv -f $@-tmp $@
\f
-$(objpfx)version-info.h: $(..)Makefile $(+sysdir_pfx)config.make
- (first=yes; \
- for dir in $(subdirs); do \
- if [ -r $$dir/Banner ]; then \
- if [ $$first = yes ]; then \
- echo "\"Available extensions:"; \
- first=no; \
- fi; \
- sed -e '/^#/d' -e 's/^[[:space:]]*/ /' $$dir/Banner; \
- fi; \
- done; \
- [ $$first = yes ] || echo "\"") > $@-tmp
- mv -f $@-tmp $@
+all-Banner-files = $(wildcard $(addsuffix /Banner, $(subdirs)))
+$(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
+ (files="$(all-Banner-files)"; \
+ if [ test -n "$$files" ]; then \
+ echo "\"Available extensions:"; \
+ sed -e '/^#/d' -e 's/^[[:space:]]*/ /' $$files; \
+ echo "\""; \
+ fi) > $@-tmp
+ mv -f $@-tmp $@
version.c-objects := $(addprefix $(objpfx)version,$(object-suffixes))
$(version.c-objects): $(objpfx)version-info.h
/* 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);
}
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);
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. */
/* 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);
}
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);
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;
return -1;
save = errno;
- errno = 0;
+ __set_errno (0);
i = 0;
while ((d = readdir (dp)) != NULL)
if (new == NULL)
{
lose:
- errno = ENOMEM;
+ __set_errno (ENOMEM);
break;
}
v = new;
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)
p = dirpath;
if (p == NULL || *p == '\0')
{
- errno = ENOENT;
+ __set_errno (ENOENT);
return -1;
}
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);
__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. */
(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);
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)
(*alport)--;
if (*alport == IPPORT_RESERVED/2) {
(void)close(s);
- errno = EAGAIN; /* close */
+ __set_errno (EAGAIN); /* close */
return (-1);
}
}
#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>
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)
/* 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;
}
|| strcmp (single_locale, "POSIX") == 0)
{
FREE_BLOCKS (block_list);
- errno = saved_errno;
+ __set_errno (saved_errno);
return (char *) msgid;
}
if (retval != NULL)
{
FREE_BLOCKS (block_list);
- errno = saved_errno;
+ __set_errno (saved_errno);
return retval;
}
}
-/* 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
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>
/* 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);
}
/* Options check. */
if (options & ~FTS_OPTIONMASK) {
- errno = EINVAL;
+ __set_errno (EINVAL);
return (NULL);
}
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;
}
/* Set errno and return. */
if (!ISSET(FTS_NOCHDIR) && saved_errno) {
- errno = saved_errno;
+ __set_errno (saved_errno);
return (-1);
}
return (0);
* can distinguish between error and EOF.
*/
free(p);
- errno = 0;
+ __set_errno (0);
return (sp->fts_cur = NULL);
}
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);
}
{
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;
int fd;
if (instr && instr != FTS_NAMEONLY) {
- errno = EINVAL;
+ __set_errno (EINVAL);
return (NULL);
}
* 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))
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);
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;
got = 0;
- errno = 0;
+ __set_errno (0);
while ((entry = readdir (dirs[level])) != NULL)
{
&& (entry->d_name[1] == '\0' ||
(entry->d_name[1] == '.' && entry->d_name[2] == '\0')))
{
- errno = 0;
+ __set_errno (0);
continue;
}
if (namlen + len + 1 > PATH_MAX)
{
#ifdef ENAMETOOLONG
- errno = ENAMETOOLONG;
+ __set_errno (ENAMETOOLONG);
#else
- errno = ENOMEM;
+ __set_errno (ENOMEM);
#endif
return -1;
}
save = errno;
closedir (dirs[newlev]);
- errno = save;
+ __set_errno (save);
dirs[newlev] = NULL;
}
}
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;
save = errno;
closedir (dirs[0]);
- errno = save;
+ __set_errno (save);
}
}
if (buf == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
-/* 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
return -1;
if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
return 0;
- errno = EACCES;
+ __set_errno (EACCES);
return -1;
case F_ULOCK:
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
\
libc_fatal
+all: # Make this the default target; it will be defined in Rules.
+
include ../Makeconfig
ifneq (,$(filter %REENTRANT, $(defines)))
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] == '+')) {
fp->_markers = NULL;
fp->_cur_column = 0;
#ifdef _IO_MTSAFE_IO
- __libc_lock_init (fp->_lock);
+ __libc_lock_init (*fp->_lock);
#endif
}
}
#ifdef _IO_MTSAFE_IO
- __libc_lock_fini (fp->_lock);
+ __libc_lock_fini (*fp->_lock);
#endif
_IO_un_link(fp);
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] == '+'))
{
#ifdef EIO
if (errno == 0)
- errno = EIO;
+ __set_errno (EIO);
#endif
return EOF;
}
/*ANSI explicily requires setting errno to a positive value on failure.*/
#ifdef EIO
if (errno == 0)
- errno = EIO;
+ __set_errno (EIO);
#endif
result = EOF;
}
{
#ifdef EIO
if (errno == 0)
- errno = EIO;
+ __set_errno (EIO);
#endif
return -1L;
}
if (lineptr == NULL || n == NULL)
{
-#ifdef EINVAL
- errno = EINVAL;
-#endif
+ MAYBE_SET_EINVAL;
return -1;
}
CHECK_FILE (fp, -1);
#endif
#ifdef EINVAL
-#define MAYBE_SET_EINVAL errno = EINVAL
+#define MAYBE_SET_EINVAL __set_errno (EINVAL)
#else
#define MAYBE_SET_EINVAL /* nothing */
#endif
{
_nl_C_name,
NULL, 0, /* no file mapped */
- 45,
+ 53,
{
{ string: "Sun" },
{ string: "Mon" },
{ 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 },
}
};
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
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,
/* 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
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;
+}
{
free (filedata);
if (nread == 0)
- errno = EINVAL; /* Bizarreness going on. */
+ __set_errno (EINVAL); /* Bizarreness going on. */
goto puntfd;
}
p += nread;
}
else
goto puntfd;
- errno = save_err;
+ __set_errno (save_err);
}
else
goto puntfd;
>= (size_t) st.st_size))
{
/* Insufficient data. */
- errno = EINVAL;
+ __set_errno (EINVAL);
goto puntmap;
}
if (idx >= newdata->filesize)
{
free (newdata);
- errno = EINVAL;
+ __set_errno (EINVAL);
goto puntmap;
}
if (_nl_value_types[category][cnt] == word)
#include <stddef.h>
#include <langinfo.h>
+#include <time.h>
#include <sys/types.h>
#include "../intl/loadinfo.h" /* For loaded_l10nfile definition. */
};
+/* 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;
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;
if (category < 0 || category >= LC_ALL)
{
/* Bogus category: bogus item. */
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
if (index >= data->nstrings)
{
/* Bogus index for this category: bogus item. */
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
/* 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
{
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;
};
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;
+ }
+ }
}
{
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;
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;
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);
}
"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;
/* 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);
}
-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);
/* 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);
}
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);
static const char *
construct_output_path (char *path)
{
- char *normal = NULL;
+ const char *normal = NULL;
char *result;
if (strchr (path, '/') == NULL)
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
case tok_mon:
case tok_am_pm:
case tok_alt_digits:
+ case tok_era:
READ_STRING_LIST (time_add, bad_time);
continue;
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:
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"));
/* 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)
}
/* Protect global data. */
- __libc_lock_lock (lock);
+ __libc_lock_lock (__libc_setlocale_lock);
/* Load the new data for each category. */
while (category-- > 0)
}
/* Critical section left. */
- __libc_lock_unlock (lock);
+ __libc_lock_unlock (__libc_setlocale_lock);
return composite;
}
char *newname = (char *) locale;
/* Protect global data. */
- __libc_lock_lock (lock);
+ __libc_lock_lock (__libc_setlocale_lock);
if (_nl_current[category] != NULL)
{
}
/* Critical section left. */
- __libc_lock_unlock (lock);
+ __libc_lock_unlock (__libc_setlocale_lock);
return newname;
}
&& 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;
}
!= sizeof (struct utmp))
{
utmp_data->loc_utmp = 0; /* Mark loc_utmp invalid. */
- errno = ESRCH;
+ __set_errno (ESRCH);
return -1;
}
!= sizeof (struct utmp))
{
utmp_data->loc_utmp = 0; /* Mark loc_utmp invalid. */
- errno = ESRCH;
+ __set_errno (ESRCH);
return -1;
}
return 0;
#else /* !_HAVE_UT_ID && !_HAVE_UT_TYPE */
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
#endif
}
!= sizeof (struct utmp))
{
utmp_data->loc_utmp = 0; /* Mark UTMP_DATA->ubuf invalid. */
- errno = ESRCH;
+ __set_errno (ESRCH);
return -1;
}
if (! new_buf)
{
rv = -1;
- errno = ENOMEM;
+ __set_errno (ENOMEM);
break;
}
}
&& 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
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
if (buf == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
--- /dev/null
+/* 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;
/* Test for correct arguments. */
if (htab == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return 0;
}
/* Test for correct arguments. */
if (htab == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return;
}
error. */
if (action == ENTER && htab->filled == htab->size)
{
- errno = ENOMEM;
+ __set_errno (ENOMEM);
*retval = NULL;
return 0;
}
return 1;
}
- errno = ESRCH;
+ __set_errno (ESRCH);
*retval = NULL;
return 0;
}
/* 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
/* 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
/* 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));
break;
default:
*h_errnop = NETDB_INTERNAL;
- errno = EAFNOSUPPORT;
+ __set_errno (EAFNOSUPPORT);
return NSS_STATUS_UNAVAIL;
}
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;
}
if (buflen < (int) sizeof *data + 1)
{
- errno = ERANGE;
+ __set_errno (ERANGE);
return NSS_STATUS_TRYAGAIN;
}
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')
break;
if (cmp > 0)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
}
if (cnt == sizeof databases)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
if (new_db == NULL)
{
/* Illegal service specification. */
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
# 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
-/* 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
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>
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;
}
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;
#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
if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
(*pglob->gl_closedir) (stream);
else
closedir ((DIR *) stream);
- errno = save;
+ __set_errno (save);
}
return nfound == 0 ? GLOB_NOMATCH : 0;
(*pglob->gl_closedir) (stream);
else
closedir ((DIR *) stream);
- errno = save;
+ __set_errno (save);
}
while (names != NULL)
{
}
#endif /* Not ELIDE_CODE. */
-
-/* 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
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>
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;
}
-/* 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
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>
/* 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;
}
case AF_INET:
return (inet_net_ntop_ipv4(src, bits, dst, size));
default:
- errno = EAFNOSUPPORT;
+ __set_errno (EAFNOSUPPORT);
return (NULL);
}
}
int b;
if (bits < 0 || bits > 32) {
- errno = EINVAL;
+ __set_errno (EINVAL);
return (NULL);
}
if (bits == 0) {
return (odst);
emsgsize:
- errno = EMSGSIZE;
+ __set_errno (EMSGSIZE);
return (NULL);
}
case AF_INET:
return (inet_net_pton_ipv4(src, dst, size));
default:
- errno = EAFNOSUPPORT;
+ __set_errno (EAFNOSUPPORT);
return (-1);
}
}
return (bits);
enoent:
- errno = ENOENT;
+ __set_errno (ENOENT);
return (-1);
emsgsize:
- errno = EMSGSIZE;
+ __set_errno (EMSGSIZE);
return (-1);
}
return (odst);
emsgsize:
- errno = EMSGSIZE;
+ __set_errno (EMSGSIZE);
return (NULL);
}
case AF_INET6:
return (inet_ntop6(src, dst, size));
default:
- errno = EAFNOSUPPORT;
+ __set_errno (EAFNOSUPPORT);
return (NULL);
}
/* NOTREACHED */
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);
* Check for overflow, copy, and we're done.
*/
if ((size_t)(tp - tmp) > size) {
- errno = ENOSPC;
+ __set_errno (ENOSPC);
return (NULL);
}
strcpy(dst, tmp);
case AF_INET6:
return (inet_pton6(src, dst));
default:
- errno = EAFNOSUPPORT;
+ __set_errno (EAFNOSUPPORT);
return (-1);
}
/* NOTREACHED */
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++)
ntohs(address.sin_port),
strerror(error));
}
- errno = save;
+ __set_errno (save);
}
static void
Perror(file, string, error)
fprintf(file, "res_send: %s: %s\n",
string, strerror(error));
}
- errno = save;
+ __set_errno (save);
}
#endif
Perror(stderr, "socket(vc)", errno);
return (-1);
}
- errno = 0;
+ __set_errno (0);
if (connect(s, (struct sockaddr *)nsap,
sizeof(struct sockaddr)) < 0) {
terrno = errno;
(stdout, ";; new DG socket\n"))
#endif
connected = 0;
- errno = 0;
+ __set_errno (0);
}
if (sendto(s, (char*)buf, buflen, 0,
(struct sockaddr *)nsap,
_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);
_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);
}
/* 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. */
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <errno.h>
#include <stdio.h>
#include <shadow.h>
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;
#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;
}
)
#define __need_FILE
#include <stdio.h>
-#define __need_time_t
-#include <time.h>
/* Paths to the userd files. */
#define SHADOW "/etc/shadow"
{
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. */
};
-/* 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
/* 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;
}
-/* 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
/* 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;
}
-/* 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
/* 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;
}
-/* 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
/* 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;
}
-/* 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
/* 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;
}
{
if (spec < 0 || spec > (int) UCHAR_MAX)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
} \
} 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>
/* Check file argument for consistence. */ \
if (!__validfp(S) || !S->__mode.__write || Format == NULL) \
{ \
- errno = EINVAL; \
+ __set_errno (EINVAL); \
return -1; \
} \
if (!S->__seen) \
{
struct _IO_FILE_plus _f;
_IO_FILE *_put_stream;
+#ifdef _IO_MTSAFE_IO
+ _IO_lock_t lock;
+#endif
};
static int
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. */
} while (0)
# define memory_error() do { \
_IO_funlockfile (s); \
- errno = ENOMEM; \
+ __set_errno (ENOMEM); \
return EOF; \
} while (0)
# define ARGCHECK(s, format) \
} while (0)
# define memory_error() do { \
funlockfile (s); \
- errno = ENOMEM; \
+ __set_errno (ENOMEM); \
return EOF; \
} while (0)
# define ARGCHECK(s, format) \
/* Check file argument for consistence. */ \
if (!__validfp (s) || !s->__mode.__read || format == NULL) \
{ \
- errno = EINVAL; \
+ __set_errno (EINVAL); \
return EOF; \
} \
} while (0)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* Close a stream. */
int
-DEFUN(fclose, (stream), register FILE *stream)
+fclose (stream)
+ register FILE *stream;
{
int status;
if (!__validfp(stream))
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return EOF;
}
-
+
if (stream->__mode.__write &&
/* Flush the buffer. */
__flshfp (stream, EOF) == EOF)
-/* 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
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 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;
}
-/* 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
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 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;
}
-/* 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
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>
/* 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);
}
-/* 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
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);
}
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stdio.h>
/* 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;
}
-/* 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
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>
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;
}
{
/* 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)))
size_t i;
char *found;
- i = stream->__get_limit - stream->__bufp;
+ i = stream->__get_limit - stream->__bufp;
if (i == 0)
{
/* Refill the buffer. */
*p = '\0';
return s;
}
- i = stream->__get_limit - stream->__bufp;
+ i = stream->__get_limit - stream->__bufp;
}
if (i > n)
-/* 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
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;
}
if (stream->__io_funcs.__fileno == NULL)
{
#ifdef EOPNOTSUPP
- errno = EOPNOTSUPP;
+ __set_errno (EOPNOTSUPP);
#else
- errno = ENOSYS;
+ __set_errno (ENOSYS);
#endif
return -1;
}
-/* 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
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>
/* 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
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;
{
int save = errno;
(void) fclose (stream);
- errno = save;
+ __set_errno (save);
return NULL;
}
}
stream->__bufp = p;
}
else if (stream->__mode.__truncate)
- memset ((PTR) stream->__buffer, 0, len);
+ memset ((void *) stream->__buffer, 0, len);
return stream;
}
-/* 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
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>
#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)
{
\f
/* Open a new stream on the given file. */
FILE *
-DEFUN(fopen, (filename, mode), CONST char *filename AND CONST char *mode)
+fopen (filename, mode)
+ const char *filename;
+ const char *mode;
{
FILE *stream;
__io_mode m;
if (filename == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
{
int save = errno;
(void) fclose (stream);
- errno = save;
+ __set_errno (save);
return NULL;
}
-/* 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
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);
}
-/* 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
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>
/* 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;
/* 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;
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;
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;
}
else
{
- int c = __fillbf(stream);
+ int c = __fillbf (stream);
if (c == EOF)
return (bytes - to_read) / size;
*ptr++ = (char) c;
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stdio.h>
/* 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;
}
{
int save = errno;
(void) fclose (stream);
- errno = save;
+ __set_errno (save);
return NULL;
}
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stdio.h>
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;
}
switch (whence)
{
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return EOF;
case SEEK_END:
for, and then look where that is. */
if (stream->__io_funcs.__seek == NULL)
{
- errno = ESPIPE;
+ __set_errno (ESPIPE);
return EOF;
}
else
if (o < 0)
{
/* Negative file position is meaningless. */
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
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;
}
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stdio.h>
/* 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);
}
-/* 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
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;
}
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>
/* 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;
if (!__validfp (stream) || !stream->__mode.__write)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return 0;
}
goto done;
}
- errno = save;
+ __set_errno (save);
}
if (stream->__buffer == NULL && default_func &&
{
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)
{
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)
*stream->__bufp++ = *p++;
else
{
- memcpy ((PTR) stream->__bufp, (PTR) p, n);
+ memcpy ((void *) stream->__bufp, (void *) p, n);
stream->__bufp += n;
p += n;
}
-/* 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
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>
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;
}
size_t i;
char *found;
- i = stream->__get_limit - stream->__bufp;
+ i = stream->__get_limit - stream->__bufp;
if (i == 0)
{
/* Refill the buffer. */
if (c == terminator)
goto win;
--copy;
- i = stream->__get_limit - stream->__bufp;
+ i = stream->__get_limit - stream->__bufp;
}
if (i > copy)
-/* 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
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>
/* 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
-/* 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
libraries) compiled with Unix header files to work with the GNU C
library. */
-#include <ansidecl.h>
#include <stdio.h>
#include <errno.h>
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. */
{
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)
return putc (c, (FILE *) file);
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return EOF;
}
}
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>
/* 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)
{
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);
/* 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);
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)
{
/* 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);
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. */
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;
}
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
#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;
}
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;
!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).
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)
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'))
{
fp->__get_limit = fp->__buffer;
}
- if (feof(fp) || ferror(fp))
+ if (feof (fp) || ferror (fp))
fp->__bufp = fp->__put_limit;
}
/* 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;
}
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)
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). */
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. */
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
};
/* 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)
}
/* 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)
/* 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;
}
}
/* 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,
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
/* 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;
-/* 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
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>
/* 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;
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;
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;
}
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)
{
}
static int
-DEFUN(free_info, (cookie), PTR cookie)
+free_info (cookie)
+ void *cookie;
{
#if 0
struct memstream_info *info = (struct memstream_info *) 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;
}
{
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;
-/* 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
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>
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;
}
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);
switch (mode)
{
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return EOF;
case _IONBF: /* Unbuffered. */
stream->__buffer = NULL;
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;
-/* 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
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;
}
-/* 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
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>
/* 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;
f.__room_funcs.__input = NULL;
f.__seen = 1;
- return __vfscanf(&f, format, arg);
+ return __vfscanf (&f, format, arg);
}
{
if (resolved)
{
- errno = ENAMETOOLONG;
+ __set_errno (ENAMETOOLONG);
goto error;
}
new_size = rpath_limit - rpath;
if (++num_links > MAXSYMLINKS)
{
- errno = ELOOP;
+ __set_errno (ELOOP);
goto error;
}
if ((long int) (n + strlen (end)) >= path_max)
{
- errno = ENAMETOOLONG;
+ __set_errno (ENAMETOOLONG);
goto error;
}
/* 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.
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;
}
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. */
{
/* 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
msort_with_tmp (b, n, s, cmp, tmp);
free (tmp);
}
- errno = save;
+ __set_errno (save);
}
}
{
if (n < BREAK_0)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
buf->rand_type = TYPE_0;
break;
default:
/* State info munged. */
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
do { \
if (dest >= s + maxsize - 1) \
{ \
- errno = E2BIG; \
+ __set_errno (E2BIG); \
va_end (ap); \
return -1; \
} \
case '+': /* Use +/- for sign of number. */
if (n_sign_posn != -1)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
va_end (ap);
return -1;
}
case '(': /* Use ( ) for negative sign. */
if (n_sign_posn != -1)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
va_end (ap);
return -1;
}
can stop now and return an error. */
if (dest + width >= s + maxsize)
{
- errno = E2BIG;
+ __set_errno (E2BIG);
va_end (ap);
return -1;
}
{
if (!isdigit (*++fmt))
{
- errno = EINVAL;
+ __set_errno (EINVAL);
va_end (ap);
return -1;
}
{
if (!isdigit (*++fmt))
{
- errno = EINVAL;
+ __set_errno (EINVAL);
va_end (ap);
return -1;
}
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;
}
if (shift > MANT_DIG)
{
- errno = EDOM;
+ __set_errno (EDOM);
return 0.0;
}
FLOAT retval;
/* Overflow or underflow. */
- errno = ERANGE;
+ __set_errno (ERANGE);
retval = (exp_negative ? 0.0 :
negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL);
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;
}
Check it against the maximum possible exponent. */
if (bits > MAX_EXP)
{
- errno = ERANGE;
+ __set_errno (ERANGE);
return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
}
#ifndef errno
extern int errno;
#endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
#ifdef HAVE_LIMITS_H
# include <limits.h>
if (overflow)
{
- errno = ERANGE;
+ __set_errno (ERANGE);
#if UNSIGNED
return ULONG_MAX;
#else
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;
}
* 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
int res;
static short port;
struct sockaddr_in myaddr;
+#ifndef errno
extern int errno;
+#endif
int i;
#define STARTPORT 600
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) {
#define MCALL_MSG_SIZE 24
+#ifndef errno
extern int errno;
+#endif
static int readtcp();
static int writetcp();
* 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
#include <errno.h>
#include <rpc/pmap_clnt.h>
+#ifndef errno
extern int errno;
+#endif
/*
* UDP bases client side rpc operations
clntudp_control
};
-/*
+/*
* Private data kept per client handle
*/
struct cu_data {
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 */
#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:
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);
/*
*/
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;
}
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 ... */
return ((*xdr_res)(xdrs, res_ptr));
}
-static void
+static void
clntudp_abort(/*h*/)
/*CLIENT *h;*/
{
}
return (TRUE);
}
-
+
static void
clntudp_destroy(cl)
CLIENT *cl;
#define MAX_BROADCAST_SIZE 1400
#endif
+#ifndef errno
extern int errno;
+#endif
/*
* Get a copy of the current port maps.
#include <arpa/inet.h>
#define MAX_BROADCAST_SIZE 1400
+#ifndef errno
extern int errno;
+#endif
static struct timeval timeout = { 3, 0 };
AUTH_DESTROY(unix_auth);
return (stat);
}
-
* 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
#include <rpc/rpc.h>
#include <rpc/pmap_clnt.h>
+#ifndef errno
extern int errno;
+#endif
#ifdef FD_SETSIZE
static SVCXPRT **xports;
}
/*
- * 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
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));
}
/*
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);
}
/*
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);
}
/*
/*
* 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);
}
/*
* 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;
{
* 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.
#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))) {
* 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
#else
int readfds;
#endif /* def FD_SETSIZE */
+#ifndef errno
extern int errno;
+#endif
for (;;) {
#ifdef FD_SETSIZE
#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
svcudp_destroy
};
+#ifndef errno
extern int errno;
+#endif
/*
* kept in xprt->xp_p2
uc->uc_addr = xprt->xp_raddr;
return(0);
}
-
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;
timebuf->timezone = tp.tm_gmtoff / 60;
timebuf->dstflag = tp.tm_isdst;
- errno = save;
+ __set_errno (save);
return 0;
}
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);
}
}
}
}
- errno = ENOENT; /* out of ptys */
+ __set_errno (ENOENT); /* out of ptys */
return (-1);
}
case -1:
return (-1);
case 0:
- /*
+ /*
* child
*/
(void) close(master);
if (new_environ[size] == NULL)
{
free ((char *) new_environ);
- errno = ENOMEM;
+ __set_errno (ENOMEM);
UNLOCK;
return -1;
}
/* `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
{
if (termios_p == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
{
if (termios_p == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <errno.h>
#include <string.h>
char *token;
if (s == NULL)
- {
- if (olds == NULL)
- {
- errno = EINVAL;
- return NULL;
- }
- else
- s = olds;
- }
+ s = olds;
/* Scan leading delimiters. */
s += strspn (s, delim);
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <errno.h>
#include <string.h>
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);
-/* 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
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>
/* 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)
{
goto try;
return -1;
}
- errno = save;
+ __set_errno (save);
return nread;
#else /* No EINTR. */
/* 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)
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);
/* Close COOKIE. */
int
-DEFUN(__stdio_close, (cookie), PTR cookie)
+__stdio_close (cookie)
+ void *cookie;
{
return __close ((int) 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;
}
/* 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;
/* 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. */
-/* 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
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>
/* 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;
}
#ifdef ENAMETOOLONG
else if (errno == ENAMETOOLONG)
/* The name was truncated. */
- errno = save;
+ __set_errno (save);
#endif
else
return -1;
-/* 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
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>
/* 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)
{
(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;
}
/* 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
union wait
{
+ int w_status;
struct
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
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;
}
? "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:
? "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:
? "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:
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:
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:
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:
? "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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
: "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:
? "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:
? "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:
? "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:
? "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:
? "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:
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:
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:
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:
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:
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:
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:
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:
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:
if (_LIB_VERSION == _IEEE_ ||
_LIB_VERSION == _POSIX_) exc.retval = 1.0;
else if (!__matherr(&exc)) {
- errno = EDOM;
+ __set_errno (EDOM);
}
break;
}
*
* 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.
* ====================================================
*/
{
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)
*
* 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.
* ====================================================
*/
{
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)
{
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)
*
* 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.
* ====================================================
*/
/*
* 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.
*/
}
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)
*
* 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.
* ====================================================
*/
/*
* 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.
*/
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)
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
#ifndef FUNC
#define FUNC scalbn
-#include <s_ldexp.c>
#endif
#ifndef float_type
#define float_type double
#ifndef FUNC
#define FUNC scalbnf
-#include <s_ldexpf.c>
#endif
#define float_type float
#include <s_scalbn.c>
#ifndef FUNC
#define FUNC scalbnl
-#include <s_ldexpl.c>
#endif
#define float_type long double
#include <s_scalbn.c>
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 "";
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;
-/* 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
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>
/* 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;
#endif
)
{
- errno = EBADF;
+ __set_errno (EBADF);
return -1;
}
save = errno;
(void) close (fd2);
- errno = save;
+ __set_errno (save);
return fcntl (fd, F_DUPFD, fd2);
}
/* 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.
#ifndef errno
extern int errno;
#endif
+#ifndef __set_errno
+#define __set_errno(val) errno = 8val)
+#endif
#if defined(EACCES) && !defined(EACCESS)
#define EACCESS EACCES
granted = (stats.st_mode & mode);
if (granted == mode)
return 0;
- errno = EACCESS;
+ __set_errno (EACCESS);
return -1;
}
\f
-/* 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
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>
/* 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;
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;
if (stream == NULL)
return NULL;
- stream->__cookie = (PTR) fd;
+ stream->__cookie = (void *) fd;
stream->__mode = m;
return stream;
-/* 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
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>
/* 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;
lbuf.l_type = F_UNLCK;
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
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>
/* 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
#ifdef MAX_CANON
return MAX_CANON;
#else
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
#endif
#ifdef MAX_INPUT
return MAX_INPUT;
#else
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
#endif
#ifdef NAME_MAX
return NAME_MAX;
#else
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
#endif
return buf.f_namelen;
}
#else
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
#endif
#ifdef PIPE_BUF
return PIPE_BUF;
#else
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
#endif
#ifdef SOCK_MAXBUF
return SOCK_MAXBUF;
#else
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
#endif
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
#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
{
if (buf != NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
{
int save = errno;
(void) __closedir (dirstream);
- errno = save;
+ __set_errno (save);
goto lose;
}
if (st.st_dev == thisdev && st.st_ino == thisino)
{
int save = errno;
(void) __closedir (dirstream);
- errno = save;
+ __set_errno (save);
goto lose;
}
else
{
if (buf != NULL)
{
- errno = ERANGE;
+ __set_errno (ERANGE);
return NULL;
}
else
{
(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];
{
if (tv == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
{
int save_error = errno;
result = fstat (fildes, &st);
- errno = save_error;
+ __set_errno (save_error);
}
return result ?: (st.st_mode & S_IFMT) == fdtype;
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
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;
}
-/* 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
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>
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;
len = strlen (template);
if (len < 6 || strcmp (&template[len - 6], "XXXXXX"))
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
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>
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;
len = strlen (template);
if (len < 6 || strcmp (&template[len - 6], "XXXXXX"))
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
-/* 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
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>
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; \
{ \
} \
}
-#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
/* 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];
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. */
/* 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. */
while (dead > 0 && dead != pid);
}
#endif
- errno = save;
+ __set_errno (save);
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;
{
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;
}
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;
/* 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
return 0;
else if (errno == ENOTDIR && __unlink (file) == 0)
{
- errno = save;
+ __set_errno (save);
return 0;
}
-/* 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
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;
-/* 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
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>
(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. */
return 0;
#else
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
#endif
}
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
/* 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;
}
-/* 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
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>
/* 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;
}
-/* 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
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>
static sigset_t wrapped_masks[NSIG];
static void
-DEFUN(wrapper_handler, (sig), int sig)
+wrapper_handler (sig)
+ int sig;
{
int save;
struct sigaction act;
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;
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;
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
}
-/* 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
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>
/* 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;
}
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;
/* 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;
}
switch (name)
{
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
case _SC_ARG_MAX:
-/* 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
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>
/* 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;
{
save = errno;
(void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL);
- errno = save;
+ __set_errno (save);
return -1;
}
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;
}
}
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;
(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)
UNBLOCK) != 0)
{
if (errno == ENOSYS)
- errno = save;
+ __set_errno (save);
else
return -1;
}
return status;
}
+weak_alias (__libc_system, system)
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;
}
}
d = "/tmp";
if (d == NULL)
{
- errno = ENOENT;
+ __set_errno (ENOENT);
return NULL;
}
dir = d;
lose:
(void) remove (buf);
(void) __close (fd);
- errno = save;
+ __set_errno (save);
return NULL;
}
_IO_init (&fp->file, 0);
const int save = errno;
(void) remove (buf);
(void) __close (fd);
- errno = save;
+ __set_errno (save);
return NULL;
}
(*streamptr)->__cookie = (__ptr_t) (long int) fd;
/* 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;
}
/* We got out of the loop because we ran out of combinations to try. */
- errno = EEXIST; /* ? */
+ __set_errno (EEXIST); /* ? */
return NULL;
}
-/* 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
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>
/* 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;
save = errno;
(void) close (fd);
if (ret < 0)
- errno = save;
+ __set_errno (save);
return ret;
}
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>
/* 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;
{
(void) closedir (dirstream);
__ttyname = name;
- errno = save;
+ __set_errno (save);
return name;
}
}
(void) closedir (dirstream);
- errno = save;
+ __set_errno (save);
return NULL;
}
the loop. */
if (buflen < (int) (sizeof (dev) + 1))
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* 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
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>
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);
-/* 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.
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_Is_valid( fd ) || !__FD_Table[ fd ].in_use )
{
- errno = EBADF;
+ __set_errno (EBADF);
return -1;
}
-/* 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,
.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
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
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
| 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
#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)
DECLARE_LABEL(_environ)
DECLARE_PTR(environ)
+DECLARE_LABEL(__errno)
DECLARE_LABEL(_errno)
DECLARE_U32(errno)
-/* 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
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>
/* 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;
if (file == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
}
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;
}
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;
-/* 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.
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)
{
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;
}
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 */
return 1;
}
-weak_alias (__read, read)
+weak_alias (__libc_read, __read)
+weak_alias (__libc_read, read)
-/* 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.
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>
/* 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;
}
return count;
}
-
-weak_alias (__write, write)
+weak_alias (__libc_write, __write)
+weak_alias (__libc_write, write)
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <setjmp.h>
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. */
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <unistd.h>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <unistd.h>
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;
}
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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 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)
-/* 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
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 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
int
__closedir (DIR *dirp)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
weak_alias (__closedir, closedir)
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stdio.h>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <stdio.h>
#include <errno.h>
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;
}
/* 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
dirfd (dirp)
FILE *dirp;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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 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;
}
/* No way to check that they are valid. */
return fd2;
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (dup2)
-/* 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
#define ENFILE 9
#define EMFILE 10
#endif
+
+#define __set_errno(val) errno = (val)
/* 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
{
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* 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
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 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)
-/* 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
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 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* 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
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>
/* 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;
}
-/* 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
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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 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)
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>
/* 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:
break;
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
int
__fstatfs (int fd, struct statfs *buf)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (statfs)
weak_alias (__fstatfs, fstatfs)
-
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
{
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)
-/* 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
char *
__getcwd (char *buf, size_t size)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return NULL;
}
weak_alias (__getcwd, getcwd)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <unistd.h>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* 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
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* 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
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)
-/* 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
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)
-/* 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
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <unistd.h>
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)
-/* 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
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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;
}
char *name;
size_t name_len;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return errno;
}
-/* 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
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
int
__getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
weak_alias (__getrlimit, getrlimit)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
/* 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
pid_t
getsid (pid_t pid)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return (pid_t) -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
__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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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)
-/* 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
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)
-/* 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
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;
}
-/* 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
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
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)
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
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;
}
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. */
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
case SEEK_END:
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (lseek)
{
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)
-/* 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
int
madvise (caddr_t addr, size_t len, int advice)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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;
}
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <string.h>
#include <errno.h>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <string.h>
#include <errno.h>
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;
}
-/* 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
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;
}
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <stddef.h>
#include <errno.h>
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;
}
int
__mprotect (caddr_t addr, size_t len, int prot)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
weak_alias (__mprotect, mprotect)
-/* 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.
int cmd;
struct msqid_ds *buf;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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.
key_t key;
int msgflg;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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.
long msgtyp;
int msgflg;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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.
size_t msgsz;
int msgflg;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
int
msync (caddr_t addr, size_t len)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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
int
__munmap (caddr_t addr, size_t len)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
int
nanosleep (const struct timespec *requested_time, struct timespec *remaining)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (nanosleep)
-/* 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
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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;
}
va_end(arg);
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (open)
DIR *
__opendir (const char *name)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return NULL;
}
weak_alias (__opendir, opendir)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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);
-/* 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
int
pause ()
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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)
-/* 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
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>
/* Open a new stream that is a one-way pipe to a
child process running the given shell command. */
FILE *
-DEFUN(popen, (command, mode), CONST char *command AND CONST char *mode)
+popen (command, mode)
+ const char *command;
+ const char *mode;
{
if (command == NULL || mode == NULL || (*mode != 'r' && *mode != 'w'))
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return NULL;
}
\f
/* Close a stream opened by popen and return its status.
Returns -1 if the stream was not opened by popen. */
int
-DEFUN(pclose, (stream), register FILE *stream)
+pclose (stream)
+ register FILE *stream;
{
if (!__validfp (stream) || !stream->__ispipe)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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
unsigned long int nfds;
int timeout;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
/* 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
/* Disable profiling. */
return 0;
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (profil)
-/* 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
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>
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;
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;
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;
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
struct dirent *
__readdir (DIR *dirp)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return NULL;
}
weak_alias (__readdir, readdir)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <unistd.h>
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
-/* 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
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
/* 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
remove (file)
const char *file;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
/* 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
revoke (file)
const char *file;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (revoke)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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. */
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
int
__sched_getparam (pid_t pid, struct sched_param *param)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (sched_getparam)
int
__sched_getscheduler (pid_t pid)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (sched_getscheduler)
int
__sched_get_priority_max (int algorithm)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (sched_get_priority_max)
int
__sched_get_priority_min (int algorithm)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (sched_get_priority_min)
int
__sched_rr_get_interval (pid_t pid, struct timespec *t)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (sched_rr_get_interval)
int
__sched_setparam (pid_t pid, const struct sched_param *param)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (sched_setparam)
int
__sched_setscheduler (pid_t pid, int policy, const struct sched_param *param)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (sched_setscheduler)
int
__sched_yield (void)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (sched_yield)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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);
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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)
-/* 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.
int cmd;
union semun arg;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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.
int nsems;
int semflg;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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.
struct sembuf *sops;
unsigned int nsops;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
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;
}
-/* 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
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;
}
-/* 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
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;
}
-/* 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
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;
}
-/* 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
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;
}
-/* 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
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>
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* 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
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>
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)
-/* 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
/* Save the signal mask if requested. */
__sigjmp_save (env, savemask);
- errno = ENOSYS;
+ __set_errno (ENOSYS);
/* No way to signal failure. */
return 0;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <unistd.h>
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* 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
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 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)
-/* 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
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 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <unistd.h>
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* 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
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>
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)
-/* 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.
char *shmaddr;
int shmflg;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return (char *) -1;
}
-/* 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.
int cmd;
struct shmid_ds *buf;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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.
shmdt (shmaddr)
char *shmaddr;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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.
int size;
int shmflg;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
/* 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)
-/* 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
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
(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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
/* 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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
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)
{
case SIG_SETMASK:
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <signal.h>
/* 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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <signal.h>
#include <errno.h>
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)
-/* 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
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>
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;
}
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>
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;
}
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>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
weak_alias (__data_start, data_start)
#endif
-volatile int errno;
+volatile int __errno;
+string_alias (__errno, errno)
int
__statfs (const char *file, struct statfs *buf)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (statfs)
weak_alias (__statfs, statfs)
-
-/* 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
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>
/* 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;
}
-/* 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
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;
}
int
swapoff (const char *path)
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <sysdep.h>
#include <errno.h>
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;
}
switch (name)
{
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
case _SC_TZNAME_MAX:
break;
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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
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 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;
}
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;
}
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;
}
/* 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;
}
-/* 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
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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
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)
{
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. */
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
case TCSAFLUSH:
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
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)
{
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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;
}
-/* 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
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 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;
}
-/* 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
time (timer)
time_t *timer;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
if (timer != NULL)
*timer = (time_t) -1;
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
char *buf;
int buflen;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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.
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;
}
-/* 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
int cmd;
long int newlimit;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
weak_alias (__ulimit, ulimit)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
}
dev_t dev;
struct ustat * ust;
{
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (ustat)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <utime.h>
/* 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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <unistd.h>
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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)
-/* 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
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>
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)
-/* 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
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
}
{
if (vers != _MKNOD_VER)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
stub_warning (__xmknod)
{
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)
#endif /* __USE_BSD */
+#define __set_errno(val) errno = (val)
+
#endif /* <errno.h> included. */
-/* 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
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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)
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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;
save = errno;
is_tty = __ioctl (fd, TIOCGETP, &term) == 0;
- errno = save;
+ __set_errno (save);
return is_tty;
}
{
if (gid == (gid_t) ~0)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
{
if (uid == (uid_t) ~0)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
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;
if (__getpgid (pid) == pid)
{
/* Already the leader. */
- errno = EPERM;
+ __set_errno (EPERM);
return -1;
}
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;
}
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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>
/* 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;
}
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));
-/* 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
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>
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;
switch (how)
{
case SIG_BLOCK:
- mask = __sigblock(mask);
+ mask = __sigblock (mask);
break;
case SIG_UNBLOCK:
/* 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;
-/* 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
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>
/* 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);
}
-/* 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
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
#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
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];
/* 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);
#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);
if (sig <= 0 || sig >= NSIG)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
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
#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
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. */
int code;
register struct sigcontext *context asm("%i0"); /* See end of fn. */
- PTR addr;
+ void *addr;
int y;
double fpsave[16];
int fsr;
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. */
#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);
if (sig <= 0 || sig >= NSIG)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
- mask = __sigblock(sigmask(sig));
+ mask = __sigblock (sigmask(sig));
ohandler = handlers[sig];
if (ovec != NULL && ovec->sv_handler == trampoline)
ovec->sv_handler = ohandler;
- (void) __sigsetmask(mask);
+ (void) __sigsetmask (mask);
return 0;
}
/* `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
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,
/* 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;
}
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;
}
return 0;
}
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
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>
/* 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;
cmd = TCSETSF;
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
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>
/* 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)
-/* 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
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>
/* 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:
`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)
}
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
}
-/* 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
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>
/* 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;
arg = FREAD | FWRITE;
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
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;
if (termios_p == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
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"
-CONST speed_t __bsd_speeds[] =
+const speed_t __bsd_speeds[] =
{
0,
50,
/* 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;
#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)
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;
}
}
if (buf.sg_ispeed == -1 || buf.sg_ospeed == -1)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
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;
}
-/* 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
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>
__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));
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)
-/* 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
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>
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;
/* Get limit on file size. */
struct rlimit fsize;
- status = getrlimit(RLIMIT_FSIZE, &fsize);
+ status = getrlimit (RLIMIT_FSIZE, &fsize);
if (status < 0)
return -1;
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;
}
}
-/* 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
#include <sysdep.h>
+__errno:
.comm errno, 4
ENTRY(__start)
-/* 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
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)
{
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);
if (dirp == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
{
if (vers != _STAT_VER)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <signal.h>
#include <unistd.h>
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)
/* 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
}
-
{
if (vers != _STAT_VER)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
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);
}
weak_alias (__getdirentries, getdirentries)
-
{
if (errno == ESRCH)
/* The caller expects ENOENT if nothing is found. */
- errno = ENOENT;
+ __set_errno (ENOENT);
result = NULL;
}
else
if (result < 0)
{
- errno = err;
+ __set_errno (err);
return err;
}
}
-/* 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
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>
/* 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;
if (path == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
}
else
{
- errno = EEXIST;
+ __set_errno (EEXIST);
return -1;
}
/* 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
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
-/* 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
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>
/* 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);
-/* 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
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>
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;
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;
}
{
/* POSIX.1-1990 says an empty name gets ENOENT;
but `open' might like it fine. */
- errno = ENOENT;
+ __set_errno (ENOENT);
return NULL;
}
goto lose;
if (! S_ISDIR (statbuf.st_mode))
{
- errno = ENOTDIR;
+ __set_errno (ENOTDIR);
goto lose;
}
{
int save = errno;
(void) __close (fd);
- errno = save;
+ __set_errno (save);
return NULL;
}
int save = errno;
free (dirp);
(void) __close (fd);
- errno = save;
+ __set_errno (save);
return NULL;
}
if (dirp == NULL || dirp->data == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
-/* 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
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>
/* 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;
if (path == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
return -1;
if (!S_ISDIR (statbuf.st_mode))
{
- errno = ENOTDIR;
+ __set_errno (ENOTDIR);
return -1;
}
/* 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;
-/* 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
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));
caddr_t sobssmap;
void (*ldstart) (int, int);
struct exec soexec;
- struct
+ struct
{
caddr_t crt_ba;
int crt_dzfd;
char **crt_ep;
caddr_t crt_bp;
} soarg;
-
+
/* If not dynamically linked, do nothing. */
if (&_DYNAMIC == 0)
return;
|| 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);
}
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);
-/* 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
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>
#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. */
/* 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
-/* 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
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;
}
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
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
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
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
-/* 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
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>
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)
{
return __sysmp (MP_SCHED, MPTS_GTNICE_USER, who);
}
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-/* 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
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)
{
return __sysmp (MP_SCHED, MPTS_RENICE_USER, who, prio);
}
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
-
-/* 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
/* 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));
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
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;
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;
}
}
}
/* systype is not a know platform name... */
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
/* 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;
}
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);
{
if (level > 3)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
if (level)
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
/* Test for appropriate rights to set host ID. */
if (geteuid () || getuid ())
{
- errno = EPERM;
+ __set_errno (EPERM);
return -1;
}
-/* 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
if (name == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
if (strlen (buf.nodename) + 1 > len)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
if (result == -1)
/* We cannot get the needed value: signal an error. */
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return result;
}
if (newbrk < addr)
{
- errno = ENOMEM;
+ __set_errno (ENOMEM);
return -1;
}
return 0;
}
weak_alias (__brk, brk)
-
/* 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
if (result < 0)
{
- errno = -result;
+ __set_errno (-result);
return -1;
}
return 0;
.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
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; \
if (newbrk < addr)
{
- errno = ENOMEM;
+ __set_errno (ENOMEM);
return -1;
}
return 0;
}
weak_alias (__brk, brk)
-
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
.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
#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
.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
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 \
{
if (request > 0 && request < 4)
{
- errno = 0;
+ __set_errno (0);
return ret;
}
return res;
}
- errno = -res;
+ __set_errno (-res);
return -1;
}
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>
/* 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);
}
--- /dev/null
+/* 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;
+}
if (termios_p == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
return 0;
}
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
--- /dev/null
+#include <linux/debugreg.h>
--- /dev/null
+#include <linux/kd.h>
--- /dev/null
+#include <linux/soundard.h>
--- /dev/null
+#include <linux/vt.h>
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
/* 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)
-/* 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
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>
/* Get limit on file size. */
struct rlimit fsize;
- status = getrlimit(RLIMIT_FSIZE, &fsize);
+ status = getrlimit (RLIMIT_FSIZE, &fsize);
if (status < 0)
return -1;
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;
}
}
-/* 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
#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)
/* 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
/* This only implements those functions which are available via ulimit. */
-#include <ansidecl.h>
#include <sys/resource.h>
#include <stddef.h>
#include <errno.h>
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;
}
}
-/* 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
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;
}
-/* 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
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>
/* 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;
}
return -1;
save = errno;
(void) signal (sig, handler);
- errno = save;
+ __set_errno (save);
}
else
{
if (act->sa_flags != 0)
{
unimplemented:
- errno = ENOSYS;
+ __set_errno (ENOSYS);
return -1;
}
-/* 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
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>
/* 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;
}
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>
#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:
-/* 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
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>
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;
return infop.__pid;
}
-weak_alias (__waitpid, waitpid)
+weak_alias (__libc_waitpid, __waitpid)
+weak_alias (__libc_waitpid, waitpid)
-/* 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
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>
/* 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)
-/* 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
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>
/* 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 TCION:
return __ioctl (fd, _TCXONC, 3);
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
}
-/* 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
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>
/* 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)
{
case TCIOFLUSH:
return __ioctl (fd, _TCFLSH, 2);
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
}
-/* 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
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>
/* 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;
}
-/* 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
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>
/* 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.
/* 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;
}
-/* 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
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 <sysv_termio.h>
-CONST speed_t __unix_speeds[] =
+const speed_t __unix_speeds[] =
{
0,
50,
/* 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;
if (termios_p == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
switch (optional_actions)
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;
}
if (buf.c_cflag == -1)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
{
if (vers != _MKNOD_VER)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
{
if (vers != _STAT_VER)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
{
if (tp == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
if (timer == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
#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)
if ((byte & 0xc0) == 0x80 || (byte & 0xfe) == 0xfe)
{
/* Oh, oh. An encoding error. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
if ((byte & 0xc0) != 0x80)
{
/* Oh, oh. An encoding error. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
else
{
/* This is an illegal encoding. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
if ((byte & 0xc0) != 0x80)
{
/* This is an illegal encoding. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
else
{
/* This is an illegal encoding. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
if ((byte & 0xc0) != 0x80)
{
/* This is an illegal encoding. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
if (wc < 0 || wc > 0x7fffffff)
{
/* This is no correct ISO 10646 character. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
if (wc < 0 || wc > 0x7fffffff)
{
/* This is no correct ISO 10646 character. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
if (wc < 0 || wc > 0x7fffffff)
{
/* This is no correct ISO 10646 character. */
- errno = EILSEQ;
+ __set_errno (EILSEQ);
return (size_t) -1;
}
if (wcs == NULL)
if (*save_ptr == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
else