These are context diffs between versions 1.04 and 1.05 of the GNU C library. Some files are moved or deleted between version 1.04 and version 1.05. In the diffs, a moved or deleted file is represented by a patch to make that file empty. The empty files that result from applying the patches normally may cause problems, so they should be removed. You can do this with the -E option to GNU patch if you have version 2.0.12u6 or later; or by running a `find' command in the library source directory, like this: find . -size 0 -exec rm {} \; diff -rcN glibc-1.04/ChangeLog glibc-1.05/ChangeLog *** glibc-1.04/ChangeLog Thu Sep 3 21:26:18 1992 --- glibc-1.05/ChangeLog Thu Sep 24 16:57:03 1992 *************** *** 1,4 **** --- 1,196 ---- + Thu Sep 24 16:13:47 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * Version 1.05. + + * Makefile (dist): Depend on $(distribute). + + * stdio/__vfscanf.c (%c): Fixed DO_ASSIGN case loop condition to + not write one char too many. + + Wed Sep 23 16:32:18 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * stdlib/qsort.c (_quicksort): Return immediately if TOTAL_ELEMS==0. + + Tue Sep 22 19:10:59 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * Makerules [! OUTPUT_OPTION && objpfx]: Define OUTPUT_OPTION. + + Mon Sep 21 22:40:55 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * sysdeps/unix/bsd/mk-local_lim.c: Use MAXNAMLEN for NAME_MAX, + rather than hard-wiring 255. + [! MAXNAMLEN]: Define it to 255. + [LINK_MAX && ! MAXLINK]: #define MAXLINK LINK_MAX. + + * sysdeps/unix/bsd/glue-ctype.c [ultrix]: #define _ctype_ _ctype__. + + * configure: Rename var `gas' to `gnu_as' and use consistently. + + Fri Sep 18 16:32:16 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * sys/errno.h: New file. + * Makefile (headers): Add it. + + * Makeconfig (+make-deps): Use = not define. + + * time/Makefile (zones-%): Don't clobber zonenames; append to it. + Depend on Makefile so we rebuild when the rule changes. + Changed implicit rule from zoneinfo/%/... to zone%/... so it will + actually match. + + * sysdeps/unix/Makefile (syscall.h): Filter out "#ident" lines. + + * Makeconfig (+link): Use $(gnulib) instead of -lgcc. + (gnulib): Define to -lgcc. + + * posix/glob/Makefile.in (AR, ARFLAGS): Define. + (libglob.a): Use those vars instead of hardcoding. + + * Makeconfig (ARCH) [machine]: Don't define if $(..)config.make exists. + + * Makerules (compile.S): Include $(asm-CPPFLAGS). + (S-CPPFLAGS): Define = $(asm-CPPFLAGS). + (+make-deps): Include $(sfx-CPPFLAGS), where `sfx' is S or c. + * Makeconfig (asm-CPPFLAGS): Define (empty) and comment. + + * sysdeps/unix/Makefile ($(sys/param.h-includes)): Filter out + decls or macros for host<->net conversion (htonl et al). + + Thu Sep 17 17:33:51 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * sysdeps/unix/sysv/statbuf.h: Define __S_*. + + * misc/Makefile (headers): syslog.h -> sys/syslog.h. + * misc/syslog.h: Moved to misc/sys/syslog.h. + + * limits.h [__GNUC__ >= 2]: #define _LIBC_LIMITS_H before + #include_next . + Define _LIMITS_H unconditionally. + + Wed Sep 16 17:43:59 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * sysdeps/unix/Makefile (syscall.h): Don't use \< in sed commands. + Some seds don't seem to grok it. + + * Makerules (+install-dirs): Sort them. + + * Makeconfig (stdarg.h): Use $(wildcard va-*.h) instead of va-*.h, + and := instead of =. + + * Makeconfig (prefix): Default to $(exec_prefix), not /usr/local. + + * Makeconfig (+link): Use $(common-objpfx) rather than $(objpfx) + to find start.o; use $(libc.a) instead of $(objpfx)libc.a. + + * sysdeps/sparc/Makefile: crypt subdir is not called uf-crypt. + + * sysdeps/unix/Makefile (sys/param.h-includes): Fixed filtering + out of existent glibc headers to remove $(..) pfx after wildcard. + + * misc/paths.h: New file, snarfed from 4.4 BSD. + * misc/Makefile (headers): Add paths.h. + + Tue Sep 15 14:55:11 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Makerules (+sysdir_pfx): Define as $(common-objpfx). + + * MakeTAGS (TAGS) [subdir && ! tags_sources]: Create an empty + file, rather than no commands at all. + + * string/string.h [__GNUC__ && __OPTIMIZE__] (ffs): Take arg. + + * sysdeps/unix/sysv/linux/__wait4.S: New file. + + * sysdeps/unix/sysv/linux/syscall.h: New version from hlu. + + * sysdeps/unix/Makefile (syscall.h): Upcase `sys_' in input. + + * sysdeps/unix/bsd/ultrix4/mips/sysdep.h (MOVE): Insn is `move', + not `movl'. + + * sysdeps/unix/bsd/ultrix4/mips/sigcontext.h: Deansideclized. + + * sysdeps/unix/ioctls-tmpl.c [DIOCGETPT, DEVGETGEOM]: Include + headers for these. + [ultrix]: Mondo cruft. + + Sat Sep 12 12:08:29 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) + + * misc/Makefile (routines): Add ttyslot, syslog. + * misc/ttyslot.c, misc/syslog.[ch]: New, snarfed from 4.4 BSD. + (headers): Add syslog.h + + * misc/getttyent.c (getttyent): Parse _TTYS_TRUSTED keyword and + set TTY_TRUSTED bit. + * misc/ttyent.h (TTY_TRUSTED): New bit in ty_status. + (_TTYS_TRUSTED): New keyword. + (_TTYS_CONSOLE): New keyword. + (TTY_CONSOLE): New bit in ty_status. + + * dirent/scandir.c (scandir): Don't keep using V after realloc'ing + it. Use the returned new ptr instead. + + Thu Sep 10 18:59:23 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * stdlib/div.c, stdlib/ldiv.c: Rewritten from Berkeley code that works. + + * Makeconfig (stdarg.h): Add va-*.h. + + * stdlib/Makefile (dont_distribute): Define: testsort.input. + + * sysdeps/mach/hurd/i386/_hurd_start_sigthread.c, + sysdeps/stub/_hurd_start_sigthread.c: Renamed to .../startsig.c. + * sysdeps/mach/hurd/sys_errlist.awk: Renamed to .../errlist.awk. + * sysdeps/mach/hurd/Makefile (sys_errlist.c): Change dep. + * sysdeps/unix/bsd/make-local_lim.c: Renamed to .../mk-local_lim.c. + * sysdeps/unix/bsd/Makefile (local_lim.h): Change dep. + (make-local_lim): Change target and dep. + * hurd/_hurd_dead_recv.c: Renamed to hurd/dead_recv.c. + * hurd/setdtablesize.c: Renamed to hurd/setdtsz.c. + * hurd/Makefile (routines): Change references. + * stdio/tstgetline.c: Renamed to stdio/tstgetln.c. + * stdio/tstgetline.input: Renamed to stdio/tstgetln.input. + * stdio/Makefile (tests): Change ref. + * README.template: Remove note about long file names. + + * sysdeps/unix/bsd/sun/sunos4/utsnamelen.h (_UTSNAME_LENGTH): + Define here, rather than #include'ing sysv/utsnamelen.h. + This file gets installed. + + Wed Sep 9 17:06:14 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu) + + * Makeconfig (localtime-file): Put in $(prefix)/etc, not /etc. + + * setjmp/Makefile (routines): Remove sigsetjmp. + + * sysdeps/posix/Makefile (objdir-CPPFLAGS) [! subdir]: Rewrote + totally broken defn. + + * sysdeps/unix/Makefile (syscall.h): Keep lines starting + with #, not only those starting with #define. + We want to preserve any #ifdef in the original. + + * Makerules (install): Dep $(+install-dirs), not $(dir $(+install)). + (+install-dirs): Define to get two levels of dirs. + + * time/Makefile (tz-cc): Use = instead of define directive. + + * sysdeps/unix/bsd/sun/sparc/start.c (_start): Give ARGC, ARGV, + and ENVP `register' storage class; can then clear the FP early. + + Sat Sep 5 13:14:09 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) + + * Makerules (sysdirs): Pass sysdep_dir in child's environment. + + Fri Sep 4 15:37:23 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) + + * Makeconfig (common-objpfx): Add trailing slash. + Move comment to prev line to avoid extra whitespace. + Thu Sep 3 17:31:13 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) + + * sysdeps/unix/bsd/setgroups.S: New file. How did this manage not + to exist already?? * Version 1.04. diff -rcN glibc-1.04/Make-dist glibc-1.05/Make-dist *** glibc-1.04/Make-dist Thu Sep 3 21:41:43 1992 --- glibc-1.05/Make-dist Tue Sep 15 20:13:46 1992 *************** *** 104,109 **** --- 104,112 ---- +tsrcs := $(+tsrcs) \ TAGS + .PHONY: TAGS + TAGS: $(..)MakeTAGS + $(MAKE) -f $< $@ -o subdir_TAGS ifdef subdir *************** *** 160,167 **** $(tardir)-crypt.tar.Z: crypt/crypt.tar.Z ln $< $@ ! crypt/%: $(MAKE) -C $(@D) $(@F) dist.tar: $(tardir) $(+tsrcs) tar ch$(verbose)f $@ $(addprefix $(tardir)/,$(filter-out $(tardir),$^)) --- 163,171 ---- $(tardir)-crypt.tar.Z: crypt/crypt.tar.Z ln $< $@ ! crypt/%: FORCE $(MAKE) -C $(@D) $(@F) + FORCE: dist.tar: $(tardir) $(+tsrcs) tar ch$(verbose)f $@ $(addprefix $(tardir)/,$(filter-out $(tardir),$^)) diff -rcN glibc-1.04/MakeTAGS glibc-1.05/MakeTAGS *** glibc-1.04/MakeTAGS Thu May 7 01:20:22 1992 --- glibc-1.05/MakeTAGS Tue Sep 15 17:57:59 1992 *************** *** 72,77 **** --- 72,80 ---- ifdef subdir ifdef tags_sources $(ETAGS) -o $@ $^ + else + # No sources. Create a dummy file. + touch $@ endif # tags_sources else # parent TAGS: subdir_TAGS diff -rcN glibc-1.04/Makeconfig glibc-1.05/Makeconfig *** glibc-1.04/Makeconfig Tue Sep 1 17:32:44 1992 --- glibc-1.05/Makeconfig Sat Sep 19 01:44:10 1992 *************** *** 33,41 **** ifndef ARCH ifdef machine ARCH = $(machine) ! endif ! endif # Directory for object files and libc.a. If this is not defined, the # object files live in the subdirectories where their sources live, and --- 33,45 ---- ifndef ARCH ifdef machine + # If config.make exists, the source directory was configured, + # so don't try to be clever and find another directory to build in. + ifeq (,$(wildcard $(..)config.make)) ARCH = $(machine) ! endif # config.make ! endif # machine ! endif # ARCH # Directory for object files and libc.a. If this is not defined, the # object files live in the subdirectories where their sources live, and *************** *** 61,67 **** common-objpfx = $(..) common-objdir = .. else ! common-objpfx = sysdeps/.. # This is a kludge. make wizards might grok. endif endif --- 65,72 ---- common-objpfx = $(..) common-objdir = .. else ! # This is a kludge. make wizards might grok. ! common-objpfx = sysdeps/../ endif endif *************** *** 101,107 **** # Common prefix for machine-dependent installation directories. ifndef exec_prefix ! exec_prefix = /usr/local endif # Where to install the library and object files. --- 106,112 ---- # Common prefix for machine-dependent installation directories. ifndef exec_prefix ! exec_prefix = $(prefix) endif # Where to install the library and object files. *************** *** 123,129 **** # Define if the library should install its own . # Do this unless you are using version 2.3 or later of GCC. ifndef stdarg.h ! stdarg.h = stdarg.h endif # Where to install machine-independent data files. --- 128,134 ---- # Define if the library should install its own . # Do this unless you are using version 2.3 or later of GCC. ifndef stdarg.h ! stdarg.h := stdarg.h $(wildcard va-*.h) endif # Where to install machine-independent data files. *************** *** 148,154 **** # whose contents $(localtime) specifies. If this is a relative # pathname, it is relative to $(datadir)/zoneinfo. ifndef localtime-file ! localtime-file = /etc/localtime endif # What timezone's DST rules should be used when a POSIX-style TZ --- 153,159 ---- # whose contents $(localtime) specifies. If this is a relative # pathname, it is relative to $(datadir)/zoneinfo. ifndef localtime-file ! localtime-file = $(prefix)/etc/localtime endif # What timezone's DST rules should be used when a POSIX-style TZ *************** *** 197,203 **** # if using GNU ld (which you should do if possible). If you do this, you # may need the GNU assembler as well. If you don't do this, your library # won't work as well (and won't be strictly compliant with the ANSI C ! # standard). +defines = $(defines) $(gnu_ld) $(gnu_as) # Default flags to pass the C compiler. --- 202,208 ---- # if using GNU ld (which you should do if possible). If you do this, you # may need the GNU assembler as well. If you don't do this, your library # won't work as well (and won't be strictly compliant with the ANSI C ! # and POSIX.1 standards). +defines = $(defines) $(gnu_ld) $(gnu_as) # Default flags to pass the C compiler. *************** *** 205,214 **** +default_cflags := -g endif # Command for linking programs with the C library. ifndef +link ! +link = $(CC) -nostdlib -o $@ $(objpfx)start.o $(^:lib=$(objpfx)libc.a) \ ! -lgcc $(objpfx)libc.a endif ifndef LD --- 210,230 ---- +default_cflags := -g endif + # Flags to pass the C compiler when assembling preprocessed assembly code + # (`.S' files). On some systems the assembler doesn't understand the `#' line + # directives the preprocessor produces. If you have troubling compiling + # assembly code, try using -P here to suppress these directives. + ifndef asm-CPPFLAGS + asm-CPPFLAGS = + endif + # Command for linking programs with the C library. ifndef +link ! +link = $(CC) -nostdlib -o $@ $(common-objpfx)start.o $(^:lib=$(libc.a)) \ ! $(gnulib) $(libc.a) ! endif ! ifndef gnulib ! gnulib := -lgcc endif ifndef LD diff -rcN glibc-1.04/Makefile glibc-1.05/Makefile *** glibc-1.04/Makefile Wed Sep 2 22:42:01 1992 --- glibc-1.05/Makefile Thu Sep 24 16:56:44 1992 *************** *** 58,64 **** tests subdir_lint.out \ subdir_echo-headers subdir_echo-distinfo subdir_install ! headers := features.h errno.h errnos.h limits.h $(stddef.h) $(stdarg.h) echo-headers: subdir_echo-headers --- 58,65 ---- tests subdir_lint.out \ subdir_echo-headers subdir_echo-distinfo subdir_install ! headers := features.h errno.h sys/errno.h errnos.h limits.h \ ! $(stddef.h) $(stdarg.h) echo-headers: subdir_echo-headers *************** *** 158,162 **** export dont_distribute := $(dont_distribute) .PHONY: dist ! dist: Make-dist $(MAKE) -f $< no_deps=t $(Make-dist-args) --- 159,163 ---- export dont_distribute := $(dont_distribute) .PHONY: dist ! dist: Make-dist $(distribute) $(MAKE) -f $< no_deps=t $(Make-dist-args) diff -rcN glibc-1.04/Makerules glibc-1.05/Makerules *** glibc-1.04/Makerules Wed Sep 2 19:02:50 1992 --- glibc-1.05/Makerules Tue Sep 22 19:10:55 1992 *************** *** 56,66 **** # Finish this someday.... endif ! ifdef objdir ! +sysdir_pfx = $(objpfx) ! else ! +sysdir_pfx = $(..) ! endif # Right now, however, we do it with shell scripts and lots of strangeness. sysdep_dir := $(..)sysdeps --- 56,62 ---- # Finish this someday.... endif ! +sysdir_pfx = $(common-objpfx) # Right now, however, we do it with shell scripts and lots of strangeness. sysdep_dir := $(..)sysdeps *************** *** 74,80 **** endif $(+sysdir_pfx)sysdirs: $(+sysdir_pfx)Sysnames $(..)find-sysdirs (echo define sysdirs; \ ! $(dir $(word 2,$^))$(notdir $(word 2,$^)) < $<; \ echo endef) > $@ $(+sysdir_pfx)Sysnames: @(echo The GNU C Library has not been configured! ;\ --- 70,77 ---- endif $(+sysdir_pfx)sysdirs: $(+sysdir_pfx)Sysnames $(..)find-sysdirs (echo define sysdirs; \ ! sysdep_dir=$(sysdep_dir) \ ! $(dir $(word 2,$^))$(notdir $(word 2,$^)) < $<; \ echo endef) > $@ $(+sysdir_pfx)Sysnames: @(echo The GNU C Library has not been configured! ;\ *************** *** 183,194 **** ifeq ($(notdir $(firstword $(CC))),gcc) # GCC can grok options after the file name. ! compile.S = $(CC) $< -c $(CPPFLAGS) compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS) else ! compile.S = $(COMPILE.S) $< compile.c = $(COMPILE.c) $< endif # This makes all the object files in the parent library archive. --- 180,200 ---- ifeq ($(notdir $(firstword $(CC))),gcc) # GCC can grok options after the file name. ! compile.S = $(CC) $< -c $(CPPFLAGS) $(asm-CPPFLAGS) compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS) else ! compile.S = $(COMPILE.S) $(asm-CPPFLAGS) $< compile.c = $(COMPILE.c) $< endif + + ifndef OUTPUT_OPTION + ifdef objpfx + # We need this for the output to go in the right place. It will default to + # empty if make was configured to work with a cc that can't grok -c and -o + # together. You can't compile the C library with such a compiler. + OUTPUT_OPTION = -o $@ + endif + endif # This makes all the object files in the parent library archive. *************** *** 233,243 **** # Installation. ! # install-lib are installed from the object directory into libdir. ! # install-data are installed as they are into datadir. headers are ! # installed from the object directory header directories into includedir. ! # install-others are absolute path names of files to install; rules to ! # install them are defined elsewhere. do-install = $(INSTALL_DATA) $< $@ --- 239,248 ---- # Installation. ! # install-lib are installed from the object directory into $(libdir). ! # install-data are installed as they are into $(datadir). headers are ! # installed as they are in $(includedir). install-others are absolute path ! # names of files to install; rules to install them are defined elsewhere. do-install = $(INSTALL_DATA) $< $@ *************** *** 263,274 **** endif # headers +install := $(filter-out $(addprefix %/,$(no-install)),$(+install)) .PHONY: install ! install: $(dir $(+install)) $(+install) ! define +make-deps ! $(+mkdep) $(CPPFLAGS) $< | sed 's,$*\.o,$(@:.dep=.o) $@,' > $@ ! endef # N.B.: The order of these two rules is important. $(objpfx)%.dep: %.S $(before-compile) --- 268,285 ---- endif # headers +install := $(filter-out $(addprefix %/,$(no-install)),$(+install)) + +install-dirs := $(dir $(+install)) + # Get two levels of directories so $(datadir)/zoneinfo wins. + +install-dirs := $(+install-dirs) $(filter-out ./,$(dir $(+install-dirs))) + # Sort them so containing dirs are guaranteed to come first. + +install-dirs := $(sort $(+install-dirs)) + .PHONY: install ! install: $(+install-dirs) $(+install) ! S-CPPFLAGS = $(asm-CPPFLAGS) ! +make-deps = $(+mkdep) $(CPPFLAGS) $($(<:$*.%=%)-CPPFLAGS) $< | \ ! sed 's,$*\.o,$(@:.dep=.o) $@,' > $@ # N.B.: The order of these two rules is important. $(objpfx)%.dep: %.S $(before-compile) *************** *** 299,304 **** --- 310,316 ---- .PHONY: check check: tests + .PHONY: TAGS TAGS: $(..)MakeTAGS $(MAKE) -f $< $@ *************** *** 308,314 **** ifdef gpl2lgpl ! ifneq (,$(wildcard /home/gd/gnu/lib/ChangeLog) # Snarf from the master source and frob the copying notice. $(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/% sed -f $^ > $@-tmp --- 320,326 ---- ifdef gpl2lgpl ! ifneq (,$(wildcard /home/gd/gnu/lib/ChangeLog)) # Snarf from the master source and frob the copying notice. $(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/% sed -f $^ > $@-tmp diff -rcN glibc-1.04/NEWS glibc-1.05/NEWS *** glibc-1.04/NEWS Tue Sep 1 18:00:55 1992 --- glibc-1.05/NEWS Tue Sep 15 19:43:45 1992 *************** *** 1,9 **** ! GNU C Library NEWS -- history of user-visible changes. 1 September 1992 Copyright (C) 1992 Free Software Foundation, Inc. See the end for copying conditions. Please send GNU C library bug reports to bug-glibc@prep.ai.mit.edu. Version 1.04 --- 1,23 ---- ! GNU C Library NEWS -- history of user-visible changes. 15 September 1992 Copyright (C) 1992 Free Software Foundation, Inc. See the end for copying conditions. Please send GNU C library bug reports to bug-glibc@prep.ai.mit.edu. + + Version 1.05 + + * The standard location for the file that says what the local timezone is + has changed again. It is now `/usr/local/etc/localtime' (or more + precisely, `${prefix}/etc/localtime') rather than `/etc/localtime'. + + * The distribution no longer contains any files with names longer than 14 + characters. + + * `struct ttyent' has two new flag bits: TTY_TRUSTED and TTY_CONSOLE. + These are set by the new `trusted' and `console' keywords in `/etc/ttys'. + + * New functions `ttyslot' and `syslog' from 4.4 BSD. Version 1.04 diff -rcN glibc-1.04/README glibc-1.05/README *** glibc-1.04/README Wed Sep 2 19:26:41 1992 --- glibc-1.05/README Fri Sep 18 19:44:55 1992 *************** *** 1,4 **** ! This directory contains the version 1.04 test release of the GNU C Library. Many bugs have been fixed since the last release. Some bugs surely remain. --- 1,4 ---- ! This directory contains the version 1.05 test release of the GNU C Library. Many bugs have been fixed since the last release. Some bugs surely remain. *************** *** 15,21 **** of the United States export restriction on DES implementations, we are distributing this code separately from the rest of the C library. There is an extra distribution tar file just for crypt; it is called ! `glibc-1.04-crypt.tar.Z'. You can just unpack the crypt distribution along with the rest of the C library and build; you can also build the library without getting crypt. Users outside the USA can get the crypt distribution via anonymous FTP from ftp.uni-c.dk [129.142.6.74], or another --- 15,21 ---- of the United States export restriction on DES implementations, we are distributing this code separately from the rest of the C library. There is an extra distribution tar file just for crypt; it is called ! `glibc-1.05-crypt.tar.Z'. You can just unpack the crypt distribution along with the rest of the C library and build; you can also build the library without getting crypt. Users outside the USA can get the crypt distribution via anonymous FTP from ftp.uni-c.dk [129.142.6.74], or another *************** *** 39,46 **** The GNU C Library is free software. See the file COPYING.LIB for copying conditions. - - Please note that there are some files in the distribution whose names - exceed 14 characters in length. None of these files are needed to build - the library on System V, where a 14 character limit on the length of file - names is imposed, so this is harmless. --- 39,41 ---- diff -rcN glibc-1.04/configure glibc-1.05/configure *** glibc-1.04/configure Tue Sep 1 16:29:29 1992 --- glibc-1.05/configure Mon Sep 21 22:42:40 1992 *************** *** 41,47 **** # --nfp, --with-gnu-ld, and --with-gnu-as are meaningful. nfp= gnu_ld= ! gas= version= release= prefix= --- 41,47 ---- # --nfp, --with-gnu-ld, and --with-gnu-as are meaningful. nfp= gnu_ld= ! gnu_as= version= release= prefix= *************** *** 72,78 **** ;; -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a) ! gas=--with-gnu-as ;; -nfp | --nfp | --nf | --n) --- 72,78 ---- ;; -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a) ! gnu_as=--with-gnu-as ;; -nfp | --nfp | --nf | --n) diff -rcN glibc-1.04/dirent/scandir.c glibc-1.05/dirent/scandir.c *** glibc-1.04/dirent/scandir.c Fri May 15 19:37:44 1992 --- glibc-1.05/dirent/scandir.c Sat Sep 12 12:08:24 1992 *************** *** 61,66 **** --- 61,67 ---- errno = ENOMEM; return -1; } + v = new; } v[i] = (struct dirent *) malloc (sizeof (**v)); diff -rcN glibc-1.04/hurd/Makefile glibc-1.05/hurd/Makefile *** glibc-1.04/hurd/Makefile Tue Aug 18 20:04:35 1992 --- glibc-1.05/hurd/Makefile Tue Sep 15 15:23:23 1992 *************** *** 32,41 **** __setauth setauth hurdports \ fchroot \ hurdauth hurdid hurdpath hurdpid hurdsig hurdsock hurdfrob \ ! dtable __getdport getdport openport setdtablesize \ ! msgportdemux _hurd_start_sigthread \ getuids getumask \ ! _hurd_dead_recv \ fopenport __fopenport \ $(interface-routines) aux := hurdsyms --- 32,41 ---- __setauth setauth hurdports \ fchroot \ hurdauth hurdid hurdpath hurdpid hurdsig hurdsock hurdfrob \ ! dtable __getdport getdport openport setdtsz \ ! msgportdemux startsig \ getuids getumask \ ! dead_recv \ fopenport __fopenport \ $(interface-routines) aux := hurdsyms diff -rcN glibc-1.04/hurd/_hurd_dead_recv.c glibc-1.05/hurd/_hurd_dead_recv.c *** glibc-1.04/hurd/_hurd_dead_recv.c Sat Feb 8 03:42:24 1992 --- glibc-1.05/hurd/_hurd_dead_recv.c *************** *** 1,30 **** - /* Copyright (C) 1992 Free Software 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 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, - Cambridge, MA 02139, USA. */ - - #include - - /* Return a receive right to which there are no send rights in use. */ - mach_port_t - _hurd_dead_recv (void) - { - static mach_port_t port = MACH_PORT_NULL; - if (port == MACH_PORT_NULL) - __mach_port_allocate (__mach_task_self (), - MACH_PORT_RIGHT_RECEIVE, &port); - return port; - } --- 0 ---- diff -rcN glibc-1.04/hurd/dead_recv.c glibc-1.05/hurd/dead_recv.c *** glibc-1.04/hurd/dead_recv.c --- glibc-1.05/hurd/dead_recv.c Sat Feb 8 03:42:24 1992 *************** *** 0 **** --- 1,30 ---- + /* Copyright (C) 1992 Free Software 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 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, + Cambridge, MA 02139, USA. */ + + #include + + /* Return a receive right to which there are no send rights in use. */ + mach_port_t + _hurd_dead_recv (void) + { + static mach_port_t port = MACH_PORT_NULL; + if (port == MACH_PORT_NULL) + __mach_port_allocate (__mach_task_self (), + MACH_PORT_RIGHT_RECEIVE, &port); + return port; + } diff -rcN glibc-1.04/hurd/hurd.h glibc-1.05/hurd/hurd.h *** glibc-1.04/hurd/hurd.h Wed Jul 1 00:15:41 1992 --- glibc-1.05/hurd/hurd.h Wed Sep 16 17:18:06 1992 *************** *** 38,44 **** With the lock held, a user extracts PORT, and sets USER_DEALLOC to point to a word in his local storage. PORT can then safely be used. When PORT is no longer needed, with the lock held, the user examines ! USER_DEALLOC. If it is the same address that user stored there, it extracts *USER_DEALLOC, clears USER_DEALLOC to NULL, and releases the lock. If *USER_DEALLOC is set, the user deallocates the port he used. */ struct _hurd_port --- 38,44 ---- With the lock held, a user extracts PORT, and sets USER_DEALLOC to point to a word in his local storage. PORT can then safely be used. When PORT is no longer needed, with the lock held, the user examines ! USER_DEALLOC. If it is the same address that user stored there, he extracts *USER_DEALLOC, clears USER_DEALLOC to NULL, and releases the lock. If *USER_DEALLOC is set, the user deallocates the port he used. */ struct _hurd_port *************** *** 381,386 **** --- 381,387 ---- int suspended; /* If nonzero, sig_post signals `arrived'. */ struct condition arrived; + #if 0 int vforked; /* Nonzero if this thread is a vfork child. */ struct { *************** *** 393,403 **** struct _hurd_dtable *dtable; jmp_buf continuation; } *vfork_saved; /* Not locked. Used only by this thread, or by signal thread with this thread suspended. */ ! mach_port_t intr_port; /* Port an interruptible RPC was sent on. */ ! int intr_restart; /* If nonzero, restart interrupted RPC. */ }; /* Linked list of states of all threads whose state has been inquired about. */ --- 394,405 ---- struct _hurd_dtable *dtable; jmp_buf continuation; } *vfork_saved; + #endif /* Not locked. Used only by this thread, or by signal thread with this thread suspended. */ ! volatile mach_port_t intr_port; /* Port interruptible RPC was sent on. */ ! volatile int intr_restart; /* If nonzero, restart interrupted RPC. */ }; /* Linked list of states of all threads whose state has been inquired about. */ *************** *** 425,431 **** The args in CALL should be constant or local variable refs. They may be evaluated many times, and must not change. PORT must not be deallocated before this RPC is finished. */ ! #define _HURD_EINTR_RPC(port, call) \ ({ error_t __err; struct _hurd_sigstate *__ss --- 427,433 ---- The args in CALL should be constant or local variable refs. They may be evaluated many times, and must not change. PORT must not be deallocated before this RPC is finished. */ ! #define HURD_EINTR_RPC(port, call) \ ({ error_t __err; struct _hurd_sigstate *__ss *************** *** 436,442 **** a signal, in which case we want to restart our call. */ __ss->intr_restart = 1; /* This one needs to be last. A signal can arrive before here, ! and if intr_port were set before intr_restart are initialized, the signal thread would get confused. */ __ss->intr_port = (port); /* A signal may arrive here, after intr_port is set, --- 438,444 ---- a signal, in which case we want to restart our call. */ __ss->intr_restart = 1; /* This one needs to be last. A signal can arrive before here, ! and if intr_port were set before intr_restart is initialized, the signal thread would get confused. */ __ss->intr_port = (port); /* A signal may arrive here, after intr_port is set, *************** *** 444,450 **** interruptible RPC, and clobber intr_port; then it would not be set properly when we actually did send the RPC, and a later signal wouldn't interrupt that RPC. So, _hurd_run_sighandler saves ! intr_port in the sigcontext, and sigreturn restores them. */ __do_call: switch (__err = (call)) { --- 446,452 ---- interruptible RPC, and clobber intr_port; then it would not be set properly when we actually did send the RPC, and a later signal wouldn't interrupt that RPC. So, _hurd_run_sighandler saves ! intr_port in the sigcontext, and sigreturn restores it. */ __do_call: switch (__err = (call)) { *************** *** 453,461 **** if (__ss->intr_restart) /* Restart the interrupted call. */ goto __do_call; ! /* Return EINTR. */ ! __err = EINTR; ! break; case MACH_RCV_PORT_DIED: /* Server didn't respond to interrupt_operation, so the signal thread destroyed the reply port. */ --- 455,461 ---- if (__ss->intr_restart) /* Restart the interrupted call. */ goto __do_call; ! /* FALLTHROUGH */ case MACH_RCV_PORT_DIED: /* Server didn't respond to interrupt_operation, so the signal thread destroyed the reply port. */ *************** *** 498,503 **** --- 498,507 ---- /* Open a file descriptor on a port. */ extern int openport (io_t port); + + /* Inform the proc server we have exitted with STATUS, and kill the + task thoroughly. This function never returns, no matter what. */ + extern volatile void _hurd_exit (int status); #endif /* hurd.h */ diff -rcN glibc-1.04/hurd/hurdsig.c glibc-1.05/hurd/hurdsig.c *** glibc-1.04/hurd/hurdsig.c Mon May 11 15:10:26 1992 --- glibc-1.05/hurd/hurdsig.c Wed Sep 16 17:15:13 1992 *************** *** 76,82 **** /* User doesn't want a core. */ return 0; ! name = getenv ("CORESERVER"); if (name != NULL) coreserver = __path_lookup (name, 0, 0); else --- 76,82 ---- /* User doesn't want a core. */ return 0; ! name = getenv ("CORESERVER"); /* XXX don't lose if environ scrod */ if (name != NULL) coreserver = __path_lookup (name, 0, 0); else *************** *** 87,93 **** if (coreserver == MACH_PORT_NULL) return 0; ! name = getenv ("COREFILE"); if (name != NULL) file = __path_lookup (name, FS_LOOKUP_WRITE|FS_LOOKUP_CREATE, 0666 & ~_hurd_umask); --- 87,93 ---- if (coreserver == MACH_PORT_NULL) return 0; ! name = getenv ("COREFILE"); /* XXX ditto */ if (name != NULL) file = __path_lookup (name, FS_LOOKUP_WRITE|FS_LOOKUP_CREATE, 0666 & ~_hurd_umask); *************** *** 105,111 **** __mach_task_self (), file, signo, sigcode, ! getenv ("GNUTARGET")); __mach_port_deallocate (__mach_task_self (), coreserver); if (!err && _hurd_core_limit != RLIM_INFINITY) { --- 105,111 ---- __mach_task_self (), file, signo, sigcode, ! getenv ("GNUTARGET")); /* XXX ditto */ __mach_port_deallocate (__mach_task_self (), coreserver); if (!err && _hurd_core_limit != RLIM_INFINITY) { *************** *** 337,344 **** (act == core && write_corefile (signo, sigcode) ? WCOREDUMP : 0))) })); - __task_terminate (__mach_task_self ()); - return; /* Yeah, right. */ case handle: __thread_suspend (ss->thread); --- 337,342 ---- diff -rcN glibc-1.04/hurd/intr_rpc.awk glibc-1.05/hurd/intr_rpc.awk *** glibc-1.04/hurd/intr_rpc.awk Tue Mar 24 21:17:49 1992 --- glibc-1.05/hurd/intr_rpc.awk Wed Sep 16 17:03:58 1992 *************** *** 22,28 **** /^}/ \ { print "{"; ! print " return _HURD_EINTR_RPC (" firstarg ", " rpc args ");"; print "}"; echo = 1; } --- 22,28 ---- /^}/ \ { print "{"; ! print " return HURD_EINTR_RPC (" firstarg ", " rpc args ");"; print "}"; echo = 1; } diff -rcN glibc-1.04/hurd/setdtablesize.c glibc-1.05/hurd/setdtablesize.c *** glibc-1.04/hurd/setdtablesize.c Sun Mar 22 00:39:57 1992 --- glibc-1.05/hurd/setdtablesize.c *************** *** 1,86 **** - /* Copyright (C) 1991, 1992 Free Software 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 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, - Cambridge, MA 02139, USA. */ - - #include - - /* Change the size of the descriptor table. - You cannot shrink the table if any of the descriptors - which would be removed are being used. */ - - int - setdtablesize (size_t size) - { - int i; - struct _hurd_fd *table; - - __mutex_lock (&_hurd_dtable_lock); - - /* Check that no descriptors which are in use are going to disappear. */ - for (i = size; i < _hurd_dtable.size; ++i) - { - struct _hurd_fd *const d = &_hurd_dtable.d[i]; - - __spin_lock (&d->port.lock); - if (d->port.port != MACH_PORT_NULL) - { - __spin_unlock (&d->port.lock); - __mutex_unlock (&_hurd_dtable_lock); - errno = EBUSY; - return -1; - } - } - - /* Resize the table. */ - - if (_hurd_dtable_user_dealloc == NULL) - /* Noone is using the table. We can relocate it. */ - table = realloc (_hurd_dtable.d, size * sizeof (*table)); - else - /* Someone else is using the table. - We must make a new copy, and let them free the old one. */ - table = malloc (size * sizeof (*table)); - - if (table == NULL) - { - __mutex_unlock (&_hurd_dtable_lock); - return -1; - } - - if (_hurd_dtable_user_dealloc != NULL) - { - *_hurd_dtable_user_dealloc = 1; - _hurd_dtable_user_dealloc = NULL; - - memcpy (table, _hurd_dtable.d, _hurd_dtable.size * sizeof (table[0])); - } - - /* If the table grew, initialize the new slots. */ - for (i = _hurd_dtable.size; i < size; ++i) - { - table[i].flags = 0; - _hurd_port_init (&table[i].port, MACH_PORT_NULL); - _hurd_port_init (&table[i].ctty, MACH_PORT_NULL); - } - - _hurd_dtable.size = size; - _hurd_dtable.d = table; - - __mutex_unlock (&_hurd_dtable_lock); - - return 0; - } --- 0 ---- diff -rcN glibc-1.04/hurd/setdtsz.c glibc-1.05/hurd/setdtsz.c *** glibc-1.04/hurd/setdtsz.c --- glibc-1.05/hurd/setdtsz.c Sun Mar 22 00:39:57 1992 *************** *** 0 **** --- 1,86 ---- + /* Copyright (C) 1991, 1992 Free Software 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 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, + Cambridge, MA 02139, USA. */ + + #include + + /* Change the size of the descriptor table. + You cannot shrink the table if any of the descriptors + which would be removed are being used. */ + + int + setdtablesize (size_t size) + { + int i; + struct _hurd_fd *table; + + __mutex_lock (&_hurd_dtable_lock); + + /* Check that no descriptors which are in use are going to disappear. */ + for (i = size; i < _hurd_dtable.size; ++i) + { + struct _hurd_fd *const d = &_hurd_dtable.d[i]; + + __spin_lock (&d->port.lock); + if (d->port.port != MACH_PORT_NULL) + { + __spin_unlock (&d->port.lock); + __mutex_unlock (&_hurd_dtable_lock); + errno = EBUSY; + return -1; + } + } + + /* Resize the table. */ + + if (_hurd_dtable_user_dealloc == NULL) + /* Noone is using the table. We can relocate it. */ + table = realloc (_hurd_dtable.d, size * sizeof (*table)); + else + /* Someone else is using the table. + We must make a new copy, and let them free the old one. */ + table = malloc (size * sizeof (*table)); + + if (table == NULL) + { + __mutex_unlock (&_hurd_dtable_lock); + return -1; + } + + if (_hurd_dtable_user_dealloc != NULL) + { + *_hurd_dtable_user_dealloc = 1; + _hurd_dtable_user_dealloc = NULL; + + memcpy (table, _hurd_dtable.d, _hurd_dtable.size * sizeof (table[0])); + } + + /* If the table grew, initialize the new slots. */ + for (i = _hurd_dtable.size; i < size; ++i) + { + table[i].flags = 0; + _hurd_port_init (&table[i].port, MACH_PORT_NULL); + _hurd_port_init (&table[i].ctty, MACH_PORT_NULL); + } + + _hurd_dtable.size = size; + _hurd_dtable.d = table; + + __mutex_unlock (&_hurd_dtable_lock); + + return 0; + } diff -rcN glibc-1.04/limits.h glibc-1.05/limits.h *** glibc-1.04/limits.h Tue Apr 21 02:11:13 1992 --- glibc-1.05/limits.h Thu Sep 17 17:33:48 1992 *************** *** 22,27 **** --- 22,28 ---- #ifndef _LIMITS_H + #define _LIMITS_H 1 #include #ifdef __USE_POSIX *************** *** 36,42 **** #if __GNUC__ >= 2 ! /* Get GCC's limits.h. It tests and defines _LIMITS_H. */ #include_next #else /* Not GCC 2. */ --- 37,44 ---- #if __GNUC__ >= 2 ! /* Get the compiler's limits.h, which defines all the ANSI constants. */ ! #define _LIBC_LIMITS_H /* This tells it not to look for another. */ #include_next #else /* Not GCC 2. */ *************** *** 43,50 **** /* We don't have #include_next. Define ANSI for standard 32-bit words. */ - - #define _LIMITS_H 1 /* These assume 8-bit `char's, 16-bit `short int's, and 32-bit `int's and `long int's. */ --- 45,50 ---- diff -rcN glibc-1.04/mach/Makefile glibc-1.05/mach/Makefile *** glibc-1.04/mach/Makefile Fri Apr 10 13:10:05 1992 --- glibc-1.05/mach/Makefile Tue Sep 15 19:33:31 1992 *************** *** 18,24 **** subdir := mach ! distribute = Machrules interface.awk mach-syscalls.awk # $(interfaces:%=%.defs) interface-header-prefix = mach/ headers = mach_init.h \ --- 18,24 ---- subdir := mach ! distribute = Machrules interface.awk syscalls.awk # $(interfaces:%=%.defs) interface-header-prefix = mach/ headers = mach_init.h \ *************** *** 46,55 **** endif routines = $(interface-routines) \ ! mach_init mach_init_syms \ mig_strncpy mig_support msg \ ! mach_msg_destroy mach_msg_server mach_msg_server_timeout \ ! __mach_msg_destroy __mach_msg_server \ devstream tests := hello --- 46,55 ---- endif routines = $(interface-routines) \ ! mach_init vm_page_size \ mig_strncpy mig_support msg \ ! msg_destroy msg_server msg_server_t \ ! __msg_destroy __msg_server \ devstream tests := hello *************** *** 61,67 **** # Define mach-syscalls and sysno-*. #include mach-syscalls.mk dont_distribute := syscall_sw.h ! mach-syscalls.mk: syscall_sw.h mach-syscalls.awk sed -n -e '/STANDALONE/,$$d' \ -e 's/^kernel_trap(\(.*\),\([-0-9]*\),[0-9]*)$$/\1 \2/p' \ < $< | awk -f $(word 2,$^) > $@-new --- 61,67 ---- # Define mach-syscalls and sysno-*. #include mach-syscalls.mk dont_distribute := syscall_sw.h ! mach-syscalls.mk: syscall_sw.h syscalls.awk sed -n -e '/STANDALONE/,$$d' \ -e 's/^kernel_trap(\(.*\),\([-0-9]*\),[0-9]*)$$/\1 \2/p' \ < $< | awk -f $(word 2,$^) > $@-new diff -rcN glibc-1.04/mach/__mach_msg_destroy.c glibc-1.05/mach/__mach_msg_destroy.c *** glibc-1.04/mach/__mach_msg_destroy.c Wed Oct 23 08:49:45 1991 --- glibc-1.05/mach/__mach_msg_destroy.c *************** *** 1,147 **** - /* - * Mach Operating System - * Copyright (c) 1991,1990 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ - /* - * HISTORY - * $Log: mach_msg_destroy.c,v $ - * Revision 2.4 91/05/14 17:53:15 mrt - * Correcting copyright - * - * Revision 2.3 91/02/14 14:17:43 mrt - * Added new Mach copyright - * [91/02/13 12:44:15 mrt] - * - * Revision 2.2 90/08/06 17:24:22 rpd - * Created. - * - */ - - #include - #include - #include - - static void mach_msg_destroy_port(); - static void mach_msg_destroy_memory(); - - /* - * Routine: mach_msg_destroy - * Purpose: - * Deallocates all port rights and out-of-line memory - * found in a received message. - */ - - void - __mach_msg_destroy(msg) - mach_msg_header_t *msg; - { - mach_msg_bits_t mbits = msg->msgh_bits; - - /* - * The msgh_local_port field doesn't hold a port right. - * The receive operation consumes the destination port right. - */ - - mach_msg_destroy_port(msg->msgh_remote_port, MACH_MSGH_BITS_REMOTE(mbits)); - - if (mbits & MACH_MSGH_BITS_COMPLEX) { - vm_offset_t saddr; - vm_offset_t eaddr; - - saddr = (vm_offset_t) (msg + 1); - eaddr = (vm_offset_t) msg + msg->msgh_size; - - while (saddr < eaddr) { - mach_msg_type_long_t *type; - mach_msg_type_name_t name; - mach_msg_type_size_t size; - mach_msg_type_number_t number; - boolean_t is_inline; - vm_size_t length; - vm_offset_t addr; - - type = (mach_msg_type_long_t *) saddr; - is_inline = type->msgtl_header.msgt_inline; - if (type->msgtl_header.msgt_longform) { - name = type->msgtl_name; - size = type->msgtl_size; - number = type->msgtl_number; - saddr += sizeof(mach_msg_type_long_t); - } else { - name = type->msgtl_header.msgt_name; - size = type->msgtl_header.msgt_size; - number = type->msgtl_header.msgt_number; - saddr += sizeof(mach_msg_type_t); - } - - /* calculate length of data in bytes, rounding up */ - length = ((((number * size) + 7) >> 3) + 3) &~ 3; - - addr = is_inline ? saddr : * (vm_offset_t *) saddr; - - if (MACH_MSG_TYPE_PORT_ANY(name)) { - mach_port_t *ports = (mach_port_t *) addr; - mach_msg_type_number_t i; - - for (i = 0; i < number; i++) - mach_msg_destroy_port(*ports++, name); - } - - if (is_inline) { - /* inline data sizes round up to int boundaries */ - saddr += length; - } else { - mach_msg_destroy_memory(addr, length); - saddr += sizeof(vm_offset_t); - } - } - } - } - - static void - mach_msg_destroy_port(port, type) - mach_port_t port; - mach_msg_type_name_t type; - { - if (MACH_PORT_VALID(port)) switch (type) { - case MACH_MSG_TYPE_PORT_SEND: - case MACH_MSG_TYPE_PORT_SEND_ONCE: - (void) __mach_port_deallocate(__mach_task_self(), port); - break; - - case MACH_MSG_TYPE_PORT_RECEIVE: - (void) __mach_port_mod_refs(__mach_task_self(), port, - MACH_PORT_RIGHT_RECEIVE, -1); - break; - } - } - - static void - mach_msg_destroy_memory(addr, size) - vm_offset_t addr; - vm_size_t size; - { - if (size > 0) - (void) __vm_deallocate(__mach_task_self(), addr, size); - } --- 0 ---- diff -rcN glibc-1.04/mach/__mach_msg_server.c glibc-1.05/mach/__mach_msg_server.c *** glibc-1.04/mach/__mach_msg_server.c Fri Oct 25 19:19:03 1991 --- glibc-1.05/mach/__mach_msg_server.c *************** *** 1,134 **** - /* - * Mach Operating System - * Copyright (c) 1991,1990 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ - /* - * HISTORY - * $Log: mach_msg_server.c,v $ - * Revision 2.4 91/05/14 17:53:22 mrt - * Correcting copyright - * - * Revision 2.3 91/02/14 14:17:47 mrt - * Added new Mach copyright - * [91/02/13 12:44:20 mrt] - * - * Revision 2.2 90/08/06 17:23:58 rpd - * Created. - * - */ - - #include - #include - #include - #include - #include - - /* - * Routine: mach_msg_server - * Purpose: - * A simple generic server function. - */ - - mach_msg_return_t - __mach_msg_server_timeout(demux, max_size, rcv_name, option, timeout) - boolean_t (*demux)(); - mach_msg_size_t max_size; - mach_port_t rcv_name; - mach_msg_option_t option; - mach_msg_timeout_t timeout; - { - register mig_reply_header_t *bufRequest, *bufReply, *bufTemp; - register mach_msg_return_t mr; - - bufRequest = (mig_reply_header_t *) malloc(max_size); - if (bufRequest == 0) - return KERN_RESOURCE_SHORTAGE; - bufReply = (mig_reply_header_t *) malloc(max_size); - if (bufReply == 0) - return KERN_RESOURCE_SHORTAGE; - - for (;;) { - get_request: - mr = __mach_msg(&bufRequest->Head, MACH_RCV_MSG|option, - 0, max_size, rcv_name, - timeout, MACH_PORT_NULL); - while (mr == MACH_MSG_SUCCESS) { - /* we have a request message */ - - (void) (*demux)(&bufRequest->Head, &bufReply->Head); - - if (bufReply->RetCode != KERN_SUCCESS) { - if (bufReply->RetCode == MIG_NO_REPLY) - goto get_request; - - /* don't destroy the reply port right, - so we can send an error message */ - bufRequest->Head.msgh_remote_port = MACH_PORT_NULL; - __mach_msg_destroy(&bufRequest->Head); - } - - if (bufReply->Head.msgh_remote_port == MACH_PORT_NULL) { - /* no reply port, so destroy the reply */ - if (bufReply->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) - __mach_msg_destroy(&bufReply->Head); - - goto get_request; - } - - /* send reply and get next request */ - - bufTemp = bufRequest; - bufRequest = bufReply; - bufReply = bufTemp; - - mr = __mach_msg(&bufRequest->Head, - MACH_SEND_MSG|MACH_RCV_MSG|option, - bufRequest->Head.msgh_size, max_size, rcv_name, - timeout, MACH_PORT_NULL); - } - - /* a message error occurred */ - - if (mr != MACH_SEND_INVALID_DEST) - break; - - /* the reply can't be delivered, so destroy it */ - __mach_msg_destroy(&bufRequest->Head); - } - - free((char *) bufRequest); - free((char *) bufReply); - return mr; - } - - - mach_msg_return_t - __mach_msg_server (demux, max_size, rcv_name) - boolean_t (*demux) (); - mach_msg_size_t max_size; - mach_port_t rcv_name; - { - return __mach_msg_server_timeout (demux, max_size, rcv_name, - option, MACH_MSG_TIMEOUT_NONE); - } --- 0 ---- diff -rcN glibc-1.04/mach/__msg_destroy.c glibc-1.05/mach/__msg_destroy.c *** glibc-1.04/mach/__msg_destroy.c --- glibc-1.05/mach/__msg_destroy.c Wed Oct 23 08:49:45 1991 *************** *** 0 **** --- 1,147 ---- + /* + * Mach Operating System + * Copyright (c) 1991,1990 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + /* + * HISTORY + * $Log: mach_msg_destroy.c,v $ + * Revision 2.4 91/05/14 17:53:15 mrt + * Correcting copyright + * + * Revision 2.3 91/02/14 14:17:43 mrt + * Added new Mach copyright + * [91/02/13 12:44:15 mrt] + * + * Revision 2.2 90/08/06 17:24:22 rpd + * Created. + * + */ + + #include + #include + #include + + static void mach_msg_destroy_port(); + static void mach_msg_destroy_memory(); + + /* + * Routine: mach_msg_destroy + * Purpose: + * Deallocates all port rights and out-of-line memory + * found in a received message. + */ + + void + __mach_msg_destroy(msg) + mach_msg_header_t *msg; + { + mach_msg_bits_t mbits = msg->msgh_bits; + + /* + * The msgh_local_port field doesn't hold a port right. + * The receive operation consumes the destination port right. + */ + + mach_msg_destroy_port(msg->msgh_remote_port, MACH_MSGH_BITS_REMOTE(mbits)); + + if (mbits & MACH_MSGH_BITS_COMPLEX) { + vm_offset_t saddr; + vm_offset_t eaddr; + + saddr = (vm_offset_t) (msg + 1); + eaddr = (vm_offset_t) msg + msg->msgh_size; + + while (saddr < eaddr) { + mach_msg_type_long_t *type; + mach_msg_type_name_t name; + mach_msg_type_size_t size; + mach_msg_type_number_t number; + boolean_t is_inline; + vm_size_t length; + vm_offset_t addr; + + type = (mach_msg_type_long_t *) saddr; + is_inline = type->msgtl_header.msgt_inline; + if (type->msgtl_header.msgt_longform) { + name = type->msgtl_name; + size = type->msgtl_size; + number = type->msgtl_number; + saddr += sizeof(mach_msg_type_long_t); + } else { + name = type->msgtl_header.msgt_name; + size = type->msgtl_header.msgt_size; + number = type->msgtl_header.msgt_number; + saddr += sizeof(mach_msg_type_t); + } + + /* calculate length of data in bytes, rounding up */ + length = ((((number * size) + 7) >> 3) + 3) &~ 3; + + addr = is_inline ? saddr : * (vm_offset_t *) saddr; + + if (MACH_MSG_TYPE_PORT_ANY(name)) { + mach_port_t *ports = (mach_port_t *) addr; + mach_msg_type_number_t i; + + for (i = 0; i < number; i++) + mach_msg_destroy_port(*ports++, name); + } + + if (is_inline) { + /* inline data sizes round up to int boundaries */ + saddr += length; + } else { + mach_msg_destroy_memory(addr, length); + saddr += sizeof(vm_offset_t); + } + } + } + } + + static void + mach_msg_destroy_port(port, type) + mach_port_t port; + mach_msg_type_name_t type; + { + if (MACH_PORT_VALID(port)) switch (type) { + case MACH_MSG_TYPE_PORT_SEND: + case MACH_MSG_TYPE_PORT_SEND_ONCE: + (void) __mach_port_deallocate(__mach_task_self(), port); + break; + + case MACH_MSG_TYPE_PORT_RECEIVE: + (void) __mach_port_mod_refs(__mach_task_self(), port, + MACH_PORT_RIGHT_RECEIVE, -1); + break; + } + } + + static void + mach_msg_destroy_memory(addr, size) + vm_offset_t addr; + vm_size_t size; + { + if (size > 0) + (void) __vm_deallocate(__mach_task_self(), addr, size); + } diff -rcN glibc-1.04/mach/__msg_server.c glibc-1.05/mach/__msg_server.c *** glibc-1.04/mach/__msg_server.c --- glibc-1.05/mach/__msg_server.c Fri Oct 25 19:19:03 1991 *************** *** 0 **** --- 1,134 ---- + /* + * Mach Operating System + * Copyright (c) 1991,1990 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + /* + * HISTORY + * $Log: mach_msg_server.c,v $ + * Revision 2.4 91/05/14 17:53:22 mrt + * Correcting copyright + * + * Revision 2.3 91/02/14 14:17:47 mrt + * Added new Mach copyright + * [91/02/13 12:44:20 mrt] + * + * Revision 2.2 90/08/06 17:23:58 rpd + * Created. + * + */ + + #include + #include + #include + #include + #include + + /* + * Routine: mach_msg_server + * Purpose: + * A simple generic server function. + */ + + mach_msg_return_t + __mach_msg_server_timeout(demux, max_size, rcv_name, option, timeout) + boolean_t (*demux)(); + mach_msg_size_t max_size; + mach_port_t rcv_name; + mach_msg_option_t option; + mach_msg_timeout_t timeout; + { + register mig_reply_header_t *bufRequest, *bufReply, *bufTemp; + register mach_msg_return_t mr; + + bufRequest = (mig_reply_header_t *) malloc(max_size); + if (bufRequest == 0) + return KERN_RESOURCE_SHORTAGE; + bufReply = (mig_reply_header_t *) malloc(max_size); + if (bufReply == 0) + return KERN_RESOURCE_SHORTAGE; + + for (;;) { + get_request: + mr = __mach_msg(&bufRequest->Head, MACH_RCV_MSG|option, + 0, max_size, rcv_name, + timeout, MACH_PORT_NULL); + while (mr == MACH_MSG_SUCCESS) { + /* we have a request message */ + + (void) (*demux)(&bufRequest->Head, &bufReply->Head); + + if (bufReply->RetCode != KERN_SUCCESS) { + if (bufReply->RetCode == MIG_NO_REPLY) + goto get_request; + + /* don't destroy the reply port right, + so we can send an error message */ + bufRequest->Head.msgh_remote_port = MACH_PORT_NULL; + __mach_msg_destroy(&bufRequest->Head); + } + + if (bufReply->Head.msgh_remote_port == MACH_PORT_NULL) { + /* no reply port, so destroy the reply */ + if (bufReply->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) + __mach_msg_destroy(&bufReply->Head); + + goto get_request; + } + + /* send reply and get next request */ + + bufTemp = bufRequest; + bufRequest = bufReply; + bufReply = bufTemp; + + mr = __mach_msg(&bufRequest->Head, + MACH_SEND_MSG|MACH_RCV_MSG|option, + bufRequest->Head.msgh_size, max_size, rcv_name, + timeout, MACH_PORT_NULL); + } + + /* a message error occurred */ + + if (mr != MACH_SEND_INVALID_DEST) + break; + + /* the reply can't be delivered, so destroy it */ + __mach_msg_destroy(&bufRequest->Head); + } + + free((char *) bufRequest); + free((char *) bufReply); + return mr; + } + + + mach_msg_return_t + __mach_msg_server (demux, max_size, rcv_name) + boolean_t (*demux) (); + mach_msg_size_t max_size; + mach_port_t rcv_name; + { + return __mach_msg_server_timeout (demux, max_size, rcv_name, + option, MACH_MSG_TIMEOUT_NONE); + } diff -rcN glibc-1.04/mach/devstream.c glibc-1.05/mach/devstream.c *** glibc-1.04/mach/devstream.c Mon Jul 6 19:54:10 1992 --- glibc-1.05/mach/devstream.c Thu Sep 10 18:16:36 1992 *************** *** 22,34 **** #include #include #include static int input (FILE *f) { ! error_t err; char *buffer; ! size_t to_read; char c; if (f->__buffer == NULL) --- 22,36 ---- #include #include #include + #include + #include static int input (FILE *f) { ! kern_return_t err; char *buffer; ! size_t to_read, nread; char c; if (f->__buffer == NULL) *************** *** 44,51 **** f->__eof = 0; ! if (err = device_read_inband ((device_t) cookie, 0, f->__target, to_read, ! buffer, &nread)) { f->__error = 1; f->__bufp = f->__get_limit = f->__put_limit = f->__buffer; --- 46,53 ---- f->__eof = 0; ! if (err = device_read_inband ((device_t) f->__cookie, 0, f->__target, ! to_read, buffer, &nread)) { f->__error = 1; f->__bufp = f->__get_limit = f->__put_limit = f->__buffer; *************** *** 59,72 **** f->__get_limit = f->__buffer + nread; f->__bufp = f->__buffer; f->__put_limit = f->__buffer + (f->__mode.__write ? f->__bufsize : 0); ! return (unsigned char *) *f->__bufp++; } static void output (FILE *f, int c) { ! error_t err; size_t to_write; char *p; if (f->__buffer == NULL) --- 61,75 ---- f->__get_limit = f->__buffer + nread; f->__bufp = f->__buffer; f->__put_limit = f->__buffer + (f->__mode.__write ? f->__bufsize : 0); ! return (unsigned char) *f->__bufp++; } static void output (FILE *f, int c) { ! kern_return_t err; size_t to_write; + int wrote; char *p; if (f->__buffer == NULL) *************** *** 74,80 **** if (c != EOF) { char cc = (unsigned char) c; - int wrote; if (cc == '\n') cc = '\r'; if ((err = device_write_inband ((device_t) f->__cookie, 0, --- 77,82 ---- *************** *** 116,122 **** p = f->__buffer; while (to_write > 0) { - int wrote; if (err = device_write_inband ((device_t) f->__cookie, 0, f->__target, p, to_write, &wrote)) { --- 118,123 ---- *************** *** 154,160 **** FILE * mach_open_devstream (device_t dev, const char *mode) { ! FILE *stream = fopencookie (dev, mode, __default_io_functions); if (stream == NULL) return NULL; --- 155,161 ---- FILE * mach_open_devstream (device_t dev, const char *mode) { ! FILE *stream = fopencookie ((void *) dev, mode, __default_io_functions); if (stream == NULL) return NULL; *************** *** 163,167 **** stream->__io_funcs.__close = device_close; stream->__seen = 1; ! retrun stream; } --- 164,168 ---- stream->__io_funcs.__close = device_close; stream->__seen = 1; ! return stream; } diff -rcN glibc-1.04/mach/mach-syscalls.awk glibc-1.05/mach/mach-syscalls.awk *** glibc-1.04/mach/mach-syscalls.awk Thu Apr 2 22:08:11 1992 --- glibc-1.05/mach/mach-syscalls.awk *************** *** 1,8 **** - BEGIN { calls="" } - - { - calls = calls " " $1; - print "sysno-" $1 " = " $2; - } - - END { print "mach-syscalls := " calls } --- 0 ---- diff -rcN glibc-1.04/mach/mach_init.c glibc-1.05/mach/mach_init.c *** glibc-1.04/mach/mach_init.c Fri Oct 18 00:58:14 1991 --- glibc-1.05/mach/mach_init.c Thu Sep 10 19:55:32 1992 *************** *** 1,4 **** ! /* Copyright (C) 1991 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or --- 1,4 ---- ! /* Copyright (C) 1992 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or *************** *** 26,32 **** void __mach_init (void) { ! error_t err; vm_statistics_data_t stats; __mach_task_self_ = (__mach_task_self) (); --- 26,32 ---- void __mach_init (void) { ! kern_return_t err; vm_statistics_data_t stats; __mach_task_self_ = (__mach_task_self) (); diff -rcN glibc-1.04/mach/mach_init_syms.c glibc-1.05/mach/mach_init_syms.c *** glibc-1.04/mach/mach_init_syms.c Fri Oct 18 00:57:57 1991 --- glibc-1.05/mach/mach_init_syms.c *************** *** 1,3 **** - #include - - symbol_alias (__vm_page_size, vm_page_size); --- 0 ---- diff -rcN glibc-1.04/mach/mach_msg_destroy.c glibc-1.05/mach/mach_msg_destroy.c *** glibc-1.04/mach/mach_msg_destroy.c Wed Oct 23 08:50:33 1991 --- glibc-1.05/mach/mach_msg_destroy.c *************** *** 1,4 **** - #include - - #undef mach_msg_destroy - symbol_alias (__mach_msg_destroy, mach_msg_destroy); --- 0 ---- diff -rcN glibc-1.04/mach/mach_msg_server.c glibc-1.05/mach/mach_msg_server.c *** glibc-1.04/mach/mach_msg_server.c Wed Oct 23 08:51:55 1991 --- glibc-1.05/mach/mach_msg_server.c *************** *** 1,4 **** - #include - - #undef mach_msg_server - symbol_alias (__mach_msg_server, mach_msg_server); --- 0 ---- diff -rcN glibc-1.04/mach/mach_msg_server_timeout.c glibc-1.05/mach/mach_msg_server_timeout.c *** glibc-1.04/mach/mach_msg_server_timeout.c Fri Oct 25 19:19:23 1991 --- glibc-1.05/mach/mach_msg_server_timeout.c *************** *** 1,4 **** - #include - - #undef mach_msg_server_timeout - symbol_alias (__mach_msg_server_timeout, mach_msg_server_timeout); --- 0 ---- diff -rcN glibc-1.04/mach/msg_destroy.c glibc-1.05/mach/msg_destroy.c *** glibc-1.04/mach/msg_destroy.c --- glibc-1.05/mach/msg_destroy.c Wed Oct 23 08:50:33 1991 *************** *** 0 **** --- 1,4 ---- + #include + + #undef mach_msg_destroy + symbol_alias (__mach_msg_destroy, mach_msg_destroy); diff -rcN glibc-1.04/mach/msg_server.c glibc-1.05/mach/msg_server.c *** glibc-1.04/mach/msg_server.c --- glibc-1.05/mach/msg_server.c Wed Oct 23 08:51:55 1991 *************** *** 0 **** --- 1,4 ---- + #include + + #undef mach_msg_server + symbol_alias (__mach_msg_server, mach_msg_server); diff -rcN glibc-1.04/mach/msg_server_t.c glibc-1.05/mach/msg_server_t.c *** glibc-1.04/mach/msg_server_t.c --- glibc-1.05/mach/msg_server_t.c Fri Oct 25 19:19:23 1991 *************** *** 0 **** --- 1,4 ---- + #include + + #undef mach_msg_server_timeout + symbol_alias (__mach_msg_server_timeout, mach_msg_server_timeout); diff -rcN glibc-1.04/mach/syscalls.awk glibc-1.05/mach/syscalls.awk *** glibc-1.04/mach/syscalls.awk --- glibc-1.05/mach/syscalls.awk Thu Apr 2 22:08:11 1992 *************** *** 0 **** --- 1,8 ---- + BEGIN { calls="" } + + { + calls = calls " " $1; + print "sysno-" $1 " = " $2; + } + + END { print "mach-syscalls := " calls } diff -rcN glibc-1.04/mach/vm_page_size.c glibc-1.05/mach/vm_page_size.c *** glibc-1.04/mach/vm_page_size.c --- glibc-1.05/mach/vm_page_size.c Fri Oct 18 00:57:57 1991 *************** *** 0 **** --- 1,3 ---- + #include + + symbol_alias (__vm_page_size, vm_page_size); diff -rcN glibc-1.04/malloc/Makefile glibc-1.05/malloc/Makefile *** glibc-1.04/malloc/Makefile Tue Aug 18 17:42:30 1992 --- glibc-1.05/malloc/Makefile Sat Sep 12 13:17:44 1992 *************** *** 30,36 **** routines := $(dist-routines) \ cfree \ obstack ! gpl2gpl := obstack.c obstack.h # Frob these guys' copying notices. install-lib := libmcheck.a --- 30,36 ---- routines := $(dist-routines) \ cfree \ obstack ! gpl2lgpl := obstack.c obstack.h # Frob these guys' copying notices. install-lib := libmcheck.a diff -rcN glibc-1.04/malloc/obstack.h glibc-1.05/malloc/obstack.h *** glibc-1.04/malloc/obstack.h Mon Aug 3 19:28:46 1992 --- glibc-1.05/malloc/obstack.h Fri Sep 18 18:57:20 1992 *************** *** 95,101 **** Exactly one object is growing in an obstack at any one time. You can run one obstack per control block. You may have as many control blocks as you dare. ! Because of the way we do it, you can `unwind' a obstack back to a previous state. (You may remove objects much as you would with a stack.) */ --- 95,101 ---- Exactly one object is growing in an obstack at any one time. You can run one obstack per control block. You may have as many control blocks as you dare. ! Because of the way we do it, you can `unwind' an obstack back to a previous state. (You may remove objects much as you would with a stack.) */ diff -rcN glibc-1.04/misc/Makefile glibc-1.05/misc/Makefile *** glibc-1.04/misc/Makefile Wed Sep 2 22:41:50 1992 --- glibc-1.05/misc/Makefile Thu Sep 17 19:01:30 1992 *************** *** 24,30 **** headers := sys/uio.h sys/ioctl.h sys/ptrace.h ioctls.h sys/file.h \ a.out.h nlist.h stab.h stab.def sgtty.h sys/dir.h sys/cdefs.h \ ! ttyent.h syscall.h routines := brk sbrk sstk ioctl \ __brk __sbrk __ioctl \ --- 24,30 ---- headers := sys/uio.h sys/ioctl.h sys/ptrace.h ioctls.h sys/file.h \ a.out.h nlist.h stab.h stab.def sgtty.h sys/dir.h sys/cdefs.h \ ! ttyent.h syscall.h sys/syslog.h paths.h routines := brk sbrk sstk ioctl \ __brk __sbrk __ioctl \ *************** *** 50,56 **** __utimes \ truncate ftruncate \ chflags fchflags \ ! insremque getttyent getusersh getpass aux := data_start progname distribute := bsd-compat.c install-lib := libbsd-compat.a --- 50,57 ---- __utimes \ truncate ftruncate \ chflags fchflags \ ! insremque getttyent getusersh getpass ttyslot \ ! syslog aux := data_start progname distribute := bsd-compat.c install-lib := libbsd-compat.a *************** *** 58,61 **** --- 59,63 ---- include ../Rules $(objpfx)libbsd-compat.a: $(objpfx)bsd-compat.o + rm -f $@ ln $< $@ diff -rcN glibc-1.04/misc/getttyent.c glibc-1.05/misc/getttyent.c *** glibc-1.04/misc/getttyent.c Wed May 13 03:20:47 1992 --- glibc-1.05/misc/getttyent.c Sat Sep 12 16:31:16 1992 *************** *** 108,113 **** --- 108,117 ---- tty.ty_status |= TTY_ON; else if (scmp(_TTYS_SECURE)) tty.ty_status |= TTY_SECURE; + else if (scmp(_TTYS_TRUSTED)) + tty.ty_status |= TTY_TRUSTED; + else if (scmp(_TTYS_CONSOLE)) + tty.ty_status |= TTY_CONSOLE; else if (vcmp(_TTYS_WINDOW)) tty.ty_window = value(p); else diff -rcN glibc-1.04/misc/paths.h glibc-1.05/misc/paths.h *** glibc-1.04/misc/paths.h --- glibc-1.05/misc/paths.h Wed Sep 16 17:43:55 1992 *************** *** 0 **** --- 1,64 ---- + /* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)paths.h 5.15 (Berkeley) 5/29/91 + */ + + #ifndef _PATHS_H_ + #define _PATHS_H_ + + /* Default search path. */ + #define _PATH_DEFPATH "/usr/bin:/bin" + + #define _PATH_BSHELL "/bin/sh" + #define _PATH_CONSOLE "/dev/console" + #define _PATH_CSHELL "/bin/csh" + #define _PATH_DEVDB "/var/run/dev.db" + #define _PATH_DEVNULL "/dev/null" + #define _PATH_DRUM "/dev/drum" + #define _PATH_KMEM "/dev/kmem" + #define _PATH_MAILDIR "/var/mail" + #define _PATH_MAN "/usr/share/man" + #define _PATH_MEM "/dev/mem" + #define _PATH_NOLOGIN "/etc/nologin" + #define _PATH_SENDMAIL "/usr/sbin/sendmail" + #define _PATH_TTY "/dev/tty" + #define _PATH_UNIX "/vmunix" + #define _PATH_VI "/usr/bin/vi" + + /* Provide trailing slash, since mostly used for building pathnames. */ + #define _PATH_DEV "/dev/" + #define _PATH_TMP "/tmp/" + #define _PATH_VARRUN "/var/run/" + #define _PATH_VARTMP "/var/tmp/" + + #endif /* !_PATHS_H_ */ diff -rcN glibc-1.04/misc/sys/syslog.h glibc-1.05/misc/sys/syslog.h *** glibc-1.04/misc/sys/syslog.h --- glibc-1.05/misc/sys/syslog.h Sat Sep 12 17:16:02 1992 *************** *** 0 **** --- 1,178 ---- + /* + * Copyright (c) 1982, 1986, 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)syslog.h 7.20 (Berkeley) 2/23/91 + */ + + #define _PATH_LOG "/dev/log" + + /* + * priorities/facilities are encoded into a single 32-bit quantity, where the + * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility + * (0-big number). Both the priorities and the facilities map roughly + * one-to-one to strings in the syslogd(8) source code. This mapping is + * included in this file. + * + * priorities (these are ordered) + */ + #define LOG_EMERG 0 /* system is unusable */ + #define LOG_ALERT 1 /* action must be taken immediately */ + #define LOG_CRIT 2 /* critical conditions */ + #define LOG_ERR 3 /* error conditions */ + #define LOG_WARNING 4 /* warning conditions */ + #define LOG_NOTICE 5 /* normal but significant condition */ + #define LOG_INFO 6 /* informational */ + #define LOG_DEBUG 7 /* debug-level messages */ + + #define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */ + /* extract priority */ + #define LOG_PRI(p) ((p) & LOG_PRIMASK) + #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) + + #ifdef SYSLOG_NAMES + #define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ + /* mark "facility" */ + #define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0) + typedef struct _code { + char *c_name; + int c_val; + } CODE; + + CODE prioritynames[] = { + "alert", LOG_ALERT, + "crit", LOG_CRIT, + "debug", LOG_DEBUG, + "emerg", LOG_EMERG, + "err", LOG_ERR, + "error", LOG_ERR, /* DEPRECATED */ + "info", LOG_INFO, + "none", INTERNAL_NOPRI, /* INTERNAL */ + "notice", LOG_NOTICE, + "panic", LOG_EMERG, /* DEPRECATED */ + "warn", LOG_WARNING, /* DEPRECATED */ + "warning", LOG_WARNING, + NULL, -1, + }; + #endif + + /* facility codes */ + #define LOG_KERN (0<<3) /* kernel messages */ + #define LOG_USER (1<<3) /* random user-level messages */ + #define LOG_MAIL (2<<3) /* mail system */ + #define LOG_DAEMON (3<<3) /* system daemons */ + #define LOG_AUTH (4<<3) /* security/authorization messages */ + #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ + #define LOG_LPR (6<<3) /* line printer subsystem */ + #define LOG_NEWS (7<<3) /* network news subsystem */ + #define LOG_UUCP (8<<3) /* UUCP subsystem */ + #define LOG_CRON (9<<3) /* clock daemon */ + #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ + + /* other codes through 15 reserved for system use */ + #define LOG_LOCAL0 (16<<3) /* reserved for local use */ + #define LOG_LOCAL1 (17<<3) /* reserved for local use */ + #define LOG_LOCAL2 (18<<3) /* reserved for local use */ + #define LOG_LOCAL3 (19<<3) /* reserved for local use */ + #define LOG_LOCAL4 (20<<3) /* reserved for local use */ + #define LOG_LOCAL5 (21<<3) /* reserved for local use */ + #define LOG_LOCAL6 (22<<3) /* reserved for local use */ + #define LOG_LOCAL7 (23<<3) /* reserved for local use */ + + #define LOG_NFACILITIES 24 /* current number of facilities */ + #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ + /* facility of pri */ + #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) + + #ifdef SYSLOG_NAMES + CODE facilitynames[] = { + "auth", LOG_AUTH, + "authpriv", LOG_AUTHPRIV, + "cron", LOG_CRON, + "daemon", LOG_DAEMON, + "kern", LOG_KERN, + "lpr", LOG_LPR, + "mail", LOG_MAIL, + "mark", INTERNAL_MARK, /* INTERNAL */ + "news", LOG_NEWS, + "security", LOG_AUTH, /* DEPRECATED */ + "syslog", LOG_SYSLOG, + "user", LOG_USER, + "uucp", LOG_UUCP, + "local0", LOG_LOCAL0, + "local1", LOG_LOCAL1, + "local2", LOG_LOCAL2, + "local3", LOG_LOCAL3, + "local4", LOG_LOCAL4, + "local5", LOG_LOCAL5, + "local6", LOG_LOCAL6, + "local7", LOG_LOCAL7, + NULL, -1, + }; + #endif + + #ifdef KERNEL + #define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */ + #endif + + /* + * arguments to setlogmask. + */ + #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ + #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ + + /* + * Option flags for openlog. + * + * LOG_ODELAY no longer does anything. + * LOG_NDELAY is the inverse of what it used to be. + */ + #define LOG_PID 0x01 /* log the pid with each message */ + #define LOG_CONS 0x02 /* log on the console if errors in sending */ + #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ + #define LOG_NDELAY 0x08 /* don't delay open */ + #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ + #define LOG_PERROR 0x20 /* log to stderr as well */ + + #ifndef KERNEL + + #include + #include + + __BEGIN_DECLS + void closelog __P((void)); + void openlog __P((const char *, int, int)); + int setlogmask __P((int)); + void syslog __P((int, const char *, ...)); + void vsyslog __P((int, const char *, va_list)); + __END_DECLS + + #endif /* !KERNEL */ diff -rcN glibc-1.04/misc/syslog.c glibc-1.05/misc/syslog.c *** glibc-1.04/misc/syslog.c --- glibc-1.05/misc/syslog.c Sat Sep 12 17:14:23 1992 *************** *** 0 **** --- 1,236 ---- + /* + * Copyright (c) 1983, 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + #if defined(LIBC_SCCS) && !defined(lint) + static char sccsid[] = "@(#)syslog.c 5.34 (Berkeley) 6/26/91"; + #endif /* LIBC_SCCS and not lint */ + + #include + #include + #include + #include + #include + #include + #include + #include + #if __STDC__ + #include + #else + #include + #endif + #include + #include + #include + #include + + static int LogFile = -1; /* fd for log */ + static int connected; /* have done connect */ + static int LogStat = 0; /* status bits, set by openlog() */ + static const char *LogTag = "syslog"; /* string to tag the entry with */ + static int LogFacility = LOG_USER; /* default facility code */ + static int LogMask = 0xff; /* mask of priorities to be logged */ + + /* + * syslog, vsyslog -- + * print message on log file; output is intended for syslogd(8). + */ + void + #if __STDC__ + syslog(int pri, const char *fmt, ...) + #else + syslog(pri, fmt, va_alist) + int pri; + char *fmt; + va_dcl + #endif + { + va_list ap; + + #if __STDC__ + va_start(ap, fmt); + #else + va_start(ap); + #endif + vsyslog(pri, fmt, ap); + va_end(ap); + } + + void + vsyslog(pri, fmt, ap) + int pri; + register const char *fmt; + va_list ap; + { + register int cnt; + register char *p; + time_t now, time(); + int fd, saved_errno; + char tbuf[2048], fmt_cpy[1024], *stdp, *ctime(); + + /* check for invalid bits or no priority set */ + if (!LOG_PRI(pri) || (pri &~ (LOG_PRIMASK|LOG_FACMASK)) || + !(LOG_MASK(pri) & LogMask)) + return; + + saved_errno = errno; + + /* set default facility if none specified */ + if ((pri & LOG_FACMASK) == 0) + pri |= LogFacility; + + /* build the message */ + (void)time(&now); + (void)sprintf(tbuf, "<%d>%.15s ", pri, ctime(&now) + 4); + for (p = tbuf; *p; ++p); + if (LogStat & LOG_PERROR) + stdp = p; + if (LogTag) { + (void)strcpy(p, LogTag); + for (; *p; ++p); + } + if (LogStat & LOG_PID) { + (void)sprintf(p, "[%d]", getpid()); + for (; *p; ++p); + } + if (LogTag) { + *p++ = ':'; + *p++ = ' '; + } + + /* substitute error message for %m */ + { + register char ch, *t1, *t2; + char *strerror(); + + for (t1 = fmt_cpy; ch = *fmt; ++fmt) + if (ch == '%' && fmt[1] == 'm') { + ++fmt; + for (t2 = strerror(saved_errno); + *t1 = *t2++; ++t1); + } + else + *t1++ = ch; + *t1 = '\0'; + } + + (void)vsprintf(p, fmt_cpy, ap); + + cnt = strlen(tbuf); + + /* output to stderr if requested */ + if (LogStat & LOG_PERROR) { + struct iovec iov[2]; + register struct iovec *v = iov; + + v->iov_base = stdp; + v->iov_len = cnt - (stdp - tbuf); + ++v; + v->iov_base = "\n"; + v->iov_len = 1; + (void)writev(STDERR_FILENO, iov, 2); + } + + /* get connected, output the message to the local logger */ + if (!connected) + openlog(LogTag, LogStat | LOG_NDELAY, 0); + if (send(LogFile, tbuf, cnt, 0) >= 0) + return; + + /* see if should attempt the console */ + if (!(LogStat&LOG_CONS)) + return; + + /* + * Output the message to the console; don't worry about blocking, + * if console blocks everything will. Make sure the error reported + * is the one from the syslogd failure. + */ + if ((fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) { + (void)strcat(tbuf, "\r\n"); + cnt += 2; + p = index(tbuf, '>') + 1; + (void)write(fd, p, cnt - (p - tbuf)); + (void)close(fd); + } + } + + static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */ + + void + openlog(ident, logstat, logfac) + const char *ident; + int logstat, logfac; + { + if (ident != NULL) + LogTag = ident; + LogStat = logstat; + if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0) + LogFacility = logfac; + + if (LogFile == -1) { + SyslogAddr.sa_family = AF_UNIX; + (void)strncpy(SyslogAddr.sa_data, _PATH_LOG, + sizeof(SyslogAddr.sa_data)); + if (LogStat & LOG_NDELAY) { + if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) + return; + (void)fcntl(LogFile, F_SETFD, 1); + } + } + if (LogFile != -1 && !connected) + if (connect(LogFile, &SyslogAddr, sizeof(SyslogAddr)) == -1) { + (void)close(LogFile); + LogFile = -1; + } else + connected = 1; + } + + void + closelog() + { + (void)close(LogFile); + LogFile = -1; + connected = 0; + } + + /* setlogmask -- set the log mask level */ + setlogmask(pmask) + int pmask; + { + int omask; + + omask = LogMask; + if (pmask != 0) + LogMask = pmask; + return (omask); + } diff -rcN glibc-1.04/misc/ttyent.h glibc-1.05/misc/ttyent.h *** glibc-1.04/misc/ttyent.h Wed May 13 03:20:02 1992 --- glibc-1.05/misc/ttyent.h Sat Sep 12 16:31:17 1992 *************** *** 42,47 **** --- 42,49 ---- #define _TTYS_ON "on" #define _TTYS_SECURE "secure" #define _TTYS_WINDOW "window" + #define _TTYS_TRUSTED "trusted" + #define _TTYS_CONSOLE "console" struct ttyent { char *ty_name; /* terminal device name */ *************** *** 49,54 **** --- 51,58 ---- char *ty_type; /* terminal type for termcap */ #define TTY_ON 0x01 /* enable logins (start ty_getty program) */ #define TTY_SECURE 0x02 /* allow uid of 0 to login */ + #define TTY_TRUSTED 0x04 /* allow login without password */ + #define TTY_CONSOLE 0x08 /* allow uid of 0 to login without password */ int ty_status; /* status flags */ char *ty_window; /* command to start up window manager */ char *ty_comment; /* comment field */ diff -rcN glibc-1.04/misc/ttyslot.c glibc-1.05/misc/ttyslot.c *** glibc-1.04/misc/ttyslot.c --- glibc-1.05/misc/ttyslot.c Sat Sep 12 17:11:29 1992 *************** *** 0 **** --- 1,68 ---- + /* + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + #if defined(LIBC_SCCS) && !defined(lint) + static char sccsid[] = "@(#)ttyslot.c 5.6 (Berkeley) 2/23/91"; + #endif /* LIBC_SCCS and not lint */ + + #include + #include + #include + #include + + int + ttyslot() + { + register struct ttyent *ttyp; + register int slot; + register char *p; + int cnt; + char *name; + + setttyent(); + for (cnt = 0; cnt < 3; ++cnt) + if (name = ttyname(cnt)) { + if (p = rindex(name, '/')) + ++p; + else + p = name; + for (slot = 1; ttyp = getttyent(); ++slot) + if (!strcmp(ttyp->ty_name, p)) { + endttyent(); + return(slot); + } + break; + } + endttyent(); + return(0); + } diff -rcN glibc-1.04/paths.h glibc-1.05/paths.h *** glibc-1.04/paths.h --- glibc-1.05/paths.h Wed Sep 16 18:22:24 1992 *************** *** 0 **** --- 1 ---- + #include diff -rcN glibc-1.04/posix/Makefile glibc-1.05/posix/Makefile *** glibc-1.04/posix/Makefile Tue Aug 18 17:42:29 1992 --- glibc-1.05/posix/Makefile Sat Sep 12 13:09:47 1992 *************** *** 47,53 **** tests := tstgetopt others := getconf install-lib := libposix.a ! gpl2gpl := getopt.c getopt1.c getopt.h # Frob these guys' copying notices. include ../Rules --- 47,53 ---- tests := tstgetopt others := getconf install-lib := libposix.a ! gpl2lgpl := getopt.c getopt1.c getopt.h # Frob these guys' copying notices. include ../Rules diff -rcN glibc-1.04/posix/getopt.c glibc-1.05/posix/getopt.c *** glibc-1.04/posix/getopt.c Mon Aug 24 13:00:50 1992 --- glibc-1.05/posix/getopt.c Sat Sep 12 13:17:49 1992 *************** *** 5,23 **** Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software Foundation, Inc. ! This program 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 program 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 program; if not, write to the Free Software ! Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* AIX requires this to be the first thing in the file. */ #ifdef __GNUC__ --- 5,26 ---- Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software 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 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, ! Cambridge, MA 02139, USA. */ /* AIX requires this to be the first thing in the file. */ #ifdef __GNUC__ diff -rcN glibc-1.04/posix/getopt.h glibc-1.05/posix/getopt.h *** glibc-1.04/posix/getopt.h Tue Aug 18 17:33:49 1992 --- glibc-1.05/posix/getopt.h Sat Sep 12 13:19:53 1992 *************** *** 1,20 **** /* Declarations for getopt. Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. ! This program 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 program 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 program; if not, write to the Free Software ! Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _GETOPT_H #define _GETOPT_H 1 --- 1,23 ---- /* Declarations for getopt. Copyright (C) 1989, 1990, 1991, 1992 Free Software 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 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, + Cambridge, MA 02139, USA. */ + #ifndef _GETOPT_H #define _GETOPT_H 1 *************** *** 94,100 **** --- 97,110 ---- }; #if __STDC__ + #if defined(__GNU_LIBRARY__) + /* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); + #else /* not __GNU_LIBRARY__ */ + extern int getopt (); + #endif /* not __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, diff -rcN glibc-1.04/posix/getopt1.c glibc-1.05/posix/getopt1.c *** glibc-1.04/posix/getopt1.c Tue Aug 18 17:33:48 1992 --- glibc-1.05/posix/getopt1.c Sat Sep 12 13:17:40 1992 *************** *** 1,19 **** /* Getopt for GNU. Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software Foundation, Inc. ! This program 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 program 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 program; if not, write to the Free Software ! Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "getopt.h" --- 1,22 ---- /* Getopt for GNU. Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software 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 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, ! Cambridge, MA 02139, USA. */ #include "getopt.h" diff -rcN glibc-1.04/posix/sys/utsname.h glibc-1.05/posix/sys/utsname.h *** glibc-1.04/posix/sys/utsname.h Mon May 25 19:33:03 1992 --- glibc-1.05/posix/sys/utsname.h Thu Sep 17 00:43:36 1992 *************** *** 31,51 **** /* Structure describing the system and machine. */ struct utsname ! { ! /* Name of the implementation of the operating system. */ ! char sysname[_UTSNAME_LENGTH]; ! /* Name of this node on the network. */ ! char nodename[_UTSNAME_LENGTH]; ! /* Current release level of this implementation. */ ! char release[_UTSNAME_LENGTH]; ! /* Current version level of this release. */ ! char version[_UTSNAME_LENGTH]; ! /* Name of the hardware type the system is running on. */ ! char machine[_UTSNAME_LENGTH]; ! }; /* Put information about the system in NAME. */ --- 31,51 ---- /* Structure describing the system and machine. */ struct utsname ! { ! /* Name of the implementation of the operating system. */ ! char sysname[_UTSNAME_LENGTH]; ! /* Name of this node on the network. */ ! char nodename[_UTSNAME_LENGTH]; ! /* Current release level of this implementation. */ ! char release[_UTSNAME_LENGTH]; ! /* Current version level of this release. */ ! char version[_UTSNAME_LENGTH]; ! /* Name of the hardware type the system is running on. */ ! char machine[_UTSNAME_LENGTH]; ! }; /* Put information about the system in NAME. */ diff -rcN glibc-1.04/setjmp/Makefile glibc-1.05/setjmp/Makefile *** glibc-1.04/setjmp/Makefile Wed Sep 2 22:41:57 1992 --- glibc-1.05/setjmp/Makefile Wed Sep 9 18:50:32 1992 *************** *** 23,29 **** headers := setjmp.h jmp_buf.h ! routines := setjmp sigjmp_save _setjmp sigsetjmp \ longjmp _longjmp __longjmp siglongjmp tests := tst-setjmp --- 23,29 ---- headers := setjmp.h jmp_buf.h ! routines := setjmp sigjmp_save _setjmp \ longjmp _longjmp __longjmp siglongjmp tests := tst-setjmp diff -rcN glibc-1.04/setjmp/sigsetjmp.c glibc-1.05/setjmp/sigsetjmp.c *** glibc-1.04/setjmp/sigsetjmp.c Thu Sep 3 17:32:28 1992 --- glibc-1.05/setjmp/sigsetjmp.c *************** *** 1,39 **** - /* Copyright (C) 1991, 1992 Free Software 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 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, - Cambridge, MA 02139, USA. */ - - #include - #include - #include - #include - - - #undef sigsetjmp - - /* Store the calling environment in ENV, also saving the - signal mask if SAVEMASK is nonzero. Return 0. */ - int - DEFUN(sigsetjmp, (env, savemask), sigjmp_buf env AND int savemask) - { - if (savemask) - env[0].__savemask - = sigprocmask (SIG_BLOCK, (sigset_t *) NULL, &env[0].__sigmask) == 0; - else - env[0].__savemask = 0; - - return setjmp (env[0].__jmpbuf); - } --- 0 ---- diff -rcN glibc-1.04/stdarg.h glibc-1.05/stdarg.h *** glibc-1.04/stdarg.h Fri Aug 14 15:33:22 1992 --- glibc-1.05/stdarg.h Tue Sep 15 01:01:18 1992 *************** *** 62,70 **** void va_end (__gnuc_va_list); /* Defined in libgcc.a */ #define va_end(AP) #define va_arg(AP, TYPE) \ (AP = (char *) (AP) + __va_rounded_size (TYPE), \ ! *((TYPE *) ((char *) (AP) - __va_rounded_size (TYPE)))) #endif /* _STDARG_H */ #endif /* not alpha */ --- 62,72 ---- void va_end (__gnuc_va_list); /* Defined in libgcc.a */ #define va_end(AP) + /* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ #define va_arg(AP, TYPE) \ (AP = (char *) (AP) + __va_rounded_size (TYPE), \ ! *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) #endif /* _STDARG_H */ #endif /* not alpha */ diff -rcN glibc-1.04/stdio/Makefile glibc-1.05/stdio/Makefile *** glibc-1.04/stdio/Makefile Tue Jul 7 20:09:28 1992 --- glibc-1.05/stdio/Makefile Thu Sep 10 19:47:39 1992 *************** *** 50,56 **** routines := $(strip $(routines)) aux := errlist siglist defs syms-stdio glue ! tests := tst-printf tstscanf test_rdwr test-popen tstgetline \ bug1 bug2 bug3 bug4 bug5 bug6 test-fseek --- 50,56 ---- routines := $(strip $(routines)) aux := errlist siglist defs syms-stdio glue ! tests := tst-printf tstscanf test_rdwr test-popen tstgetln \ bug1 bug2 bug3 bug4 bug5 bug6 test-fseek diff -rcN glibc-1.04/stdio/__vfscanf.c glibc-1.05/stdio/__vfscanf.c *** glibc-1.04/stdio/__vfscanf.c Mon May 25 21:46:45 1992 --- glibc-1.05/stdio/__vfscanf.c Thu Sep 24 16:12:43 1992 *************** *** 220,226 **** { do *str++ = c; ! while (inchar() != EOF && width-- > 0); } else while (inchar() != EOF && width > 0) --- 220,226 ---- { do *str++ = c; ! while (inchar() != EOF && --width > 0); } else while (inchar() != EOF && width > 0) diff -rcN glibc-1.04/stdio/tstgetline.c glibc-1.05/stdio/tstgetline.c *** glibc-1.04/stdio/tstgetline.c Mon Mar 30 17:18:36 1992 --- glibc-1.05/stdio/tstgetline.c *************** *** 1,46 **** - /* Copyright (C) 1992 Free Software 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 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, - Cambridge, MA 02139, USA. */ - - #include - #include - - int - DEFUN_VOID(main) - { - char *buf = NULL; - size_t size = 0; - ssize_t len; - - while ((len = getline (&buf, &size, stdin)) != -1) - { - printf ("bufsize %u; read %d: ", size, len); - if (fwrite (buf, len, 1, stdout) != 1) - { - perror ("fwrite"); - return 1; - } - } - - if (ferror (stdin)) - { - perror ("getline"); - return 1; - } - - return 0; - } --- 0 ---- diff -rcN glibc-1.04/stdio/tstgetline.input glibc-1.05/stdio/tstgetline.input *** glibc-1.04/stdio/tstgetline.input Mon Mar 30 16:15:51 1992 --- glibc-1.05/stdio/tstgetline.input *************** *** 1,3 **** - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy - z --- 0 ---- diff -rcN glibc-1.04/stdio/tstgetln.c glibc-1.05/stdio/tstgetln.c *** glibc-1.04/stdio/tstgetln.c --- glibc-1.05/stdio/tstgetln.c Mon Mar 30 17:18:36 1992 *************** *** 0 **** --- 1,46 ---- + /* Copyright (C) 1992 Free Software 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 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, + Cambridge, MA 02139, USA. */ + + #include + #include + + int + DEFUN_VOID(main) + { + char *buf = NULL; + size_t size = 0; + ssize_t len; + + while ((len = getline (&buf, &size, stdin)) != -1) + { + printf ("bufsize %u; read %d: ", size, len); + if (fwrite (buf, len, 1, stdout) != 1) + { + perror ("fwrite"); + return 1; + } + } + + if (ferror (stdin)) + { + perror ("getline"); + return 1; + } + + return 0; + } diff -rcN glibc-1.04/stdio/tstgetln.input glibc-1.05/stdio/tstgetln.input *** glibc-1.04/stdio/tstgetln.input --- glibc-1.05/stdio/tstgetln.input Mon Mar 30 16:15:51 1992 *************** *** 0 **** --- 1,3 ---- + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy + z diff -rcN glibc-1.04/stdlib/Makefile glibc-1.05/stdlib/Makefile *** glibc-1.04/stdlib/Makefile Tue Jul 14 20:54:27 1992 --- glibc-1.05/stdlib/Makefile Thu Sep 10 19:14:49 1992 *************** *** 41,45 **** --- 41,46 ---- $(objpfx)testsort.input: /usr/dict/words cp $< $@ + dont_distribute := testsort.input include ../Rules diff -rcN glibc-1.04/stdlib/div.c glibc-1.05/stdlib/div.c *** glibc-1.04/stdlib/div.c Wed Jun 12 14:17:04 1991 --- glibc-1.05/stdlib/div.c Thu Sep 10 20:21:39 1992 *************** *** 1,4 **** ! /* Copyright (C) 1991 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or --- 1,4 ---- ! /* Copyright (C) 1992 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or *************** *** 16,21 **** --- 16,57 ---- not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + /* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + #include #include *************** *** 26,39 **** DEFUN(div, (numer, denom), int numer AND int denom) { div_t result; - /* Behavior for negative numbers is guaranteed. */ - register int sign = (numer < 0) == (denom < 0) ? 1 : -1; ! numer = numer < 0 ? -numer : numer; ! denom = denom < 0 ? -denom : denom; ! result.quot = (numer / denom) * sign; ! result.rem = (numer % denom) * sign; ! return(result); } --- 62,92 ---- DEFUN(div, (numer, denom), int numer AND int denom) { div_t result; ! result.quot = numer / denom; ! result.rem = numer % denom; ! /* The ANSI standard says that |QUOT| <= |NUMER / DENOM|, where ! NUMER / DENOM is to be computed in infinite precision. In ! other words, we should always truncate the quotient towards ! zero, never -infinity. Machine division and remainer may ! work either way when one or both of NUMER or DENOM is ! negative. If only one is negative and QUOT has been ! truncated towards -infinity, REM will have the same sign as ! DENOM and the opposite sign of NUMER; if both are negative ! and QUOT has been truncated towards -infinity, REM will be ! positive (will have the opposite sign of NUMER). These are ! considered `wrong'. If both are NUM and DENOM are positive, ! RESULT will always be positive. This all boils down to: if ! NUMER >= 0, but REM < 0, we got the wrong answer. In that ! case, to get the right answer, add 1 to QUOT and subtract ! DENOM from REM. */ ! ! if (numer >= 0 && result.rem < 0) ! { ! ++result.quot; ! result.rem -= denom; ! } ! return result; } diff -rcN glibc-1.04/stdlib/ldiv.c glibc-1.05/stdlib/ldiv.c *** glibc-1.04/stdlib/ldiv.c Wed Jun 12 14:17:28 1991 --- glibc-1.05/stdlib/ldiv.c Thu Sep 10 20:24:12 1992 *************** *** 1,4 **** ! /* Copyright (C) 1991 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or --- 1,4 ---- ! /* Copyright (C) 1992 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or *************** *** 16,21 **** --- 16,57 ---- not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + /* + * Copyright (c) 1990 Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + #include #include *************** *** 26,39 **** DEFUN(ldiv, (numer, denom), long int numer AND long int denom) { ldiv_t result; - /* Behavior for negative numbers is guaranteed. */ - register long int sign = (numer < 0L) == (denom < 0L) ? 1L : -1L; ! numer = numer < 0L ? -numer : numer; ! denom = denom < 0L ? -denom : denom; ! result.quot = (numer / denom) * sign; ! result.rem = (numer % denom) * sign; return result; } --- 62,92 ---- DEFUN(ldiv, (numer, denom), long int numer AND long int denom) { ldiv_t result; ! result.quot = numer / denom; ! result.rem = numer % denom; ! /* The ANSI standard says that |QUOT| <= |NUMER / DENOM|, where ! NUMER / DENOM is to be computed in infinite precision. In ! other words, we should always truncate the quotient towards ! zero, never -infinity. Machine division and remainer may ! work either way when one or both of NUMER or DENOM is ! negative. If only one is negative and QUOT has been ! truncated towards -infinity, REM will have the same sign as ! DENOM and the opposite sign of NUMER; if both are negative ! and QUOT has been truncated towards -infinity, REM will be ! positive (will have the opposite sign of NUMER). These are ! considered `wrong'. If both are NUM and DENOM are positive, ! RESULT will always be positive. This all boils down to: if ! NUMER >= 0, but REM < 0, we got the wrong answer. In that ! case, to get the right answer, add 1 to QUOT and subtract ! DENOM from REM. */ ! ! if (numer >= 0 && result.rem < 0) ! { ! ++result.quot; ! result.rem -= denom; ! } return result; } diff -rcN glibc-1.04/stdlib/qsort.c glibc-1.05/stdlib/qsort.c *** glibc-1.04/stdlib/qsort.c Thu May 14 03:38:07 1992 --- glibc-1.05/stdlib/qsort.c Wed Sep 23 16:32:45 1992 *************** *** 88,93 **** --- 88,97 ---- char *pivot_buffer = (char *) __alloca (size); CONST size_t max_thresh = MAX_THRESH * size; + if (total_elems == 0) + /* Avoid lossage with unsigned arithmetic below. */ + return; + if (total_elems > MAX_THRESH) { char *lo = base_ptr; diff -rcN glibc-1.04/string/string.h glibc-1.05/string/string.h *** glibc-1.04/string/string.h Thu Sep 3 17:53:07 1992 --- glibc-1.05/string/string.h Tue Sep 15 17:08:31 1992 *************** *** 144,150 **** extern int ffs __P ((int __i)); #if defined(__GNUC__) && defined(__OPTIMIZE__) ! #define ffs() __builtin_ffs() #endif /* GCC and optimizing. */ /* Compare S1 and S2, ignoring case. */ --- 144,150 ---- extern int ffs __P ((int __i)); #if defined(__GNUC__) && defined(__OPTIMIZE__) ! #define ffs(x) __builtin_ffs(x) #endif /* GCC and optimizing. */ /* Compare S1 and S2, ignoring case. */ diff -rcN glibc-1.04/sys/errno.h glibc-1.05/sys/errno.h *** glibc-1.04/sys/errno.h --- glibc-1.05/sys/errno.h Fri Sep 18 19:36:02 1992 *************** *** 0 **** --- 1 ---- + #include diff -rcN glibc-1.04/sys/syslog.h glibc-1.05/sys/syslog.h *** glibc-1.04/sys/syslog.h --- glibc-1.05/sys/syslog.h Fri Sep 18 19:50:58 1992 *************** *** 0 **** --- 1 ---- + #include diff -rcN glibc-1.04/sysdeps/mach/hurd/Dist glibc-1.05/sysdeps/mach/hurd/Dist *** glibc-1.04/sysdeps/mach/hurd/Dist Wed Nov 13 23:38:03 1991 --- glibc-1.05/sysdeps/mach/hurd/Dist Tue Sep 15 16:46:14 1992 *************** *** 1 **** ! errnos.awk sys_errlist.awk --- 1 ---- ! errnos.awk errlist.awk diff -rcN glibc-1.04/sysdeps/mach/hurd/Makefile glibc-1.05/sysdeps/mach/hurd/Makefile *** glibc-1.04/sysdeps/mach/hurd/Makefile Sat Mar 21 17:43:14 1992 --- glibc-1.05/sysdeps/mach/hurd/Makefile Thu Sep 10 19:09:55 1992 *************** *** 21,27 **** $(objpfx)errnos.h: $(errno.texinfo) $(..)sysdeps/mach/hurd/errnos.awk awk -f $(word 2,$^) $< > $@-tmp mv $@-tmp $@ ! $(objpfx)sys_errlist.c: $(errno.texinfo) $(..)sysdeps/mach/hurd/sys_errlist.awk grep '^@comment.###errno:' $< | sort -n +3 | \ awk -f $(word 2,$^) > $@-tmp mv $@-tmp $@ --- 21,27 ---- $(objpfx)errnos.h: $(errno.texinfo) $(..)sysdeps/mach/hurd/errnos.awk awk -f $(word 2,$^) $< > $@-tmp mv $@-tmp $@ ! $(objpfx)sys_errlist.c: $(errno.texinfo) $(..)sysdeps/mach/hurd/errlist.awk grep '^@comment.###errno:' $< | sort -n +3 | \ awk -f $(word 2,$^) > $@-tmp mv $@-tmp $@ diff -rcN glibc-1.04/sysdeps/mach/hurd/_exit.c glibc-1.05/sysdeps/mach/hurd/_exit.c *** glibc-1.04/sysdeps/mach/hurd/_exit.c Wed Mar 25 20:16:39 1992 --- glibc-1.05/sysdeps/mach/hurd/_exit.c Wed Sep 16 17:00:26 1992 *************** *** 20,41 **** #include #include ! void ! DEFUN(_exit, (status), int status) { - /* Does not return (when applied to the calling task). */ - extern volatile void __task_terminate (task_t); - - #if 0 - struct _hurd_sigstate *ss = _hurd_thread_sigstate (__mach_thread_self ()); - #endif - _HURD_PORT_USE (&_hurd_proc, __proc_exit (port, status)); - #if 0 - if (ss->vforked) - longjmp (ss->vfork_saved.continuation, 1); - #endif - __task_terminate (__mach_task_self ()); } --- 20,45 ---- #include #include ! volatile void ! _hurd_exit (int status) { _HURD_PORT_USE (&_hurd_proc, __proc_exit (port, status)); __task_terminate (__mach_task_self ()); + + /* Perhaps the cached mach_task_self was bogus. */ + __task_terminate ((__mach_task_self) ()); + + /* This sucker really doesn't want to die. */ + while (1) + { + volatile const int zero = 0, one = 1; + volatile int lossage = one / zero; + } + } + + void + DEFUN(_exit, (status), int status) + { + _hurd_exit (W_EXITCODE (status, 0)); } diff -rcN glibc-1.04/sysdeps/mach/hurd/errlist.awk glibc-1.05/sysdeps/mach/hurd/errlist.awk *** glibc-1.04/sysdeps/mach/hurd/errlist.awk --- glibc-1.05/sysdeps/mach/hurd/errlist.awk Tue May 5 23:51:06 1992 *************** *** 0 **** --- 1,56 ---- + # Copyright (C) 1991, 1992 Free Software 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 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, + # Cambridge, MA 02139, USA. + + # errno.texinfo contains lines like: + # @comment errno.h + # @comment POSIX.1: Function not implemented + # @deftypevr Macro int ENOSYS + + BEGIN { + print "/* This file is generated from errno.texinfo by sys_errlist.awk. */" + print ""; + print "const char *_sys_errlist[] ="; + print " {"; + errno = 0; + print " \"Success,\"" + } + $1 == "@comment" && $2 == "errno.h" { errnoh=1; next } + errnoh == 1 && $1 == "@comment" \ + { + ++errnoh; + etext = $3; + for (i = 4; i <= NF; ++i) + etext = etext " " $i; + next; + } + errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" \ + { + e = $4; + s = " \"" etext "\","; + l = 40 - length (s); + while (l-- > 0) + s = s " "; + printf "%s/* %d = %s */\n", s, ++errno, e; + next; + } + { errnoh=0 } + END { + print " };"; + print ""; + printf "const int _sys_nerr = %d;\n", errno; + } diff -rcN glibc-1.04/sysdeps/mach/hurd/i386/_hurd_start_sigthread.c glibc-1.05/sysdeps/mach/hurd/i386/_hurd_start_sigthread.c *** glibc-1.04/sysdeps/mach/hurd/i386/_hurd_start_sigthread.c Wed Jul 1 00:25:23 1992 --- glibc-1.05/sysdeps/mach/hurd/i386/_hurd_start_sigthread.c *************** *** 1,42 **** - /* Copyright (C) 1991, 1992 Free Software 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 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, - Cambridge, MA 02139, USA. */ - - #include - - #define STACK_SIZE (4 * __vm_page_size) /* ? XXX */ - - error_t - _hurd_start_sigthread (thread_t sigthread, void (*function) (void)) - { - error_t error; - struct i386_thread_state ts; - size_t tssize = i386_THREAD_STATE_COUNT; - vm_address_t stack; - - if (error = __vm_allocate (__mach_task_self (), &stack, STACK_SIZE, 1)) - return error; - - bzero (&ts, sizeof (ts)); - ts.eip = (int) function; - ts.esp = stack + STACK_SIZE; - - if (error = __thread_set_state (sigthread, i386_THREAD_STATE, &ts, tssize)) - return error; - - return __thread_resume (sigthread); - } --- 0 ---- diff -rcN glibc-1.04/sysdeps/mach/hurd/i386/startsig.c glibc-1.05/sysdeps/mach/hurd/i386/startsig.c *** glibc-1.04/sysdeps/mach/hurd/i386/startsig.c --- glibc-1.05/sysdeps/mach/hurd/i386/startsig.c Wed Jul 1 00:25:23 1992 *************** *** 0 **** --- 1,42 ---- + /* Copyright (C) 1991, 1992 Free Software 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 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, + Cambridge, MA 02139, USA. */ + + #include + + #define STACK_SIZE (4 * __vm_page_size) /* ? XXX */ + + error_t + _hurd_start_sigthread (thread_t sigthread, void (*function) (void)) + { + error_t error; + struct i386_thread_state ts; + size_t tssize = i386_THREAD_STATE_COUNT; + vm_address_t stack; + + if (error = __vm_allocate (__mach_task_self (), &stack, STACK_SIZE, 1)) + return error; + + bzero (&ts, sizeof (ts)); + ts.eip = (int) function; + ts.esp = stack + STACK_SIZE; + + if (error = __thread_set_state (sigthread, i386_THREAD_STATE, &ts, tssize)) + return error; + + return __thread_resume (sigthread); + } diff -rcN glibc-1.04/sysdeps/mach/hurd/statbuf.h glibc-1.05/sysdeps/mach/hurd/statbuf.h *** glibc-1.04/sysdeps/mach/hurd/statbuf.h Wed May 6 12:49:41 1992 --- glibc-1.05/sysdeps/mach/hurd/statbuf.h Thu Sep 17 19:01:28 1992 *************** *** 24,30 **** struct stat { ! int st_ftype; /* File system type. */ __fsid_t st_fsid; /* File system ID. */ __ino_t st_ino; /* File number. */ unsigned int st_gen; /* To detect reuse of file numbers. */ --- 24,30 ---- struct stat { ! int st_fstype; /* File system type. */ __fsid_t st_fsid; /* File system ID. */ __ino_t st_ino; /* File number. */ unsigned int st_gen; /* To detect reuse of file numbers. */ *************** *** 40,47 **** --- 40,72 ---- unsigned long int st_mtime_usec; /* and microseconds. */ __time_t st_ctime; /* Status change time, seconds */ unsigned long int st_ctime_usec; /* and microseconds. */ + unsigned int st_blksize; /* Optimal size for I/O. */ + unsigned int st_blocks; /* Number of 512-byte blocks allocated. + Not particular related to `st_blksize'. */ __uid_t st_author; /* File author. */ int st_spare[8]; /* Reserved for future use. */ }; + + /* Encoding of the file mode. */ + + #define __S_IFMT 0170000 /* These bits determine file type. */ + + /* File types. */ + #define __S_IFDIR 0040000 /* Directory. */ + #define __S_IFCHR 0020000 /* Character device. */ + #define __S_IFBLK 0060000 /* Block device. */ + #define __S_IFREG 0100000 /* Regular file. */ + #define __S_IFLNK 0120000 /* Symbolic link. */ + #define __S_IFSOCK 0140000 /* Socket. */ + #define __S_IFIFO 0010000 /* FIFO. */ + + /* Protection bits. */ + + #define __S_ISUID 04000 /* Set user ID on execution. */ + #define __S_ISGID 02000 /* Set group ID on execution. */ + #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ + #define __S_IREAD 0400 /* Read by owner. */ + #define __S_IWRITE 0200 /* Write by owner. */ + #define __S_IEXEC 0100 /* Execute by owner. */ #endif /* statbuf.h */ diff -rcN glibc-1.04/sysdeps/mach/hurd/sys_errlist.awk glibc-1.05/sysdeps/mach/hurd/sys_errlist.awk *** glibc-1.04/sysdeps/mach/hurd/sys_errlist.awk Tue May 5 23:51:06 1992 --- glibc-1.05/sysdeps/mach/hurd/sys_errlist.awk *************** *** 1,56 **** - # Copyright (C) 1991, 1992 Free Software 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 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, - # Cambridge, MA 02139, USA. - - # errno.texinfo contains lines like: - # @comment errno.h - # @comment POSIX.1: Function not implemented - # @deftypevr Macro int ENOSYS - - BEGIN { - print "/* This file is generated from errno.texinfo by sys_errlist.awk. */" - print ""; - print "const char *_sys_errlist[] ="; - print " {"; - errno = 0; - print " \"Success,\"" - } - $1 == "@comment" && $2 == "errno.h" { errnoh=1; next } - errnoh == 1 && $1 == "@comment" \ - { - ++errnoh; - etext = $3; - for (i = 4; i <= NF; ++i) - etext = etext " " $i; - next; - } - errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" \ - { - e = $4; - s = " \"" etext "\","; - l = 40 - length (s); - while (l-- > 0) - s = s " "; - printf "%s/* %d = %s */\n", s, ++errno, e; - next; - } - { errnoh=0 } - END { - print " };"; - print ""; - printf "const int _sys_nerr = %d;\n", errno; - } --- 0 ---- diff -rcN glibc-1.04/sysdeps/posix/Makefile glibc-1.05/sysdeps/posix/Makefile *** glibc-1.04/sysdeps/posix/Makefile Mon Jul 6 19:57:09 1992 --- glibc-1.05/sysdeps/posix/Makefile Wed Sep 9 18:11:09 1992 *************** *** 25,31 **** ifdef subdir objdir-CPPFLAGS = $(CPPFLAGS) # Already has appropriate `..'s. else ! objdir-CPPFLAGS = $(patsubst -I%,-I../%,$(patsubst -I/%,-I//%)) endif # The point of this is to not use -W options to gcc. $(objpfx)mk-stdiolim: $(sysdep_dir)/posix/mk-stdiolim.c \ --- 25,31 ---- ifdef subdir objdir-CPPFLAGS = $(CPPFLAGS) # Already has appropriate `..'s. else ! objdir-CPPFLAGS = $(patsubst -I/..//%,-I/%,$(CPPFLAGS:-I%=-I../%)) endif # The point of this is to not use -W options to gcc. $(objpfx)mk-stdiolim: $(sysdep_dir)/posix/mk-stdiolim.c \ diff -rcN glibc-1.04/sysdeps/sparc/Makefile glibc-1.05/sysdeps/sparc/Makefile *** glibc-1.04/sysdeps/sparc/Makefile Thu May 14 17:12:25 1992 --- glibc-1.05/sysdeps/sparc/Makefile Wed Sep 16 18:18:02 1992 *************** *** 44,51 **** endif # gnulib ! ifeq ($(subdir),uf-crypt) ! crypt := crypt.sparc # Use uf-crypt/crypt.sparc.S. ! endif # uf-crypt --- 44,51 ---- endif # gnulib ! ifeq ($(subdir),crypt) ! crypt := crypt.sparc # Use crypt/crypt.sparc.S. ! endif # crypt diff -rcN glibc-1.04/sysdeps/stub/_hurd_start_sigthread.c glibc-1.05/sysdeps/stub/_hurd_start_sigthread.c *** glibc-1.04/sysdeps/stub/_hurd_start_sigthread.c Mon Oct 28 22:05:09 1991 --- glibc-1.05/sysdeps/stub/_hurd_start_sigthread.c *************** *** 1,28 **** - /* Copyright (C) 1991 Free Software 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 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, - Cambridge, MA 02139, USA. */ - - #include - - #define STACK_SIZE (4 * __vm_page_size) /* ? XXX */ - - /* Give SIGTHREAD a stack and start it running _hurd_sigport_receive. */ - error_t - _hurd_start_sigthread (thread_t sigthread) - { - return POSIX_ENOSYS; - } --- 0 ---- diff -rcN glibc-1.04/sysdeps/stub/startsig.c glibc-1.05/sysdeps/stub/startsig.c *** glibc-1.04/sysdeps/stub/startsig.c --- glibc-1.05/sysdeps/stub/startsig.c Mon Oct 28 22:05:09 1991 *************** *** 0 **** --- 1,28 ---- + /* Copyright (C) 1991 Free Software 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 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, + Cambridge, MA 02139, USA. */ + + #include + + #define STACK_SIZE (4 * __vm_page_size) /* ? XXX */ + + /* Give SIGTHREAD a stack and start it running _hurd_sigport_receive. */ + error_t + _hurd_start_sigthread (thread_t sigthread) + { + return POSIX_ENOSYS; + } diff -rcN glibc-1.04/sysdeps/unix/Makefile glibc-1.05/sysdeps/unix/Makefile *** glibc-1.04/sysdeps/unix/Makefile Wed Sep 2 22:50:23 1992 --- glibc-1.05/sysdeps/unix/Makefile Fri Sep 18 18:02:08 1992 *************** *** 60,66 **** # Don't preempt our own headers. sys/param.h-includes := \ ! $(filter-out $(wildcard $(addprefix $(..),$(sys/param.h-includes))),\ $(sys/param.h-includes)) sysdep_headers := $(sysdep_headers) $(sys/param.h-includes) --- 60,68 ---- # Don't preempt our own headers. sys/param.h-includes := \ ! $(filter-out $(patsubst $(..)%,%,\ ! $(wildcard $(addprefix $(..),\ ! $(sys/param.h-includes)))),\ $(sys/param.h-includes)) sysdep_headers := $(sysdep_headers) $(sys/param.h-includes) *************** *** 71,77 **** $(addprefix $(common-objpfx),$(sys/param.h-includes)): $(common-objpfx)%: \ $(sysincludedir)/% -mkdir $(dir $@) ! cp $< $@ endif endif # misc --- 73,82 ---- $(addprefix $(common-objpfx),$(sys/param.h-includes)): $(common-objpfx)%: \ $(sysincludedir)/% -mkdir $(dir $@) ! # Some of these files sometimes contain conflicting declarations ! # for htons, ntohs, etc. ! sed '/[ ]*[hn][sl]to[nh][sl][ (]*/d' $< > $@-tmp ! mv $@-tmp $@ endif endif # misc *************** *** 155,163 **** # Transmogrify any of several formats of the file into the one we want. $(common-objpfx)syscall.h: $(syscall.h) tr '[A-Z]' '[a-z]' < $< | \ ! sed -e 's/\ $@-tmp mv $@-tmp $@ --- 160,170 ---- # Transmogrify any of several formats of the file into the one we want. $(common-objpfx)syscall.h: $(syscall.h) tr '[A-Z]' '[a-z]' < $< | \ ! sed -e 's/[ ]sys_/ /' \ -e 's/^#define[ ]*\([a-z0-9_]*\)[ ]*/#define SYS_\1 /' \ ! -e 's/[ ]sys_/ SYS_/' \ ! -e '/^#/!d' \ ! -e '/^#ident/d' \ > $@-tmp mv $@-tmp $@ diff -rcN glibc-1.04/sysdeps/unix/bsd/Dist glibc-1.05/sysdeps/unix/bsd/Dist *** glibc-1.04/sysdeps/unix/bsd/Dist Sun Mar 15 00:18:30 1992 --- glibc-1.05/sysdeps/unix/bsd/Dist Tue Sep 15 15:24:34 1992 *************** *** 1,2 **** ! make-local_lim.c bsddir.h bsd_getgrp.S bsdtty.h glue-ctype.c make_siglist.c --- 1,2 ---- ! mk-local_lim.c bsddir.h bsd_getgrp.S bsdtty.h glue-ctype.c make_siglist.c diff -rcN glibc-1.04/sysdeps/unix/bsd/Makefile glibc-1.05/sysdeps/unix/bsd/Makefile *** glibc-1.04/sysdeps/unix/bsd/Makefile Fri Aug 14 13:55:43 1992 --- glibc-1.05/sysdeps/unix/bsd/Makefile Thu Sep 10 19:09:53 1992 *************** *** 16,25 **** # not, write to the Free Software Foundation, Inc., 675 Mass Ave, # Cambridge, MA 02139, USA. ! $(common-objpfx)local_lim.h: $(common-objpfx)make-local_lim $(dir $<)$(notdir $<) > $@-tmp mv $@-tmp $@ ! $(common-objpfx)make-local_lim: $(sysdep_dir)/unix/bsd/make-local_lim.c $(native-compile) before-compile := $(before-compile) $(common-objpfx)local_lim.h --- 16,25 ---- # not, write to the Free Software Foundation, Inc., 675 Mass Ave, # Cambridge, MA 02139, USA. ! $(common-objpfx)local_lim.h: $(common-objpfx)mk-local_lim $(dir $<)$(notdir $<) > $@-tmp mv $@-tmp $@ ! $(common-objpfx)mk-local_lim: $(sysdep_dir)/unix/bsd/mk-local_lim.c $(native-compile) before-compile := $(before-compile) $(common-objpfx)local_lim.h diff -rcN glibc-1.04/sysdeps/unix/bsd/glue-ctype.c glibc-1.05/sysdeps/unix/bsd/glue-ctype.c *** glibc-1.04/sysdeps/unix/bsd/glue-ctype.c Mon Jul 29 22:54:40 1991 --- glibc-1.05/sysdeps/unix/bsd/glue-ctype.c Mon Sep 21 23:15:22 1992 *************** *** 1,5 **** --- 1,9 ---- #include + #ifdef ultrix + #define _ctype_ _ctype__ + #endif + main () { int i; diff -rcN glibc-1.04/sysdeps/unix/bsd/make-local_lim.c glibc-1.05/sysdeps/unix/bsd/make-local_lim.c *** glibc-1.04/sysdeps/unix/bsd/make-local_lim.c Mon Apr 6 02:46:46 1992 --- glibc-1.05/sysdeps/unix/bsd/make-local_lim.c *************** *** 1,63 **** - /* Copyright (C) 1991, 1992 Free Software 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 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, - Cambridge, MA 02139, USA. */ - - #include - #include - - /* Generate local_limits.h from values for BSD. */ - - struct param - { - char *name; - int value; - }; - - static struct param params[] = - { - { "NGROUPS_MAX", NGROUPS }, - { "ARG_MAX", NCARGS }, - #ifdef MAXUPRC - { "CHILD_MAX", MAXUPRC }, - #endif - { "OPEN_MAX", NOFILE }, - #ifdef MAXLINK - { "LINK_MAX", MAXLINK }, - #endif - { "MAX_CANON", CANBSIZ }, - { "NAME_MAX", 255 }, - { "PATH_MAX", MAXPATHLEN }, - { NULL, 0 } - }; - - int - main() - { - extern char *ctime(); - extern time_t time(); - time_t now = time((time_t *) NULL); - register struct param *p; - - printf("\ - /* Implementation-specific limits.\n\ - Generated at %.25s. */\n\n", ctime(&now)); - - for (p = params; p->name != NULL; ++p) - printf("#define %s %d\n", p->name, p->value); - - exit(0); - } --- 0 ---- diff -rcN glibc-1.04/sysdeps/unix/bsd/mk-local_lim.c glibc-1.05/sysdeps/unix/bsd/mk-local_lim.c *** glibc-1.04/sysdeps/unix/bsd/mk-local_lim.c --- glibc-1.05/sysdeps/unix/bsd/mk-local_lim.c Mon Sep 21 23:22:18 1992 *************** *** 0 **** --- 1,78 ---- + /* Copyright (C) 1991, 1992 Free Software 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 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, + Cambridge, MA 02139, USA. */ + + #include + #include + + /* Generate local_limits.h from values for BSD. */ + + struct param + { + char *name; + int value; + }; + + static struct param params[] = + { + { "NGROUPS_MAX", NGROUPS }, + + { "ARG_MAX", NCARGS }, + + #ifdef MAXUPRC + { "CHILD_MAX", MAXUPRC }, + #endif + + { "OPEN_MAX", NOFILE }, + + /* Apparently, Ultrix's defines LINK_MAX and not MAXLINK. */ + #if defined (LINK_MAX) && !defined (MAXLINK) + #define MAXLINK LINK_MAX + #endif + #ifdef MAXLINK + { "LINK_MAX", MAXLINK }, + #endif + + { "MAX_CANON", CANBSIZ }, + + #ifndef MAXNAMLEN + #define MAXNAMLEN 255 + #endif + { "NAME_MAX", MAXNAMLEN }, + + { "PATH_MAX", MAXPATHLEN }, + + { NULL, 0 } + }; + + int + main() + { + extern char *ctime(); + extern time_t time(); + time_t now = time((time_t *) NULL); + register struct param *p; + + printf("\ + /* Implementation-specific limits.\n\ + Generated at %.25s. */\n\n", ctime(&now)); + + for (p = params; p->name != NULL; ++p) + printf("#define %s %d\n", p->name, p->value); + + exit(0); + } diff -rcN glibc-1.04/sysdeps/unix/bsd/setgroups.S glibc-1.05/sysdeps/unix/bsd/setgroups.S *** glibc-1.04/sysdeps/unix/bsd/setgroups.S --- glibc-1.05/sysdeps/unix/bsd/setgroups.S Thu Sep 3 21:52:58 1992 *************** *** 0 **** --- 1,22 ---- + /* Copyright (C) 1992 Free Software 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 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, + Cambridge, MA 02139, USA. */ + + #include + + SYSCALL (setgroups, 2) + ret diff -rcN glibc-1.04/sysdeps/unix/bsd/sun/sparc/start.c glibc-1.05/sysdeps/unix/bsd/sun/sparc/start.c *** glibc-1.04/sysdeps/unix/bsd/sun/sparc/start.c Thu Jun 11 15:47:07 1992 --- glibc-1.05/sysdeps/unix/bsd/sun/sparc/start.c Wed Sep 9 17:05:20 1992 *************** *** 59,70 **** void DEFUN_VOID(_start) { ! int argc; ! char **argv, **envp; /* Unwind the frame built when we entered the function. */ asm("restore"); /* The argument info starts after one register window (64 bytes) past the SP. */ argc = ((int *) sp)[16]; --- 59,76 ---- void DEFUN_VOID(_start) { ! /* It is important that these be declared `register'. ! Otherwise, when compiled without optimization, they are put on the ! stack, which loses completely after we zero the FP. */ ! register int argc; ! register char **argv, **envp; /* Unwind the frame built when we entered the function. */ asm("restore"); + /* And clear the frame pointer. */ + fp = 0; + /* The argument info starts after one register window (64 bytes) past the SP. */ argc = ((int *) sp)[16]; *************** *** 77,86 **** /* Allocate 24 bytes of stack space for the register save area. */ sp -= 24; __libc_init (argc, argv, envp); - - /* Clear the frame pointer down here, since the compiler's going to - refer to %fp when using ARGC, ARGV, and ENVP above. */ - fp = 0; exit (main (argc, argv, envp)); } --- 83,88 ---- diff -rcN glibc-1.04/sysdeps/unix/bsd/sun/sunos4/utsnamelen.h glibc-1.05/sysdeps/unix/bsd/sun/sunos4/utsnamelen.h *** glibc-1.04/sysdeps/unix/bsd/sun/sunos4/utsnamelen.h Tue May 26 02:45:14 1992 --- glibc-1.05/sysdeps/unix/bsd/sun/sunos4/utsnamelen.h Thu Sep 10 18:54:01 1992 *************** *** 1 **** ! #include --- 1 ---- ! #define _UTSNAME_LENGTH 9 diff -rcN glibc-1.04/sysdeps/unix/bsd/ultrix4/mips/sigcontext.h glibc-1.05/sysdeps/unix/bsd/ultrix4/mips/sigcontext.h *** glibc-1.04/sysdeps/unix/bsd/ultrix4/mips/sigcontext.h Thu Apr 30 03:10:37 1992 --- glibc-1.05/sysdeps/unix/bsd/ultrix4/mips/sigcontext.h Tue Sep 15 15:04:28 1992 *************** *** 27,33 **** sigset_t sc_mask; /* Program counter when the signal hit. */ ! PTR sc_pc; /* Registers 0 through 31. */ int sc_regs[32]; --- 27,33 ---- sigset_t sc_mask; /* Program counter when the signal hit. */ ! __ptr_t sc_pc; /* Registers 0 through 31. */ int sc_regs[32]; *************** *** 52,60 **** int sc_cause; /* CPU bad virtual address. */ ! PTR sc_badvaddr; /* CPU board bad physical address. */ ! PTR sc_badpaddr; }; --- 52,60 ---- int sc_cause; /* CPU bad virtual address. */ ! __ptr_t sc_badvaddr; /* CPU board bad physical address. */ ! __ptr_t sc_badpaddr; }; diff -rcN glibc-1.04/sysdeps/unix/bsd/ultrix4/mips/sysdep.h glibc-1.05/sysdeps/unix/bsd/ultrix4/mips/sysdep.h *** glibc-1.04/sysdeps/unix/bsd/ultrix4/mips/sysdep.h Wed Apr 29 23:12:09 1992 --- glibc-1.05/sysdeps/unix/bsd/ultrix4/mips/sysdep.h Tue Sep 15 15:04:26 1992 *************** *** 64,67 **** #define r0 v0 #define r1 v1 /* The mips move insn is d,s. */ ! #define MOVE(x,y) movl y , x --- 64,67 ---- #define r0 v0 #define r1 v1 /* The mips move insn is d,s. */ ! #define MOVE(x,y) move y , x diff -rcN glibc-1.04/sysdeps/unix/ioctls-tmpl.c glibc-1.05/sysdeps/unix/ioctls-tmpl.c *** glibc-1.04/sysdeps/unix/ioctls-tmpl.c Mon Aug 10 17:10:57 1992 --- glibc-1.05/sysdeps/unix/ioctls-tmpl.c Tue Sep 15 14:56:07 1992 *************** *** 27,32 **** --- 27,71 ---- #include #endif + /* These exist under Ultrix, but I figured there may be others. */ + #ifdef DIOCGETPT + #include /* for DIOC* */ + #endif + #ifdef DEVGETGEOM + #include + #endif + + #ifdef ultrix + /* Ultrix has a conditional include that brings these in; we have to force + their inclusion when we actually compile them. */ + #undef TCGETA + #undef TCSETA + #undef TCSETAW + #undef TCSETAF + #undef TCGETP + #undef TCSANOW + #undef TCSADRAIN + #undef TCSAFLUSH + #ifdef ELSETPID + #include /* get sockaddr_un for elcsd.h */ + #include + #endif + #ifdef DKIOCDOP + #include + #endif + /* Couldn't find the header where the structures used by these are + defined; it looks like an unbundled LAT package or something. */ + #undef LIOCSOL + #undef LIOCRES + #undef LIOCCMD + #undef LIOCINI + #undef LIOCTTYI + #undef LIOCCONN + /* struct mtop hasn't been in sys/mtio.h since 4.1 */ + #undef MTIOCTOP + #undef MTIOCGET + #endif + #define DEFINE(name, value) \ printf("#define %s 0x%.8x\n", (name), (value)) diff -rcN glibc-1.04/sysdeps/unix/sysv/linux/__wait4.S glibc-1.05/sysdeps/unix/sysv/linux/__wait4.S *** glibc-1.04/sysdeps/unix/sysv/linux/__wait4.S --- glibc-1.05/sysdeps/unix/sysv/linux/__wait4.S Tue Sep 15 16:07:12 1992 *************** *** 0 **** --- 1 ---- + #include diff -rcN glibc-1.04/sysdeps/unix/sysv/linux/syscall.h glibc-1.05/sysdeps/unix/sysv/linux/syscall.h *** glibc-1.04/sysdeps/unix/sysv/linux/syscall.h Tue Jul 14 20:38:40 1992 --- glibc-1.05/sysdeps/unix/sysv/linux/syscall.h Tue Sep 15 16:03:58 1992 *************** *** 111,115 **** --- 111,122 ---- #define SYS_lstat 107 #define SYS_fstat 108 #define SYS_uname 109 + #define SYS_iopl 110 + #define SYS_vhangup 111 + #define SYS_idle 112 + #define SYS_vm86 113 + #define SYS_wait4 114 + #define SYS_swapoff 115 + #endif /* syscall.h */ diff -rcN glibc-1.04/sysdeps/unix/sysv/statbuf.h glibc-1.05/sysdeps/unix/sysv/statbuf.h *** glibc-1.04/sysdeps/unix/sysv/statbuf.h Fri May 1 15:22:26 1992 --- glibc-1.05/sysdeps/unix/sysv/statbuf.h Thu Sep 17 18:59:37 1992 *************** *** 16,21 **** --- 16,24 ---- not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #ifndef _STATBUF_H + #define _STATBUF_H + struct stat { short int st_dev; *************** *** 30,32 **** --- 33,61 ---- long int st_mtime; long int st_ctime; }; + + /* Encoding of the file mode. */ + + #define __S_IFMT 0170000 /* These bits determine file type. */ + + /* File types. */ + #define __S_IFDIR 0040000 /* Directory. */ + #define __S_IFCHR 0020000 /* Character device. */ + #define __S_IFBLK 0060000 /* Block device. */ + #define __S_IFREG 0100000 /* Regular file. */ + #define __S_IFIFO 0010000 /* FIFO. */ + + /* These don't actually exist on System V, but having them doesn't hurt. */ + #define __S_IFLNK 0120000 /* Symbolic link. */ + #define __S_IFSOCK 0140000 /* Socket. */ + + /* Protection bits. */ + + #define __S_ISUID 04000 /* Set user ID on execution. */ + #define __S_ISGID 02000 /* Set group ID on execution. */ + #define __S_ISVTX 01000 /* Save swapped text after use (sticky). */ + #define __S_IREAD 0400 /* Read by owner. */ + #define __S_IWRITE 0200 /* Write by owner. */ + #define __S_IEXEC 0100 /* Execute by owner. */ + + #endif /* statbuf.h */ diff -rcN glibc-1.04/time/Makefile glibc-1.05/time/Makefile *** glibc-1.04/time/Makefile Wed Sep 2 22:41:52 1992 --- glibc-1.05/time/Makefile Fri Sep 18 19:04:06 1992 *************** *** 48,54 **** endef include zonenames - zonenames := $(subst $(nl), ,$(zonenames)) install-data = $(addprefix zoneinfo/,$(zonenames) \ $(filter-out /%,$(localtime-file) \ --- 48,53 ---- *************** *** 57,76 **** include ../Rules ! $(tzfiles:%=zones-%): zones-%: % (echo 'define $*-zones' ;\ awk '$$1 == "Zone" { print $$2 } $$1 == "Link" { print $$3 }' $^;\ echo 'endef' ;\ echo '$*-zones := $$(subst $$(nl), ,$$($*-zones))' ;\ echo 'ifdef $*-zones' ;\ ! echo '$$(addprefix zoneinfo/%/,$$($*-zones)): \' ;\ echo '$< $$(objpfx)zic leapseconds zoneinfo/' ;\ echo ' $$(tzcompile)' ;\ echo 'endif' ;\ ! echo 'define zonenames' ;\ ! echo '$$($*-zones)' ;\ ! echo 'endef' ;\ ! echo 'zonenames := $$(subst $$(nl), ,$$(zonenames))' ;\ ) > $@ zonenames: Makefile (for file in $(tzfiles); do \ --- 56,75 ---- include ../Rules ! $(tzfiles:%=zones-%): zones-%: % Makefile ! # Kludge alert: we use an implicit rule (in what we are generating here) ! # because that is the only way to tell Make that the one command builds all ! # the files. (echo 'define $*-zones' ;\ awk '$$1 == "Zone" { print $$2 } $$1 == "Link" { print $$3 }' $^;\ echo 'endef' ;\ echo '$*-zones := $$(subst $$(nl), ,$$($*-zones))' ;\ echo 'ifdef $*-zones' ;\ ! echo '$$(addprefix zone%/,$$($*-zones)): \' ;\ echo '$< $$(objpfx)zic leapseconds zoneinfo/' ;\ echo ' $$(tzcompile)' ;\ echo 'endif' ;\ ! echo 'zonenames := $$(zonenames) $$($*-zones)' ;\ ) > $@ zonenames: Makefile (for file in $(tzfiles); do \ *************** *** 112,121 **** $(objpfx)tzfile.o: tzfile.c; $(tz-cc) $(objpfx)zic.o: zic.c; $(tz-cc) ! define tz-cc ! $(COMPILE.c) $(+gcc-nowarn) \ -DTZDIR='"$(datadir)/zoneinfo"' \ -DTZDEFAULT='"$(localtime-file)"' \ -DTZDEFRULES='"$(posixrules-file)"' \ $< $(OUTPUT_OPTION) - endef --- 111,120 ---- $(objpfx)tzfile.o: tzfile.c; $(tz-cc) $(objpfx)zic.o: zic.c; $(tz-cc) ! ! # Some versions of GNU make have a bug with backslashes in define directives. ! tz-cc = $(COMPILE.c) $(+gcc-nowarn) \ -DTZDIR='"$(datadir)/zoneinfo"' \ -DTZDEFAULT='"$(localtime-file)"' \ -DTZDEFRULES='"$(posixrules-file)"' \ $< $(OUTPUT_OPTION) diff -rcN glibc-1.04/va-alpha.h glibc-1.05/va-alpha.h *** glibc-1.04/va-alpha.h --- glibc-1.05/va-alpha.h Fri Aug 14 15:32:10 1992 *************** *** 0 **** --- 1,186 ---- + /* GNU C varargs and stdargs support for the DEC Alpha. */ + + /* Note: We must use the name __builtin_savregs. GCC attaches special + significance to that name. In particular, regardless of where in a + function __builtin_saveregs is called, GCC moves the call up to the + very start of the function. */ + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + + typedef struct { + long __va_arg; /* Current argument number. */ + long *__va_stack; /* Start of arguments on stack */ + long *__va_iregs; /* Integer parameter registers ($16-$21) */ + long *__va_fregs; /* FP parameter registers ($f16-$f21) */ + } __gnuc_va_list; + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + + #define va_list __gnuc_va_list + #define _VA_LIST + #define _VA_LIST_ + + #if !defined(_STDARG_H) + + /* varargs support */ + #define va_alist __builtin_va_alist + #define va_dcl + #define va_start(pvar) ((pvar) = * (__gnuc_va_list *) __builtin_saveregs ()) + + #else /* STDARG.H */ + + /* ANSI alternative. */ + + #define va_start(pvar, firstarg) \ + ((pvar) = *(__gnuc_va_list *) __builtin_saveregs ()) + + #endif /* _STDARG_H */ + + #define va_end(__va) + + /* Values returned by __builtin_classify_type. */ + + enum { + __no_type_class = -1, + __void_type_class, + __integer_type_class, + __char_type_class, + __enumeral_type_class, + __boolean_type_class, + __pointer_type_class, + __reference_type_class, + __offset_type_class, + __real_type_class, + __complex_type_class, + __function_type_class, + __method_type_class, + __record_type_class, + __union_type_class, + __array_type_class, + __string_type_class, + __set_type_class, + __file_type_class, + __lang_type_class + }; + + /* Note that parameters are always aligned at least to a word boundary + (when passed) regardless of what GCC's __alignof__ operator says. */ + + /* Avoid errors if compiling GCC v2 with GCC v1. */ + #if __GNUC__ == 1 + #define __extension__ + #endif + + /* Get the rounded number of words of a type. */ + + #define __va_nwords(__type) \ + ((sizeof (__type) + sizeof (long) - 1) / sizeof (long)) + + #define va_arg(__va, __type) \ + __extension__ \ + (* (__type *) \ + ({ \ + register void *__rv; /* result value */ \ + switch (__builtin_classify_type (* (__type *) 0)) \ + { \ + case __real_type_class: \ + \ + /* Get a pointer to the value. If we want a float instead of \ + a double, we have to make one and point to it instead. */ \ + \ + __rv = (void *) & (__va.__va_arg < 6 \ + ? __va.__va_fregs[__va.__va_arg] \ + : __va.__va_stack[__va.__va_arg - 6]); \ + \ + if (sizeof (__type) == sizeof (float)) \ + { \ + float __rf = * ((double *) __rv); \ + \ + __rv = (void *) &__rf; \ + } \ + \ + break; \ + \ + case __void_type_class: \ + case __integer_type_class: \ + case __char_type_class: \ + case __enumeral_type_class: \ + case __boolean_type_class: \ + case __pointer_type_class: \ + case __reference_type_class: \ + case __offset_type_class: \ + case __record_type_class: \ + case __union_type_class: \ + \ + /* Force this on the stack if it's alignment isn't right. */ \ + \ + if (__va.__va_arg < 6) \ + switch (sizeof (__type)) \ + { \ + case sizeof (char): \ + break; \ + case sizeof (short): \ + if (__alignof__ (__type) < sizeof (short)) \ + __va.__va_arg = 6; \ + break; \ + case 3: \ + case sizeof (int): \ + if (__alignof__ (__type) < sizeof (int)) \ + __va.__va_arg = 6; \ + break; \ + default: \ + if (__alignof__ (__type) < sizeof (long)) \ + __va.__va_arg = 6; \ + break; \ + } \ + \ + /* If this object is only one word long, just get it. If it is \ + longer, we need to worry about the possibility that it is \ + passed both in registers and in memory. */ \ + \ + if (sizeof (__type) <= sizeof (long) \ + || __va.__va_arg >= 6 \ + || __va.__va_arg + __va_nwords (__type) < 6) \ + __rv = (void *) & (__va.__va_arg < 6 \ + ? __va.__va_iregs[__va.__va_arg] \ + : __va.__va_stack[__va.__va_arg - 6]); \ + else \ + { \ + long __obj[__va_nwords (__type)]; \ + int __i; \ + \ + for (__i = 0; __i < __va_nwords (__type); __i++) \ + __obj[__i] = (__va.__va_arg < 6 \ + ? __va.__va_iregs[__va.__va_arg] \ + : __va.__va_stack[__va.__va_arg - 6]); \ + \ + __rv = (void *) &__obj[0]; \ + } \ + break; \ + \ + case __complex_type_class: \ + case __function_type_class: \ + case __method_type_class: \ + case __array_type_class: \ + case __string_type_class: \ + case __set_type_class: \ + case __file_type_class: \ + case __lang_type_class: \ + case __no_type_class: \ + default: \ + abort (); \ + } \ + \ + __va.__va_arg += __va_nwords (__type); \ + \ + __rv; \ + })) + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ + diff -rcN glibc-1.04/va-i860.h glibc-1.05/va-i860.h *** glibc-1.04/va-i860.h --- glibc-1.05/va-i860.h Sat Aug 1 22:53:44 1992 *************** *** 0 **** --- 1,205 ---- + /* Note: We must use the name __builtin_savregs. GCC attaches special + significance to that name. In particular, regardless of where in a + function __builtin_saveregs is called, GCC moves the call up to the + very start of the function. */ + + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + + typedef union { + float __freg[8]; + double __dreg[4]; + } __f_regs; + + typedef struct { + #if defined (__SVR4__) || defined (__svr4__) || defined (__alliant__) + __f_regs __float_regs; long __ireg[12]; + #else /* pre-SVR4 */ + long __ireg[12]; __f_regs __float_regs; + #endif + } __va_saved_regs; + + typedef struct { + #if defined(__SVR4__) || defined(__alliant__) + unsigned __ireg_used; /* How many int regs consumed 'til now? */ + unsigned __freg_used; /* How many flt regs consumed 'til now? */ + long *__reg_base; /* Address of where we stored the regs. */ + long * __mem_ptr; /* Address of memory overflow args area. */ + #else /* pre-SVR4 */ + long *__reg_base; /* Address of where we stored the regs. */ + long * __mem_ptr; /* Address of memory overflow args area. */ + unsigned __ireg_used; /* How many int regs consumed 'til now? */ + unsigned __freg_used; /* How many flt regs consumed 'til now? */ + #endif + } __gnuc_va_list; + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + + #if !defined(_STDARG_H) + + /* varargs support */ + #define va_alist __builtin_va_alist + #define va_dcl + #define va_start(pvar) ((pvar) = * (__gnuc_va_list *) __builtin_saveregs ()) + + #else /* STDARG.H */ + + /* ANSI alternative. */ + /* Note that CUMULATIVE_ARGS elements are measured in bytes on the i860, + so we divide by 4 to get # of registers. */ + #define va_start(pvar, firstarg) \ + ((pvar) = *(__gnuc_va_list *) __builtin_saveregs (), \ + (pvar).__ireg_used = __builtin_args_info (0) / 4, \ + (pvar).__freg_used = __builtin_args_info (1) / 4, \ + (pvar).__mem_ptr = __builtin_next_arg ()) + + #endif /* _STDARG_H */ + + void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #define va_end(__va) + + /* Values returned by __builtin_classify_type. */ + + enum { + __no_type_class = -1, + __void_type_class, + __integer_type_class, + __char_type_class, + __enumeral_type_class, + __boolean_type_class, + __pointer_type_class, + __reference_type_class, + __offset_type_class, + __real_type_class, + __complex_type_class, + __function_type_class, + __method_type_class, + __record_type_class, + __union_type_class, + __array_type_class, + __string_type_class, + __set_type_class, + __file_type_class, + __lang_type_class + }; + + #define __NUM_PARM_FREGS 8 + #define __NUM_PARM_IREGS 12 + + #define __savereg(__va) ((__va_saved_regs *) (__va.__reg_base)) + + /* This macro works both for SVR4 and pre-SVR4 environments. */ + + /* Note that parameters are always aligned at least to a word boundary + (when passed) regardless of what GCC's __alignof__ operator says. */ + + /* Make allowances here for adding 128-bit (long double) floats someday. */ + + #if 0 /* What was this for? */ + #ifndef __GNU_VA_LIST + #define __ireg_used ireg_used + #define __freg_used freg_used + #define __mem_ptr mem_ptr + #define __reg_base reg_base + #endif + #endif /* 0 */ + + /* Avoid errors if compiling GCC v2 with GCC v1. */ + #if __GNUC__ == 1 + #define __extension__ + #endif + + #define va_arg(__va, __type) \ + __extension__ \ + (* (__type *) \ + ({ \ + register void *__rv; /* result value */ \ + register unsigned __align; \ + switch (__builtin_classify_type (* (__type *) 0)) \ + { \ + case __real_type_class: \ + switch (sizeof (__type)) \ + { \ + case sizeof (float): \ + case sizeof (double): \ + if (__va.__freg_used < __NUM_PARM_FREGS - 1) \ + { \ + if ((__va.__freg_used & 1) != 0) \ + __va.__freg_used++; /* skip odd */ \ + __rv = &__savereg(__va)->__float_regs.__freg[__va.__freg_used];\ + __va.__freg_used += 2; \ + } \ + else \ + { \ + if ((((unsigned) __va.__mem_ptr) & (sizeof(double)-1)) != 0) \ + __va.__mem_ptr++; /* skip odd */ \ + __rv = __va.__mem_ptr; \ + __va.__mem_ptr += 2; \ + } \ + if (sizeof (__type) == sizeof (float)) \ + { \ + *((float *) __rv) = *((double *) __rv); \ + *(((long *) __rv) + 1) = 0xfff00001; \ + } \ + break; \ + default: \ + abort (); \ + } \ + break; \ + case __void_type_class: \ + case __integer_type_class: \ + case __char_type_class: \ + case __enumeral_type_class: \ + case __boolean_type_class: \ + case __pointer_type_class: \ + case __reference_type_class: \ + case __offset_type_class: \ + if (sizeof (__type) <= 4) \ + { \ + __rv = (__va.__ireg_used < __NUM_PARM_IREGS \ + ? (&__savereg(__va)->__ireg[__va.__ireg_used++]) \ + : __va.__mem_ptr++); \ + break; \ + } \ + else if (__va.__ireg_used + sizeof (__type) / 4 <= __NUM_PARM_IREGS) \ + { \ + __rv = &__savereg(__va)->__ireg[__va.__ireg_used]; \ + __va.__ireg_used += sizeof (__type) / 4; \ + break; \ + } \ + /* Fall through to fetch from memory. */ \ + case __record_type_class: \ + case __union_type_class: \ + __align = (__alignof__ (__type) < sizeof (long) \ + ? sizeof (long) \ + : __alignof__ (__type)); \ + __va.__mem_ptr \ + = (long *) \ + ((((unsigned) __va.__mem_ptr) + (__align-1)) & ~(__align-1)); \ + __rv = __va.__mem_ptr; \ + __va.__mem_ptr \ + += ((sizeof (__type) + sizeof (long) - 1) / sizeof (long)); \ + break; \ + case __complex_type_class: \ + case __function_type_class: \ + case __method_type_class: \ + case __array_type_class: \ + case __string_type_class: \ + case __set_type_class: \ + case __file_type_class: \ + case __lang_type_class: \ + case __no_type_class: \ + default: \ + abort (); \ + } \ + __rv; \ + })) + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ + diff -rcN glibc-1.04/va-i960.h glibc-1.05/va-i960.h *** glibc-1.04/va-i960.h --- glibc-1.05/va-i960.h Tue Sep 15 01:02:45 1992 *************** *** 0 **** --- 1,60 ---- + /* GNU C varargs support for the Intel 80960. */ + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + /* The first element is the address of the first argument. + The second element is the number of bytes skipped past so far. */ + typedef unsigned __gnuc_va_list[2]; + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + + /* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + + #if __GNUC__ > 1 + #define __va_ellipsis ... + #else + #define __va_ellipsis + #endif + + /* The stack size of the type t. */ + #define __vsiz(T) (((sizeof (T) + 3) / 4) * 4) + /* The stack alignment of the type t. */ + #define __vali(T) (__alignof__ (T) >= 4 ? __alignof__ (T) : 4) + /* The offset of the next stack argument after one of type t at offset i. */ + #define __vpad(I, T) ((((I) + __vali (T) - 1) / __vali (T)) \ + * __vali (T) + __vsiz (T)) + + #ifdef _STDARG_H + #define va_start(AP, LASTARG) ((AP)[1] = 0, \ + *(AP) = (unsigned) __builtin_next_arg ()) + #else + + #define va_alist __builtin_va_alist + #define va_dcl char *__builtin_va_alist; __va_ellipsis + #define va_start(AP) ((AP)[1] = 0, *(AP) = (unsigned) &va_alist) + #endif + + /* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ + #define va_arg(AP, T) \ + ( \ + ( \ + ((AP)[1] <= 48 && (__vpad ((AP)[1], T) > 48 || __vsiz (T) > 16)) \ + ? ((AP)[1] = 48 + __vsiz (T)) \ + : ((AP)[1] = __vpad ((AP)[1], T)) \ + ), \ + \ + *((T *) (void *) ((char *) *(AP) + (AP)[1] - __vsiz (T))) \ + ) + + void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #define va_end(AP) + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ + diff -rcN glibc-1.04/va-m88k.h glibc-1.05/va-m88k.h *** glibc-1.04/va-m88k.h --- glibc-1.05/va-m88k.h Tue Sep 15 01:03:39 1992 *************** *** 0 **** --- 1,79 ---- + /* GNU C varargs support for the Motorola 88100 */ + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + + typedef struct + { + int __va_arg; /* argument number */ + int *__va_stk; /* start of args passed on stack */ + int *__va_reg; /* start of args passed in regs */ + } __gnuc_va_list; + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + + #ifdef _STDARG_H /* stdarg.h support */ + + #if __GNUC__ > 1 /* GCC 2.0 and beyond */ + #define va_start(AP,LASTARG) ((AP) = *(__gnuc_va_list *)__builtin_saveregs()) + #else + #define va_start(AP,LASTARG) \ + ( (AP).__va_reg = (int *) __builtin_saveregs2(0), \ + (AP).__va_stk = (int *) __builtin_argptr(), \ + (AP).__va_arg = (int) (__builtin_argsize() + 3) / 4 ) + #endif + + #else /* varargs.h support */ + + #if __GNUC__ > 1 /* GCC 2.0 and beyond */ + #define va_start(AP) ((AP) = *(__gnuc_va_list *)__builtin_saveregs()) + #else + #define va_start(AP) \ + ( (AP).__va_reg = (int *) __builtin_saveregs2(1), \ + (AP).__va_stk = (int *) __builtin_argptr(), \ + (AP).__va_arg = (int) (__builtin_argsize() - 4 + 3) / 4 ) + #endif + #define va_alist __va_1st_arg + #define va_dcl register int va_alist; + + #endif /* _STDARG_H */ + + /* Avoid trouble between this file and _int_varargs.h under DG/UX. This file + can be included by and others and provides definitions of + __va_size and __va_reg_p and a va_list typedef. Avoid defining va_list + again with _VA_LIST. */ + #ifdef __INT_VARARGS_H + #undef __va_size + #undef __va_reg_p + #define __gnuc_va_list va_list + #define _VA_LIST + #else + /* Similarly, if this gets included first, do nothing in _int_varargs.h. */ + #define __INT_VARARGS_H + #endif + + #define __va_reg_p(TYPE) \ + (__builtin_classify_type(*(TYPE *)0) < 12 \ + ? sizeof(TYPE) <= 8 : sizeof(TYPE) == 4 && __alignof__(TYPE) == 4) + + #define __va_size(TYPE) ((sizeof(TYPE) + 3) >> 2) + + /* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ + #define va_arg(AP,TYPE) \ + ( (AP).__va_arg = (((AP).__va_arg + (1 << (__alignof__(TYPE) >> 3)) - 1) \ + & ~((1 << (__alignof__(TYPE) >> 3)) - 1)) \ + + __va_size(TYPE), \ + *((TYPE *) (void *) ((__va_reg_p(TYPE) \ + && (AP).__va_arg < 8 + __va_size(TYPE) \ + ? (AP).__va_reg : (AP).__va_stk) \ + + ((AP).__va_arg - __va_size(TYPE))))) + + #define va_end(AP) + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff -rcN glibc-1.04/va-mips.h glibc-1.05/va-mips.h *** glibc-1.04/va-mips.h --- glibc-1.05/va-mips.h Tue Sep 15 01:04:29 1992 *************** *** 0 **** --- 1,61 ---- + /* ---------------------------------------- */ + /* VARARGS for MIPS/GNU CC */ + /* */ + /* */ + /* */ + /* */ + /* ---------------------------------------- */ + + + /* These macros implement varargs for GNU C--either traditional or ANSU. */ + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + typedef char * __gnuc_va_list; + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + + /* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + + #if __GNUC__ > 1 + #define __va_ellipsis ... + #else + #define __va_ellipsis + #endif + + #define __va_rounded_size(__TYPE) \ + (((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) + + #ifdef _STDARG_H + #define va_start(__AP, __LASTARG) \ + (__AP = ((char *) &(__LASTARG) + __va_rounded_size (__LASTARG))) + + #else + #define va_alist __builtin_va_alist + #define va_dcl int __builtin_va_alist; __va_ellipsis + #define va_start(__AP) __AP = (char *) &__builtin_va_alist + #endif + + void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #define va_end(__AP) + + #ifdef lint /* complains about constant in conditional context */ + #define va_arg(list, mode) ((mode *)(list += __va_rounded_size(mode)))[-1] + + #else /* !lint */ + /* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ + #define va_arg(__AP, __type) \ + ((__type *) (void *) (__AP = (char *) ((__alignof(__type) > 4 \ + ? ((int)__AP + 8 - 1) & -8 \ + : ((int)__AP + 4 - 1) & -4) \ + + __va_rounded_size(__type))))[-1] + #endif /* lint */ + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff -rcN glibc-1.04/va-pa.h glibc-1.05/va-pa.h *** glibc-1.04/va-pa.h --- glibc-1.05/va-pa.h Tue Sep 15 01:05:03 1992 *************** *** 0 **** --- 1,38 ---- + #if __GNUC__ > 1 + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + + typedef double *__gnuc_va_list; + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + #ifdef _STDARG_H + #define va_start(AP,LASTARG) ((AP) = (va_list)__builtin_saveregs()) + #else + /* The ... causes current_function_varargs to be set in cc1. */ + #define va_dcl long va_alist; ... + #define va_start(AP) ((AP) = (va_list)__builtin_saveregs()) + #endif + + #define va_arg(AP,TYPE) \ + (sizeof(TYPE) > 8 ? \ + ((AP = (__gnuc_va_list) ((char *)AP - sizeof (int))), \ + (*((TYPE *) (void *) (*((int *) (AP)))))) \ + :((AP = \ + (__gnuc_va_list) ((long)((char *)AP - sizeof (TYPE)) \ + & (sizeof(TYPE) > 4 ? ~0x7 : ~0x3))), \ + (*((TYPE *) (void *) ((char *)AP + ((8 - sizeof(TYPE)) % 4)))))) + + #define va_end(AP) + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ + + #else /* not __GNUC__ > 1 */ + #include "/usr/local/lib/gcc-include/va-hp9k8.h" + #define _VA_LIST_ + #endif diff -rcN glibc-1.04/va-pyr.h glibc-1.05/va-pyr.h *** glibc-1.04/va-pyr.h --- glibc-1.05/va-pyr.h Tue Sep 15 01:05:46 1992 *************** *** 0 **** --- 1,130 ---- + /** + * + * Varargs for PYR/GNU CC + * + * WARNING -- WARNING -- DANGER + * + * The code in this file implements varargs for gcc on a pyr in + * a way that is compatible with code compiled by the Pyramid Technology + * C compiler. + * As such, it depends strongly on the Pyramid conventions for + * parameter passing.ct and independent implementation. + * These (somewhat bizarre) parameter-passing conventions are described + * in the ``OSx Operating System Porting Guide''. + * + * A quick summary is useful: + * 12 of the 48 register-windowed regs available for + * parameter passing. Parameters of a function call that are eligible + * to be passed in registers are assigned registers from TR0/PR0 onwards; + * all other arguments are passed on the stack. + * Structure and union parameters are *never* passed in registers, + * even if they are small enough to fit. They are always passed on + * the stack. + * + * Double-sized parameters cannot be passed in TR11, because + * TR12 is not used for passing parameters. If, in the absence of this + * rule, a double-sized param would have been passed in TR11, + * that parameter is passed on the stack and no parameters are + * passed in TR11. + * + * It is only known to work for passing 32-bit integer quantities + * (ie chars, shorts, ints/enums, longs), doubles, or pointers. + * Passing structures on a Pyramid via varargs is a loser. + * Passing an object larger than 8 bytes on a pyramid via varargs may + * also be a loser. + * + */ + + + /* + * pointer to next stack parameter in __va_buf[0] + * pointer to next parameter register in __va_buf[1] + * Count of registers seen at __va_buf[2] + * saved pr0..pr11 in __va_buf[3..14] + * # of calls to va_arg (debugging) at __va_buf[15] + */ + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + + typedef void *__voidptr; + #if 1 + + typedef struct __va_regs { + __voidptr __stackp,__regp,__count; + __voidptr __pr0,__pr1,__pr2,__pr3,__pr4,__pr5,__pr6,__pr7,__pr8,__pr9,__pr10,__pr11; + } __va_regs; + + typedef __va_regs __va_buf; + #else + + /* __va_buf[0] = address of next arg passed on the stack + __va_buf[1] = address of next arg passed in a register + __va_buf[2] = register-# of next arg passed in a register + */ + typedef __voidptr(*__va_buf); + + #endif + + typedef __va_buf __gnuc_va_list; + + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + + /* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + + #if __GNUC__ > 1 + #define __va_ellipsis ... + #else + #define __va_ellipsis + #endif + + #define va_alist \ + __va0,__va1,__va2,__va3,__va4,__va5,__va6,__va7,__va8,__va9,__va10,__va11, \ + __builtin_va_alist + + /* The ... causes current_function_varargs to be set in cc1. */ + #define va_dcl __voidptr va_alist; __va_ellipsis + + + /* __asm ("rcsp %0" : "=r" ( _AP [0]));*/ + + #define va_start(_AP) \ + _AP = ((struct __va_regs) { \ + &(_AP.__pr0), (void*)&__builtin_va_alist, (void*)0, \ + __va0,__va1,__va2,__va3,__va4,__va5, \ + __va6,__va7,__va8,__va9,__va10,__va11}) + + + /* Avoid errors if compiling GCC v2 with GCC v1. */ + #if __GNUC__ == 1 + #define __extension__ + #endif + + /* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ + #define va_arg(_AP, _MODE) \ + __extension__ \ + ({__voidptr *__ap = (__voidptr*)&_AP; \ + register int __size = sizeof (_MODE); \ + register int __onstack = \ + (__size > 8 || ( (int)(__ap[2]) > 11) || \ + (__size==8 && (int)(__ap[2])==11)); \ + register int* __param_addr = ((int*)((__ap) [__onstack])); \ + \ + ((void *)__ap[__onstack])+=__size; \ + if (__onstack==0 || (int)(__ap[2])==11) \ + __ap[2]+= (__size >> 2); \ + *(( _MODE *) (void *) __param_addr); \ + }) + + void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #define va_end(_X) + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ diff -rcN glibc-1.04/va-sparc.h glibc-1.05/va-sparc.h *** glibc-1.04/va-sparc.h --- glibc-1.05/va-sparc.h Tue Sep 15 01:01:13 1992 *************** *** 0 **** --- 1,80 ---- + /* This is just like the default gvarargs.h + except for differences described below. */ + + /* Define __gnuc_va_list. */ + + #ifndef __GNUC_VA_LIST + #define __GNUC_VA_LIST + + #ifndef __svr4__ + /* This has to be a char * to be compatible with Sun. + i.e., we have to pass a `va_list' to vsprintf. */ + typedef char * __gnuc_va_list; + #else + /* This has to be a void * to be compatible with Sun svr4. + i.e., we have to pass a `va_list' to vsprintf. */ + typedef void * __gnuc_va_list; + #endif + #endif /* not __GNUC_VA_LIST */ + + /* If this is for internal libc use, don't define anything but + __gnuc_va_list. */ + #if defined (_STDARG_H) || defined (_VARARGS_H) + + /* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + + #if __GNUC__ > 1 + #define __va_ellipsis ... + #else + #define __va_ellipsis + #endif + + #ifdef _STDARG_H + #define va_start(AP, LASTARG) \ + (__builtin_saveregs (), AP = ((char *) __builtin_next_arg ())) + #else + #define va_alist __builtin_va_alist + /* The ... causes current_function_varargs to be set in cc1. */ + #define va_dcl int __builtin_va_alist; __va_ellipsis + + #define va_start(AP) \ + (__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist)) + #endif + + void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #define va_end(pvar) + + #define __va_rounded_size(TYPE) \ + (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) + + /* Avoid errors if compiling GCC v2 with GCC v1. */ + #if __GNUC__ == 1 + #define __extension__ + #endif + + /* RECORD_TYPE args passed using the C calling convention are + passed by invisible reference. ??? RECORD_TYPE args passed + in the stack are made to be word-aligned; for an aggregate that is + not word-aligned, we advance the pointer to the first non-reg slot. */ + /* We don't declare the union member `d' to have type TYPE + because that would lose in C++ if TYPE has a constructor. */ + /* We cast to void * and then to TYPE * because this avoids + a warning about increasing the alignment requirement. */ + #define va_arg(pvar,TYPE) \ + __extension__ \ + ({ TYPE __va_temp; \ + ((__builtin_classify_type (__va_temp) >= 12) \ + ? ((pvar) += __va_rounded_size (TYPE *), \ + **(TYPE **) ((pvar) - __va_rounded_size (TYPE *))) \ + : __va_rounded_size (TYPE) == 8 \ + ? ({ union {char __d[sizeof (TYPE)]; int __i[2];} __u; \ + __u.__i[0] = ((int *) (pvar))[0]; \ + __u.__i[1] = ((int *) (pvar))[1]; \ + (pvar) += 8; \ + *(TYPE *) (void *) __u.__d; }) \ + : ((pvar) += __va_rounded_size (TYPE), \ + *((TYPE *) (void *) ((pvar) - __va_rounded_size (TYPE)))));}) + + #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */ + diff -rcN glibc-1.04/va-spur.h glibc-1.05/va-spur.h *** glibc-1.04/va-spur.h --- glibc-1.05/va-spur.h Sat Aug 1 22:55:23 1992 *************** *** 0 **** --- 1,61 ---- + /* varargs.h for SPUR */ + + /* NB. This is NOT the definition needed for the new ANSI proposed + standard */ + + + struct __va_struct { char __regs[20]; }; + + #define va_alist __va_regs, __va_stack + + /* In GCC version 2, we want an ellipsis at the end of the declaration + of the argument list. GCC version 1 can't parse it. */ + + #if __GNUC__ > 1 + #define __va_ellipsis ... + #else + #define __va_ellipsis + #endif + + /* The ... causes current_function_varargs to be set in cc1. */ + #define va_dcl struct __va_struct __va_regs; int __va_stack; + + typedef struct { + int __pnt; + char *__regs; + char *__stack; + } va_list; + + #define va_start(pvar) \ + ((pvar).__pnt = 0, (pvar).__regs = __va_regs.__regs, \ + (pvar).__stack = (char *) &__va_stack) + #define va_end(pvar) + + /* Avoid errors if compiling GCC v2 with GCC v1. */ + #if __GNUC__ == 1 + #define __extension__ + #endif + + #define va_arg(pvar,type) \ + __extension__ \ + ({ type __va_result; \ + if ((pvar).__pnt >= 20) { \ + __va_result = *( (type *) ((pvar).__stack + (pvar).__pnt - 20)); \ + (pvar).__pnt += (sizeof(type) + 7) & ~7; \ + } \ + else if ((pvar).__pnt + sizeof(type) > 20) { \ + __va_result = * (type *) (pvar).__stack; \ + (pvar).__pnt = 20 + ( (sizeof(type) + 7) & ~7); \ + } \ + else if (sizeof(type) == 8) { \ + union {double d; int i[2];} __u; \ + __u.i[0] = *(int *) ((pvar).__regs + (pvar).__pnt); \ + __u.i[1] = *(int *) ((pvar).__regs + (pvar).__pnt + 4); \ + __va_result = * (type *) &__u; \ + (pvar).__pnt += 8; \ + } \ + else { \ + __va_result = * (type *) ((pvar).__regs + (pvar).__pnt); \ + (pvar).__pnt += (sizeof(type) + 3) & ~3; \ + } \ + __va_result; }) diff -rcN glibc-1.04/version.c glibc-1.05/version.c *** glibc-1.04/version.c Wed Sep 2 16:36:58 1992 --- glibc-1.05/version.c Fri Sep 18 19:30:50 1992 *************** *** 20,26 **** #include CONST char __libc_release[] = "beta"; ! CONST char __libc_version[] = "1.04"; void DEFUN_VOID(__libc_print_version) --- 20,26 ---- #include CONST char __libc_release[] = "beta"; ! CONST char __libc_version[] = "1.05"; void DEFUN_VOID(__libc_print_version)