mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-07 13:50:07 +00:00
c40298232a
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>.
415 lines
16 KiB
C
415 lines
16 KiB
C
/*
|
|
Copyright (C) 1993 Free Software Foundation
|
|
|
|
This file is part of the GNU IO Library. This library is free
|
|
software; you can redistribute it and/or modify it under the
|
|
terms of the GNU General Public License as published by the
|
|
Free Software Foundation; either version 2, or (at your option)
|
|
any later version.
|
|
|
|
This 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 General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this library; see the file COPYING. If not, write to the Free
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
As a special exception, if you link this library with files
|
|
compiled with a GNU compiler to produce an executable, this does not cause
|
|
the resulting executable to be covered by the GNU General Public License.
|
|
This exception does not however invalidate any other reasons why
|
|
the executable file might be covered by the GNU General Public License. */
|
|
|
|
#include <errno.h>
|
|
#ifndef errno
|
|
extern int errno;
|
|
#endif
|
|
#include <libc-lock.h>
|
|
|
|
#include "iolibio.h"
|
|
|
|
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__cplusplus)
|
|
/* All known AIX compilers implement these things (but don't always
|
|
define __STDC__). The RISC/OS MIPS compiler defines these things
|
|
in SVR4 mode, but does not define __STDC__. */
|
|
|
|
#define AND ,
|
|
#define DEFUN(name, arglist, args) name(args)
|
|
#define DEFUN_VOID(name) name(void)
|
|
|
|
#else /* Not ANSI C. */
|
|
|
|
#define AND ;
|
|
#ifndef const /* some systems define it in header files for non-ansi mode */
|
|
#define const
|
|
#endif
|
|
#define DEFUN(name, arglist, args) name arglist args;
|
|
#define DEFUN_VOID(name) name()
|
|
#endif /* ANSI C. */
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define _IO_seek_set 0
|
|
#define _IO_seek_cur 1
|
|
#define _IO_seek_end 2
|
|
|
|
typedef int (*_IO_overflow_t) __P((_IO_FILE*, int));
|
|
typedef int (*_IO_underflow_t) __P((_IO_FILE*));
|
|
typedef _IO_size_t (*_IO_xsputn_t) __P((_IO_FILE*,const void*,_IO_size_t));
|
|
typedef _IO_size_t (*_IO_xsgetn_t) __P((_IO_FILE*, void*, _IO_size_t));
|
|
typedef _IO_ssize_t (*_IO_read_t) __P((_IO_FILE*, void*, _IO_ssize_t));
|
|
typedef _IO_ssize_t (*_IO_write_t) __P((_IO_FILE*,const void*,_IO_ssize_t));
|
|
typedef int (*_IO_stat_t) __P((_IO_FILE*, void*));
|
|
typedef _IO_fpos_t (*_IO_seek_t) __P((_IO_FILE*, _IO_off_t, int));
|
|
typedef int (*_IO_doallocate_t) __P((_IO_FILE*));
|
|
typedef int (*_IO_pbackfail_t) __P((_IO_FILE*, int));
|
|
typedef _IO_FILE* (*_IO_setbuf_t) __P((_IO_FILE*, char *, _IO_ssize_t));
|
|
typedef int (*_IO_sync_t) __P((_IO_FILE*));
|
|
typedef void (*_IO_finish_t) __P((_IO_FILE*)); /* finalize */
|
|
typedef int (*_IO_close_t) __P((_IO_FILE*)); /* finalize */
|
|
typedef _IO_fpos_t (*_IO_seekoff_t) __P((_IO_FILE*, _IO_off_t, int, int));
|
|
|
|
/* The _IO_seek_cur and _IO_seek_end options are not allowed. */
|
|
typedef _IO_fpos_t (*_IO_seekpos_t) __P((_IO_FILE*, _IO_fpos_t, int));
|
|
|
|
#if !_IO_UNIFIED_JUMPTABLES
|
|
#define _IO_JUMPS(THIS) (THIS)->_jumps
|
|
#else
|
|
#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus*)(THIS))->vtable
|
|
#endif
|
|
|
|
#if !_IO_UNIFIED_JUMPTABLES
|
|
#define JUMP_FIELD(TYPE, NAME) TYPE NAME
|
|
#define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC(THIS)
|
|
#define JUMP1(FUNC, THIS, X1) _IO_JUMPS(THIS)->FUNC(THIS, X1)
|
|
#define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS(THIS)->FUNC(THIS, X1, X2)
|
|
#define JUMP3(FUNC, THIS, X1, X2, X3) _IO_JUMPS(THIS)->FUNC(THIS, X1, X2, X3)
|
|
#define JUMP_INIT(NAME, VALUE) VALUE
|
|
#else
|
|
#define JUMP_FIELD(TYPE, NAME) struct { short delta1, delta2; TYPE pfn; } NAME
|
|
#define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC.pfn(THIS)
|
|
#define JUMP1(FUNC, THIS, X1) _IO_JUMPS(THIS)->FUNC.pfn(THIS, X1)
|
|
#define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS(THIS)->FUNC.pfn(THIS, X1, X2)
|
|
#define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC.pfn(THIS, X1,X2, X3)
|
|
#define JUMP_INIT(NAME, VALUE) {0, 0, VALUE}
|
|
#endif
|
|
#define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0)
|
|
|
|
#define _IO_FINISH(FP) JUMP0(__finish, FP)
|
|
#define _IO_OVERFLOW(FP, CH) JUMP1(__overflow, FP, CH)
|
|
#define _IO_UNDERFLOW(FP) JUMP0(__underflow, FP)
|
|
#define _IO_UFLOW(FP) JUMP0(__uflow, FP)
|
|
#define _IO_PBACKFAIL(FP, CH) JUMP1(__pbackfail, FP, CH)
|
|
#define _IO_XSPUTN(FP, DATA, N) JUMP2(__xsputn, FP, DATA, N)
|
|
#define _IO_XSGETN(FP, DATA, N) JUMP2(__xsgetn, FP, DATA, N)
|
|
#define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3(__seekoff, FP, OFF, DIR, MODE)
|
|
#define _IO_SEEKPOS(FP, POS, FLAGS) JUMP2(__seekpos, FP, POS, FLAGS)
|
|
#define _IO_SETBUF(FP, BUFFER, LENGTH) JUMP2(__setbuf, FP, BUFFER, LENGTH)
|
|
#define _IO_SYNC(FP) JUMP0(__sync, FP)
|
|
#define _IO_DOALLOCATE(FP) JUMP0(__doallocate, FP)
|
|
#define _IO_SYSREAD(FP, DATA, LEN) JUMP2(__read, FP, DATA, LEN)
|
|
#define _IO_SYSWRITE(FP, DATA, LEN) JUMP2(__write, FP, DATA, LEN)
|
|
#define _IO_SYSSEEK(FP, OFFSET, MODE) JUMP2(__seek, FP, OFFSET, MODE)
|
|
#define _IO_SYSCLOSE(FP) JUMP0(__close, FP)
|
|
#define _IO_SYSSTAT(FP, BUF) JUMP1(__stat, FP, BUF)
|
|
|
|
#define _IO_CHAR_TYPE char /* unsigned char ? */
|
|
#define _IO_INT_TYPE int
|
|
|
|
struct _IO_jump_t {
|
|
JUMP_FIELD(_G_size_t, __dummy);
|
|
JUMP_FIELD(_IO_finish_t, __finish);
|
|
JUMP_FIELD(_IO_overflow_t, __overflow);
|
|
JUMP_FIELD(_IO_underflow_t, __underflow);
|
|
JUMP_FIELD(_IO_underflow_t, __uflow);
|
|
JUMP_FIELD(_IO_pbackfail_t, __pbackfail);
|
|
/* showmany */
|
|
JUMP_FIELD(_IO_xsputn_t, __xsputn);
|
|
JUMP_FIELD(_IO_xsgetn_t, __xsgetn);
|
|
JUMP_FIELD(_IO_seekoff_t, __seekoff);
|
|
JUMP_FIELD(_IO_seekpos_t, __seekpos);
|
|
JUMP_FIELD(_IO_setbuf_t, __setbuf);
|
|
JUMP_FIELD(_IO_sync_t, __sync);
|
|
JUMP_FIELD(_IO_doallocate_t, __doallocate);
|
|
JUMP_FIELD(_IO_read_t, __read);
|
|
JUMP_FIELD(_IO_write_t, __write);
|
|
JUMP_FIELD(_IO_seek_t, __seek);
|
|
JUMP_FIELD(_IO_close_t, __close);
|
|
JUMP_FIELD(_IO_stat_t, __stat);
|
|
#if 0
|
|
get_column;
|
|
set_column;
|
|
#endif
|
|
};
|
|
|
|
/* We always allocate an extra word following an _IO_FILE.
|
|
This is for compatibility with C++ streambuf; the word can
|
|
be used to smash to a pointer to a virtual function table. */
|
|
|
|
struct _IO_FILE_plus {
|
|
_IO_FILE file;
|
|
#if _IO_UNIFIED_JUMPTABLES
|
|
const struct _IO_jump_t *vtable;
|
|
#else
|
|
const void *vtable;
|
|
#endif
|
|
};
|
|
|
|
/* Generic functions */
|
|
|
|
extern _IO_fpos_t _IO_seekoff __P((_IO_FILE*, _IO_off_t, int, int));
|
|
extern _IO_fpos_t _IO_seekpos __P((_IO_FILE*, _IO_fpos_t, int));
|
|
|
|
extern int _IO_switch_to_get_mode __P((_IO_FILE*));
|
|
extern void _IO_init __P((_IO_FILE*, int));
|
|
extern int _IO_sputbackc __P((_IO_FILE*, int));
|
|
extern int _IO_sungetc __P((_IO_FILE*));
|
|
extern void _IO_un_link __P((_IO_FILE*));
|
|
extern void _IO_link_in __P((_IO_FILE *));
|
|
extern void _IO_doallocbuf __P((_IO_FILE*));
|
|
extern void _IO_unsave_markers __P((_IO_FILE*));
|
|
extern void _IO_setb __P((_IO_FILE*, char*, char*, int));
|
|
extern unsigned _IO_adjust_column __P((unsigned, const char *, int));
|
|
#define _IO_sputn(__fp, __s, __n) _IO_XSPUTN(__fp, __s, __n)
|
|
|
|
/* Marker-related function. */
|
|
|
|
extern void _IO_init_marker __P((struct _IO_marker *, _IO_FILE *));
|
|
extern void _IO_remove_marker __P((struct _IO_marker*));
|
|
extern int _IO_marker_difference __P((struct _IO_marker *, struct _IO_marker *));
|
|
extern int _IO_marker_delta __P((struct _IO_marker *));
|
|
extern int _IO_seekmark __P((_IO_FILE *, struct _IO_marker *, int));
|
|
|
|
/* Default jumptable functions. */
|
|
|
|
extern int _IO_default_underflow __P((_IO_FILE*));
|
|
extern int _IO_default_uflow __P((_IO_FILE*));
|
|
extern int _IO_default_doallocate __P((_IO_FILE*));
|
|
extern void _IO_default_finish __P((_IO_FILE *));
|
|
extern int _IO_default_pbackfail __P((_IO_FILE*, int));
|
|
extern _IO_FILE* _IO_default_setbuf __P((_IO_FILE *, char*, _IO_ssize_t));
|
|
extern _IO_size_t _IO_default_xsputn __P((_IO_FILE *, const void*, _IO_size_t));
|
|
extern _IO_size_t _IO_default_xsgetn __P((_IO_FILE *, void*, _IO_size_t));
|
|
extern _IO_fpos_t _IO_default_seekoff __P((_IO_FILE*, _IO_off_t, int, int));
|
|
extern _IO_fpos_t _IO_default_seekpos __P((_IO_FILE*, _IO_fpos_t, int));
|
|
extern _IO_ssize_t _IO_default_write __P((_IO_FILE*,const void*,_IO_ssize_t));
|
|
extern _IO_ssize_t _IO_default_read __P((_IO_FILE*, void*, _IO_ssize_t));
|
|
extern int _IO_default_stat __P((_IO_FILE*, void*));
|
|
extern _IO_fpos_t _IO_default_seek __P((_IO_FILE*, _IO_off_t, int));
|
|
extern int _IO_default_sync __P((_IO_FILE*));
|
|
#define _IO_default_close ((_IO_close_t)_IO_default_sync)
|
|
|
|
extern struct _IO_jump_t _IO_file_jumps;
|
|
extern struct _IO_jump_t _IO_streambuf_jumps;
|
|
extern struct _IO_jump_t _IO_proc_jumps;
|
|
extern struct _IO_jump_t _IO_str_jumps;
|
|
extern int _IO_do_write __P((_IO_FILE*, const char*, _IO_size_t));
|
|
extern int _IO_flush_all __P((void));
|
|
extern void _IO_cleanup __P((void));
|
|
extern void _IO_flush_all_linebuffered __P((void));
|
|
|
|
#define _IO_do_flush(_f) \
|
|
_IO_do_write(_f, (_f)->_IO_write_base, \
|
|
(_f)->_IO_write_ptr-(_f)->_IO_write_base)
|
|
#define _IO_in_put_mode(_fp) ((_fp)->_flags & _IO_CURRENTLY_PUTTING)
|
|
#define _IO_mask_flags(fp, f, mask) \
|
|
((fp)->_flags = ((fp)->_flags & ~(mask)) | ((f) & (mask)))
|
|
#define _IO_setg(fp, eb, g, eg) ((fp)->_IO_read_base = (eb),\
|
|
(fp)->_IO_read_ptr = (g), (fp)->_IO_read_end = (eg))
|
|
#define _IO_setp(__fp, __p, __ep) \
|
|
((__fp)->_IO_write_base = (__fp)->_IO_write_ptr = __p, (__fp)->_IO_write_end = (__ep))
|
|
#define _IO_have_backup(fp) ((fp)->_IO_save_base != NULL)
|
|
#define _IO_in_backup(fp) ((fp)->_flags & _IO_IN_BACKUP)
|
|
#define _IO_have_markers(fp) ((fp)->_markers != NULL)
|
|
#define _IO_blen(p) ((fp)->_IO_buf_end - (fp)->_IO_buf_base)
|
|
|
|
/* Jumptable functions for files. */
|
|
|
|
extern int _IO_file_doallocate __P((_IO_FILE*));
|
|
extern _IO_FILE* _IO_file_setbuf __P((_IO_FILE *, char*, _IO_ssize_t));
|
|
extern _IO_fpos_t _IO_file_seekoff __P((_IO_FILE*, _IO_off_t, int, int));
|
|
extern _IO_size_t _IO_file_xsputn __P((_IO_FILE*,const void*,_IO_size_t));
|
|
extern int _IO_file_stat __P((_IO_FILE*, void*));
|
|
extern int _IO_file_close __P((_IO_FILE*));
|
|
extern int _IO_file_underflow __P((_IO_FILE *));
|
|
extern int _IO_file_overflow __P((_IO_FILE *, int));
|
|
#define _IO_file_is_open(__fp) ((__fp)->_fileno >= 0)
|
|
extern void _IO_file_init __P((_IO_FILE*));
|
|
extern _IO_FILE* _IO_file_attach __P((_IO_FILE*, int));
|
|
extern _IO_FILE* _IO_file_fopen __P((_IO_FILE*, const char*, const char*));
|
|
extern _IO_ssize_t _IO_file_write __P((_IO_FILE*,const void*,_IO_ssize_t));
|
|
extern _IO_ssize_t _IO_file_read __P((_IO_FILE*, void*, _IO_ssize_t));
|
|
extern int _IO_file_sync __P((_IO_FILE*));
|
|
extern int _IO_file_close_it __P((_IO_FILE*));
|
|
extern _IO_fpos_t _IO_file_seek __P((_IO_FILE *, _IO_off_t, int));
|
|
extern void _IO_file_finish __P((_IO_FILE*));
|
|
|
|
/* Other file functions. */
|
|
extern _IO_FILE* _IO_file_attach __P((_IO_FILE *, int));
|
|
|
|
/* Jumptable functions for proc_files. */
|
|
extern _IO_FILE* _IO_proc_open __P((_IO_FILE*, const char*, const char *));
|
|
extern int _IO_proc_close __P((_IO_FILE*));
|
|
|
|
/* Jumptable functions for strfiles. */
|
|
extern int _IO_str_underflow __P((_IO_FILE*));
|
|
extern int _IO_str_overflow __P((_IO_FILE *, int));
|
|
extern int _IO_str_pbackfail __P((_IO_FILE*, int));
|
|
extern _IO_fpos_t _IO_str_seekoff __P((_IO_FILE*,_IO_off_t,int,int));
|
|
extern void _IO_str_finish __P ((_IO_FILE*));
|
|
|
|
/* Other strfile functions */
|
|
extern void _IO_str_init_static __P((_IO_FILE *, char*, int, char*));
|
|
extern void _IO_str_init_readonly __P((_IO_FILE *, const char*, int));
|
|
extern _IO_ssize_t _IO_str_count __P ((_IO_FILE*));
|
|
|
|
extern int _IO_vasprintf __P ((char **result_ptr, __const char *format,
|
|
_IO_va_list args));
|
|
extern int _IO_vdprintf __P ((int d, __const char *format, _IO_va_list arg));
|
|
extern int _IO_vsnprintf __P ((char *string, _IO_size_t maxlen,
|
|
__const char *format, _IO_va_list args));
|
|
|
|
|
|
extern _IO_size_t _IO_getline __P((_IO_FILE*,char*,_IO_size_t,int,int));
|
|
extern _IO_ssize_t _IO_getdelim __P((char**, _IO_size_t*, int, _IO_FILE*));
|
|
extern double _IO_strtod __P((const char *, char **));
|
|
extern char * _IO_dtoa __P((double __d, int __mode, int __ndigits,
|
|
int *__decpt, int *__sign, char **__rve));
|
|
extern int _IO_outfloat __P((double __value, _IO_FILE *__sb, int __type,
|
|
int __width, int __precision, int __flags,
|
|
int __sign_mode, int __fill));
|
|
|
|
extern _IO_FILE *_IO_list_all;
|
|
extern void (*_IO_cleanup_registration_needed) __P ((void));
|
|
|
|
#ifndef EOF
|
|
#define EOF (-1)
|
|
#endif
|
|
#ifndef NULL
|
|
#if !defined(__cplusplus) || defined(__GNUC__)
|
|
#define NULL ((void*)0)
|
|
#else
|
|
#define NULL (0)
|
|
#endif
|
|
#endif
|
|
|
|
#define FREE_BUF(_B) free(_B)
|
|
#define ALLOC_BUF(_S) (char*)malloc(_S)
|
|
|
|
#ifndef OS_FSTAT
|
|
#define OS_FSTAT fstat
|
|
#endif
|
|
struct stat;
|
|
extern _IO_ssize_t _IO_read __P((int, void*, _IO_size_t));
|
|
extern _IO_ssize_t _IO_write __P((int, const void*, _IO_size_t));
|
|
extern _IO_off_t _IO_lseek __P((int, _IO_off_t, int));
|
|
extern int _IO_close __P((int));
|
|
extern int _IO_fstat __P((int, struct stat *));
|
|
extern int _IO_vscanf __P((const char *, _IO_va_list));
|
|
|
|
/* Operations on _IO_fpos_t.
|
|
Normally, these are trivial, but we provide hooks for configurations
|
|
where an _IO_fpos_t is a struct.
|
|
Note that _IO_off_t must be an integral type. */
|
|
|
|
/* _IO_pos_BAD is an _IO_fpos_t value indicating error, unknown, or EOF. */
|
|
#ifndef _IO_pos_BAD
|
|
#define _IO_pos_BAD ((_IO_fpos_t)(-1))
|
|
#endif
|
|
/* _IO_pos_as_off converts an _IO_fpos_t value to an _IO_off_t value. */
|
|
#ifndef _IO_pos_as_off
|
|
#define _IO_pos_as_off(__pos) ((_IO_off_t)(__pos))
|
|
#endif
|
|
/* _IO_pos_adjust adjust an _IO_fpos_t by some number of bytes. */
|
|
#ifndef _IO_pos_adjust
|
|
#define _IO_pos_adjust(__pos, __delta) ((__pos) += (__delta))
|
|
#endif
|
|
/* _IO_pos_0 is an _IO_fpos_t value indicating beginning of file. */
|
|
#ifndef _IO_pos_0
|
|
#define _IO_pos_0 ((_IO_fpos_t)0)
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#if _IO_UNIFIED_JUMPTABLES
|
|
#define _IO_FJUMP /* nothing */
|
|
#else
|
|
#define _IO_FJUMP &_IO_file_jumps,
|
|
#endif
|
|
#ifdef _IO_MTSAFE_IO
|
|
/* check following! */
|
|
#define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
|
|
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, _IO_FJUMP FD, \
|
|
0, 0, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock }
|
|
#else
|
|
/* check following! */
|
|
#define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
|
|
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, _IO_FJUMP FD }
|
|
#endif
|
|
|
|
/* VTABLE_LABEL defines NAME as of the CLASS class.
|
|
CNLENGTH is strlen(#CLASS). */
|
|
#ifdef __GNUC__
|
|
#if _G_VTABLE_LABEL_HAS_LENGTH
|
|
#define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
|
|
extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CNLENGTH #CLASS);
|
|
#else
|
|
#define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
|
|
extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CLASS);
|
|
#endif
|
|
#endif /* __GNUC__ */
|
|
|
|
#if !defined(builtinbuf_vtable) && defined(__cplusplus)
|
|
#ifdef __GNUC__
|
|
VTABLE_LABEL(builtinbuf_vtable, builtinbuf, 10)
|
|
#else
|
|
#if _G_VTABLE_LABEL_HAS_LENGTH
|
|
#define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##10builtinbuf
|
|
#else
|
|
#define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##builtinbuf
|
|
#endif
|
|
#endif
|
|
#endif /* !defined(builtinbuf_vtable) && defined(__cplusplus) */
|
|
|
|
#if defined(__STDC__) || defined(__cplusplus)
|
|
#define _IO_va_start(args, last) va_start(args, last)
|
|
#else
|
|
#define _IO_va_start(args, last) va_start(args)
|
|
#endif
|
|
|
|
extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf;
|
|
|
|
#if 1
|
|
#define COERCE_FILE(FILE) /* Nothing */
|
|
#else
|
|
/* This is part of the kludge for binary compatibility with old stdio. */
|
|
#define COERCE_FILE(FILE) \
|
|
(((FILE)->_IO_file_flags & _IO_MAGIC_MASK) == _OLD_MAGIC_MASK \
|
|
&& (FILE) = *(FILE**)&((int*)fp)[1])
|
|
#endif
|
|
|
|
#ifdef EINVAL
|
|
#define MAYBE_SET_EINVAL __set_errno (EINVAL)
|
|
#else
|
|
#define MAYBE_SET_EINVAL /* nothing */
|
|
#endif
|
|
|
|
#ifdef DEBUG
|
|
#define CHECK_FILE(FILE,RET) \
|
|
if ((FILE) == NULL) { MAYBE_SET_EINVAL; return RET; } \
|
|
else { COERCE_FILE(FILE); \
|
|
if (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
|
|
{ errno = EINVAL; return RET; }}
|
|
#else
|
|
#define CHECK_FILE(FILE,RET) \
|
|
COERCE_FILE(FILE)
|
|
#endif
|