home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-15 | 107.5 KB | 4,570 lines |
- diff -cr ../mntlib34/Bugs ./Bugs
- *** ../mntlib34/Bugs Tue Jul 6 09:45:30 1993
- --- ./Bugs Tue Jul 13 12:09:40 1993
- ***************
- *** 31,45 ****
- For you to decide upon the correct action!
-
- [I just read this for the 90th time and I finally understand what's being
- ! said (I can be pretty dense sometimes. <grin>) I guess making symbolic
- ! links for the sys/ files is the best solution but I'm reluctant to
- ! distribute the library that way as I'm not sure how ZOO would unpack the
- ! links on a TOS filesystem. -entropy]
-
- abort.c: ++entropy
- ! Should fclose() all streams in the same way of exit(). Also, if my
- ! understanding is correct, it should unmask SIGABRT, and also set SIGABRT's
- ! signal handler to SIG_DFL if it was SIG_IGN, before raising the signal.
-
- access.c: ++entropy
- I think my "superuser can access anything" assumption is wrong, especially
- --- 31,49 ----
- For you to decide upon the correct action!
-
- [I just read this for the 90th time and I finally understand what's being
- ! said (I can be pretty dense sometimes. <grin>) I've hopefully made it
- ! impossible for this to go into an infinite loop by changing the include
- ! protection in some of the sys/*.h files. Now it should just unwind the
- ! second time it hits the sys/wait.h file (or other sys/ file) and
- ! eventually your compile will bomb because it never got the correct
- ! definitions from the include file. That should be easier to track down
- ! than a hung compiler, at least. -entropy]
-
- abort.c: ++entropy
- ! If my understanding is correct, abort() should unmask SIGABRT, and also
- ! set SIGABRT's signal handler to SIG_DFL if it was SIG_IGN, before raising
- ! the signal. Would someone with a copy of the POSIX spec please look into
- ! this?
-
- access.c: ++entropy
- I think my "superuser can access anything" assumption is wrong, especially
- ***************
- *** 146,152 ****
- scanf.c: ++jrb
- Evidently loses big time. Run Gcctests and find out what's what.
-
- ! sigaction.c: ++nox@jelal.north.de, ++entropy
- sigblock() could be declared int at least #ifndef __MSHORT__. The
- functions sigpending(), sigprocmask(), and sigsuspend() have not been
- tested. The other new POSIX sig*() functions have been tested but not
- --- 150,156 ----
- scanf.c: ++jrb
- Evidently loses big time. Run Gcctests and find out what's what.
-
- ! sigactio.c: ++nox@jelal.north.de, ++entropy
- sigblock() could be declared int at least #ifndef __MSHORT__. The
- functions sigpending(), sigprocmask(), and sigsuspend() have not been
- tested. The other new POSIX sig*() functions have been tested but not
- ***************
- *** 200,221 ****
- file! (which can be annoying on things like lock files...)
- [I don't think this can be fixed in the library. MiNT acts this
- way on purpose. -entropy]
- -
- - utime.c: ++boender
- - stime(): My System V.3 manual state that `The stime() call will
- - fail if the effective user ID of the calling process is not
- - super-user.'. Now, I know the underlying system calls Tsetdate()
- - and Tsettime() are not privileged, and possibly the clock itself
- - can also be set on hardware level. What do we do here? Perhaps
- - MiNT should be fixed to check the effective user ID in Tsetdate()
- - and Tsettime() (a trivial fix in MiNT source file dos.c), or
- - perhaps we should do a check in stime(). I personally would prefer
- - MiNT to be fixed. Could you raise this subject with Eric Smith?
- - [I did, and I believe someone mentioned that it is now a privileged
- - call in MiNT 1.05, but I'm still running 1.04 so I cannot verify this.
- - As to the hardware clock, I'd hope that would be in protected memory
- - on newer machines, but I don't know. Anyone want to give me a TT
- - so I can try it? <grin> -entropy]
-
- utmp.c: ++boender
- The utmp structure as defined differs from the System V structure.
- --- 204,209 ----
- diff -cr ../mntlib34/Changelog ./Changelog
- *** ../mntlib34/Changelog Thu Jul 8 07:50:18 1993
- --- ./Changelog Mon Sep 13 07:21:28 1993
- ***************
- *** 4,9 ****
- --- 4,137 ----
- Changes are listed in *reverse* order, most recent changes being
- first.
-
- + PATCHLEVEL35::
- +
- + unx2dos.c: ++schwab
- + _unx2dos("/dev/.") -> ".:" -> file not found. This patch isn't
- + optimal, because it only works for the first 26 drives, but better
- + than before. (Who has more than 26 drives anyway? :-)
- + wait.c, waitpid.c, wait.h: ++Robert.Wilhelm@Physik.TU-Muenchen.DE
- + Accept both POSIX and BSD style parameters. [I'm not certain these
- + patches really leave us with a POSIX-compliant wait*() suite, but
- + I'll leave it be for now -entropy]
- + Makefile: ++Bjarne_Pohlers
- + Fix 020 targets to use 'make install020', and fix all targets to
- + do 'make clean' only when necessary.
- + doprnt.c, scanf.c: ++Bjarne_Pohlers@ms2.maus.de
- + Add support for printing/scanning long longs.
- + div.c: ++pvt1-117
- + Add div functions for compilers other than GCC.
- + bsearch.c: ++dsb
- + Fix bug reported by Thorsten Roskowetz: the order arguments to
- + bsearch()'s comparison function was reversed.
- + sozobon/makefile, sozobon/readme: ++dsb
- + Updated to reflect recent changes in the library.
- + thread.c: ++dsb
- + Fix a strange declaration (extern static?!?).
- + sozobon/linea.s, sozobon/makefile: ++dsb@cs.duke.edu
- + Fix some HSC linker problems by punting alglobal.o.
- + ioctl.h: ++Jan-Hinrich_Fessel@un.maus.ruhr.de (Jan-Hinrich Fessel)
- + Make it possible to include both ioctl.h and filesys.h.
- + pgrp.c: ++schwab
- + Correctly check the MiNT version in _bsd_getpgrp().
- + clock.c, doprnt.c, main.c, thread.c, uname.c: ++pvt1-117
- + Changes to keep Lattice C from generating annoying warnings, and
- + other miscellaneous cleanups. [Once again I've modified these
- + patches in various ways, so if something's broken it's my fault
- + -entropy].
- + math.h, process.h, support.h, unistd.h, exec.c, execp.c, findfile.c,
- + scanf.c, spawn.c, spawnve.c, spawnvp.c, statfs.c, textio.c: ++schwab
- + Add 'const' to declarations where appropriate.
- + malloc.c: ++schwab
- + Make malloc() round all memory requests to the page size to be able
- + to use all the available memory.
- + setjmp.cpp, setjmp.h: ++schwab
- + Some cleanup; one element of jmp_buf[] can be saved by using the
- + fact that signal 0 cannot be masked; why was the type char*[] insead
- + of long[]?
- + osbind.cpp: ++schwab
- + Add some missing functions added; code cleanup.
- + select.c: ++schwab@ls5.informatik.uni-dortmund.de
- + Fix select() to deal with timeouts of more than 65.535 seconds. This
- + is needed for emacs 19.
- + statfs.c: ++schwab
- + In statfs(): before passing to Dcntl, the path must be passed
- + through _unx2dos, and it should be declared const.
- + sysconf.c: ++schwab
- + Update the value returned for _PC_LAST.
- + fopen.c: ++schwab
- + Make fopen() use 0666 as the default file mask (use umask() if you
- + want something else); make mkdir() respect the umask setting.
- + mktemp.c: ++schwab
- + mktemp() can generate a name more than once; the length of the
- + pattern should not be changed (emacs depends on it).
- + lattice/crt0.s: ++pvt1-117
- + Add some conditional stuff depending on program type.
- + utime.c: ++shenson@nyx.cs.du.edu
- + Pass through a NULL tset argument unchanged to the filesystem
- + so that it can determine permissions correctly.
- + falcon.h: ++hyc@hanauma.Jpl.Nasa.Gov, ++Markus_Kilbinger@ac.maus.de
- + Change several erroneous macros to correctly cast return to short.
- + lattice/*: ++pvt1-117
- + Strip all carriage returns from Lattice C files.
- + spawn.c: ++Ole_Arndt
- + Add script interpretation (#!).
- + sync.c, support.h: ++Ole_Arndt
- + NEW file, sync() and fsync() (for Minixfs only). Proto in support.h.
- + sigactio.c: ++Ole_Arndt
- + Use __NSIG instead of NSIG, may as well be POSIX-clean.
- + errno.h: ++Ole_Arndt
- + Add errors ENOTDIR and ELOOP.
- + signal.h: ++Ole_Arndt@f.maus.de (Ole Arndt)
- + Fix definition of _SIGSET_MAX_INDEX to correct several bugs
- + in the POSIX signal mask functios.
- + stdio.h:
- + Add vsscanf() and _getbuf() protos (yech).
- + dirent.h:
- + Add alphasort() proto (excluded by _POSIX_SOURCE).
- + utmp.c, wtmp.c, utmp.h:
- + Rename write_utmp() to _write_utmp(). Rename write_wtmp() to
- + _write_wtmp(). Add protos (and other cleanups) to utmp.h.
- + atof.c, fdopen.c, fputs.c:
- + Move 'register' to beginning of declarations (shuts up gcc -Wall).
- + fwrite.c: ++michal
- + With unbuffered IO fwrite miscounts number of characters written.
- + findfile.c: ++michal
- + Try to accomodate tos style paths PATH=e:\bin,c:\bin,...
- + unistd.h: ++jrb
- + Take out setlinebuf, doesn't really belong here.
- + ffs.c: ++NTOMCZAK@vm.ucs.UAlberta.CA (Michal Jaegermann)
- + An even faster algorithm. Yow! Are we optimized yet?
- + support.h:
- + Added _exit() and gethostname() protos. Removed write_utmp() and
- + write_wtmp() protos.
- + lib.h, crtinit.c:
- + Moved prototypes from crtinit.c to lib.h, and added more to lib.h.
- + abort.c, main.c, lib.h:
- + Make abort() close file handles in exactly the same manner
- + as exit().
- + sigactio.c, signal.h: ++nox@jelal.north.de, ++Oskar, ++entropy
- + Fix type of sa_mask in struct sigaction (sigset_t, not long).
- + Clean up dirty tricks in sigaction() (UNTESTED).
- + falcon.h: ++Markus_Kilbinger@ac.maus.de, ++entropy
- + Add missing traps.
- + unistd.h, support.h:
- + Cleaned unistd.h for easier reading. Moved back the link(),
- + symlink(), and readlink() protos from support.h (sorry if I seem
- + really indecisive on where some of these protos belong).
- + doprnt.c, getdtabl.c, gethostn.c, mknod.c, nice.c, open.c, putenv.c,
- + symlink.c, utime.c:
- + Include appropriate headers for protos (and fixed mknod() proto).
- + sys/statfs.h:
- + Add statfs() proto.
- + sys/errno.h, sys/ioctl.h, sys/resource.h, sys/signal.h, sys/wait.h:
- + Fix multiple-include protection to hopefully prevent possible
- + infinite include loops (see Bugs file).
- + getpw.c, pwd.h: ++Jan-Hinrich_Fessel@un.maus.de (Oskar)
- + Use uid_t (_UID_T) for getpwuid() instead of int (POSIX).
- + lattice/inc.i: ++pvt1-117@nada.kth.se
- + Fix a typo.
- +
- PATCHLEVEL34::
-
- ffs.c: ++frog
- ***************
- *** 14,20 ****
- doprnt.c: ++schwab@ls5.informatik.uni-dortmund.de (Andreas Schwab)
- The decimal precision in a printf format does not include the sign or
- hex prefix, e.g. printf ("%-2.5d", -18) should print "-00018".
- ! select.c, time.h: ++Frank_Baumgart@pb.maus,de, ++entropy
- Get struct timeval from time.h, eliminate local definition.
- Add prototype of select() to time.h (is there a better place?)
- ctype.h, grp.h, dirent.h, stddef.h, string.h:
- --- 142,148 ----
- doprnt.c: ++schwab@ls5.informatik.uni-dortmund.de (Andreas Schwab)
- The decimal precision in a printf format does not include the sign or
- hex prefix, e.g. printf ("%-2.5d", -18) should print "-00018".
- ! select.c, time.h: ++Frank_Baumgart@pb.maus.de, ++entropy
- Get struct timeval from time.h, eliminate local definition.
- Add prototype of select() to time.h (is there a better place?)
- ctype.h, grp.h, dirent.h, stddef.h, string.h:
- diff -cr ../mntlib34/Files ./Files
- *** ../mntlib34/Files Thu Jul 8 08:37:26 1993
- --- ./Files Sun Jul 18 09:03:42 1993
- ***************
- *** 41,53 ****
-
- MiNT library:
-
- ! Bugs
- ! Changelog
- ! Copyright execp.c isatty.c spawnvp.c
- ! Files fcntl.c kill.c pause.c sscanf.c
- ! GMakefile.16 fopenp.c stat.c
- ! GMakefile.32 fork.c killpg.c pipe.c statfs.c
- ! GNUGPL2 fscanf.c popen.c symlink.c
- Makefile getcwd.c read.c sysconf.c
- OChangelog rename.c thread.c
- PatchLev.h getdtabl.c link.c rmdir.c times.c
- --- 41,53 ----
-
- MiNT library:
-
- ! Bugs spawnvp.c
- ! Changelog sscanf.c
- ! Copyright execp.c isatty.c stat.c
- ! Files fcntl.c kill.c pause.c statfs.c
- ! GMakefile.16 fopenp.c symlink.c
- ! GMakefile.32 fork.c killpg.c pipe.c sync.c
- ! GNUGPL2 fscanf.c popen.c
- Makefile getcwd.c read.c sysconf.c
- OChangelog rename.c thread.c
- PatchLev.h getdtabl.c link.c rmdir.c times.c
- diff -cr ../mntlib34/Makefile ./Makefile
- *** ../mntlib34/Makefile Thu Jul 8 06:06:56 1993
- --- ./Makefile Mon Sep 13 11:22:00 1993
- ***************
- *** 55,63 ****
- INCLUDE_DIR := ../minclude
- endif
- XPFLAGS := -nostdinc -I$(INCLUDE_DIR)
- ! XFLAGS := $(XPFLAGS) -Wall
- endif
-
- # Additional options for compiling C code
-
- #XFLAGS := -I../co
- --- 55,66 ----
- INCLUDE_DIR := ../minclude
- endif
- XPFLAGS := -nostdinc -I$(INCLUDE_DIR)
- ! XFLAGS := $(XPFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes
- endif
-
- + # Flags for extra 'long long' support under newer gcc's
- + #LONGLONG=-DPRINTF_LONGLONG
- +
- # Additional options for compiling C code
-
- #XFLAGS := -I../co
- ***************
- *** 112,118 ****
- CFFLAGS = $(SHORT) $(COPTS)
-
- # normal CFLAGS including int size and omit-frame-pointer
- ! CFLAGS= $(CFFLAGS) $(FRAME)
-
- # cflags for stuff that needs to be compiled with 32 bit ints
- CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
- --- 115,121 ----
- CFFLAGS = $(SHORT) $(COPTS)
-
- # normal CFLAGS including int size and omit-frame-pointer
- ! CFLAGS= $(CFFLAGS) $(FRAME) $(LONGLONG)
-
- # cflags for stuff that needs to be compiled with 32 bit ints
- CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
- ***************
- *** 150,213 ****
-
- #all: lshort llong lgshort lglong
- top: lshort llong lbshort lblong
- ! #top: l020short l020long l020bshort l020blong
-
- ! lshort:
- $(MAKE) clean
- $(MAKE) install
-
- ! llong:
- ! $(MAKE) clean
- $(MAKE) install TARGET="long-int"
-
- ! lgshort:
- ! $(MAKE) clean
- $(MAKE) install TARGET=debug
-
- ! lglong:
- ! $(MAKE) clean
- $(MAKE) install TARGET="long-int debug"
-
- ! l020short:
- ! $(MAKE) clean
- ! $(MAKE) install TARGET=68020
- ! # $(MAKE) install020 TARGET=68020
- !
- ! l020long:
- ! $(MAKE) clean
- ! $(MAKE) install TARGET="68020 long-int"
- ! # $(MAKE) install020 TARGET="68020 long-int"
-
- ! lbshort:
- ! $(MAKE) clean
- $(MAKE) install TARGET="baserel"
-
- ! lblong:
- ! $(MAKE) clean
- $(MAKE) install TARGET="long-int baserel"
-
- ! l020bshort:
- ! $(MAKE) clean
- ! $(MAKE) install TARGET="68020 baserel"
-
- ! l020blong:
- ! $(MAKE) clean
- ! $(MAKE) install TARGET="68020 long-int baserel"
-
- ! lsfpshort:
- ! $(MAKE) clean
- $(MAKE) install TARGET="sfp004"
-
- ! lsfplong:
- ! $(MAKE) clean
- $(MAKE) install TARGET="long-int sfp004"
-
- ! lbsfpshort:
- ! $(MAKE) clean
- $(MAKE) install TARGET="baserel sfp004"
-
- ! lbsfplong:
- ! $(MAKE) clean
- $(MAKE) install TARGET="long-int baserel sfp004"
-
- bakclean:
- --- 153,207 ----
-
- #all: lshort llong lgshort lglong
- top: lshort llong lbshort lblong
- ! top020: l020short l020long l020bshort l020blong
-
- ! %.target:
- $(MAKE) clean
- + -rm -f *.target
- + -touch $@
- +
- + lshort: lshort.target
- $(MAKE) install
-
- ! llong: llong.target
- $(MAKE) install TARGET="long-int"
-
- ! lgshort: lgshort.target
- $(MAKE) install TARGET=debug
-
- ! lglong: lglong.target
- $(MAKE) install TARGET="long-int debug"
-
- ! l020short: l020short.target
- ! $(MAKE) install020 TARGET=68020
- ! # $(MAKE) install TARGET=68020
- !
- ! l020long: l020long.target
- ! $(MAKE) install020 TARGET="68020 long-int"
- ! # $(MAKE) install TARGET="68020 long-int"
-
- ! lbshort: lbshort.target
- $(MAKE) install TARGET="baserel"
-
- ! lblong: lblong.target
- $(MAKE) install TARGET="long-int baserel"
-
- ! l020bshort: l020bshort.target
- ! $(MAKE) install020 TARGET="68020 baserel"
-
- ! l020blong: l020blong.target
- ! $(MAKE) install020 TARGET="68020 long-int baserel"
-
- ! lsfpshort: lsfpshort.target
- $(MAKE) install TARGET="sfp004"
-
- ! lsfplong: lsfplong.target
- $(MAKE) install TARGET="long-int sfp004"
-
- ! lbsfpshort: lbsfpshort.target
- $(MAKE) install TARGET="baserel sfp004"
-
- ! lbsfplong: lbsfplong.target
- $(MAKE) install TARGET="long-int baserel sfp004"
-
- bakclean:
- ***************
- *** 226,231 ****
- --- 220,226 ----
- rm -f foo bar baz
-
- distclean: realclean
- + rm -f diffc diffh
-
- # Get the rules to build everything...
-
- diff -cr ../mntlib34/PatchLev.h ./PatchLev.h
- *** ../mntlib34/PatchLev.h Tue Jul 6 07:50:46 1993
- --- ./PatchLev.h Fri Jul 9 06:30:38 1993
- ***************
- *** 3,6 ****
- * directory.
- */
-
- ! #define PatchLevel "34"
- --- 3,6 ----
- * directory.
- */
-
- ! #define PatchLevel "35"
- diff -cr ../mntlib34/README ./README
- *** ../mntlib34/README Wed Jun 23 05:53:30 1993
- --- ./README Sun Jul 11 05:47:24 1993
- ***************
- *** 11,19 ****
- GNU C and common files: entropy@terminator.rs.itd.umich.edu (Nick Castellano)
- Sozobon C/HSC: dsb@cs.duke.edu (D. Scott Bigham)
- Pure C: hohmuth@freia.inf.tu-dresden.de (Michael Hohmuth)
- ! Lattice C: ???
-
- ! Be sure to read the "Changes" file so that you know what's new in this
- release of the library.
-
- Also, please read the "Copyright" file for important copyright information
- --- 11,19 ----
- GNU C and common files: entropy@terminator.rs.itd.umich.edu (Nick Castellano)
- Sozobon C/HSC: dsb@cs.duke.edu (D. Scott Bigham)
- Pure C: hohmuth@freia.inf.tu-dresden.de (Michael Hohmuth)
- ! Lattice C: pvt1-117@nada.kth.se
-
- ! Be sure to read the "Changelog" file so that you know what's new in this
- release of the library.
-
- Also, please read the "Copyright" file for important copyright information
- diff -cr ../mntlib34/abort.c ./abort.c
- *** ../mntlib34/abort.c Fri Feb 26 12:08:46 1993
- --- ./abort.c Tue Jul 13 11:27:42 1993
- ***************
- *** 3,8 ****
- --- 3,9 ----
- #include <signal.h>
- #include <stdlib.h>
- #include <unistd.h>
- + #include "lib.h"
-
- #ifndef SIGABRT
- #define SIGABRT SIGIOT
- ***************
- *** 11,15 ****
- --- 12,17 ----
- __EXITING abort()
- {
- raise(SIGABRT);
- + _fclose_all_files();
- _exit(127);
- }
- diff -cr ../mntlib34/atof.c ./atof.c
- *** ../mntlib34/atof.c Sun Feb 28 13:07:18 1993
- --- ./atof.c Thu Jul 15 07:56:52 1993
- ***************
- *** 241,247 ****
- #define CONVF 0x08
-
- double strtod (s, endptr)
- ! const register char *s;
- char **endptr;
- {
- double accum = 0.0;
- --- 241,247 ----
- #define CONVF 0x08
-
- double strtod (s, endptr)
- ! register const char *s;
- char **endptr;
- {
- double accum = 0.0;
- diff -cr ../mntlib34/bsearch.c ./bsearch.c
- *** ../mntlib34/bsearch.c Fri Feb 26 17:19:36 1993
- --- ./bsearch.c Mon Sep 13 06:25:30 1993
- ***************
- *** 36,50 ****
- while(a <= b)
- {
- c = (a + b) >> 1; /* == ((a + b) / 2) */
- ! if ((dir = (*cmp)((void *)((char *)base + (c * size)), key)) != 0)
- {
- ! if (dir > 0)
- {
- if (c == 0)
- return(NULL);
- b = c - 1;
- }
- ! else /* (dir < 0) */
- a = c + 1;
- }
- else
- --- 36,50 ----
- while(a <= b)
- {
- c = (a + b) >> 1; /* == ((a + b) / 2) */
- ! if ((dir = (*cmp)(key, (void *)((char *)base + (c * size)))) != 0)
- {
- ! if (dir < 0)
- {
- if (c == 0)
- return(NULL);
- b = c - 1;
- }
- ! else /* (dir > 0) */
- a = c + 1;
- }
- else
- diff -cr ../mntlib34/clock.c ./clock.c
- *** ../mntlib34/clock.c Wed Feb 17 13:23:24 1993
- --- ./clock.c Sun Sep 12 20:14:12 1993
- ***************
- *** 13,19 ****
- * containing the number of 200HZ ticks since the system was booted
- */
-
- ! static void getnow() { now = *((unsigned long *) 0x4baL); }
-
- clock_t
- _clock()
- --- 13,26 ----
- * containing the number of 200HZ ticks since the system was booted
- */
-
- ! static long getnow __PROTO((void));
- !
- ! static long
- ! getnow()
- ! {
- ! now = *((unsigned long *) 0x4baL);
- ! return 0;
- ! }
-
- clock_t
- _clock()
- diff -cr ../mntlib34/crtinit.c ./crtinit.c
- *** ../mntlib34/crtinit.c Sun May 23 11:27:50 1993
- --- ./crtinit.c Wed Sep 15 02:22:16 1993
- ***************
- *** 82,87 ****
- --- 82,88 ----
-
- #include <basepage.h>
- #include <osbind.h>
- + #include <support.h>
- #include "lib.h"
-
- #define isspace(c) ((c) == ' '||(c) == '\t')
- ***************
- *** 132,143 ****
-
- static long parseargs __PROTO((BASEPAGE *));
- static void setup_handlers __PROTO((void));
- - __EXTERN void _main __PROTO((long, char **, char **));
- - __EXTERN void _init_signal __PROTO((void));
- - __EXTERN void _monstartup __PROTO((void *lowpc, void *highpc));
- - __EXTERN void __mcleanup __PROTO((void));
- - __EXTERN void _moncontrol __PROTO((long));
- - __EXTERN void _setstack __PROTO((char *));
-
- /*
- * accessories start here:
- --- 133,138 ----
- diff -cr ../mntlib34/div.c ./div.c
- *** ../mntlib34/div.c Mon Jun 1 03:25:18 1992
- --- ./div.c Mon Sep 13 06:30:38 1993
- ***************
- *** 6,11 ****
- --- 6,13 ----
- */
- #include <stdlib.h>
-
- + #ifdef __GNUC__
- +
- long __divsi3(long, long); /* returns: quot in d0.l remainder in d1.l */
-
- #ifdef __MSHORT__
- ***************
- *** 44,46 ****
- --- 46,76 ----
- ); /* compiler dependency, dont tell gcc about d0,d1 clobb */
- return result;
- }
- +
- + #else /* !__GNUC__ */
- +
- + div_t
- + div(num, denom)
- + int num, denom;
- + {
- + div_t res;
- +
- + res.quot = num / denom;
- + res.rem = num % denom;
- +
- + return res;
- + }
- +
- + ldiv_t
- + ldiv(num, denom)
- + long num, denom;
- + {
- + ldiv_t res;
- +
- + res.quot = num / denom;
- + res.rem = num % denom;
- +
- + return res;
- + }
- +
- + #endif /* !__GNUC__ */
- diff -cr ../mntlib34/doprnt.c ./doprnt.c
- *** ../mntlib34/doprnt.c Thu Jul 8 05:52:50 1993
- --- ./doprnt.c Mon Sep 13 11:10:20 1993
- ***************
- *** 59,65 ****
- #include <ctype.h>
- #include <string.h>
- #include <limits.h>
- ! #include <math.h> /* mjr++ */
-
- #ifndef __GNUC__ /* gcc lib has these typedefs in sys/types.h */
- #ifndef __MINT__ /* as does the MiNT library */
- --- 59,66 ----
- #include <ctype.h>
- #include <string.h>
- #include <limits.h>
- ! #include <math.h> /* mjr++ */
- ! #include "lib.h"
-
- #ifndef __GNUC__ /* gcc lib has these typedefs in sys/types.h */
- #ifndef __MINT__ /* as does the MiNT library */
- ***************
- *** 77,83 ****
-
- #if defined (__M68881__) && !defined (sfp004)
- # include <math-68881.h> /* mjr: use the inline functions */
- ! #endif __M68881__
-
- #define DEFPREC 6
-
- --- 78,84 ----
-
- #if defined (__M68881__) && !defined (sfp004)
- # include <math-68881.h> /* mjr: use the inline functions */
- ! #endif /* __M68881__ */
-
- #define DEFPREC 6
-
- ***************
- *** 85,91 ****
-
- #define PUTC(ch) if( fputc(ch, fp) == EOF ) return EOF;
-
- !
- #define ARG(signtag) \
- _ulong = \
- flags&LONGINT ? \
- --- 86,107 ----
-
- #define PUTC(ch) if( fputc(ch, fp) == EOF ) return EOF;
-
- ! #ifdef PRINTF_LONGLONG
- ! #define ARG(signtag) (\
- ! (flags&LONGLONG ? \
- ! (_ulonglong = (unsigned long long)va_arg(argp, signtag long long)) : 0 ) ,\
- ! _ulong = \
- ! flags&LONGLONG ? \
- ! _ulonglong != 0ll : \
- ! flags&LONGINT ? \
- ! (unsigned long long)va_arg(argp, signtag long) : \
- ! (flags&SHORTINT ? \
- ! (unsigned long long)(signtag short)va_arg(argp, signtag int) : \
- ! (unsigned long long)va_arg(argp, signtag int)) )
- ! /* shorts are always promoted to ints; thus, it's `va_arg(... int)'
- ! * for `flags&SHORTINT'!
- ! */
- ! #else
- #define ARG(signtag) \
- _ulong = \
- flags&LONGINT ? \
- ***************
- *** 96,101 ****
- --- 112,118 ----
- /* shorts are always promoted to ints; thus, it's `va_arg(... int)'
- * for `flags&SHORTINT'!
- */
- + #endif
-
- #define TEN_MUL(X) ((((X) << 2) + (X)) << 1)
-
- ***************
- *** 103,114 ****
- #define tochar(n) ((n) + '0')
-
- #define LONGINT 0x01 /* long integer */
- ! #define LONGDBL 0x02 /* long double; unimplemented */
- ! #define SHORTINT 0x04 /* short integer */
- ! #define ALT 0x08 /* alternate form */
- ! #define LADJUST 0x10 /* left adjustment */
- ! #define ZEROPAD 0x20 /* zero (as opposed to blank) pad */
- ! #define HEXPREFIX 0x40 /* add 0x or 0X prefix */
-
- #ifndef __NO_FLOAT__
- #define __FLOATS__ 1
- --- 120,132 ----
- #define tochar(n) ((n) + '0')
-
- #define LONGINT 0x01 /* long integer */
- ! #define LONGLONG 0x02 /* long long integer (8 bytes) */
- ! #define LONGDBL 0x04 /* long double; unimplemented */
- ! #define SHORTINT 0x08 /* short integer */
- ! #define ALT 0x10 /* alternate form */
- ! #define LADJUST 0x20 /* left adjustment */
- ! #define ZEROPAD 0x40 /* zero (as opposed to blank) pad */
- ! #define HEXPREFIX 0x80 /* add 0x or 0X prefix */
-
- #ifndef __NO_FLOAT__
- #define __FLOATS__ 1
- ***************
- *** 197,202 ****
- --- 215,227 ----
-
- #endif /* __GNUC__ */
-
- + #ifdef PRINTF_LONGLONG
- + #define _ICONVLL(NUMBER, BASE, BUF) \
- + do { \
- + *--(BUF) = digs[(NUMBER) % (BASE)]; \
- + (NUMBER) /= (BASE); \
- + } while (NUMBER);
- + #endif
-
- int _doprnt(fp, fmt0, argp)
- register FILE *fp;
- ***************
- *** 212,219 ****
- /* double _double; *//* double precision arguments %[eEfgG] */
- union double_di _dd; /* _double is #defined to be _dd later on */
- char softsign; /* temporary negative sign for floats */
- ! #endif __FLOATS__
- ! u_long _ulong; /* integer arguments %[diouxX] */
- short base; /* base for [diouxX] conversion */
- short dprec; /* decimal precision in [diouxX] */
- short fieldsz; /* field size expanded by sign, etc */
- --- 237,251 ----
- /* double _double; *//* double precision arguments %[eEfgG] */
- union double_di _dd; /* _double is #defined to be _dd later on */
- char softsign; /* temporary negative sign for floats */
- ! #endif /* __FLOATS__ */
- ! #ifdef PRINTF_LONGLONG
- ! typedef unsigned long long _ulonglongtype;
- ! typedef long long _ulonglongsignedtype;
- ! _ulonglongtype _ulonglong;
- ! #endif
- ! typedef u_long _ulongtype;
- ! typedef long _ulongsignedtype;
- ! _ulongtype _ulong; /* integer arguments %[diouxX] */
- short base; /* base for [diouxX] conversion */
- short dprec; /* decimal precision in [diouxX] */
- short fieldsz; /* field size expanded by sign, etc */
- ***************
- *** 307,313 ****
- flags |= SHORTINT;
- goto rflag;
- case 'l':
- ! flags |= LONGINT;
- goto rflag;
- case 'c':
- *(t = buf) = va_arg(argp, int);
- --- 339,350 ----
- flags |= SHORTINT;
- goto rflag;
- case 'l':
- ! #ifdef PRINTF_LONGLONG
- ! if (flags & (LONGINT|LONGLONG))
- ! flags &= -1-LONGINT, flags |= LONGLONG;
- ! else
- ! #endif
- ! flags |= LONGINT;
- goto rflag;
- case 'c':
- *(t = buf) = va_arg(argp, int);
- ***************
- *** 315,329 ****
- sign = '\0';
- goto pforw;
- case 'D':
- ! flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'd':
- case 'i':
- ARG(signed);
- ! if ((long)_ulong < 0) {
- ! _ulong = -_ulong;
- ! sign = '-';
- }
- base = 10;
- goto number;
- #ifdef __FLOATS__
- --- 352,380 ----
- sign = '\0';
- goto pforw;
- case 'D':
- ! #ifdef PRINTF_LONGLONG
- ! if (flags & (LONGINT|LONGLONG))
- ! flags &= -1-LONGINT, flags |= LONGLONG;
- ! else
- ! #endif
- ! flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'd':
- case 'i':
- ARG(signed);
- ! #ifdef PRINTF_LONGLONG
- ! if (flags & LONGLONG) {
- ! if ((_ulonglongsignedtype)_ulonglong < 0ll) {
- ! _ulonglong = -_ulonglong;
- ! sign = '-';
- ! }
- }
- + else
- + #endif
- + if ((_ulongsignedtype)_ulong < 0) {
- + _ulong = -(long)_ulong;
- + sign = '-';
- + }
- base = 10;
- goto number;
- #ifdef __FLOATS__
- ***************
- *** 411,416 ****
- --- 462,472 ----
- goto pforw;
- #endif /* __FLOATS__ */
- case 'n':
- + #ifdef PRINTF_LONGLONG
- + if (flags & LONGLONG)
- + *va_arg(argp, long long *) = cnt;
- + else
- + #endif
- if (flags & LONGINT)
- *va_arg(argp, long *) = cnt;
- else if (flags & SHORTINT)
- ***************
- *** 419,425 ****
- *va_arg(argp, int *) = cnt;
- break;
- case 'O':
- ! flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'o':
- ARG(unsigned);
- --- 475,486 ----
- *va_arg(argp, int *) = cnt;
- break;
- case 'O':
- ! #ifdef PRINTF_LONGLONG
- ! if (flags & (LONGINT|LONGLONG))
- ! flags &= -1-LONGINT, flags |= LONGLONG;
- ! else
- ! #endif
- ! flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'o':
- ARG(unsigned);
- ***************
- *** 434,440 ****
- * -- ANSI X3J11
- */
- /* NOSTRICT */
- ! _ulong = (u_long)va_arg(argp, void *);
- base = 16;
- goto nosign;
- case 's':
- --- 495,504 ----
- * -- ANSI X3J11
- */
- /* NOSTRICT */
- ! _ulong = (_ulongtype)va_arg(argp, void *);
- ! #ifdef PRINTF_LONGLONG
- ! flags &= -1-LONGLONG;
- ! #endif
- base = 16;
- goto nosign;
- case 's':
- ***************
- *** 454,460 ****
- #endif
-
- if ((p = (char *)memchr(t, 0, (size_t)prec)) != NULL) {
- ! size = p - t;
- if (size > prec)
- size = prec;
- } else
- --- 518,524 ----
- #endif
-
- if ((p = (char *)memchr(t, 0, (size_t)prec)) != NULL) {
- ! size = (short)(p - t);
- if (size > prec)
- size = prec;
- } else
- ***************
- *** 464,470 ****
- sign = '\0';
- goto pforw;
- case 'U':
- ! flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'u':
- ARG(unsigned);
- --- 528,539 ----
- sign = '\0';
- goto pforw;
- case 'U':
- ! #ifdef PRINTF_LONGLONG
- ! if (flags & (LONGINT|LONGLONG))
- ! flags &= -1-LONGINT, flags |= LONGLONG;
- ! else
- ! #endif
- ! flags |= LONGINT;
- /*FALLTHROUGH*/
- case 'u':
- ARG(unsigned);
- ***************
- *** 477,482 ****
- --- 546,553 ----
- ARG(unsigned);
- base = 16;
- /* leading 0x/X only if non-zero */
- + /* Note: this does also work with _ulonglong, as we set
- + _ulong = 0 iff _ulonglong==0 --bjarne */
- if (flags & ALT && _ulong != 0)
- flags |= HEXPREFIX;
-
- ***************
- *** 496,508 ****
- * -- ANSI X3J11
- */
- t = buf + BUF;
- if (_ulong != 0 || prec != 0) {
- ! _ICONV(_ulong, base, t);
- digs = "0123456789abcdef";
- if (flags & ALT && base == 8 && *t != '0')
- *--t = '0'; /* octal leading 0 */
- }
- ! size = buf + BUF - t;
-
- pforw:
- /*
- --- 567,591 ----
- * -- ANSI X3J11
- */
- t = buf + BUF;
- + /* Note: this does also work with _ulonglong, as we set
- + _ulong = 0 iff _ulonglong==0 --bjarne */
- if (_ulong != 0 || prec != 0) {
- ! #ifdef PRINTF_LONGLONG
- ! if (flags & LONGLONG) {
- ! _ICONVLL(_ulonglong, base, t);
- ! }
- ! /* As _ICONVLL might be a macro, we better put it in braces */
- ! else
- ! #endif
- ! {
- ! _ICONV(_ulong, base, t);
- ! }
- ! /* As _ICONV might be a macro, we better put it in braces */
- digs = "0123456789abcdef";
- if (flags & ALT && base == 8 && *t != '0')
- *--t = '0'; /* octal leading 0 */
- }
- ! size = (short)(buf + BUF - t);
-
- pforw:
- /*
- diff -cr ../mntlib34/exec.c ./exec.c
- *** ../mntlib34/exec.c Mon Feb 22 09:33:24 1993
- --- ./exec.c Thu Sep 9 15:59:56 1993
- ***************
- *** 12,20 ****
-
- int
- execve(path, argv, envp)
- ! char *path;
- ! char **argv;
- ! char **envp;
- {
- return _spawnve(P_OVERLAY, path, argv, envp);
- }
- --- 12,20 ----
-
- int
- execve(path, argv, envp)
- ! const char *path;
- ! char *const *argv;
- ! char *const *envp;
- {
- return _spawnve(P_OVERLAY, path, argv, envp);
- }
- ***************
- *** 21,34 ****
-
- int
- execv(path, argv)
- ! char *path;
- ! char **argv;
- {
- return _spawnve(P_OVERLAY, path, argv, NULL);
- }
-
- #ifdef __STDC__
- ! int execle(char *path, ...)
- #else
- int execle(path)
- char *path;
- --- 21,34 ----
-
- int
- execv(path, argv)
- ! const char *path;
- ! char *const *argv;
- {
- return _spawnve(P_OVERLAY, path, argv, NULL);
- }
-
- #ifdef __STDC__
- ! int execle(const char *path, ...)
- #else
- int execle(path)
- char *path;
- ***************
- *** 45,51 ****
- }
-
- #ifdef __STDC__
- ! int execl(char *path, ...)
- #else
- int execl(path)
- char *path;
- --- 45,51 ----
- }
-
- #ifdef __STDC__
- ! int execl(const char *path, ...)
- #else
- int execl(path)
- char *path;
- diff -cr ../mntlib34/execp.c ./execp.c
- *** ../mntlib34/execp.c Tue May 25 11:38:04 1993
- --- ./execp.c Thu Sep 9 15:59:58 1993
- ***************
- *** 20,34 ****
- first.
- */
-
- ! static char *extensions[] = { "ttp", "prg", "tos", NULL };
-
- #ifdef __STDC__
- ! int execvp(char *name, char **argv)
- #else
- int execvp(name, argv) char *name; char **argv;
- #endif
- {
- ! char *execname;
- char buffer[PATH_MAX];
- execname = buffindfile(name, getenv("PATH"), extensions,buffer);
- if (!execname) {
- --- 20,34 ----
- first.
- */
-
- ! static char *const extensions[] = { "ttp", "prg", "tos", NULL };
-
- #ifdef __STDC__
- ! int execvp(const char *name, char *const *argv)
- #else
- int execvp(name, argv) char *name; char **argv;
- #endif
- {
- ! const char *execname;
- char buffer[PATH_MAX];
- execname = buffindfile(name, getenv("PATH"), extensions,buffer);
- if (!execname) {
- ***************
- *** 39,45 ****
- }
-
- #ifdef __STDC__
- ! int execlp(char *name, ...)
- #else
- int execlp(name)
- char *name;
- --- 39,45 ----
- }
-
- #ifdef __STDC__
- ! int execlp(const char *name, ...)
- #else
- int execlp(name)
- char *name;
- diff -cr ../mntlib34/fdopen.c ./fdopen.c
- *** ../mntlib34/fdopen.c Wed Aug 26 04:54:50 1992
- --- ./fdopen.c Thu Jul 15 07:56:08 1993
- ***************
- *** 7,13 ****
-
- FILE *fdopen(h, mode)
- register int h;
- ! const register char *mode;
- {
- extern int __default_mode__; /* see defmode.c */
- register int i, iomode = 0, f = __default_mode__;
- --- 7,13 ----
-
- FILE *fdopen(h, mode)
- register int h;
- ! register const char *mode;
- {
- extern int __default_mode__; /* see defmode.c */
- register int i, iomode = 0, f = __default_mode__;
- diff -cr ../mntlib34/ffs.c ./ffs.c
- *** ../mntlib34/ffs.c Thu Jul 8 07:46:18 1993
- --- ./ffs.c Thu Jul 15 04:14:54 1993
- ***************
- *** 1,8 ****
- /*
- ! ffs.c - find first set bit
- ! Carmine T. Guida
- ! 7 - 7 - 93 Public Domain
- ! */
-
- #include <support.h>
-
- --- 1,10 ----
- /*
- ! * ffs.c - find the lowest bit set
- ! * Returns a 2-exponent of position + 1 and 0 for 0
- ! * Michal Jaegermann, <ntomczak@vm.ucs.ualberta.ca>
- ! * 10 July 1993
- ! * This piece of code is in a Public Domain
- ! */
-
- #include <support.h>
-
- ***************
- *** 10,47 ****
- ffs(bits)
- int bits;
- {
- ! register int i;
-
- ! if (!bits)
- ! return 0;
-
- ! i = 1;
- !
- #ifndef __MSHORT__
- ! if (!(bits & 0x0000FFFF)) /* Check word */
- ! {
- ! bits >>= 16;
- ! i += 16;
- ! }
- ! #endif
- !
- ! if (!(bits & 0x00FF)) /* Check byte */
- ! {
- ! bits >>= 8;
- ! i += 8;
- ! }
- ! if (!(bits & 0x0F)) /* Check nybble */
- ! {
- ! bits >>= 4;
- ! i += 4;
- ! }
- ! if (!(bits & 0x3)) /* Check 2 bits */
- ! {
- ! bits >>= 2;
- ! i += 2;
- ! }
- ! if (!(bits & 0x1)) /* Check bit */
- ! i += 1;
- !
- ! return i;
- }
- --- 12,41 ----
- ffs(bits)
- int bits;
- {
- ! register int count;
-
- ! if (0 == bits)
- ! return 0;
-
- ! bits &= -bits;
- #ifndef __MSHORT__
- ! count = (bits & 0x0000ffff ? 16 : 32);
- ! if (bits & 0x00ff00ff)
- ! count -= 8;
- ! if (bits & 0x0f0f0f0f)
- ! count -= 4;
- ! if (bits & 0x33333333)
- ! count -= 2;
- ! if (bits & 0x55555555)
- ! count -= 1;
- ! #else
- ! count = (bits & 0x00ff ? 8 : 16);
- ! if (bits & 0x0f0f)
- ! count -= 4;
- ! if (bits & 0x3333)
- ! count -= 2;
- ! if (bits & 0x5555)
- ! count -= 1;
- ! #endif /* __MSHORT__ */
- ! return count;
- }
- diff -cr ../mntlib34/findfile.c ./findfile.c
- *** ../mntlib34/findfile.c Tue May 25 12:09:40 1993
- --- ./findfile.c Thu Sep 9 16:00:02 1993
- ***************
- *** 27,39 ****
- #define DIRSEP1 '\\' /* native OS directory separator */
- #define DIRSEP2 '/' /* for emulating another OS */
-
- ! static char *nullext[] = { NULL };
-
- ! static int EXISTS __PROTO((char *));
-
- static int
- EXISTS(name)
- ! char *name;
- {
- struct stat dummy;
-
- --- 27,39 ----
- #define DIRSEP1 '\\' /* native OS directory separator */
- #define DIRSEP2 '/' /* for emulating another OS */
-
- ! static char *const nullext[] = { NULL };
-
- ! static int EXISTS __PROTO((const char *));
-
- static int
- EXISTS(name)
- ! const char *name;
- {
- struct stat dummy;
-
- ***************
- *** 47,53 ****
-
- char *
- findfile(fname, fpath, fext)
- ! char *fname, *fpath, **fext;
- {
- /* simply calls buffindfile */
- static char try[PATH_MAX];
- --- 47,54 ----
-
- char *
- findfile(fname, fpath, fext)
- ! const char *fname, *fpath;
- ! char *const *fext;
- {
- /* simply calls buffindfile */
- static char try[PATH_MAX];
- ***************
- *** 57,65 ****
-
- char *
- buffindfile(fname, fpath, fext, try)
- ! char *fname, *fpath, **fext, *try;
- {
- ! char *s, *t, *extplace, **nextext, c;
- int hasext = 0, haspath = 0;
-
- if (!fname || !*fname)
- --- 58,68 ----
-
- char *
- buffindfile(fname, fpath, fext, try)
- ! const char *fname, *fpath;
- ! char *const *fext, *try;
- {
- ! char *s, *extplace, *const *nextext, c;
- ! const char *t;
- int hasext = 0, haspath = 0;
-
- if (!fname || !*fname)
- ***************
- *** 108,113 ****
- --- 111,126 ----
-
- /* copy in next element of path list */
- s = try;
- + /* an attempt to accomodate within reason TOS specs -- mj */
- + if (*(fpath + 1) == ':') {
- + if ((*(fpath + 2) == DIRSEP1 ||
- + *(fpath + 2) == DIRSEP2) &&
- + (*fpath != '.' && *fpath != ':')) {
- + *s++ = *fpath++;
- + *s++ = *fpath++;
- + *s++ = *fpath++;
- + }
- + }
- while ((c = *fpath) != 0 && c != PATHSEP1 && c != PATHSEP2) {
- *s++ = c;
- fpath++;
- diff -cr ../mntlib34/fopen.c ./fopen.c
- *** ../mntlib34/fopen.c Sun Jun 6 08:44:34 1993
- --- ./fopen.c Wed Sep 8 19:06:20 1993
- ***************
- *** 65,71 ****
- else
- iomode |= O_RDWR;
- iomode |= O_NOCTTY;
- ! h = open(filename, iomode, 0644);
- if(h < __SMALLEST_VALID_HANDLE)
- {
- return(NULL); /* file open/create error */
- --- 65,71 ----
- else
- iomode |= O_RDWR;
- iomode |= O_NOCTTY;
- ! h = open(filename, iomode, 0666);
- if(h < __SMALLEST_VALID_HANDLE)
- {
- return(NULL); /* file open/create error */
- diff -cr ../mntlib34/fputs.c ./fputs.c
- *** ../mntlib34/fputs.c Sat Sep 5 08:31:36 1992
- --- ./fputs.c Thu Jul 15 07:54:40 1993
- ***************
- *** 5,11 ****
- #include <assert.h>
-
- int fputs(data, fp)
- ! const register char *data;
- register FILE *fp;
- {
- register int n = 0;
- --- 5,11 ----
- #include <assert.h>
-
- int fputs(data, fp)
- ! register const char *data;
- register FILE *fp;
- {
- register int n = 0;
- diff -cr ../mntlib34/fwrite.c ./fwrite.c
- *** ../mntlib34/fwrite.c Sun Jun 6 06:19:24 1993
- --- ./fwrite.c Tue Jul 13 17:17:56 1993
- ***************
- *** 94,101 ****
- line_flush=0;
- /* this relies on having at least one byte buffer,
- otherwise we'll hang up when trying to write CRLF */
- ! while(n > 0)
- ! {
- space = fp->_bsiz - fp->_cnt;
- restart_buf=data;
- while( space>0 && n>0 ) {
- --- 94,100 ----
- line_flush=0;
- /* this relies on having at least one byte buffer,
- otherwise we'll hang up when trying to write CRLF */
- ! while(n > 0) {
- space = fp->_bsiz - fp->_cnt;
- restart_buf=data;
- while( space>0 && n>0 ) {
- ***************
- *** 137,151 ****
- n--;
- data++;
- }
- ! if( (m=_write(fp->_file, restart_buf, data-restart_buf ))
- ! != data-restart_buf ) {
- fp->_flag |= _IOERR;
- return 0;
- }
- ! l+=m;
- }
- }
- ! }
- if( line_flush ) {
- if(fflush(fp))
- return 0;
- --- 136,151 ----
- n--;
- data++;
- }
- ! if( (m = _write(fp->_file, restart_buf, data - restart_buf))
- ! != data - restart_buf) {
- fp->_flag |= _IOERR;
- return 0;
- }
- ! l += (m - 1); /* we already counted one character, before
- ! * decrementing 'space' to zero */
- }
- }
- ! } /* while */
- if( line_flush ) {
- if(fflush(fp))
- return 0;
- diff -cr ../mntlib34/getdtabl.c ./getdtabl.c
- *** ../mntlib34/getdtabl.c Sun Jun 20 09:09:16 1993
- --- ./getdtabl.c Mon Jul 12 04:23:16 1993
- ***************
- *** 1,6 ****
- #include <stdio.h>
- #include <mintbind.h>
- ! #include <unistd.h>
-
- extern int __mint;
-
- --- 1,6 ----
- #include <stdio.h>
- #include <mintbind.h>
- ! #include <support.h>
-
- extern int __mint;
-
- diff -cr ../mntlib34/gethostn.c ./gethostn.c
- *** ../mntlib34/gethostn.c Tue Nov 5 02:17:32 1991
- --- ./gethostn.c Fri Jul 16 05:18:08 1993
- ***************
- *** 6,11 ****
- --- 6,12 ----
- #include <stdlib.h>
- #include <fcntl.h>
- #include <unistd.h>
- + #include <support.h>
-
- #define MAXLEN 127
-
- diff -cr ../mntlib34/getpw.c ./getpw.c
- *** ../mntlib34/getpw.c Sun Jun 6 06:19:32 1993
- --- ./getpw.c Fri Jul 23 05:04:22 1993
- ***************
- *** 205,210 ****
- --- 205,211 ----
- #include <unistd.h>
- #include <string.h>
- #include <stdlib.h>
- + #include <types.h>
-
- static char *pwdfile = "/etc/passwd"; /* default passwd file */
-
- ***************
- *** 289,296 ****
- } /* End of getpwent() */
-
- /* Get first passwd entry from file with pw_uid matching uid */
- struct passwd *getpwuid(uid)
- ! int uid;
- {
- setpwent();
- while (nextent(fp) != 0)
- --- 290,301 ----
- } /* End of getpwent() */
-
- /* Get first passwd entry from file with pw_uid matching uid */
- + #ifdef __STDC__
- + struct passwd *getpwuid(uid_t uid)
- + #else
- struct passwd *getpwuid(uid)
- ! uid_t uid;
- ! #endif
- {
- setpwent();
- while (nextent(fp) != 0)
- diff -cr ../mntlib34/lattice/crt0.s ./lattice/crt0.s
- *** ../mntlib34/lattice/crt0.s Sun May 23 09:13:26 1993
- --- ./lattice/crt0.s Wed Sep 8 15:08:14 1993
- ***************
- *** 1,4 ****
- --- 1,19 ----
- INCLUDE inc.i
- +
- + _PRG EQU 1 ; Default...
- + _ACC EQU 0
- + _AUT EQU 0
- +
- + IFD ACC
- + _ACC EQU 1
- + _PRG EQU 0
- + ELSE
- +
- + IFD AUT
- + _AUT EQU 1
- + _ACC EQU 1
- + ENDC
- + ENDC ; !ACC
-
- ;
- ; Initilization code; this is common to both 16 and 32 bit libraries,
- ***************
- *** 34,43 ****
- --- 49,61 ----
- lea __LinkerDB,a4
- ENDC
- sub.l a6,a6 ; clear a6 for debuggers
- + IF _AUT
- cmp.w #0,a0 ; test if acc or program
- beq.s __startprg ; if a program, go elsewhere
- tst.l 36(a0) ; also test parent basepage pointer
- bne.s __startprg ; for acc's, it must be 0
- + ENDC
- + IF _ACC
- move.l a0,__base ; acc basepage is in A0
- move.l __heapbase,sp ; stack must be set from heap
- add.l __stksize,sp
- ***************
- *** 46,55 ****
- --- 64,75 ----
- ELSE
- bra __acc_main ; function is in crtinit.c
- ENDC
- + ENDC
- ;
- ; program startup code: doesn't actually do much, other than push
- ; the basepage onto the stack and call _start1 in crtinit.c
- ;
- + IF _PRG
- __startprg:
- move.l 4(sp),a0 ; get basepage
- move.l a0,__base ; save it
- ***************
- *** 60,65 ****
- --- 80,86 ----
- bra @_crtinit
- ELSE
- bra __crtinit ; in crtinit.c
- + ENDC
- ENDC
-
- ;
- diff -cr ../mntlib34/lattice/inc.i ./lattice/inc.i
- *** ../mntlib34/lattice/inc.i Sun May 23 08:27:58 1993
- --- ./lattice/inc.i Sun Jul 11 05:42:20 1993
- ***************
- *** 22,31 ****
-
- IFND __M020__
- _ARC32 EQU 0
- ! _SIZ EQU 2
- ELSE
- _ARC32 EQU 1
- ! _SIZ EQU 4
- ENDC
-
- XFUNC MACRO
- --- 22,31 ----
-
- IFND __M020__
- _ARC32 EQU 0
- ! _SIZ EQU 1
- ELSE
- _ARC32 EQU 1
- ! _SIZ EQU 2
- ENDC
-
- XFUNC MACRO
- Only in .: lblong.target
- diff -cr ../mntlib34/lib.h ./lib.h
- *** ../mntlib34/lib.h Sun Jun 20 09:23:26 1993
- --- ./lib.h Tue Jul 13 14:19:14 1993
- ***************
- *** 55,63 ****
- __EXTERN long get_sysvar __PROTO((void *var));
- __EXTERN void set_sysvar_to_long __PROTO((void *var, long val));
-
- ! __EXTERN void _setstack __PROTO((char *));
- ! __EXTERN __EXITING __exit __PROTO((long status));
-
- /* from the TOS GCC library */
- /* 5/5/92 sb -- definitions needed in malloc.c and realloc.c */
-
- --- 55,71 ----
- __EXTERN long get_sysvar __PROTO((void *var));
- __EXTERN void set_sysvar_to_long __PROTO((void *var, long val));
-
- ! __EXTERN void _main __PROTO((long, char **, char **));
- ! __EXTERN void _init_signal __PROTO((void));
- ! __EXTERN void _monstartup __PROTO((void *lowpc, void *highpc));
- ! __EXTERN void __mcleanup __PROTO((void));
- ! __EXTERN void _moncontrol __PROTO((long));
- ! __EXTERN void _setstack __PROTO((char *));
- ! __EXTERN void _crtinit __PROTO((void));
- ! __EXTERN void _acc_main __PROTO((void));
- ! __EXTERN __EXITING __exit __PROTO((long status));
-
- + __EXTERN void _fclose_all_files __PROTO((void));
- /* from the TOS GCC library */
- /* 5/5/92 sb -- definitions needed in malloc.c and realloc.c */
-
- diff -cr ../mntlib34/link.c ./link.c
- *** ../mntlib34/link.c Sat Feb 13 04:57:28 1993
- --- ./link.c Tue Jul 13 13:49:16 1993
- ***************
- *** 3,9 ****
- #include <errno.h>
- #include <mintbind.h>
- #include <param.h>
- ! #include <support.h>
- #include "lib.h"
-
- extern int __mint;
- --- 3,9 ----
- #include <errno.h>
- #include <mintbind.h>
- #include <param.h>
- ! #include <unistd.h>
- #include "lib.h"
-
- extern int __mint;
- diff -cr ../mntlib34/main.c ./main.c
- *** ../mntlib34/main.c Thu Jul 1 06:36:40 1993
- --- ./main.c Sun Sep 12 20:16:28 1993
- ***************
- *** 25,35 ****
- FILE _iob[_NFILE]; /* stream buffers initialized below */
-
- /* functions registered by user for calling at exit */
- ! #ifdef __STDC__
- ! typedef void (*ExitFn)(void);
- ! #else
- ! typedef void (*ExitFn)();
- ! #endif
- ExitFn *_at_exit;
- int _num_at_exit; /* number of functions registered - 1 */
-
- --- 25,31 ----
- FILE _iob[_NFILE]; /* stream buffers initialized below */
-
- /* functions registered by user for calling at exit */
- ! typedef void (*ExitFn) __PROTO((void));
- ExitFn *_at_exit;
- int _num_at_exit; /* number of functions registered - 1 */
-
- ***************
- *** 37,44 ****
- * get MiNT version number. Since this has to be done in supervisor mode,
- * we might as well set the start-up time of the system here, too.
- */
-
- ! static void
- getMiNT()
- {
- long *cookie;
- --- 33,41 ----
- * get MiNT version number. Since this has to be done in supervisor mode,
- * we might as well set the start-up time of the system here, too.
- */
- + static long getMiNT __PROTO((void));
-
- ! static long
- getMiNT()
- {
- long *cookie;
- ***************
- *** 54,73 ****
- while (*cookie) {
- if (*cookie == 0x4d694e54L) { /* MiNT */
- __mint = (int) cookie[1];
- ! return;
- }
- cookie += 2;
- }
- }
- __mint = 0;
- }
-
- /* supplied by the user */
- __EXTERN int main __PROTO((int, char **, char **));
-
- - /* in getbuf.c */
- - __EXTERN void _getbuf __PROTO((FILE *));
- -
- #if __GNUC__ > 1
- /* in libgcc2.c */
- __EXTERN void __do_global_dtors __PROTO ((void));
- --- 51,68 ----
- while (*cookie) {
- if (*cookie == 0x4d694e54L) { /* MiNT */
- __mint = (int) cookie[1];
- ! return 0;
- }
- cookie += 2;
- }
- }
- __mint = 0;
- + return 0;
- }
-
- /* supplied by the user */
- __EXTERN int main __PROTO((int, char **, char **));
-
- #if __GNUC__ > 1
- /* in libgcc2.c */
- __EXTERN void __do_global_dtors __PROTO ((void));
- ***************
- *** 81,86 ****
- --- 76,83 ----
- long _fpuctrl;
- #endif
-
- + void _main __PROTO((long, char **, char **));
- +
- void
- _main(_argc, _argv, _envp)
- long _argc;
- ***************
- *** 246,263 ****
- exit(main((int) _argc, _argv, _envp));
- }
-
- ! __EXITING exit(status)
- ! int status;
- {
- register int i, f;
-
- - for(i = _num_at_exit - 1; i >= 0; --i)
- - (*_at_exit[i])();
- -
- - #if __GNUC__ > 1
- - __do_global_dtors ();
- - #endif
- -
- for(i=0; i<_NFILE; ++i) {
- f = _iob[i]._flag;
- if(f & (_IORW | _IOREAD | _IOWRT))
- --- 243,253 ----
- exit(main((int) _argc, _argv, _envp));
- }
-
- ! void
- ! _fclose_all_files()
- {
- register int i, f;
-
- for(i=0; i<_NFILE; ++i) {
- f = _iob[i]._flag;
- if(f & (_IORW | _IOREAD | _IOWRT))
- ***************
- *** 266,270 ****
- --- 256,275 ----
- else
- fclose(&_iob[i]);
- }
- + }
- +
- + __EXITING exit(status)
- + int status;
- + {
- + register int i;
- +
- + for(i = _num_at_exit - 1; i >= 0; --i)
- + (*_at_exit[i])();
- +
- + #if __GNUC__ > 1
- + __do_global_dtors ();
- + #endif
- +
- + _fclose_all_files();
- _exit(status);
- }
- diff -cr ../mntlib34/malloc.c ./malloc.c
- *** ../mntlib34/malloc.c Thu Sep 17 05:36:04 1992
- --- ./malloc.c Wed Sep 8 22:20:24 1993
- ***************
- *** 70,75 ****
- --- 70,82 ----
- if (MINHUNK < MAXHUNK)
- MINHUNK *= 2;
- }
- + if (_split_mem || _heapbase == NULL)
- + {
- + static int page_size = 0;
- + if (!page_size)
- + page_size = getpagesize ();
- + sz = (sz + page_size - 1) & -page_size;
- + }
- q = (struct mem_chunk * )_sbrk(sz);
-
- if (((long)q) == -1) /* can't alloc any more? */
- diff -cr ../mntlib34/mincl ./mincl
- *** ../mntlib34/mincl Sun Jun 27 06:11:22 1993
- --- ./mincl Sun Jul 18 08:48:18 1993
- ***************
- *** 43,49 ****
- ffs.o findfile.o fopenp.o frwbin.o \
- ftw.o getpw.o gethostn.o \
- getlogin.o getopt.o getpages.o getpass.o grp.o ident.o mktemp.o \
- ! regexp.o regsup.o scandir.o strlwr.o strupr.o strrev.o \
- textio.o random.o \
- obstack.o utmp.o wtmp.o \
- il.o ic.o iw.o ig.o ip.o
- --- 43,49 ----
- ffs.o findfile.o fopenp.o frwbin.o \
- ftw.o getpw.o gethostn.o \
- getlogin.o getopt.o getpages.o getpass.o grp.o ident.o mktemp.o \
- ! regexp.o regsup.o scandir.o strlwr.o strupr.o strrev.o sync.o \
- textio.o random.o \
- obstack.o utmp.o wtmp.o \
- il.o ic.o iw.o ig.o ip.o
- diff -cr ../mntlib34/mkdir.c ./mkdir.c
- *** ../mntlib34/mkdir.c Sat Jun 19 12:15:30 1993
- --- ./mkdir.c Wed Sep 8 19:06:24 1993
- ***************
- *** 40,46 ****
- return -1;
- }
- if (__mint >= 9) {
- ! (void)Fchmod(path, mode);
- }
- return 0;
- }
- --- 40,48 ----
- return -1;
- }
- if (__mint >= 9) {
- ! int umask = Pumask (0);
- ! (void) Pumask (umask);
- ! (void)Fchmod(path, mode & ~umask);
- }
- return 0;
- }
- diff -cr ../mntlib34/mknod.c ./mknod.c
- *** ../mntlib34/mknod.c Sun Jun 20 08:59:54 1993
- --- ./mknod.c Mon Jul 12 04:34:50 1993
- ***************
- *** 1,7 ****
- /* fake mknod -- this always fails */
-
- #include <errno.h>
- ! #include <unistd.h>
-
- int
- mknod(path, mode, dev)
- --- 1,7 ----
- /* fake mknod -- this always fails */
-
- #include <errno.h>
- ! #include <support.h>
-
- int
- mknod(path, mode, dev)
- diff -cr ../mntlib34/mktemp.c ./mktemp.c
- *** ../mntlib34/mktemp.c Thu Sep 17 20:02:50 1992
- --- ./mktemp.c Wed Sep 8 19:06:28 1993
- ***************
- *** 27,36 ****
-
- /* scan back over X's */
- for(p = pattern; *p; p++) ;
- ! for(q = --p; *q == 'X'; --q) ;
- if((nx = p - q) == 0) /* # of X's */
- return NULL;
- - q++;
-
- /* if MiNT is active and there's room, put in the pid */
- /* we need 5 X's for this: up to 3 for the pid, and up to 2 for the
- --- 27,35 ----
-
- /* scan back over X's */
- for(p = pattern; *p; p++) ;
- ! for(q = p; q[-1] == 'X'; --q) ;
- if((nx = p - q) == 0) /* # of X's */
- return NULL;
-
- /* if MiNT is active and there's room, put in the pid */
- /* we need 5 X's for this: up to 3 for the pid, and up to 2 for the
- ***************
- *** 38,44 ****
- --- 37,47 ----
- if (__mint && nx > 4 && startat < 256) {
- (void) _itoa(getpid(), q, 10);
- while (*q) q++;
- + /* be sure to generate each name only once */
- + if (startat < 16) *q++ = '0';
- (void) _itoa(startat++, q, 16);
- + while (*q) q++;
- + while (q < p) *q++ = '0'; /* fill with zeros */
- return pattern;
- }
-
- diff -cr ../mntlib34/nice.c ./nice.c
- *** ../mntlib34/nice.c Tue Nov 5 02:21:00 1991
- --- ./nice.c Mon Jul 12 04:37:00 1993
- ***************
- *** 4,13 ****
- * ref seems to say "-20 to +19, or -1 on error". Hmm.
- */
-
- - #include <unistd.h>
- #include <errno.h>
- - #include <stdlib.h>
- #include <mintbind.h>
-
- extern long __mint;
-
- --- 4,12 ----
- * ref seems to say "-20 to +19, or -1 on error". Hmm.
- */
-
- #include <errno.h>
- #include <mintbind.h>
- + #include <support.h>
-
- extern long __mint;
-
- diff -cr ../mntlib34/open.c ./open.c
- *** ../mntlib34/open.c Thu Jun 17 06:35:30 1993
- --- ./open.c Thu Jul 15 08:12:26 1993
- ***************
- *** 10,15 ****
- --- 10,16 ----
- #include <errno.h>
- #include <unistd.h>
- #include <stdarg.h>
- + #include <stat.h>
- #include "lib.h"
-
- /*
- diff -cr ../mntlib34/osbind.cpp ./osbind.cpp
- *** ../mntlib34/osbind.cpp Thu Oct 1 15:25:10 1992
- --- ./osbind.cpp Wed Sep 8 22:20:16 1993
- ***************
- *** 58,65 ****
- .globl _trap_1_w
- _trap_1_w:
- moveml d2/a2, sp@-
- ! movel sp@(12), d0
- ! movew d0, sp@-
- trap #1
- addql #2, sp
- moveml sp@+, d2/a2
- --- 58,64 ----
- .globl _trap_1_w
- _trap_1_w:
- moveml d2/a2, sp@-
- ! movew sp@(14), sp@-
- trap #1
- addql #2, sp
- moveml sp@+, d2/a2
- ***************
- *** 68,77 ****
- .globl _trap_1_ww
- _trap_1_ww:
- moveml d2/a2, sp@-
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #1
- addql #4, sp
- moveml sp@+, d2/a2
- --- 67,74 ----
- .globl _trap_1_ww
- _trap_1_ww:
- moveml d2/a2, sp@-
- ! movew sp@(18), sp@-
- ! movew sp@(14+2), sp@-
- trap #1
- addql #4, sp
- moveml sp@+, d2/a2
- ***************
- *** 80,89 ****
- .globl _trap_1_wl
- _trap_1_wl:
- moveml d2/a2, sp@-
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #1
- addql #6, sp
- moveml sp@+, d2/a2
- --- 77,84 ----
- .globl _trap_1_wl
- _trap_1_wl:
- moveml d2/a2, sp@-
- ! movel sp@(16), sp@-
- ! movew sp@(14+4), sp@-
- trap #1
- addql #6, sp
- moveml sp@+, d2/a2
- ***************
- *** 92,103 ****
- .globl _trap_1_wlw
- _trap_1_wlw:
- moveml d2/a2, sp@-
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew a0, sp@-
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #1
- addql #8, sp | addq is valid for 1-8
- moveml sp@+, d2/a2
- --- 87,95 ----
- .globl _trap_1_wlw
- _trap_1_wlw:
- moveml d2/a2, sp@-
- ! movew sp@(22), sp@-
- ! movel sp@(16+2), sp@-
- ! movew sp@(14+6), sp@-
- trap #1
- addql #8, sp | addq is valid for 1-8
- moveml sp@+, d2/a2
- ***************
- *** 106,117 ****
- .globl _trap_1_wwl
- _trap_1_wwl:
- moveml d2/a2, sp@-
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #1
- addql #8, sp
- moveml sp@+, d2/a2
- --- 98,106 ----
- .globl _trap_1_wwl
- _trap_1_wwl:
- moveml d2/a2, sp@-
- ! movel sp@(20), sp@-
- ! movew sp@(18+4), sp@-
- ! movew sp@(14+6), sp@-
- trap #1
- addql #8, sp
- moveml sp@+, d2/a2
- ***************
- *** 120,131 ****
- .globl _trap_1_www
- _trap_1_www:
- moveml d2/a2, sp@-
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #1
- addql #6, sp
- moveml sp@+, d2/a2
- --- 109,117 ----
- .globl _trap_1_www
- _trap_1_www:
- moveml d2/a2, sp@-
- ! movew sp@(22), sp@-
- ! movew sp@(18+2), sp@-
- ! movew sp@(14+4), sp@-
- trap #1
- addql #6, sp
- moveml sp@+, d2/a2
- ***************
- *** 134,161 ****
- .globl _trap_1_wll
- _trap_1_wll:
- moveml d2/a2, sp@-
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel a0, sp@-
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #1
- lea sp@(10), sp
- moveml sp@+, d2/a2
- rts
-
- .globl _trap_1_wwll
- _trap_1_wwll:
- moveml d2/a2, sp@-
- ! movel sp@(24), a1
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel a1, sp@-
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #1
- lea sp@(12), sp
- moveml sp@+, d2/a2
- --- 120,164 ----
- .globl _trap_1_wll
- _trap_1_wll:
- moveml d2/a2, sp@-
- ! movel sp@(20), sp@-
- ! movel sp@(16+4), sp@-
- ! movew sp@(14+8), sp@-
- trap #1
- lea sp@(10), sp
- moveml sp@+, d2/a2
- rts
-
- + .globl _trap_1_wwww
- + _trap_1_wwww:
- + moveml d2/a1, sp@-
- + movew sp@(26), sp@-
- + movew sp@(22+2), sp@-
- + movew sp@(18+4), sp@-
- + movew sp@(14+6), sp@-
- + trap #1
- + addql #8, sp
- + moveml sp@+, d2/a2
- + rts
- +
- + .globl _trap_1_wwwl
- + _trap_1_wwwl:
- + moveml d2/a1, sp@-
- + movel sp@(24), sp@-
- + movew sp@(22+4), sp@-
- + movew sp@(18+6), sp@-
- + movew sp@(14+8), sp@-
- + trap #1
- + addw #10, sp
- + moveml sp@+, d2/a2
- + rts
- +
- .globl _trap_1_wwll
- _trap_1_wwll:
- moveml d2/a2, sp@-
- ! movel sp@(24), sp@-
- ! movel sp@(20+4), sp@-
- ! movew sp@(18+8), sp@-
- ! movew sp@(14+10), sp@-
- trap #1
- lea sp@(12), sp
- moveml sp@+, d2/a2
- ***************
- *** 164,177 ****
- .globl _trap_1_wlww
- _trap_1_wlww:
- moveml d2/a2, sp@-
- ! movel sp@(24), a1
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew a1, sp@-
- ! movew a0, sp@-
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #1
- lea sp@(10), sp
- moveml sp@+, d2/a2
- --- 167,176 ----
- .globl _trap_1_wlww
- _trap_1_wlww:
- moveml d2/a2, sp@-
- ! movew sp@(26), sp@-
- ! movew sp@(22+2), sp@-
- ! movel sp@(16+4), sp@-
- ! movew sp@(14+8), sp@-
- trap #1
- lea sp@(10), sp
- moveml sp@+, d2/a2
- ***************
- *** 180,193 ****
- .globl _trap_1_wwlw
- _trap_1_wwlw:
- moveml d2/a2, sp@-
- ! movel sp@(24), a1
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew a1, sp@-
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #1
- lea sp@(10), sp
- moveml sp@+, d2/a2
- --- 179,188 ----
- .globl _trap_1_wwlw
- _trap_1_wwlw:
- moveml d2/a2, sp@-
- ! movew sp@(26), sp@-
- ! movel sp@(20+2), sp@-
- ! movew sp@(18+6), sp@-
- ! movew sp@(14+8), sp@-
- trap #1
- lea sp@(10), sp
- moveml sp@+, d2/a2
- ***************
- *** 196,221 ****
- .globl _trap_1_wwlll
- _trap_1_wwlll:
- moveml d2/a2, sp@-
- ! movel sp@(28), a1
- ! movel sp@(24), a0
- ! movel sp@(20), d1
- ! movel a1, sp@-
- ! movel a0, sp@-
- ! movel d1, sp@-
- ! movel sp@(16+12), d1
- ! movel sp@(12+12), d0
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #1
- lea sp@(16), sp
- moveml sp@+, d2/a2
- rts
-
- .globl _trap_13_w
- _trap_13_w:
- moveml d2/a2, sp@-
- ! movel sp@(12), d0
- ! movew d0, sp@-
- trap #13
- addql #2, sp
- moveml sp@+, d2/a2
- --- 191,223 ----
- .globl _trap_1_wwlll
- _trap_1_wwlll:
- moveml d2/a2, sp@-
- ! movel sp@(28), sp@-
- ! movel sp@(24+4), sp@-
- ! movel sp@(20+8), sp@-
- ! movew sp@(18+12), sp@-
- ! movew sp@(14+14), sp@-
- trap #1
- lea sp@(16), sp
- moveml sp@+, d2/a2
- rts
-
- + .globl _trap_1_wwwll
- + _trap_1_wwwll:
- + moveml d2/a2, sp@-
- + movel sp@(28), sp@-
- + movel sp@(24+4), sp@-
- + movew sp@(22+8), sp@-
- + movew sp@(18+10), sp@-
- + movew sp@(14+12), sp@-
- + trap #1
- + addw #16, sp
- + moveml sp@+, d2/a2
- + rts
- +
- .globl _trap_13_w
- _trap_13_w:
- moveml d2/a2, sp@-
- ! movew sp@(14), sp@-
- trap #13
- addql #2, sp
- moveml sp@+, d2/a2
- ***************
- *** 224,233 ****
- .globl _trap_13_ww
- _trap_13_ww:
- moveml d2/a2, sp@-
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #13
- addql #4, sp
- moveml sp@+, d2/a2
- --- 226,233 ----
- .globl _trap_13_ww
- _trap_13_ww:
- moveml d2/a2, sp@-
- ! movew sp@(18), sp@-
- ! movew sp@(14+2), sp@-
- trap #13
- addql #4, sp
- moveml sp@+, d2/a2
- ***************
- *** 236,245 ****
- .globl _trap_13_wl
- _trap_13_wl:
- moveml d2/a2, sp@-
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #13
- addql #6, sp
- moveml sp@+, d2/a2
- --- 236,243 ----
- .globl _trap_13_wl
- _trap_13_wl:
- moveml d2/a2, sp@-
- ! movel sp@(16), sp@-
- ! movew sp@(14+4), sp@-
- trap #13
- addql #6, sp
- moveml sp@+, d2/a2
- ***************
- *** 248,259 ****
- .globl _trap_13_www
- _trap_13_www:
- moveml d2/a2, sp@-
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #13
- addql #6, sp
- moveml sp@+, d2/a2
- --- 246,254 ----
- .globl _trap_13_www
- _trap_13_www:
- moveml d2/a2, sp@-
- ! movew sp@(22), sp@-
- ! movew sp@(18+2), sp@-
- ! movew sp@(14+4), sp@-
- trap #13
- addql #6, sp
- moveml sp@+, d2/a2
- ***************
- *** 262,273 ****
- .globl _trap_13_wwl
- _trap_13_wwl:
- moveml d2/a2, sp@-
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #13
- addql #8, sp
- moveml sp@+, d2/a2
- --- 257,265 ----
- .globl _trap_13_wwl
- _trap_13_wwl:
- moveml d2/a2, sp@-
- ! movel sp@(20), sp@-
- ! movew sp@(18+4), sp@-
- ! movew sp@(14+6), sp@-
- trap #13
- addql #8, sp
- moveml sp@+, d2/a2
- ***************
- *** 276,293 ****
- .globl _trap_13_wwlwww
- _trap_13_wwlwww:
- moveml d2/a2, sp@-
- ! movel sp@(32), a0
- ! movel sp@(28), d1
- ! movel sp@(24), d0
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- ! movel sp@(20+6), a0
- ! movel sp@(16+6), d1
- ! movel sp@(12+6), d0
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #13
- lea sp@(14), sp
- moveml sp@+, d2/a2
- --- 268,279 ----
- .globl _trap_13_wwlwww
- _trap_13_wwlwww:
- moveml d2/a2, sp@-
- ! movew sp@(34), sp@-
- ! movew sp@(30+2), sp@-
- ! movew sp@(26+4), sp@-
- ! movel sp@(20+6), sp@-
- ! movew sp@(18+10), sp@-
- ! movew sp@(14+12), sp@-
- trap #13
- lea sp@(14), sp
- moveml sp@+, d2/a2
- ***************
- *** 296,303 ****
- .globl _trap_14_w
- _trap_14_w:
- moveml d2/a2, sp@-
- ! movel sp@(12), d0
- ! movew d0, sp@-
- trap #14
- addql #2, sp
- moveml sp@+, d2/a2
- --- 282,288 ----
- .globl _trap_14_w
- _trap_14_w:
- moveml d2/a2, sp@-
- ! movew sp@(14), sp@-
- trap #14
- addql #2, sp
- moveml sp@+, d2/a2
- ***************
- *** 306,315 ****
- .globl _trap_14_ww
- _trap_14_ww:
- moveml d2/a2, sp@-
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #14
- addql #4, sp
- moveml sp@+, d2/a2
- --- 291,298 ----
- .globl _trap_14_ww
- _trap_14_ww:
- moveml d2/a2, sp@-
- ! movew sp@(18), sp@-
- ! movew sp@(14+2), sp@-
- trap #14
- addql #4, sp
- moveml sp@+, d2/a2
- ***************
- *** 318,327 ****
- .globl _trap_14_wl
- _trap_14_wl:
- moveml d2/a2, sp@-
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #14
- addql #6, sp
- moveml sp@+, d2/a2
- --- 301,308 ----
- .globl _trap_14_wl
- _trap_14_wl:
- moveml d2/a2, sp@-
- ! movel sp@(16), sp@-
- ! movew sp@(14+4), sp@-
- trap #14
- addql #6, sp
- moveml sp@+, d2/a2
- ***************
- *** 330,341 ****
- .globl _trap_14_www
- _trap_14_www:
- moveml d2/a2, sp@-
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #14
- addql #6, sp
- moveml sp@+, d2/a2
- --- 311,319 ----
- .globl _trap_14_www
- _trap_14_www:
- moveml d2/a2, sp@-
- ! movew sp@(22), sp@-
- ! movew sp@(18+2), sp@-
- ! movew sp@(14+4), sp@-
- trap #14
- addql #6, sp
- moveml sp@+, d2/a2
- ***************
- *** 344,355 ****
- .globl _trap_14_wwl
- _trap_14_wwl:
- moveml d2/a2, sp@-
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #14
- addql #8, sp
- moveml sp@+, d2/a2
- --- 322,330 ----
- .globl _trap_14_wwl
- _trap_14_wwl:
- moveml d2/a2, sp@-
- ! movel sp@(20), sp@-
- ! movew sp@(18+4), sp@-
- ! movew sp@(14+6), sp@-
- trap #14
- addql #8, sp
- moveml sp@+, d2/a2
- ***************
- *** 358,371 ****
- .globl _trap_14_wwll
- _trap_14_wwll:
- moveml d2/a2, sp@-
- ! movel sp@(24), a1
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel a1, sp@-
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #14
- lea sp@(12), sp
- moveml sp@+, d2/a2
- --- 333,342 ----
- .globl _trap_14_wwll
- _trap_14_wwll:
- moveml d2/a2, sp@-
- ! movel sp@(24), sp@-
- ! movel sp@(20+4), sp@-
- ! movew sp@(18+8), sp@-
- ! movew sp@(14+10), sp@-
- trap #14
- lea sp@(12), sp
- moveml sp@+, d2/a2
- ***************
- *** 374,387 ****
- .globl _trap_14_wllw
- _trap_14_wllw:
- moveml d2/a2, sp@-
- ! movel sp@(24), a1
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movew a1, sp@-
- ! movel a0, sp@-
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #14
- lea sp@(12), sp
- moveml sp@+, d2/a2
- --- 345,354 ----
- .globl _trap_14_wllw
- _trap_14_wllw:
- moveml d2/a2, sp@-
- ! movew sp@(26), sp@-
- ! movel sp@(20+2), sp@-
- ! movel sp@(16+6), sp@-
- ! movew sp@(14+10), sp@-
- trap #14
- lea sp@(12), sp
- moveml sp@+, d2/a2
- ***************
- *** 390,403 ****
- .globl _trap_14_wlll
- _trap_14_wlll:
- moveml d2/a2, sp@-
- ! movel sp@(24), a1
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel a1, sp@-
- ! movel a0, sp@-
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #14
- lea sp@(14), sp
- moveml sp@+, d2/a2
- --- 357,366 ----
- .globl _trap_14_wlll
- _trap_14_wlll:
- moveml d2/a2, sp@-
- ! movel sp@(24), sp@-
- ! movel sp@(20+4), sp@-
- ! movel sp@(16+8), sp@-
- ! movew sp@(14+12), sp@-
- trap #14
- lea sp@(14), sp
- moveml sp@+, d2/a2
- ***************
- *** 406,419 ****
- .globl _trap_14_wwwl
- _trap_14_wwwl:
- moveml d2/a2, sp@-
- ! movel sp@(24), a1
- ! movel sp@(20), a0
- ! movel sp@(16), d1
- ! movel sp@(12), d0
- ! movel a1, sp@-
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #14
- lea sp@(10), sp
- moveml sp@+, d2/a2
- --- 369,378 ----
- .globl _trap_14_wwwl
- _trap_14_wwwl:
- moveml d2/a2, sp@-
- ! movel sp@(24), sp@-
- ! movew sp@(22+4), sp@-
- ! movew sp@(18+6), sp@-
- ! movew sp@(14+8), sp@-
- trap #14
- lea sp@(10), sp
- moveml sp@+, d2/a2
- ***************
- *** 422,437 ****
- .globl _trap_14_wwwwl
- _trap_14_wwwwl:
- moveml d2/a2, sp@-
- ! movel sp@(28), d0
- ! movel d0, sp@-
- ! movel sp@(24+4), a1
- ! movel sp@(20+4), a0
- ! movel sp@(16+4), d1
- ! movel sp@(12+4), d0
- ! movew a1, sp@-
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #14
- lea sp@(12), sp
- moveml sp@+, d2/a2
- --- 381,391 ----
- .globl _trap_14_wwwwl
- _trap_14_wwwwl:
- moveml d2/a2, sp@-
- ! movel sp@(28), sp@-
- ! movew sp@(26+4), sp@-
- ! movew sp@(22+6), sp@-
- ! movew sp@(18+8), sp@-
- ! movew sp@(14+10), sp@-
- trap #14
- lea sp@(12), sp
- moveml sp@+, d2/a2
- ***************
- *** 440,455 ****
- .globl _trap_14_wllww
- _trap_14_wllww:
- moveml d2/a2, sp@-
- ! movel sp@(28), d1
- ! movel sp@(24), d0
- ! movew d1, sp@-
- ! movew d0, sp@-
- ! movel sp@(20+4), a0
- ! movel sp@(16+4), d1
- ! movel sp@(12+4), d0
- ! movel a0, sp@-
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #14
- lea sp@(14), sp
- moveml sp@+, d2/a2
- --- 394,431 ----
- .globl _trap_14_wllww
- _trap_14_wllww:
- moveml d2/a2, sp@-
- ! movew sp@(30), sp@-
- ! movew sp@(26+2), sp@-
- ! movel sp@(20+4), sp@-
- ! movel sp@(16+8), sp@-
- ! movew sp@(14+12), sp@-
- ! trap #14
- ! lea sp@(14), sp
- ! moveml sp@+, d2/a2
- ! rts
- !
- ! .globl _trap_14_wlwlw
- ! _trap_14_wlwlw:
- ! moveml d2/a2, sp@-
- ! movew sp@(30), sp@-
- ! movel sp@(24+2), sp@-
- ! movew sp@(22+6), sp@-
- ! movel sp@(16+8), sp@-
- ! movew sp@(14+12), sp@-
- ! trap #14
- ! addw #14, sp
- ! moveml sp@+, d2/a2
- ! rts
- !
- ! .globl _trap_14_wwwwww
- ! _trap_14_wwwwww:
- ! moveml d2/a2, sp@-
- ! movew sp@(34), sp@-
- ! movew sp@(30+2), sp@-
- ! movew sp@(26+4), sp@-
- ! movew sp@(22+6), sp@-
- ! movew sp@(18+8), sp@-
- ! movew sp@(14+10), sp@-
- trap #14
- lea sp@(14), sp
- moveml sp@+, d2/a2
- ***************
- *** 458,477 ****
- .globl _trap_14_wwwwwww
- _trap_14_wwwwwww:
- moveml d2/a2, sp@-
- ! movel sp@(36), a1
- ! movel sp@(32), a0
- ! movel sp@(28), d1
- ! movel sp@(24), d0
- ! movew a1, sp@-
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- ! movel sp@(20+8), a0
- ! movel sp@(16+8), d1
- ! movel sp@(12+8), d0
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- trap #14
- lea sp@(14), sp
- moveml sp@+, d2/a2
- --- 434,446 ----
- .globl _trap_14_wwwwwww
- _trap_14_wwwwwww:
- moveml d2/a2, sp@-
- ! movew sp@(38), sp@-
- ! movew sp@(34+2), sp@-
- ! movew sp@(30+4), sp@-
- ! movew sp@(26+6), sp@-
- ! movew sp@(22+8), sp@-
- ! movew sp@(18+10), sp@-
- ! movew sp@(14+12), sp@-
- trap #14
- lea sp@(14), sp
- moveml sp@+, d2/a2
- ***************
- *** 480,501 ****
- .globl _trap_14_wllwwwww
- _trap_14_wllwwwww:
- moveml d2/a2, sp@-
- ! movel sp@(40), a1
- ! movel sp@(36), a0
- ! movel sp@(32), d1
- ! movel sp@(28), d0
- ! movew a1, sp@-
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- ! movel sp@(24+8), a1
- ! movel sp@(20+8), a0
- ! movel sp@(16+8), d1
- ! movel sp@(12+8), d0
- ! movew a1, sp@-
- ! movel a0, sp@-
- ! movel d1, sp@-
- ! movew d0, sp@-
- trap #14
- lea sp@(20), sp
- moveml sp@+, d2/a2
- --- 449,462 ----
- .globl _trap_14_wllwwwww
- _trap_14_wllwwwww:
- moveml d2/a2, sp@-
- ! movew sp@(42), sp@-
- ! movew sp@(38+2), sp@-
- ! movew sp@(34+4), sp@-
- ! movew sp@(30+6), sp@-
- ! movew sp@(26+8), sp@-
- ! movel sp@(20+10), sp@-
- ! movel sp@(16+14), sp@-
- ! movew sp@(14+18), sp@-
- trap #14
- lea sp@(20), sp
- moveml sp@+, d2/a2
- ***************
- *** 504,527 ****
- .globl _trap_14_wllwwwwlw
- _trap_14_wllwwwwlw:
- moveml d2/a2, sp@-
- ! movel sp@(44), a1
- ! movel sp@(40), a0
- ! movel sp@(36), d1
- ! movel sp@(32), d0
- ! movew a1, sp@-
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- ! movel sp@(28+10), a1
- ! movel sp@(24+10), a0
- ! movel sp@(20+10), d1
- ! movel sp@(16+10), d0
- ! movel sp@(12+10), d2
- ! movew a1, sp@-
- ! movew a0, sp@-
- ! movel d1, sp@-
- ! movel d0, sp@-
- ! movew d2, sp@-
- trap #14
- lea sp@(24), sp
- moveml sp@+, d2/a2
- --- 465,479 ----
- .globl _trap_14_wllwwwwlw
- _trap_14_wllwwwwlw:
- moveml d2/a2, sp@-
- ! movew sp@(46), sp@-
- ! movel sp@(40+2), sp@-
- ! movew sp@(38+6), sp@-
- ! movew sp@(34+8), sp@-
- ! movew sp@(30+10), sp@-
- ! movew sp@(26+12), sp@-
- ! movel sp@(20+14), sp@-
- ! movel sp@(16+18), sp@-
- ! movew sp@(14+22), sp@-
- trap #14
- lea sp@(24), sp
- moveml sp@+, d2/a2
- ***************
- *** 530,555 ****
- .globl _trap_14_wllwwwwwlw
- _trap_14_wllwwwwwlw:
- moveml d2/a2, sp@-
- ! movel sp@(48), a1
- ! movel sp@(44), a0
- ! movel sp@(40), d1
- ! movel sp@(36), d0
- ! movew a1, sp@-
- ! movel a0, sp@-
- ! movew d1, sp@-
- ! movew d0, sp@-
- ! movel sp@(32+10), a1
- ! movel sp@(28+10), a0
- ! movel sp@(24+10), d1
- ! movel sp@(20+10), d0
- ! movel sp@(8+10), d2
- ! movel sp@(4+10), a2
- ! movew a1, sp@-
- ! movew a0, sp@-
- ! movew d1, sp@-
- ! movel d0, sp@-
- ! movel d2, sp@-
- ! movew a2, sp@-
- trap #14
- lea sp@(26), sp
- moveml sp@+, d2/a2
- --- 482,497 ----
- .globl _trap_14_wllwwwwwlw
- _trap_14_wllwwwwwlw:
- moveml d2/a2, sp@-
- ! movew sp@(50), sp@-
- ! movel sp@(44+2), sp@-
- ! movew sp@(42+6), sp@-
- ! movew sp@(38+8), sp@-
- ! movew sp@(34+10), sp@-
- ! movew sp@(30+12), sp@-
- ! movew sp@(26+14), sp@-
- ! movel sp@(20+16), sp@-
- ! movel sp@(16+20), sp@-
- ! movew sp@(14+24), sp@-
- trap #14
- lea sp@(26), sp
- moveml sp@+, d2/a2
- diff -cr ../mntlib34/pgrp.c ./pgrp.c
- *** ../mntlib34/pgrp.c Mon Jun 7 11:11:08 1993
- --- ./pgrp.c Mon Sep 13 06:08:20 1993
- ***************
- *** 45,51 ****
- _bsd_getpgrp(pid)
- int pid;
- {
- ! if (__mint >= 103) return _bsd_setpgrp(pid, -1);
- return 0;
- }
-
- --- 45,51 ----
- _bsd_getpgrp(pid)
- int pid;
- {
- ! if (__mint >= 0x103) return _bsd_setpgrp(pid, -1);
- return 0;
- }
-
- diff -cr ../mntlib34/putenv.c ./putenv.c
- *** ../mntlib34/putenv.c Sat Jun 19 12:37:58 1993
- --- ./putenv.c Mon Jul 12 04:38:56 1993
- ***************
- *** 7,12 ****
- --- 7,13 ----
- #ifndef _COMPILER_H
- #include <compiler.h>
- #endif
- + #include <support.h>
-
- extern char ** environ;
-
- diff -cr ../mntlib34/scanf.c ./scanf.c
- *** ../mntlib34/scanf.c Tue Sep 22 20:01:52 1992
- --- ./scanf.c Mon Sep 13 11:11:10 1993
- ***************
- *** 53,59 ****
- #define FC_SIGN 3
-
- /* given transition,state do what action? */
- ! int fp_do[][NSTATE] = {
- {F_INT,F_INT,F_INT,
- F_FRAC,F_FRAC,
- F_EXP,F_EXP,F_EXP}, /* see digit */
- --- 53,59 ----
- #define FC_SIGN 3
-
- /* given transition,state do what action? */
- ! const int fp_do[][NSTATE] = {
- {F_INT,F_INT,F_INT,
- F_FRAC,F_FRAC,
- F_EXP,F_EXP,F_EXP}, /* see digit */
- ***************
- *** 66,72 ****
- F_ESIGN,F_QUIT,F_QUIT}, /* see sign */
- };
- /* given transition,state what is new state? */
- ! int fp_ns[][NSTATE] = {
- {FS_DIGS,FS_DIGS,FS_DIGS,
- FS_DD,FS_DD,
- FS_EDIGS,FS_EDIGS,FS_EDIGS}, /* see digit */
- --- 66,72 ----
- F_ESIGN,F_QUIT,F_QUIT}, /* see sign */
- };
- /* given transition,state what is new state? */
- ! const int fp_ns[][NSTATE] = {
- {FS_DIGS,FS_DIGS,FS_DIGS,
- FS_DD,FS_DD,
- FS_EDIGS,FS_EDIGS,FS_EDIGS}, /* see digit */
- ***************
- *** 79,86 ****
- FS_ESIGN,0,0}, /* see sign */
- };
- /* which states are valid terminators? */
- ! int fp_sval[NSTATE] = {
- ! 0,0,1,0,1,0,0,1
- };
- #endif
-
- --- 79,86 ----
- FS_ESIGN,0,0}, /* see sign */
- };
- /* which states are valid terminators? */
- ! const int fp_sval[NSTATE] = {
- ! 0,0,1,0,1,1,1,1
- };
- #endif
-
- ***************
- *** 99,104 ****
- --- 99,108 ----
- {
- register long n;
- register int c, width, lval, sval, cnt = 0, charcnt = 1;
- + #ifdef PRINTF_LONGLONG
- + register int llval=0;
- + register long long lln;
- + #endif
- int store, neg, base, wide1, endnull, rngflag, c2;
- register unsigned char *p = 0;
- unsigned char delim[128], digits[17], *q;
- ***************
- *** 123,128 ****
- --- 127,136 ----
- wide1 = 1;
- base = 10;
- lval = FALSE;
- + #ifdef PRINTF_LONGLONG
- + llval = FALSE;
- + lln = 0;
- + #endif
- sval = FALSE;
- store = TRUE;
- endnull = TRUE;
- ***************
- *** 153,158 ****
- --- 161,170 ----
- goto fmtnxt;
-
- case 'l': /* long data */
- + #ifdef PRINTF_LONGLONG
- + if (lval)
- + llval = TRUE;
- + #endif
- lval = TRUE;
- case 'h': /* short data (for compatibility) */
- sval = TRUE;
- ***************
- *** 181,189 ****
- case 'u': /* unsigned decimal */
- numfmt: skip();
-
- ! if (isupper(*fmt))
- lval = TRUE;
- !
- if (!base)
- {
- base = 10;
- --- 193,204 ----
- case 'u': /* unsigned decimal */
- numfmt: skip();
-
- ! if (isupper(*fmt)) {
- ! #ifdef PRINTF_LONGLONG
- ! if (lval) llval = TRUE;
- ! #endif
- lval = TRUE;
- ! }
- if (!base)
- {
- base = 10;
- ***************
- *** 230,236 ****
-
- while (p && width-- && c)
- {
- ! n = (n * base) + (p - digits);
- charcnt++;
- c = (*get)(ip);
- zeroin:
- --- 245,256 ----
-
- while (p && width-- && c)
- {
- ! #ifdef PRINTF_LONGLONG
- ! if (llval)
- ! lln = (lln * base) + (p - digits);
- ! else
- ! #endif
- ! n = (n * base) + (p - digits);
- charcnt++;
- c = (*get)(ip);
- zeroin:
- ***************
- *** 245,259 ****
- #else
- p = ((unsigned char *) *args);
- #endif
- ! if (neg == TRUE)
- ! n = -n;
- ! if (lval)
- ! *((long*) p) = n;
- ! else if (sval)
- ! *((short *) p) = (short) n;
- else
- ! *((int *) p) = (int) n;
- ! ++cnt;
- }
- break;
-
- --- 265,290 ----
- #else
- p = ((unsigned char *) *args);
- #endif
- ! #ifdef PRINTF_LONGLONG
- ! if (llval)
- ! {
- ! if (neg == TRUE)
- ! lln=-lln;
- ! *((long long*) p) = lln;
- ! }
- else
- ! #endif
- ! {
- ! if (neg == TRUE)
- ! n = -n;
- ! if (lval)
- ! *((long*) p) = n;
- ! else if (sval)
- ! *((short *) p) = (short) n;
- ! else
- ! *((int *) p) = (int) n;
- ! ++cnt;
- ! }
- }
- break;
-
- diff -cr ../mntlib34/select.c ./select.c
- *** ../mntlib34/select.c Wed Jul 7 09:22:12 1993
- --- ./select.c Mon Sep 13 22:53:08 1993
- ***************
- *** 18,26 ****
- value under MiNT. A non-null pointer to a 0 valued struct means
- to poll; in MiNT we simulate this with a minimum timeout value.
- */
- ! unsigned short mtime;
- int rval;
-
- if (timeout) {
- mtime = timeout->tv_sec * 1000 + timeout->tv_usec/1000;
- if (mtime == 0) mtime = 1;
- --- 18,31 ----
- value under MiNT. A non-null pointer to a 0 valued struct means
- to poll; in MiNT we simulate this with a minimum timeout value.
- */
- ! unsigned long mtime;
- ! unsigned short stime;
- int rval;
- + long save_rfds = 0, save_wfds = 0, save_xfds = 0;
-
- + if (rfds) save_rfds = *rfds;
- + if (wfds) save_wfds = *wfds;
- + if (xfds) save_xfds = *xfds;
- if (timeout) {
- mtime = timeout->tv_sec * 1000 + timeout->tv_usec/1000;
- if (mtime == 0) mtime = 1;
- ***************
- *** 28,37 ****
- else
- mtime = 0;
-
- ! rval = Fselect(mtime, rfds, wfds, xfds);
- ! if (rval < 0) {
- errno = -rval;
- return -1;
- ! }
- ! return rval;
- }
- --- 33,60 ----
- else
- mtime = 0;
-
- ! /* Unfortunately, Fselect can only handle at most 65535ms timeout.
- ! We have to loop for a bigger timeout. */
- ! for (;;)
- ! {
- ! if (mtime > 65535)
- ! stime = 65535;
- ! else
- ! stime = mtime;
- ! mtime -= stime;
- ! rval = Fselect (stime, rfds, wfds, xfds);
- ! if (rval < 0)
- ! {
- errno = -rval;
- return -1;
- ! }
- ! if (rval == 0 && mtime > 0)
- ! {
- ! if (rfds) *rfds = save_rfds;
- ! if (wfds) *wfds = save_wfds;
- ! if (xfds) *xfds = save_xfds;
- ! }
- ! else
- ! return rval;
- ! }
- }
- diff -cr ../mntlib34/setjmp.cpp ./setjmp.cpp
- *** ../mntlib34/setjmp.cpp Wed Jun 9 05:10:28 1993
- --- ./setjmp.cpp Wed Sep 8 22:20:20 1993
- ***************
- *** 18,48 ****
- _sigsetjmp:
- movel sp@(4), a0 | address of sigjmp_buf[]
- #ifdef __MSHORT__
- ! movew sp@(8), d0
- ! extl d0
- #else
- ! movel sp@(8), d0
- #endif
- ! movel d0, a0@(56) | save sigmask for siglongjmp?
- beq SETJMP | no -- call common code
- ! movel Sigmask, a0@(52) | save tos emulation signal mask
- #ifdef __MSHORT__
- tstw Mint | see if MiNT is active
- #else
- tstl Mint
- #endif
- ! beq SETJMP | no -- call common code
- ! movel #0, sp@- | add no signals to sigmask
- movew #0x116, sp@- | Psigblock() system call
- trap #1 |
- addqw #6, sp
- ! movel d0, a0@(52) | save MiNT signal mask
- ! jmp SETJMP | call common code
-
- .globl _setjmp
- _setjmp:
- movel sp@(4),a0 | address of jmp_buf[]
- ! movel #0, a0@(56) | do not restore sigmask on longjmp
- SETJMP:
- movel sp@,a0@ | save return address
- moveml d2-d7/a2-a7,a0@(4) | save registers d2-d7/a2-a7
- --- 18,49 ----
- _sigsetjmp:
- movel sp@(4), a0 | address of sigjmp_buf[]
- #ifdef __MSHORT__
- ! movew sp@(8), a1
- #else
- ! movel sp@(8), a1
- #endif
- ! movel a1, a0@(52) | save sigmask for siglongjmp?
- beq SETJMP | no -- call common code
- ! movel Sigmask, d0 | save tos emulation signal mask
- #ifdef __MSHORT__
- tstw Mint | see if MiNT is active
- #else
- tstl Mint
- #endif
- ! beq nomint | no -- call common code
- ! clrl sp@- | add no signals to sigmask
- movew #0x116, sp@- | Psigblock() system call
- trap #1 |
- addqw #6, sp
- ! nomint:
- ! orw #1,d0 | make it != 0 (SIGNULL is unmaskable)
- ! movel d0, a0@(52) | save signal mask
- ! bra SETJMP | call common code
-
- .globl _setjmp
- _setjmp:
- movel sp@(4),a0 | address of jmp_buf[]
- ! clrl a0@(52) | do not restore sigmask on longjmp
- SETJMP:
- movel sp@,a0@ | save return address
- moveml d2-d7/a2-a7,a0@(4) | save registers d2-d7/a2-a7
- ***************
- *** 64,72 ****
- addqw #2, sp
- NOMINT:
- movel sp@(4),a0 | address of jmp_buf[]
- ! tstl a0@(56) | want to restore sigmask?
- beq NORESTORE | no -- skip restore code
- ! movel a0@(52), Sigmask | restore tos emulation signal mask
- #ifdef __MSHORT__
- tstw Mint | see if MiNT is active
- #else
- --- 65,74 ----
- addqw #2, sp
- NOMINT:
- movel sp@(4),a0 | address of jmp_buf[]
- ! movel a0@(52),d0 | want to restore sigmask?
- beq NORESTORE | no -- skip restore code
- ! andw #-2,d0
- ! movel d0, Sigmask | restore tos emulation signal mask
- #ifdef __MSHORT__
- tstw Mint | see if MiNT is active
- #else
- ***************
- *** 73,79 ****
- tstl Mint
- #endif
- beq NORESTORE | no -- do not call sigsetmask
- ! movel a0@(52), sp@- | restore signal mask
- movew #0x117, sp@- | Psigsetmask() system call
- trap #1 |
- addqw #6, sp
- --- 75,81 ----
- tstl Mint
- #endif
- beq NORESTORE | no -- do not call sigsetmask
- ! movel d0, sp@- | restore signal mask
- movew #0x117, sp@- | Psigsetmask() system call
- trap #1 |
- addqw #6, sp
- ***************
- *** 84,90 ****
- movel sp@(8),d0 | value to return
- #endif
- bne L1 | may not be 0
- ! movl #1, d0
- L1:
- moveml a0@(4),d2-d7/a2-a7 | restore saved reggies
- movl a0@,sp@ | and the saved return address
- --- 86,92 ----
- movel sp@(8),d0 | value to return
- #endif
- bne L1 | may not be 0
- ! movql #1, d0
- L1:
- moveml a0@(4),d2-d7/a2-a7 | restore saved reggies
- movl a0@,sp@ | and the saved return address
- diff -cr ../mntlib34/sigactio.c ./sigactio.c
- *** ../mntlib34/sigactio.c Tue Jul 6 08:04:36 1993
- --- ./sigactio.c Sun Jul 18 08:20:38 1993
- ***************
- *** 6,12 ****
- #include <signal.h>
-
- /* vector of signal handlers (for TOS, or for MiNT with -mshort) */
- ! extern __Sigfunc _sig_handler[NSIG];
-
- #ifdef __MSHORT__
- typedef void __CDECL (*__KerSigfunc) __PROTO((long));
- --- 6,12 ----
- #include <signal.h>
-
- /* vector of signal handlers (for TOS, or for MiNT with -mshort) */
- ! extern __Sigfunc _sig_handler[__NSIG];
-
- #ifdef __MSHORT__
- typedef void __CDECL (*__KerSigfunc) __PROTO((long));
- ***************
- *** 29,75 ****
- struct ksigact {
- __KerSigfunc sa_handler; /* pointer to signal handler */
- long sa_mask; /* additional signals masked during delivery */
- ! union {
- ! short kernel;
- ! int posix;
- ! } sa_flags; /* signal specific flags, kernel */
- ! } temp;
- !
- #ifdef __MSHORT__
- /* NOTE: MiNT passes 32 bit numbers for signals, so we want our
- * own signal dispatcher to switch these to 16 bit ints
- */
- - if (sig < 0 || sig >= NSIG) {
- - errno = ERANGE;
- - return -1;
- - }
- oldfunc = _sig_handler[sig];
- if (act) {
- ! temp = *(struct ksigact *)act;
- ! _sig_handler[sig] = (__Sigfunc)temp.sa_handler;
- if (_sig_handler[sig] != SIG_DFL && _sig_handler[sig] != SIG_IGN) {
- ! temp.sa_handler = _trampoline;
- }
- ! act = (struct sigaction *)&temp;
- }
- ! #else
- ! if (act) {
- ! temp = *(struct ksigact *)act; /* dept. of sleaze */
- ! temp.sa_flags.kernel = temp.sa_flags.posix;
- ! act = (struct sigaction *)&temp;
- }
- ! #endif
- ! r = Psigaction(sig, act, oact);
- #ifdef __MSHORT__
- ! if (oact && oact->sa_handler == (__Sigfunc) _trampoline)
- ! oact->sa_handler = oldfunc;
- #else
- ! if (oact)
- ! oact->sa_flags = ((struct ksigact *)oact)->sa_flags.kernel;
- #endif
- - if (r < 0) {
- - errno = (int) -r;
- - return -1;
- }
- }
- else {
- --- 29,75 ----
- struct ksigact {
- __KerSigfunc sa_handler; /* pointer to signal handler */
- long sa_mask; /* additional signals masked during delivery */
- ! short sa_flags; /* signal specific flags, kernel */
- ! } kact, koact;
- !
- ! if (sig < 0 || sig >= __NSIG) {
- ! errno = ERANGE;
- ! return -1;
- ! }
- !
- #ifdef __MSHORT__
- /* NOTE: MiNT passes 32 bit numbers for signals, so we want our
- * own signal dispatcher to switch these to 16 bit ints
- */
- oldfunc = _sig_handler[sig];
- + #endif
- if (act) {
- ! kact.sa_handler = (__KerSigfunc) act->sa_handler;
- ! kact.sa_mask = act->sa_mask.__sigset_data[0];
- ! kact.sa_flags = (short) act->sa_flags;
- ! #ifdef __MSHORT__
- ! _sig_handler[sig] = (__Sigfunc)kact.sa_handler;
- if (_sig_handler[sig] != SIG_DFL && _sig_handler[sig] != SIG_IGN) {
- ! kact.sa_handler = _trampoline;
- }
- ! #endif
- }
- ! r = Psigaction(sig, (act ? &kact : 0L), (oact ? &koact : 0L));
- ! if (r < 0) {
- ! errno = (int) -r;
- ! return -1;
- }
- ! if (oact) {
- ! oact->sa_mask.__sigset_data[0] = koact.sa_mask;
- ! oact->sa_flags = (int) koact.sa_flags;
- #ifdef __MSHORT__
- ! oact->sa_handler =
- ! ((koact.sa_handler == (__KerSigfunc) _trampoline)
- ! ? oldfunc
- ! : (__Sigfunc) koact.sa_handler);
- #else
- ! oact->sa_handler = (__Sigfunc) koact.sa_handler;
- #endif
- }
- }
- else {
- ***************
- *** 89,95 ****
- oact->sa_handler = oldfunc;
- /* we could do something useful with sa_mask when __mint */
- oact->sa_flags = 0;
- ! oact->sa_mask = 0;
- }
- }
- return 0;
- --- 89,95 ----
- oact->sa_handler = oldfunc;
- /* we could do something useful with sa_mask when __mint */
- oact->sa_flags = 0;
- ! oact->sa_mask.__sigset_data[0] = 0;
- }
- }
- return 0;
- ***************
- *** 103,109 ****
- int idx;
- int pos;
-
- ! if ((!set) || (signo >= NSIG)) {
- errno = EINVAL;
- return -1;
- }
- --- 103,109 ----
- int idx;
- int pos;
-
- ! if ((!set) || (signo >= __NSIG)) {
- errno = EINVAL;
- return -1;
- }
- ***************
- *** 121,127 ****
- int idx;
- int pos;
-
- ! if ((!set) || (signo >= NSIG)) {
- errno = EINVAL;
- return -1;
- }
- --- 121,127 ----
- int idx;
- int pos;
-
- ! if ((!set) || (signo >= __NSIG)) {
- errno = EINVAL;
- return -1;
- }
- ***************
- *** 171,177 ****
- int idx;
- int pos;
-
- ! if ((!set) || (signo >= NSIG)) {
- errno = EINVAL;
- return -1;
- }
- --- 171,177 ----
- int idx;
- int pos;
-
- ! if ((!set) || (signo >= __NSIG)) {
- errno = EINVAL;
- return -1;
- }
- diff -cr ../mntlib34/sozobon/linea.s ./sozobon/linea.s
- *** ../mntlib34/sozobon/linea.s Thu Jun 17 04:47:50 1993
- --- ./sozobon/linea.s Mon Sep 13 06:13:04 1993
- ***************
- *** 3,16 ****
- .bss
-
- .globl ___aline
- ! ;___aline:
- ! ; .ds.l 1
- .globl ___fonts
- ! ;___fonts:
- ! ; .ds.b 1
- .globl ___funcs
- ! ;___funcs:
- ! ; .ds.l 1
-
- .text
-
- --- 3,16 ----
- .bss
-
- .globl ___aline
- ! ___aline:
- ! .ds.l 1
- .globl ___fonts
- ! ___fonts:
- ! .ds.l 1
- .globl ___funcs
- ! ___funcs:
- ! .ds.l 1
-
- .text
-
- diff -cr ../mntlib34/sozobon/makefile ./sozobon/makefile
- *** ../mntlib34/sozobon/makefile Mon Jun 7 10:23:18 1993
- --- ./sozobon/makefile Mon Sep 13 06:18:44 1993
- ***************
- *** 31,42 ****
- # Unfortunately, there is an optimizer bug in 1.40 that bites here; if
- # you're using that version, you must use the non-optimizing version.
- CFLAGS = -O -D__NO_FLOAT__ -DNDEBUG $(SHORTNAMES)
- ! #NOOPT = -D__NO_FLOAT__ -DNDEBUG $(SHORTNAMES) # without debugging
- ! NOOPT = $(CFLAGS) # with debugging
-
- # If you prefer more "standard" Unix-like names for your library files, use
- # the alternate definitions of CRT0 and LIBC -- assuming, of course, that
- ! # your cc has been modified to recognize those names!
- # CRT0 = crt0.o
- # LIBC = libc.a
- CRT0 = dstart.o
- --- 31,42 ----
- # Unfortunately, there is an optimizer bug in 1.40 that bites here; if
- # you're using that version, you must use the non-optimizing version.
- CFLAGS = -O -D__NO_FLOAT__ -DNDEBUG $(SHORTNAMES)
- ! #NOOPT = -D__NO_FLOAT__ -DNDEBUG $(SHORTNAMES) # without optimizing
- ! NOOPT = $(CFLAGS) # with optimizing
-
- # If you prefer more "standard" Unix-like names for your library files, use
- # the alternate definitions of CRT0 and LIBC -- assuming, of course, that
- ! # you have a cc that recognizes those names!
- # CRT0 = crt0.o
- # LIBC = libc.a
- CRT0 = dstart.o
- ***************
- *** 47,60 ****
-
- # These are in alphabetical order to make it easy to find one.
- OBJECTS = \
- ! abort.o abs.o access.o alarm.o alglobal.o alloca.o alphasor.o \
- atexit.o atol.o \
- bcmp.o bcopy.o binmode.o bsearch.o bzero.o \
- calloc.o chdir.o chmod.o clock.o close.o console.o crtinit.o \
- ! ctermid.o ctime.o ctype.o \
- defmode.o difftime.o dirent.o doprnt.o dup.o \
- eprintf.o exec.o execp.o\
- ! fclose.o fcntl.o fdopen.o fflush.o fgetc.o fgets.o filbuf.o \
- findfile.o fopen.o fopenp.o fork.o fprintf.o fputc.o fputs.o \
- fread.o frwbin.o fscanf.o fseek.o fsetpos.o ftw.o fungetc.o \
- fwrite.o \
- --- 47,60 ----
-
- # These are in alphabetical order to make it easy to find one.
- OBJECTS = \
- ! abort.o abs.o access.o alarm.o alloca.o alphasor.o \
- atexit.o atol.o \
- bcmp.o bcopy.o binmode.o bsearch.o bzero.o \
- calloc.o chdir.o chmod.o clock.o close.o console.o crtinit.o \
- ! ctermid.o ctime.o ctype.o cuserid.o\
- defmode.o difftime.o dirent.o doprnt.o dup.o \
- eprintf.o exec.o execp.o\
- ! fclose.o fcntl.o fdopen.o fflush.o ffs.o fgetc.o fgets.o filbuf.o \
- findfile.o fopen.o fopenp.o fork.o fprintf.o fputc.o fputs.o \
- fread.o frwbin.o fscanf.o fseek.o fsetpos.o ftw.o fungetc.o \
- fwrite.o \
- diff -cr ../mntlib34/sozobon/readme ./sozobon/readme
- *** ../mntlib34/sozobon/readme Sun Jun 6 05:57:34 1993
- --- ./sozobon/readme Mon Sep 13 06:18:46 1993
- ***************
- *** 1,4 ****
- ! MiNT library for Heat-n-Serve/Sozobon C, patchlevel 30
-
- This is a port of Eric Smith's MiNT library to Heat-n-Serve C, based on
- Dave Gymer's original port. It replaces the files dlibs.a, dstart.o,
- --- 1,4 ----
- ! MiNT library for Heat-n-Serve/Sozobon C, patchlevel 34
-
- This is a port of Eric Smith's MiNT library to Heat-n-Serve C, based on
- Dave Gymer's original port. It replaces the files dlibs.a, dstart.o,
- ***************
- *** 64,72 ****
- directory.
-
- 3) Edit osbind.h from the MiNT include distribution. Find the macro
- ! definition for trap_14_wllwwwwwlw(), spanning lines 830-874 (or
- ! thereabouts). Delete every scrap of white space you can from this
- ! macro. Otherwise, it overruns HSC's static line buffer.
-
- 4) Replace the gemfast.h from the MiNT distribution with the gemfast.h
- from the Heat-n-Serve distribution (the GEMfast that comes with
- --- 64,73 ----
- directory.
-
- 3) Edit osbind.h from the MiNT include distribution. Find the macro
- ! definitions for trap_14_wllwwwwwlw(), spanning lines 1309-1349 and
- ! 1456-1500 (or thereabouts). Delete every scrap of white space you
- ! can from these macros. Otherwise, they overrun HSC's static line
- ! buffer.
-
- 4) Replace the gemfast.h from the MiNT distribution with the gemfast.h
- from the Heat-n-Serve distribution (the GEMfast that comes with
- diff -cr ../mntlib34/spawn.c ./spawn.c
- *** ../mntlib34/spawn.c Sat Jun 19 12:20:58 1993
- --- ./spawn.c Mon Sep 13 22:59:12 1993
- ***************
- *** 20,25 ****
- --- 20,34 ----
- uo, 3.5.93, throw away some static characterarrays (path[] and
- cmd[]).
-
- + 10 Jul 1993 ole
- + added emulation for script execution.
- + This feature is controlable by the Environment variable "UNIXMODE".
- + The switch 's' in UNIXMODE says that executable text files with a
- + hash as their first character are interpretable.
- + Files which have only '#' as their first character are interpreted
- + using /bin/sh
- + Files which have i.e '#!/usr/bin/awk -f' as their first character
- + are interpreted with "/usr/bin/awk -f <file>"
- */
-
- #include <stdarg.h>
- ***************
- *** 32,37 ****
- --- 41,47 ----
- #include <time.h>
- #include <string.h>
- #include <unistd.h>
- + #include <support.h>
- #include "lib.h"
-
- #define TOS_ARGS 126
- ***************
- *** 39,64 ****
- extern char **environ;
- extern int __mint;
-
-
- ! int
- ! _spawnve(mode, _path, argv, envp)
- ! int mode;
- ! char *_path;
- char **argv;
- char **envp;
- {
- char path[MAXPATHLEN];
- char cmd[TOS_ARGS + 1];
- size_t cmlen;
- size_t enlen = 0;
- size_t left, min_left;
- ! char *p;
- char *s, *t;
- char *env;
- long rval;
- ! char *pconv, *pc, *tmp;
- size_t len, cnt;
- int i, done;
-
- if (mode != P_WAIT && mode != P_OVERLAY && mode != P_NOWAIT) {
- errno = EINVAL;
- --- 49,227 ----
- extern char **environ;
- extern int __mint;
-
- + /* comment this out, if you don't want script execution */
- + #define HASH_BANG
-
- ! #ifdef HASH_BANG
- !
- ! static char *extensions[] = { "ttp", "prg", "tos", NULL };
- !
- ! static int interpret_script __PROTO((int mode, char *path,
- ! char **argv, char **envp));
- !
- ! static int
- ! interpret_script(mode, path, argv, envp)
- ! int mode;
- ! char *path;
- char **argv;
- char **envp;
- {
- + char shellpath[MAXPATHLEN];
- + char tmppath[MAXPATHLEN];
- + char args[TOS_ARGS + 1];
- + char *shell;
- + char *shellargs;
- + char **shellargv;
- + int nargcount;
- + int fd;
- + int argcount;
- + int i, rv;
- + char buf;
- +
- + /* path is already converted to dos */
- + if ((fd = (int)Fopen(path, 0)) < 0)
- + return -fd;
- +
- + if (Fread(fd, 1L, &buf) != 1L) {
- + Fclose(fd);
- + return -1;
- + }
- +
- + if (buf == '#') {
- + if (Fread(fd, 1L, &buf) != 1L) {
- + Fclose(fd);
- + return -1;
- + }
- +
- + if (buf == '!') {
- +
- + /* skip blanks */
- + do {
- + if (Fread(fd, 1L, &buf) != 1L) {
- + Fclose(fd);
- + return -1;
- + }
- + } while (buf == ' ' || buf == '\t');
- +
- + /* read filename */
- + for (i = 0; i < MAXPATHLEN; i++) {
- + if (buf == ' ' || buf == '\t' ||
- + buf == '\r' || buf == '\n')
- + break;
- + shellpath[i] = buf;
- +
- + if (Fread(fd, 1L, &buf) != 1L) {
- + Fclose(fd);
- + return -1;
- + }
- + }
- + shellpath[i] = '\0';
- + shell = shellpath;
- +
- + /*
- + * read arguments if any
- + * maximum is TOS_ARGS (only restricted for my comfort :-)
- + */
- + nargcount = 0;
- + i = 0;
- + while(i < TOS_ARGS && buf != '\r' && buf != '\n') {
- + /* skip blanks */
- + do {
- + if (Fread(fd, 1L, &buf) != 1L) {
- + Fclose(fd);
- + return -1;
- + }
- + } while (buf == ' ' || buf == '\t');
- +
- + if (buf == '\r' || buf == '\n')
- + break;
- +
- + while ( buf != ' ' && buf != '\t' &&
- + buf != '\r' && buf != '\n' && i < TOS_ARGS) {
- + args[i++] = buf;
- + if (Fread(fd, 1L, &buf) != 1L) {
- + Fclose(fd);
- + return -1;
- + }
- + }
- + args[i++] = '\0';
- + nargcount++;
- + }
- + args[i] = '\0';
- + shellargs = args;
- + }
- + else {
- + shell = "/bin/sh";
- + nargcount = 0;
- + args[0] = '\0';
- + shellargs = args;
- + }
- +
- + Fclose(fd);
- +
- + if (*shell) {
- +
- + shell = buffindfile(shell, getenv("PATH"), extensions, tmppath);
- + if (!shell) {
- + errno = ENOENT;
- + return -1; /* file not found */
- + }
- +
- + /* count old args */
- + for (i = 0; argv[i] != 0; i++);
- + argcount = i;
- +
- + shellargv = (char **)Malloc((argcount + nargcount + 2) * sizeof(char *));
- + if (!shellargv) {
- + errno = ENOMEM;
- + return -1;
- + }
- +
- + i = 0;
- + shellargv[i++] = shell;
- + while(*shellargs != '\0') {
- + shellargv[i++] = shellargs;
- + while (*shellargs++ != '\0');
- + }
- +
- + while (*argv != NULL)
- + shellargv[i++] = *argv++;
- + shellargv[i] = NULL;
- +
- + rv = _spawnve(mode, shell, shellargv, envp);
- + (void)Mfree(shellargv);
- + return rv;
- + }
- + }
- +
- + return -1;
- + }
- +
- + #endif /* HASH_BANG */
- +
- + int
- + _spawnve(mode, _path, argv, envp)
- + int mode;
- + const char *_path;
- + char *const *argv;
- + char *const *envp;
- + {
- char path[MAXPATHLEN];
- char cmd[TOS_ARGS + 1];
- size_t cmlen;
- size_t enlen = 0;
- size_t left, min_left;
- ! const char *p;
- char *s, *t;
- char *env;
- long rval;
- ! const char *pconv, *pc, *tmp;
- size_t len, cnt;
- int i, done;
- + #ifdef HASH_BANG
- + char **_envp;
- + char **_argv;
- + #endif
-
- if (mode != P_WAIT && mode != P_OVERLAY && mode != P_NOWAIT) {
- errno = EINVAL;
- ***************
- *** 68,73 ****
- --- 231,241 ----
- if (!envp)
- envp = environ;
-
- + #ifdef HASH_BANG
- + _envp = envp;
- + _argv = argv;
- + #endif
- +
- /* try to find PCONVERT environment variable */
- for (i = 0; (pconv = envp[i]) != 0; i++) {
- if (! strncmp(pconv, "PCONVERT=", 9)) {
- ***************
- *** 203,209 ****
- unsigned long null_params = 0;
- int digits, i;
- unsigned long idx, val;
- ! char **ap;
-
- /* communicate empty arguments thru ARGV= value
- */
- --- 371,377 ----
- unsigned long null_params = 0;
- int digits, i;
- unsigned long idx, val;
- ! char *const *ap;
-
- /* communicate empty arguments thru ARGV= value
- */
- ***************
- *** 242,250 ****
- }
-
- left -= digits + 2; /* 2 = sizeof( ',' in NULL:
- ! * list + ' ' we put in place
- ! * of empty params
- ! */
- if (left < min_left)
- goto need_more_core;
- }
- --- 410,418 ----
- }
-
- left -= digits + 2; /* 2 = sizeof( ',' in NULL:
- ! * list + ' ' we put in place
- ! * of empty params
- ! */
- if (left < min_left)
- goto need_more_core;
- }
- ***************
- *** 262,268 ****
- *s++ = ' '; /* replace by space */
- } else {
- do {
- ! *s++ = *p++;
- } while (*p);
- }
- *s++ = '\0';
- --- 430,436 ----
- *s++ = ' '; /* replace by space */
- } else {
- do {
- ! *s++ = *p++;
- } while (*p);
- }
- *s++ = '\0';
- ***************
- *** 273,279 ****
- /* s points at the environment's copy of the args */
- /* t points at the command line copy to be put in the basepage */
-
- ! cmlen = 0;
- if (argv && *argv) {
- t++;
- while (*++argv) {
- --- 441,447 ----
- /* s points at the environment's copy of the args */
- /* t points at the command line copy to be put in the basepage */
-
- ! cmlen = 0;
- if (argv && *argv) {
- t++;
- while (*++argv) {
- ***************
- *** 290,304 ****
- }
- } else {
- do {
- ! if (cmlen < TOS_ARGS) {
- ! *t++ = *p; cmlen++;
- ! }
- ! *s++ = *p++;
- } while (*p);
- }
- ! if (cmlen < TOS_ARGS && *(argv+1)) {
- ! *t++ = ' '; cmlen++;
- ! }
- *s++ = '\0';
- }
- /* *cmd = (char) cmlen; NOT ANY MORE */
- --- 458,472 ----
- }
- } else {
- do {
- ! if (cmlen < TOS_ARGS) {
- ! *t++ = *p; cmlen++;
- ! }
- ! *s++ = *p++;
- } while (*p);
- }
- ! if (cmlen < TOS_ARGS && *(argv+1)) {
- ! *t++ = ' '; cmlen++;
- ! }
- *s++ = '\0';
- }
- /* *cmd = (char) cmlen; NOT ANY MORE */
- ***************
- *** 324,329 ****
- --- 492,509 ----
- {
- errno = (int) -rval;
- rval = -1;
- + #ifdef HASH_BANG
- + if (errno == ENOEXEC) {
- + char *umode;
- +
- + /* try to find UNIXMODE in environment */
- + if ((umode = getenv("UNIXMODE")) != NULL &&
- + strchr(umode, 's') != NULL ) {
- + (void)Mfree(env);
- + return interpret_script(mode, path, _argv, _envp);
- + }
- + }
- + #endif
- }
- else if (mode == P_OVERLAY)
- /* note that we get here only if MiNT is not active! */
- ***************
- *** 331,333 ****
- --- 511,528 ----
- (void)Mfree(env);
- return (int) rval;
- }
- +
- + #ifdef TEST
- + int
- + main (int argc, char **argv, char **envp)
- + {
- + if (argc == 2) {
- + if (spawnve(P_WAIT, argv[1], &argv[1], envp) < 0) {
- + perror("spawn failed");
- + return errno;
- + }
- + return 0;
- + }
- + return 1;
- + }
- + #endif
- diff -cr ../mntlib34/spawnve.c ./spawnve.c
- *** ../mntlib34/spawnve.c Tue Apr 16 07:51:18 1991
- --- ./spawnve.c Thu Sep 9 16:00:20 1993
- ***************
- *** 11,19 ****
- int
- spawnve(mode, path, argv, envp)
- int mode;
- ! char *path;
- ! char **argv;
- ! char **envp;
- {
- return _spawnve(mode, path, argv, envp);
- }
- --- 11,19 ----
- int
- spawnve(mode, path, argv, envp)
- int mode;
- ! const char *path;
- ! char *const *argv;
- ! char *const *envp;
- {
- return _spawnve(mode, path, argv, envp);
- }
- ***************
- *** 21,34 ****
- int
- spawnv(mode, path, argv)
- int mode;
- ! char *path;
- ! char **argv;
- {
- return _spawnve(mode, path, argv, environ);
- }
-
- #ifdef __STDC__
- ! int spawnle(int mode, char *path, ...)
- #else
- int spawnle(mode, path)
- int mode;
- --- 21,34 ----
- int
- spawnv(mode, path, argv)
- int mode;
- ! const char *path;
- ! char *const *argv;
- {
- return _spawnve(mode, path, argv, environ);
- }
-
- #ifdef __STDC__
- ! int spawnle(int mode, const char *path, ...)
- #else
- int spawnle(mode, path)
- int mode;
- ***************
- *** 49,55 ****
- }
-
- #ifdef __STDC__
- ! int spawnl(int mode, char *path, ...)
- #else
- int spawnl(mode, path)
- int mode;
- --- 49,55 ----
- }
-
- #ifdef __STDC__
- ! int spawnl(int mode, const char *path, ...)
- #else
- int spawnl(mode, path)
- int mode;
- diff -cr ../mntlib34/spawnvp.c ./spawnvp.c
- *** ../mntlib34/spawnvp.c Tue May 25 11:43:18 1993
- --- ./spawnvp.c Thu Sep 9 16:00:24 1993
- ***************
- *** 15,29 ****
- #include <support.h>
- #include <limits.h>
-
- ! static char *extensions[] = { "ttp", "prg", "tos", NULL };
-
- #ifdef __STDC__
- ! int spawnvp(int mode, char *name, char **argv)
- #else
- int spawnvp(mode, name, argv) int mode; char *name; char **argv;
- #endif
- {
- ! char *execname;
- char buffer[PATH_MAX];
- execname = buffindfile(name, getenv("PATH"), extensions,buffer);
- if (!execname) {
- --- 15,29 ----
- #include <support.h>
- #include <limits.h>
-
- ! static char *const extensions[] = { "ttp", "prg", "tos", NULL };
-
- #ifdef __STDC__
- ! int spawnvp(int mode, const char *name, char *const *argv)
- #else
- int spawnvp(mode, name, argv) int mode; char *name; char **argv;
- #endif
- {
- ! const char *execname;
- char buffer[PATH_MAX];
- execname = buffindfile(name, getenv("PATH"), extensions,buffer);
- if (!execname) {
- ***************
- *** 34,40 ****
- }
-
- #ifdef __STDC__
- ! int spawnlp(int mode, char *name, ...)
- #else
- int spawnlp(mode, name) int mode; char *name;
- #endif
- --- 34,40 ----
- }
-
- #ifdef __STDC__
- ! int spawnlp(int mode, const char *name, ...)
- #else
- int spawnlp(mode, name) int mode; char *name;
- #endif
- diff -cr ../mntlib34/statfs.c ./statfs.c
- *** ../mntlib34/statfs.c Fri Jun 11 02:00:12 1993
- --- ./statfs.c Mon Sep 13 23:05:20 1993
- ***************
- *** 11,16 ****
- --- 11,17 ----
- #include <mintbind.h>
- #include <unistd.h> /* for chdir, getcwd */
- #include <limits.h> /* for PATH_MAX */
- + #include <support.h>
- #ifdef __TURBOC__
- #include <sys\statfs.h>
- #else
- ***************
- *** 20,26 ****
- extern int __mint;
-
- int statfs(path, buf)
- ! char *path;
- struct statfs *buf;
- {
- int r;
- --- 21,27 ----
- extern int __mint;
-
- int statfs(path, buf)
- ! const char *path;
- struct statfs *buf;
- {
- int r;
- ***************
- *** 33,38 ****
- --- 34,40 ----
- short increment;
- long res1, res2, res3, res4;
- } mfsinfo;
- + char _path[PATH_MAX];
-
- if (!buf || !path)
- {
- ***************
- *** 52,58 ****
- * Also f_type is 1 for V1 filesystems and 2 for V2 (it
- * is zero for TOS).
- */
- ! if(Dcntl(0x104,path, (long) &mfsinfo)==0)
- {
- buf->f_type = 1+mfsinfo.version;
- buf->f_bsize = 1024;
- --- 54,61 ----
- * Also f_type is 1 for V1 filesystems and 2 for V2 (it
- * is zero for TOS).
- */
- ! _unx2dos (path, _path);
- ! if(Dcntl(0x104,_path, (long) &mfsinfo)==0)
- {
- buf->f_type = 1+mfsinfo.version;
- buf->f_bsize = 1024;
- diff -cr ../mntlib34/symlink.c ./symlink.c
- *** ../mntlib34/symlink.c Sun May 23 09:03:10 1993
- --- ./symlink.c Thu Jul 15 08:01:36 1993
- ***************
- *** 4,9 ****
- --- 4,10 ----
- #include <errno.h>
- #include <string.h>
- #include <limits.h>
- + #include <unistd.h>
- #include "lib.h"
-
- extern int __mint;
- Only in .: sync.c
- diff -cr ../mntlib34/sysconf.c ./sysconf.c
- *** ../mntlib34/sysconf.c Sun Feb 28 13:08:04 1993
- --- ./sysconf.c Wed Sep 8 19:06:10 1993
- ***************
- *** 62,68 ****
- }
- switch(var) {
- case _PC_LAST:
- ! return 3;
- case _PC_IOPEN_MAX:
- return 45; /* -ish, maybe... */
- case _PC_LINK_MAX:
- --- 62,68 ----
- }
- switch(var) {
- case _PC_LAST:
- ! return 4;
- case _PC_IOPEN_MAX:
- return 45; /* -ish, maybe... */
- case _PC_LINK_MAX:
- diff -cr ../mntlib34/thread.c ./thread.c
- *** ../mntlib34/thread.c Sat Jun 19 12:12:04 1993
- --- ./thread.c Mon Sep 13 06:19:18 1993
- ***************
- *** 38,44 ****
- /* and this is used to retrieve the child's time */
- long __waittime = 0;
-
- ! __EXTERN static void __CDECL startup __PROTO((BASEPAGE *));
-
- static void __CDECL
- startup(b)
- --- 38,44 ----
- /* and this is used to retrieve the child's time */
- long __waittime = 0;
-
- ! static void __CDECL startup __PROTO((BASEPAGE *));
-
- static void __CDECL
- startup(b)
- ***************
- *** 46,52 ****
- {
- register int (*func) __PROTO((long));
- register long arg;
- - extern void _setstack(); /* in crt0.s */
-
- #ifdef __TURBOC__
- extern void *_StkLim; /* avoid stack checking */
- --- 46,51 ----
- diff -cr ../mntlib34/uname.c ./uname.c
- *** ../mntlib34/uname.c Sat Sep 5 22:12:10 1992
- --- ./uname.c Sun Sep 12 20:13:24 1993
- ***************
- *** 29,35 ****
- * get operating system information; must execute in supervisor mode
- */
-
- ! static void
- getinfo()
- {
- long *cookie, *sysbase;
- --- 29,37 ----
- * get operating system information; must execute in supervisor mode
- */
-
- ! static long getinfo __PROTO((void));
- !
- ! static long
- getinfo()
- {
- long *cookie, *sysbase;
- ***************
- *** 49,54 ****
- --- 51,57 ----
- /* get TOS version number */
- sysbase = *((long **)(0x4f2L));
- tosvers = (int)(sysbase[0] & 0x0000ffff);
- + return 0;
- }
-
- #define HILO(x) (int) ((x >> 8) & 255), (int) (x & 255)
- diff -cr ../mntlib34/unx2dos.c ./unx2dos.c
- *** ../mntlib34/unx2dos.c Sun Jun 20 09:20:34 1993
- --- ./unx2dos.c Mon Sep 13 07:20:00 1993
- ***************
- *** 30,36 ****
- u += 5;
- /* make /dev/A/foo the same as A:/foo */
-
- ! if (*u && (u[1] == 0 || (u[1] == '/' || u[1] == '\\'))) {
- d[0] = *u++;
- d[1] = ':';
- d += 2;
- --- 30,37 ----
- u += 5;
- /* make /dev/A/foo the same as A:/foo */
-
- ! if (*u && isalpha (*u)
- ! && (u[1] == 0 || (u[1] == '/' || u[1] == '\\'))) {
- d[0] = *u++;
- d[1] = ':';
- d += 2;
- diff -cr ../mntlib34/utime.c ./utime.c
- *** ../mntlib34/utime.c Tue Jun 1 06:40:12 1993
- --- ./utime.c Wed Sep 8 14:57:32 1993
- ***************
- *** 19,24 ****
- --- 19,25 ----
- #include <mintbind.h>
- #include <ioctl.h>
- #include <assert.h>
- + #include <unistd.h>
- #ifdef __TURBOC__
- #include <sys\types.h>
- #else
- ***************
- *** 87,95 ****
- }
-
- res = -EINVAL;
- ! if (__mint > 90)
- ! res = Fcntl(fh, (long)&settime, FUTIME);
- !
- if (res == -EINVAL)
- (void)Fdatime((_DOSTIME *) &dtime, fh, 1);
-
- --- 88,99 ----
- }
-
- res = -EINVAL;
- ! if (__mint > 90) {
- ! if (tset)
- ! res = Fcntl(fh, (long)&settime, FUTIME);
- ! else
- ! res = Fcntl(fh, (long)0, FUTIME);
- ! }
- if (res == -EINVAL)
- (void)Fdatime((_DOSTIME *) &dtime, fh, 1);
-
- diff -cr ../mntlib34/utmp.c ./utmp.c
- *** ../mntlib34/utmp.c Sat Jun 19 12:48:48 1993
- --- ./utmp.c Thu Jul 15 08:19:20 1993
- ***************
- *** 10,16 ****
-
- #define UTMP_FILE "/etc/utmp"
-
- ! void write_utmp(line, name, host, time)
- const char *line, *name, *host;
- unsigned long time;
- {
- --- 10,16 ----
-
- #define UTMP_FILE "/etc/utmp"
-
- ! void _write_utmp(line, name, host, time)
- const char *line, *name, *host;
- unsigned long time;
- {
- ***************
- *** 23,29 ****
-
- if ((fd = open(UTMP_FILE, O_RDWR)) == -1)
- {
- ! perror("write_utmp");
- return;
- }
-
- --- 23,29 ----
-
- if ((fd = open(UTMP_FILE, O_RDWR)) == -1)
- {
- ! perror("_write_utmp");
- return;
- }
-
- ***************
- *** 40,46 ****
-
- if (lseek(fd, (long)(counter * sizeof(struct utmp)), 0) == -1)
- {
- ! perror("write_utmp: lseek");
- close(fd);
- return;
- }
- --- 40,46 ----
-
- if (lseek(fd, (long)(counter * sizeof(struct utmp)), 0) == -1)
- {
- ! perror("_write_utmp: lseek");
- close(fd);
- return;
- }
- ***************
- *** 59,70 ****
- entry.ut_time = time;
-
- if ((returned_val = write(fd, &entry, (unsigned) sizeof(struct utmp))) == -1)
- ! perror("write_utmp: write");
- else
- if (returned_val != sizeof(struct utmp))
- ! fprintf(stderr, "write_utmp: write: wrote too few bytes!\n");
- #ifdef DEBUG
- ! printf("write_utmp: wrote %d bytes\n", returned_val);
- #endif
- close(fd);
- }
- --- 59,70 ----
- entry.ut_time = time;
-
- if ((returned_val = write(fd, &entry, (unsigned) sizeof(struct utmp))) == -1)
- ! perror("_write_utmp: write");
- else
- if (returned_val != sizeof(struct utmp))
- ! fprintf(stderr, "_write_utmp: write: wrote too few bytes!\n");
- #ifdef DEBUG
- ! printf("_write_utmp: wrote %d bytes\n", returned_val);
- #endif
- close(fd);
- }
- diff -cr ../mntlib34/wait.c ./wait.c
- *** ../mntlib34/wait.c Sun May 16 06:40:46 1993
- --- ./wait.c Mon Sep 13 06:59:22 1993
- ***************
- *** 12,23 ****
- /* under TOS, vfork() puts its result in __waitval */
- extern long __waitval; /* in thread.c */
-
- ! pid_t wait(status)
- ! int *status;
- {
- long r;
- int exit_status, sig_term, pid;
- extern int __mint;
-
- if (__mint == 0) { /* wait is faked by vfork() */
- r = __waitval;
- --- 12,28 ----
- /* under TOS, vfork() puts its result in __waitval */
- extern long __waitval; /* in thread.c */
-
- ! pid_t wait(_status)
- ! __WP _status;
- {
- long r;
- int exit_status, sig_term, pid;
- extern int __mint;
- + #ifdef __GNUC__
- + int *status = _status.__wi;
- + #else
- + int *status = _status;
- + #endif
-
- if (__mint == 0) { /* wait is faked by vfork() */
- r = __waitval;
- ***************
- *** 40,42 ****
- --- 45,59 ----
- }
- return pid;
- }
- +
- + #ifdef TEST
- + /* small test for parameter of wait */
- + void a()
- + {
- + union wait u;
- + int i;
- +
- + wait(&u);
- + wait(&i);
- + }
- + #endif
- diff -cr ../mntlib34/waitpid.c ./waitpid.c
- *** ../mntlib34/waitpid.c Sun May 16 06:47:18 1993
- --- ./waitpid.c Mon Sep 13 06:58:12 1993
- ***************
- *** 14,28 ****
- extern long __waitval; /* in thread.c */
-
- pid_t
- ! waitpid(pid, status, options)
- pid_t pid;
- ! int *status;
- int options;
- {
- long r;
- int exit_status, sig_term;
- union wait *statwait;
- !
- statwait = (union wait *) status;
- if (__mint == 0) {
- r = __waitval;
- --- 14,29 ----
- extern long __waitval; /* in thread.c */
-
- pid_t
- ! waitpid(pid, _status, options)
- pid_t pid;
- ! __WP _status;
- int options;
- {
- long r;
- int exit_status, sig_term;
- union wait *statwait;
- ! int *status = _status.__wi;
- !
- statwait = (union wait *) status;
- if (__mint == 0) {
- r = __waitval;
- diff -cr ../mntlib34/wtmp.c ./wtmp.c
- *** ../mntlib34/wtmp.c Sat Jun 19 12:49:00 1993
- --- ./wtmp.c Thu Jul 15 08:18:58 1993
- ***************
- *** 10,16 ****
-
- #define WTMP_FILE "/var/adm/wtmp"
-
- ! void write_wtmp(line, name, host, time)
- const char *line, *name, *host;
- unsigned long time;
- {
- --- 10,16 ----
-
- #define WTMP_FILE "/var/adm/wtmp"
-
- ! void _write_wtmp(line, name, host, time)
- const char *line, *name, *host;
- unsigned long time;
- {
- ***************
- *** 20,26 ****
- if ((fd = open(WTMP_FILE, O_WRONLY | O_APPEND)) < 0)
- {
- #ifdef DEBUG
- ! perror("write_wtmp");
- #endif
- return;
- }
- --- 20,26 ----
- if ((fd = open(WTMP_FILE, O_WRONLY | O_APPEND)) < 0)
- {
- #ifdef DEBUG
- ! perror("_write_wtmp");
- #endif
- return;
- }
-