home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / lib / mlib35d.zoo / diffc next >
Encoding:
Text File  |  1993-09-15  |  107.5 KB  |  4,570 lines

  1. diff -cr ../mntlib34/Bugs ./Bugs
  2. *** ../mntlib34/Bugs    Tue Jul  6 09:45:30 1993
  3. --- ./Bugs    Tue Jul 13 12:09:40 1993
  4. ***************
  5. *** 31,45 ****
  6.     For you to decide upon the correct action!
  7.   
  8.     [I just read this for the 90th time and I finally understand what's being
  9. !   said (I can be pretty dense sometimes. <grin>) I guess making symbolic
  10. !   links for the sys/ files is the best solution but I'm reluctant to
  11. !   distribute the library that way as I'm not sure how ZOO would unpack the
  12. !   links on a TOS filesystem.  -entropy]
  13.   
  14.   abort.c: ++entropy
  15. !   Should fclose() all streams in the same way of exit().  Also, if my
  16. !   understanding is correct, it should unmask SIGABRT, and also set SIGABRT's
  17. !   signal handler to SIG_DFL if it was SIG_IGN, before raising the signal.
  18.   
  19.   access.c: ++entropy
  20.     I think my "superuser can access anything" assumption is wrong, especially
  21. --- 31,49 ----
  22.     For you to decide upon the correct action!
  23.   
  24.     [I just read this for the 90th time and I finally understand what's being
  25. !   said (I can be pretty dense sometimes. <grin>) I've hopefully made it
  26. !   impossible for this to go into an infinite loop by changing the include
  27. !   protection in some of the sys/*.h files.  Now it should just unwind the
  28. !   second time it hits the sys/wait.h file (or other sys/ file) and
  29. !   eventually your compile will bomb because it never got the correct
  30. !   definitions from the include file.  That should be easier to track down
  31. !   than a hung compiler, at least. -entropy]
  32.   
  33.   abort.c: ++entropy
  34. !   If my understanding is correct, abort() should unmask SIGABRT, and also
  35. !   set SIGABRT's signal handler to SIG_DFL if it was SIG_IGN, before raising
  36. !   the signal.  Would someone with a copy of the POSIX spec please look into
  37. !   this?
  38.   
  39.   access.c: ++entropy
  40.     I think my "superuser can access anything" assumption is wrong, especially
  41. ***************
  42. *** 146,152 ****
  43.   scanf.c: ++jrb
  44.     Evidently loses big time.  Run Gcctests and find out what's what.
  45.   
  46. ! sigaction.c: ++nox@jelal.north.de, ++entropy
  47.     sigblock() could be declared int at least #ifndef __MSHORT__.  The
  48.     functions sigpending(), sigprocmask(), and sigsuspend() have not been
  49.     tested.  The other new POSIX sig*() functions have been tested but not
  50. --- 150,156 ----
  51.   scanf.c: ++jrb
  52.     Evidently loses big time.  Run Gcctests and find out what's what.
  53.   
  54. ! sigactio.c: ++nox@jelal.north.de, ++entropy
  55.     sigblock() could be declared int at least #ifndef __MSHORT__.  The
  56.     functions sigpending(), sigprocmask(), and sigsuspend() have not been
  57.     tested.  The other new POSIX sig*() functions have been tested but not
  58. ***************
  59. *** 200,221 ****
  60.     file!  (which can be annoying on things like lock files...)
  61.     [I don't think this can be fixed in the library.  MiNT acts this
  62.     way on purpose.  -entropy]
  63. - utime.c: ++boender
  64. -   stime(): My System V.3 manual state that `The stime() call will
  65. -   fail if the effective user ID of the calling process is not
  66. -   super-user.'. Now, I know the underlying system calls Tsetdate()
  67. -   and Tsettime() are not privileged, and possibly the clock itself
  68. -   can also be set on hardware level. What do we do here? Perhaps
  69. -   MiNT should be fixed to check the effective user ID in Tsetdate()
  70. -   and Tsettime() (a trivial fix in MiNT source file dos.c), or
  71. -   perhaps we should do a check in stime(). I personally would prefer
  72. -   MiNT to be fixed. Could you raise this subject with Eric Smith?
  73. -   [I did, and I believe someone mentioned that it is now a privileged
  74. -   call in MiNT 1.05, but I'm still running 1.04 so I cannot verify this.
  75. -   As to the hardware clock, I'd hope that would be in protected memory
  76. -   on newer machines, but I don't know.  Anyone want to give me a TT
  77. -   so I can try it? <grin> -entropy]
  78.   
  79.   utmp.c: ++boender
  80.     The utmp structure as defined differs from the System V structure.
  81. --- 204,209 ----
  82. diff -cr ../mntlib34/Changelog ./Changelog
  83. *** ../mntlib34/Changelog    Thu Jul  8 07:50:18 1993
  84. --- ./Changelog    Mon Sep 13 07:21:28 1993
  85. ***************
  86. *** 4,9 ****
  87. --- 4,137 ----
  88.   Changes are listed in *reverse* order, most recent changes being
  89.   first.
  90.   
  91. + PATCHLEVEL35::
  92. + unx2dos.c: ++schwab
  93. +     _unx2dos("/dev/.") -> ".:" -> file not found.  This patch isn't
  94. +     optimal, because it only works for the first 26 drives, but better
  95. +     than before. (Who has more than 26 drives anyway? :-)
  96. + wait.c, waitpid.c, wait.h: ++Robert.Wilhelm@Physik.TU-Muenchen.DE
  97. +     Accept both POSIX and BSD style parameters.  [I'm not certain these
  98. +     patches really leave us with a POSIX-compliant wait*() suite, but
  99. +     I'll leave it be for now -entropy]
  100. + Makefile: ++Bjarne_Pohlers
  101. +     Fix 020 targets to use 'make install020', and fix all targets to
  102. +     do 'make clean' only when necessary.
  103. + doprnt.c, scanf.c: ++Bjarne_Pohlers@ms2.maus.de
  104. +     Add support for printing/scanning long longs.
  105. + div.c: ++pvt1-117
  106. +     Add div functions for compilers other than GCC.
  107. + bsearch.c: ++dsb
  108. +     Fix bug reported by Thorsten Roskowetz: the order arguments to
  109. +     bsearch()'s comparison function was reversed.
  110. + sozobon/makefile, sozobon/readme: ++dsb
  111. +     Updated to reflect recent changes in the library.
  112. + thread.c: ++dsb
  113. +     Fix a strange declaration (extern static?!?).
  114. + sozobon/linea.s, sozobon/makefile: ++dsb@cs.duke.edu
  115. +     Fix some HSC linker problems by punting alglobal.o.
  116. + ioctl.h: ++Jan-Hinrich_Fessel@un.maus.ruhr.de (Jan-Hinrich Fessel)
  117. +     Make it possible to include both ioctl.h and filesys.h.
  118. + pgrp.c: ++schwab
  119. +     Correctly check the MiNT version in _bsd_getpgrp().
  120. + clock.c, doprnt.c, main.c, thread.c, uname.c: ++pvt1-117
  121. +     Changes to keep Lattice C from generating annoying warnings, and
  122. +     other miscellaneous cleanups. [Once again I've modified these
  123. +     patches in various ways, so if something's broken it's my fault
  124. +     -entropy].
  125. + math.h, process.h, support.h, unistd.h, exec.c, execp.c, findfile.c, 
  126. + scanf.c, spawn.c, spawnve.c, spawnvp.c, statfs.c, textio.c: ++schwab
  127. +     Add 'const' to declarations where appropriate.
  128. + malloc.c:  ++schwab
  129. +     Make malloc() round all memory requests to the page size to be able
  130. +     to use all the available memory.
  131. + setjmp.cpp, setjmp.h: ++schwab
  132. +     Some cleanup; one element of jmp_buf[] can be saved by using the
  133. +     fact that signal 0 cannot be masked; why was the type char*[] insead
  134. +     of long[]?
  135. + osbind.cpp: ++schwab
  136. +     Add some missing functions added; code cleanup.
  137. + select.c: ++schwab@ls5.informatik.uni-dortmund.de
  138. +     Fix select() to deal with timeouts of more than 65.535 seconds. This
  139. +     is needed for emacs 19.
  140. + statfs.c: ++schwab
  141. +     In statfs(): before passing to Dcntl, the path must be passed
  142. +     through _unx2dos, and it should be declared const.
  143. + sysconf.c: ++schwab
  144. +     Update the value returned for _PC_LAST.
  145. + fopen.c: ++schwab
  146. +     Make fopen() use 0666 as the default file mask (use umask() if you
  147. +     want something else); make mkdir() respect the umask setting.
  148. + mktemp.c: ++schwab
  149. +     mktemp() can generate a name more than once; the length of the
  150. +     pattern should not be changed (emacs depends on it).
  151. + lattice/crt0.s: ++pvt1-117
  152. +     Add some conditional stuff depending on program type.
  153. + utime.c: ++shenson@nyx.cs.du.edu
  154. +     Pass through a NULL tset argument unchanged to the filesystem
  155. +     so that it can determine permissions correctly.
  156. + falcon.h: ++hyc@hanauma.Jpl.Nasa.Gov, ++Markus_Kilbinger@ac.maus.de
  157. +     Change several erroneous macros to correctly cast return to short.
  158. + lattice/*: ++pvt1-117
  159. +     Strip all carriage returns from Lattice C files.
  160. + spawn.c: ++Ole_Arndt
  161. +     Add script interpretation (#!).
  162. + sync.c, support.h: ++Ole_Arndt
  163. +     NEW file, sync() and fsync() (for Minixfs only).  Proto in support.h.
  164. + sigactio.c: ++Ole_Arndt
  165. +     Use __NSIG instead of NSIG, may as well be POSIX-clean.
  166. + errno.h: ++Ole_Arndt
  167. +     Add errors ENOTDIR and ELOOP.
  168. + signal.h: ++Ole_Arndt@f.maus.de (Ole Arndt)
  169. +     Fix definition of _SIGSET_MAX_INDEX to correct several bugs
  170. +     in the POSIX signal mask functios.
  171. + stdio.h:
  172. +     Add vsscanf() and _getbuf() protos (yech).
  173. + dirent.h:
  174. +     Add alphasort() proto (excluded by _POSIX_SOURCE).
  175. + utmp.c, wtmp.c, utmp.h:
  176. +     Rename write_utmp() to _write_utmp().  Rename write_wtmp() to
  177. +     _write_wtmp().  Add protos (and other cleanups) to utmp.h.
  178. + atof.c, fdopen.c, fputs.c:
  179. +     Move 'register' to beginning of declarations (shuts up gcc -Wall).
  180. + fwrite.c: ++michal
  181. +         With unbuffered IO fwrite miscounts number of characters written.
  182. + findfile.c: ++michal
  183. +     Try to accomodate tos style paths PATH=e:\bin,c:\bin,...
  184. + unistd.h: ++jrb
  185. +     Take out setlinebuf, doesn't really belong here.
  186. + ffs.c: ++NTOMCZAK@vm.ucs.UAlberta.CA (Michal Jaegermann)
  187. +     An even faster algorithm.  Yow!  Are we optimized yet?
  188. + support.h:
  189. +     Added _exit() and gethostname() protos. Removed write_utmp() and
  190. +     write_wtmp() protos.
  191. + lib.h, crtinit.c:
  192. +     Moved prototypes from crtinit.c to lib.h, and added more to lib.h.
  193. + abort.c, main.c, lib.h:
  194. +     Make abort() close file handles in exactly the same manner
  195. +     as exit().
  196. + sigactio.c, signal.h: ++nox@jelal.north.de, ++Oskar, ++entropy
  197. +     Fix type of sa_mask in struct sigaction (sigset_t, not long).
  198. +     Clean up dirty tricks in sigaction() (UNTESTED).
  199. + falcon.h: ++Markus_Kilbinger@ac.maus.de, ++entropy
  200. +     Add missing traps.
  201. + unistd.h, support.h:
  202. +     Cleaned unistd.h for easier reading.  Moved back the link(),
  203. +     symlink(), and readlink() protos from support.h (sorry if I seem
  204. +     really indecisive on where some of these protos belong).
  205. + doprnt.c, getdtabl.c, gethostn.c, mknod.c, nice.c, open.c, putenv.c,
  206. + symlink.c, utime.c:
  207. +     Include appropriate headers for protos (and fixed mknod() proto).
  208. + sys/statfs.h:
  209. +     Add statfs() proto.
  210. + sys/errno.h, sys/ioctl.h, sys/resource.h, sys/signal.h, sys/wait.h:
  211. +     Fix multiple-include protection to hopefully prevent possible
  212. +     infinite include loops (see Bugs file).
  213. + getpw.c, pwd.h: ++Jan-Hinrich_Fessel@un.maus.de (Oskar)
  214. +     Use uid_t (_UID_T) for getpwuid() instead of int (POSIX).
  215. + lattice/inc.i: ++pvt1-117@nada.kth.se
  216. +     Fix a typo.
  217.   PATCHLEVEL34::
  218.   
  219.   ffs.c: ++frog
  220. ***************
  221. *** 14,20 ****
  222.   doprnt.c: ++schwab@ls5.informatik.uni-dortmund.de (Andreas Schwab)
  223.       The decimal precision in a printf format does not include the sign or
  224.       hex prefix, e.g. printf ("%-2.5d", -18) should print "-00018".
  225. ! select.c, time.h: ++Frank_Baumgart@pb.maus,de, ++entropy
  226.       Get struct timeval from time.h, eliminate local definition.
  227.       Add prototype of select() to time.h (is there a better place?)
  228.   ctype.h, grp.h, dirent.h, stddef.h, string.h:
  229. --- 142,148 ----
  230.   doprnt.c: ++schwab@ls5.informatik.uni-dortmund.de (Andreas Schwab)
  231.       The decimal precision in a printf format does not include the sign or
  232.       hex prefix, e.g. printf ("%-2.5d", -18) should print "-00018".
  233. ! select.c, time.h: ++Frank_Baumgart@pb.maus.de, ++entropy
  234.       Get struct timeval from time.h, eliminate local definition.
  235.       Add prototype of select() to time.h (is there a better place?)
  236.   ctype.h, grp.h, dirent.h, stddef.h, string.h:
  237. diff -cr ../mntlib34/Files ./Files
  238. *** ../mntlib34/Files    Thu Jul  8 08:37:26 1993
  239. --- ./Files    Sun Jul 18 09:03:42 1993
  240. ***************
  241. *** 41,53 ****
  242.   
  243.   MiNT library:
  244.   
  245. ! Bugs
  246. ! Changelog
  247. ! Copyright    execp.c        isatty.c            spawnvp.c
  248. ! Files        fcntl.c        kill.c        pause.c        sscanf.c
  249. ! GMakefile.16    fopenp.c                    stat.c
  250. ! GMakefile.32    fork.c        killpg.c    pipe.c        statfs.c
  251. ! GNUGPL2        fscanf.c            popen.c        symlink.c
  252.   Makefile    getcwd.c            read.c        sysconf.c
  253.   OChangelog                    rename.c    thread.c
  254.   PatchLev.h    getdtabl.c    link.c        rmdir.c        times.c
  255. --- 41,53 ----
  256.   
  257.   MiNT library:
  258.   
  259. ! Bugs                                spawnvp.c
  260. ! Changelog                            sscanf.c
  261. ! Copyright    execp.c        isatty.c            stat.c
  262. ! Files        fcntl.c        kill.c        pause.c        statfs.c
  263. ! GMakefile.16    fopenp.c                    symlink.c
  264. ! GMakefile.32    fork.c        killpg.c    pipe.c        sync.c
  265. ! GNUGPL2        fscanf.c            popen.c
  266.   Makefile    getcwd.c            read.c        sysconf.c
  267.   OChangelog                    rename.c    thread.c
  268.   PatchLev.h    getdtabl.c    link.c        rmdir.c        times.c
  269. diff -cr ../mntlib34/Makefile ./Makefile
  270. *** ../mntlib34/Makefile    Thu Jul  8 06:06:56 1993
  271. --- ./Makefile    Mon Sep 13 11:22:00 1993
  272. ***************
  273. *** 55,63 ****
  274.   INCLUDE_DIR := ../minclude
  275.   endif
  276.   XPFLAGS :=  -nostdinc -I$(INCLUDE_DIR)
  277. ! XFLAGS := $(XPFLAGS) -Wall
  278.   endif
  279.   
  280.   # Additional options for compiling C code
  281.   
  282.   #XFLAGS := -I../co
  283. --- 55,66 ----
  284.   INCLUDE_DIR := ../minclude
  285.   endif
  286.   XPFLAGS :=  -nostdinc -I$(INCLUDE_DIR)
  287. ! XFLAGS := $(XPFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes
  288.   endif
  289.   
  290. + # Flags for extra 'long long' support under newer gcc's
  291. + #LONGLONG=-DPRINTF_LONGLONG
  292.   # Additional options for compiling C code
  293.   
  294.   #XFLAGS := -I../co
  295. ***************
  296. *** 112,118 ****
  297.   CFFLAGS = $(SHORT) $(COPTS)
  298.   
  299.   # normal CFLAGS including int size and omit-frame-pointer
  300. ! CFLAGS= $(CFFLAGS) $(FRAME)
  301.   
  302.   # cflags for stuff that needs to be compiled with 32 bit ints
  303.   CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
  304. --- 115,121 ----
  305.   CFFLAGS = $(SHORT) $(COPTS)
  306.   
  307.   # normal CFLAGS including int size and omit-frame-pointer
  308. ! CFLAGS= $(CFFLAGS) $(FRAME) $(LONGLONG)
  309.   
  310.   # cflags for stuff that needs to be compiled with 32 bit ints
  311.   CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
  312. ***************
  313. *** 150,213 ****
  314.   
  315.   #all: lshort llong lgshort lglong
  316.   top: lshort llong lbshort lblong
  317. ! #top: l020short l020long l020bshort l020blong
  318.   
  319. ! lshort:
  320.       $(MAKE) clean
  321.       $(MAKE) install
  322.   
  323. ! llong:
  324. !     $(MAKE) clean
  325.       $(MAKE) install TARGET="long-int"
  326.   
  327. ! lgshort:
  328. !     $(MAKE) clean
  329.       $(MAKE) install TARGET=debug
  330.   
  331. ! lglong:
  332. !     $(MAKE) clean
  333.       $(MAKE) install TARGET="long-int debug"
  334.   
  335. ! l020short:
  336. !     $(MAKE) clean
  337. !     $(MAKE) install TARGET=68020
  338. ! #    $(MAKE) install020 TARGET=68020
  339. ! l020long:
  340. !     $(MAKE) clean
  341. !     $(MAKE) install TARGET="68020 long-int"
  342. ! #    $(MAKE) install020 TARGET="68020 long-int"
  343.   
  344. ! lbshort:
  345. !     $(MAKE) clean
  346.       $(MAKE) install TARGET="baserel"
  347.   
  348. ! lblong:
  349. !     $(MAKE) clean
  350.       $(MAKE) install TARGET="long-int baserel"
  351.   
  352. ! l020bshort:
  353. !     $(MAKE) clean
  354. !     $(MAKE) install TARGET="68020 baserel"
  355.   
  356. ! l020blong:
  357. !     $(MAKE) clean
  358. !     $(MAKE) install TARGET="68020 long-int baserel"
  359.   
  360. ! lsfpshort:
  361. !     $(MAKE) clean
  362.       $(MAKE) install TARGET="sfp004"
  363.   
  364. ! lsfplong:
  365. !     $(MAKE) clean
  366.       $(MAKE) install TARGET="long-int sfp004"
  367.   
  368. ! lbsfpshort:
  369. !     $(MAKE) clean
  370.       $(MAKE) install TARGET="baserel sfp004"
  371.   
  372. ! lbsfplong:
  373. !     $(MAKE) clean
  374.       $(MAKE) install TARGET="long-int baserel sfp004"
  375.   
  376.   bakclean:
  377. --- 153,207 ----
  378.   
  379.   #all: lshort llong lgshort lglong
  380.   top: lshort llong lbshort lblong
  381. ! top020: l020short l020long l020bshort l020blong
  382.   
  383. ! %.target:
  384.       $(MAKE) clean
  385. +     -rm -f *.target
  386. +     -touch $@
  387. + lshort: lshort.target
  388.       $(MAKE) install
  389.   
  390. ! llong: llong.target
  391.       $(MAKE) install TARGET="long-int"
  392.   
  393. ! lgshort: lgshort.target
  394.       $(MAKE) install TARGET=debug
  395.   
  396. ! lglong: lglong.target
  397.       $(MAKE) install TARGET="long-int debug"
  398.   
  399. ! l020short: l020short.target
  400. !     $(MAKE) install020 TARGET=68020
  401. ! #    $(MAKE) install TARGET=68020
  402. ! l020long: l020long.target
  403. !     $(MAKE) install020 TARGET="68020 long-int"
  404. ! #    $(MAKE) install TARGET="68020 long-int"
  405.   
  406. ! lbshort: lbshort.target
  407.       $(MAKE) install TARGET="baserel"
  408.   
  409. ! lblong: lblong.target
  410.       $(MAKE) install TARGET="long-int baserel"
  411.   
  412. ! l020bshort: l020bshort.target
  413. !     $(MAKE) install020 TARGET="68020 baserel"
  414.   
  415. ! l020blong: l020blong.target
  416. !     $(MAKE) install020 TARGET="68020 long-int baserel"
  417.   
  418. ! lsfpshort: lsfpshort.target
  419.       $(MAKE) install TARGET="sfp004"
  420.   
  421. ! lsfplong: lsfplong.target
  422.       $(MAKE) install TARGET="long-int sfp004"
  423.   
  424. ! lbsfpshort: lbsfpshort.target
  425.       $(MAKE) install TARGET="baserel sfp004"
  426.   
  427. ! lbsfplong: lbsfplong.target
  428.       $(MAKE) install TARGET="long-int baserel sfp004"
  429.   
  430.   bakclean:
  431. ***************
  432. *** 226,231 ****
  433. --- 220,226 ----
  434.       rm -f foo bar baz
  435.   
  436.   distclean: realclean
  437. +     rm -f diffc diffh
  438.   
  439.   # Get the rules to build everything...
  440.   
  441. diff -cr ../mntlib34/PatchLev.h ./PatchLev.h
  442. *** ../mntlib34/PatchLev.h    Tue Jul  6 07:50:46 1993
  443. --- ./PatchLev.h    Fri Jul  9 06:30:38 1993
  444. ***************
  445. *** 3,6 ****
  446.    *    directory.
  447.    */
  448.   
  449. ! #define PatchLevel "34"
  450. --- 3,6 ----
  451.    *    directory.
  452.    */
  453.   
  454. ! #define PatchLevel "35"
  455. diff -cr ../mntlib34/README ./README
  456. *** ../mntlib34/README    Wed Jun 23 05:53:30 1993
  457. --- ./README    Sun Jul 11 05:47:24 1993
  458. ***************
  459. *** 11,19 ****
  460.   GNU C and common files:  entropy@terminator.rs.itd.umich.edu (Nick Castellano)
  461.   Sozobon C/HSC:  dsb@cs.duke.edu (D. Scott Bigham)
  462.   Pure C:  hohmuth@freia.inf.tu-dresden.de (Michael Hohmuth)
  463. ! Lattice C:  ???
  464.   
  465. ! Be sure to read the "Changes" file so that you know what's new in this
  466.   release of the library.
  467.   
  468.   Also, please read the "Copyright" file for important copyright information
  469. --- 11,19 ----
  470.   GNU C and common files:  entropy@terminator.rs.itd.umich.edu (Nick Castellano)
  471.   Sozobon C/HSC:  dsb@cs.duke.edu (D. Scott Bigham)
  472.   Pure C:  hohmuth@freia.inf.tu-dresden.de (Michael Hohmuth)
  473. ! Lattice C:  pvt1-117@nada.kth.se 
  474.   
  475. ! Be sure to read the "Changelog" file so that you know what's new in this
  476.   release of the library.
  477.   
  478.   Also, please read the "Copyright" file for important copyright information
  479. diff -cr ../mntlib34/abort.c ./abort.c
  480. *** ../mntlib34/abort.c    Fri Feb 26 12:08:46 1993
  481. --- ./abort.c    Tue Jul 13 11:27:42 1993
  482. ***************
  483. *** 3,8 ****
  484. --- 3,9 ----
  485.   #include <signal.h>
  486.   #include <stdlib.h>
  487.   #include <unistd.h>
  488. + #include "lib.h"
  489.   
  490.   #ifndef SIGABRT
  491.   #define SIGABRT SIGIOT
  492. ***************
  493. *** 11,15 ****
  494. --- 12,17 ----
  495.   __EXITING abort()
  496.   {
  497.       raise(SIGABRT);
  498. +     _fclose_all_files();
  499.       _exit(127);
  500.   }
  501. diff -cr ../mntlib34/atof.c ./atof.c
  502. *** ../mntlib34/atof.c    Sun Feb 28 13:07:18 1993
  503. --- ./atof.c    Thu Jul 15 07:56:52 1993
  504. ***************
  505. *** 241,247 ****
  506.   #define CONVF    0x08
  507.   
  508.   double strtod (s, endptr)
  509. ! const register char *s;
  510.   char **endptr;
  511.   {
  512.       double         accum = 0.0;
  513. --- 241,247 ----
  514.   #define CONVF    0x08
  515.   
  516.   double strtod (s, endptr)
  517. ! register const char *s;
  518.   char **endptr;
  519.   {
  520.       double         accum = 0.0;
  521. diff -cr ../mntlib34/bsearch.c ./bsearch.c
  522. *** ../mntlib34/bsearch.c    Fri Feb 26 17:19:36 1993
  523. --- ./bsearch.c    Mon Sep 13 06:25:30 1993
  524. ***************
  525. *** 36,50 ****
  526.       while(a <= b)
  527.           {
  528.           c = (a + b) >> 1;    /* == ((a + b) / 2) */
  529. !         if ((dir = (*cmp)((void *)((char *)base + (c * size)), key)) != 0)
  530.               {
  531. !             if (dir > 0)
  532.               {
  533.                   if (c == 0)
  534.                   return(NULL);
  535.                   b = c - 1;
  536.               }
  537. !             else /* (dir < 0) */
  538.                   a = c + 1;
  539.               }
  540.           else
  541. --- 36,50 ----
  542.       while(a <= b)
  543.           {
  544.           c = (a + b) >> 1;    /* == ((a + b) / 2) */
  545. !         if ((dir = (*cmp)(key, (void *)((char *)base + (c * size)))) != 0)
  546.               {
  547. !             if (dir < 0)
  548.               {
  549.                   if (c == 0)
  550.                   return(NULL);
  551.                   b = c - 1;
  552.               }
  553. !             else /* (dir > 0) */
  554.                   a = c + 1;
  555.               }
  556.           else
  557. diff -cr ../mntlib34/clock.c ./clock.c
  558. *** ../mntlib34/clock.c    Wed Feb 17 13:23:24 1993
  559. --- ./clock.c    Sun Sep 12 20:14:12 1993
  560. ***************
  561. *** 13,19 ****
  562.    * containing the number of 200HZ ticks since the system was booted
  563.    */
  564.   
  565. ! static void getnow() { now = *((unsigned long *) 0x4baL); }
  566.   
  567.   clock_t
  568.   _clock()
  569. --- 13,26 ----
  570.    * containing the number of 200HZ ticks since the system was booted
  571.    */
  572.   
  573. ! static long getnow __PROTO((void));
  574. ! static long
  575. ! getnow()
  576. ! {
  577. !     now = *((unsigned long *) 0x4baL);
  578. !     return 0;
  579. ! }
  580.   
  581.   clock_t
  582.   _clock()
  583. diff -cr ../mntlib34/crtinit.c ./crtinit.c
  584. *** ../mntlib34/crtinit.c    Sun May 23 11:27:50 1993
  585. --- ./crtinit.c    Wed Sep 15 02:22:16 1993
  586. ***************
  587. *** 82,87 ****
  588. --- 82,88 ----
  589.   
  590.   #include <basepage.h>
  591.   #include <osbind.h>
  592. + #include <support.h>
  593.   #include "lib.h"
  594.   
  595.   #define isspace(c) ((c) == ' '||(c) == '\t')
  596. ***************
  597. *** 132,143 ****
  598.   
  599.   static long parseargs    __PROTO((BASEPAGE *));
  600.   static void setup_handlers    __PROTO((void));
  601. - __EXTERN void _main    __PROTO((long, char **, char **));
  602. - __EXTERN void _init_signal    __PROTO((void));
  603. - __EXTERN void _monstartup __PROTO((void *lowpc, void *highpc));
  604. - __EXTERN void __mcleanup __PROTO((void));
  605. - __EXTERN void _moncontrol __PROTO((long));
  606. - __EXTERN void _setstack __PROTO((char *));
  607.   
  608.   /*
  609.    * accessories start here:
  610. --- 133,138 ----
  611. diff -cr ../mntlib34/div.c ./div.c
  612. *** ../mntlib34/div.c    Mon Jun  1 03:25:18 1992
  613. --- ./div.c    Mon Sep 13 06:30:38 1993
  614. ***************
  615. *** 6,11 ****
  616. --- 6,13 ----
  617.    */
  618.   #include <stdlib.h>
  619.   
  620. + #ifdef __GNUC__
  621.   long __divsi3(long, long);    /* returns: quot in d0.l  remainder in d1.l */
  622.   
  623.   #ifdef __MSHORT__
  624. ***************
  625. *** 44,46 ****
  626. --- 46,76 ----
  627.           ); /* compiler dependency, dont tell gcc about d0,d1 clobb */
  628.       return result;
  629.   }
  630. + #else /* !__GNUC__ */
  631. + div_t
  632. + div(num, denom)
  633. + int num, denom;
  634. + {
  635. +     div_t res;
  636. +     
  637. +     res.quot = num / denom;
  638. +     res.rem = num % denom;
  639. +     
  640. +     return res;
  641. + }
  642. + ldiv_t
  643. + ldiv(num, denom)
  644. + long num, denom;
  645. + {
  646. +     ldiv_t res;
  647. +     
  648. +     res.quot = num / denom;
  649. +     res.rem = num % denom;
  650. +     
  651. +     return res;
  652. + }
  653. + #endif /* !__GNUC__ */
  654. diff -cr ../mntlib34/doprnt.c ./doprnt.c
  655. *** ../mntlib34/doprnt.c    Thu Jul  8 05:52:50 1993
  656. --- ./doprnt.c    Mon Sep 13 11:10:20 1993
  657. ***************
  658. *** 59,65 ****
  659.   #include <ctype.h>
  660.   #include <string.h>
  661.   #include <limits.h>
  662. ! #include    <math.h>    /* mjr++    */
  663.   
  664.   #ifndef __GNUC__    /* gcc lib has these typedefs in sys/types.h */
  665.   #ifndef __MINT__    /* as does the MiNT library */
  666. --- 59,66 ----
  667.   #include <ctype.h>
  668.   #include <string.h>
  669.   #include <limits.h>
  670. ! #include <math.h>    /* mjr++ */
  671. ! #include "lib.h"
  672.   
  673.   #ifndef __GNUC__    /* gcc lib has these typedefs in sys/types.h */
  674.   #ifndef __MINT__    /* as does the MiNT library */
  675. ***************
  676. *** 77,83 ****
  677.   
  678.   #if defined (__M68881__) && !defined (sfp004)
  679.   #  include <math-68881.h>    /* mjr: use the inline functions    */
  680. ! #endif    __M68881__
  681.   
  682.   #define    DEFPREC        6
  683.   
  684. --- 78,84 ----
  685.   
  686.   #if defined (__M68881__) && !defined (sfp004)
  687.   #  include <math-68881.h>    /* mjr: use the inline functions    */
  688. ! #endif    /* __M68881__ */
  689.   
  690.   #define    DEFPREC        6
  691.   
  692. ***************
  693. *** 85,91 ****
  694.   
  695.   #define    PUTC(ch)     if( fputc(ch, fp) == EOF ) return EOF;
  696.   
  697.   #define ARG(signtag) \
  698.       _ulong = \
  699.           flags&LONGINT ? \
  700. --- 86,107 ----
  701.   
  702.   #define    PUTC(ch)     if( fputc(ch, fp) == EOF ) return EOF;
  703.   
  704. ! #ifdef PRINTF_LONGLONG
  705. ! #define ARG(signtag) (\
  706. !     (flags&LONGLONG ? \
  707. !     (_ulonglong = (unsigned long long)va_arg(argp, signtag long long)) : 0 ) ,\
  708. !     _ulong = \
  709. !         flags&LONGLONG ? \
  710. !             _ulonglong != 0ll : \
  711. !         flags&LONGINT ? \
  712. !             (unsigned long long)va_arg(argp, signtag long) : \
  713. !         (flags&SHORTINT ? \
  714. !             (unsigned long long)(signtag short)va_arg(argp, signtag int) : \
  715. !              (unsigned long long)va_arg(argp, signtag int)) )
  716. !      /* shorts are always promoted to ints; thus, it's `va_arg(... int)'
  717. !       * for `flags&SHORTINT'!
  718. !       */
  719. ! #else
  720.   #define ARG(signtag) \
  721.       _ulong = \
  722.           flags&LONGINT ? \
  723. ***************
  724. *** 96,101 ****
  725. --- 112,118 ----
  726.        /* shorts are always promoted to ints; thus, it's `va_arg(... int)'
  727.         * for `flags&SHORTINT'!
  728.         */
  729. + #endif
  730.   
  731.   #define TEN_MUL(X)    ((((X) << 2) + (X)) << 1)
  732.   
  733. ***************
  734. *** 103,114 ****
  735.   #define    tochar(n)    ((n) + '0')
  736.   
  737.   #define    LONGINT        0x01        /* long integer */
  738. ! #define    LONGDBL        0x02        /* long double; unimplemented */
  739. ! #define    SHORTINT    0x04        /* short integer */
  740. ! #define    ALT        0x08        /* alternate form */
  741. ! #define    LADJUST        0x10        /* left adjustment */
  742. ! #define    ZEROPAD        0x20        /* zero (as opposed to blank) pad */
  743. ! #define    HEXPREFIX    0x40        /* add 0x or 0X prefix */
  744.   
  745.   #ifndef __NO_FLOAT__
  746.   #define __FLOATS__ 1
  747. --- 120,132 ----
  748.   #define    tochar(n)    ((n) + '0')
  749.   
  750.   #define    LONGINT        0x01        /* long integer */
  751. ! #define    LONGLONG    0x02        /* long long integer (8 bytes) */
  752. ! #define    LONGDBL        0x04        /* long double; unimplemented */
  753. ! #define    SHORTINT    0x08        /* short integer */
  754. ! #define    ALT        0x10        /* alternate form */
  755. ! #define    LADJUST        0x20        /* left adjustment */
  756. ! #define    ZEROPAD        0x40        /* zero (as opposed to blank) pad */
  757. ! #define    HEXPREFIX    0x80        /* add 0x or 0X prefix */
  758.   
  759.   #ifndef __NO_FLOAT__
  760.   #define __FLOATS__ 1
  761. ***************
  762. *** 197,202 ****
  763. --- 215,227 ----
  764.   
  765.   #endif /* __GNUC__ */
  766.   
  767. + #ifdef PRINTF_LONGLONG
  768. + #define _ICONVLL(NUMBER, BASE, BUF)                 \
  769. +   do {                                \
  770. +     *--(BUF) = digs[(NUMBER) % (BASE)];                \
  771. +     (NUMBER) /= (BASE);                        \
  772. +   } while (NUMBER);
  773. + #endif
  774.   
  775.   int _doprnt(fp, fmt0, argp)
  776.       register FILE *fp;
  777. ***************
  778. *** 212,219 ****
  779.   /*    double _double;        *//* double precision arguments %[eEfgG] */
  780.       union double_di _dd;    /* _double is #defined to be _dd later on */
  781.       char softsign;        /* temporary negative sign for floats */
  782. ! #endif    __FLOATS__
  783. !     u_long _ulong;        /* integer arguments %[diouxX] */
  784.       short base;        /* base for [diouxX] conversion */
  785.       short dprec;        /* decimal precision in [diouxX] */
  786.       short fieldsz;        /* field size expanded by sign, etc */
  787. --- 237,251 ----
  788.   /*    double _double;        *//* double precision arguments %[eEfgG] */
  789.       union double_di _dd;    /* _double is #defined to be _dd later on */
  790.       char softsign;        /* temporary negative sign for floats */
  791. ! #endif    /* __FLOATS__ */
  792. ! #ifdef PRINTF_LONGLONG
  793. !     typedef unsigned long long _ulonglongtype;
  794. !     typedef long long _ulonglongsignedtype;
  795. !     _ulonglongtype _ulonglong;
  796. ! #endif
  797. !     typedef u_long _ulongtype;
  798. !     typedef long _ulongsignedtype;
  799. !     _ulongtype _ulong;        /* integer arguments %[diouxX] */
  800.       short base;        /* base for [diouxX] conversion */
  801.       short dprec;        /* decimal precision in [diouxX] */
  802.       short fieldsz;        /* field size expanded by sign, etc */
  803. ***************
  804. *** 307,313 ****
  805.               flags |= SHORTINT;
  806.               goto rflag;
  807.           case 'l':
  808. !             flags |= LONGINT;
  809.               goto rflag;
  810.           case 'c':
  811.               *(t = buf) = va_arg(argp, int);
  812. --- 339,350 ----
  813.               flags |= SHORTINT;
  814.               goto rflag;
  815.           case 'l':
  816. ! #ifdef PRINTF_LONGLONG
  817. !             if (flags & (LONGINT|LONGLONG))
  818. !                 flags &= -1-LONGINT, flags |= LONGLONG;
  819. !             else
  820. ! #endif
  821. !                 flags |= LONGINT;
  822.               goto rflag;
  823.           case 'c':
  824.               *(t = buf) = va_arg(argp, int);
  825. ***************
  826. *** 315,329 ****
  827.               sign = '\0';
  828.               goto pforw;
  829.           case 'D':
  830. !             flags |= LONGINT;
  831.               /*FALLTHROUGH*/
  832.           case 'd':
  833.           case 'i':
  834.               ARG(signed);
  835. !             if ((long)_ulong < 0) {
  836. !                 _ulong = -_ulong;
  837. !                 sign = '-';
  838.               }
  839.               base = 10;
  840.               goto number;
  841.   #ifdef __FLOATS__
  842. --- 352,380 ----
  843.               sign = '\0';
  844.               goto pforw;
  845.           case 'D':
  846. ! #ifdef PRINTF_LONGLONG
  847. !             if (flags & (LONGINT|LONGLONG))
  848. !                 flags &= -1-LONGINT, flags |= LONGLONG;
  849. !             else
  850. ! #endif
  851. !                 flags |= LONGINT;
  852.               /*FALLTHROUGH*/
  853.           case 'd':
  854.           case 'i':
  855.               ARG(signed);
  856. ! #ifdef PRINTF_LONGLONG
  857. !             if (flags & LONGLONG) {
  858. !                 if ((_ulonglongsignedtype)_ulonglong < 0ll) {
  859. !                     _ulonglong = -_ulonglong;
  860. !                     sign = '-';
  861. !                 }
  862.               }
  863. +             else
  864. + #endif
  865. +                 if ((_ulongsignedtype)_ulong < 0) {
  866. +                     _ulong = -(long)_ulong;
  867. +                     sign = '-';
  868. +                 }
  869.               base = 10;
  870.               goto number;
  871.   #ifdef __FLOATS__
  872. ***************
  873. *** 411,416 ****
  874. --- 462,472 ----
  875.               goto pforw;
  876.   #endif /* __FLOATS__ */
  877.           case 'n':
  878. + #ifdef PRINTF_LONGLONG
  879. +             if (flags & LONGLONG)
  880. +                 *va_arg(argp, long long *) = cnt;
  881. +             else
  882. + #endif
  883.               if (flags & LONGINT)
  884.                   *va_arg(argp, long *) = cnt;
  885.               else if (flags & SHORTINT)
  886. ***************
  887. *** 419,425 ****
  888.                   *va_arg(argp, int *) = cnt;
  889.               break;
  890.           case 'O':
  891. !             flags |= LONGINT;
  892.               /*FALLTHROUGH*/
  893.           case 'o':
  894.               ARG(unsigned);
  895. --- 475,486 ----
  896.                   *va_arg(argp, int *) = cnt;
  897.               break;
  898.           case 'O':
  899. ! #ifdef PRINTF_LONGLONG
  900. !             if (flags & (LONGINT|LONGLONG))
  901. !                 flags &= -1-LONGINT, flags |= LONGLONG;
  902. !             else
  903. ! #endif
  904. !                 flags |= LONGINT;
  905.               /*FALLTHROUGH*/
  906.           case 'o':
  907.               ARG(unsigned);
  908. ***************
  909. *** 434,440 ****
  910.                *    -- ANSI X3J11
  911.                */
  912.               /* NOSTRICT */
  913. !             _ulong = (u_long)va_arg(argp, void *);
  914.               base = 16;
  915.               goto nosign;
  916.           case 's':
  917. --- 495,504 ----
  918.                *    -- ANSI X3J11
  919.                */
  920.               /* NOSTRICT */
  921. !             _ulong = (_ulongtype)va_arg(argp, void *);
  922. ! #ifdef PRINTF_LONGLONG
  923. !             flags &= -1-LONGLONG;
  924. ! #endif
  925.               base = 16;
  926.               goto nosign;
  927.           case 's':
  928. ***************
  929. *** 454,460 ****
  930.   #endif
  931.   
  932.                   if ((p = (char *)memchr(t, 0, (size_t)prec)) != NULL) {
  933. !                     size = p - t;
  934.                       if (size > prec)
  935.                           size = prec;
  936.                   } else
  937. --- 518,524 ----
  938.   #endif
  939.   
  940.                   if ((p = (char *)memchr(t, 0, (size_t)prec)) != NULL) {
  941. !                     size = (short)(p - t);
  942.                       if (size > prec)
  943.                           size = prec;
  944.                   } else
  945. ***************
  946. *** 464,470 ****
  947.               sign = '\0';
  948.               goto pforw;
  949.           case 'U':
  950. !             flags |= LONGINT;
  951.               /*FALLTHROUGH*/
  952.           case 'u':
  953.               ARG(unsigned);
  954. --- 528,539 ----
  955.               sign = '\0';
  956.               goto pforw;
  957.           case 'U':
  958. ! #ifdef PRINTF_LONGLONG
  959. !             if (flags & (LONGINT|LONGLONG))
  960. !                 flags &= -1-LONGINT, flags |= LONGLONG;
  961. !             else
  962. ! #endif
  963. !                 flags |= LONGINT;
  964.               /*FALLTHROUGH*/
  965.           case 'u':
  966.               ARG(unsigned);
  967. ***************
  968. *** 477,482 ****
  969. --- 546,553 ----
  970.               ARG(unsigned);
  971.               base = 16;
  972.               /* leading 0x/X only if non-zero */
  973. +             /* Note: this does also work with _ulonglong, as we set
  974. +                _ulong = 0 iff _ulonglong==0  --bjarne */
  975.               if (flags & ALT && _ulong != 0)
  976.                   flags |= HEXPREFIX;
  977.   
  978. ***************
  979. *** 496,508 ****
  980.                *    -- ANSI X3J11
  981.                */
  982.               t = buf + BUF;
  983.               if (_ulong != 0 || prec != 0) {
  984. !                 _ICONV(_ulong, base, t);
  985.                   digs = "0123456789abcdef";
  986.                   if (flags & ALT && base == 8 && *t != '0')
  987.                       *--t = '0'; /* octal leading 0 */
  988.               }
  989. !             size = buf + BUF - t;
  990.   
  991.   pforw:
  992.               /*
  993. --- 567,591 ----
  994.                *    -- ANSI X3J11
  995.                */
  996.               t = buf + BUF;
  997. +             /* Note: this does also work with _ulonglong, as we set
  998. +                _ulong = 0 iff _ulonglong==0  --bjarne */
  999.               if (_ulong != 0 || prec != 0) {
  1000. ! #ifdef PRINTF_LONGLONG
  1001. !                 if (flags & LONGLONG) {
  1002. !                     _ICONVLL(_ulonglong, base, t);
  1003. !                 }
  1004. !                 /* As _ICONVLL might be a macro, we better put it in braces */
  1005. !                 else
  1006. ! #endif
  1007. !                 {
  1008. !                     _ICONV(_ulong, base, t);
  1009. !                 }
  1010. !                 /* As _ICONV might be a macro, we better put it in braces */
  1011.                   digs = "0123456789abcdef";
  1012.                   if (flags & ALT && base == 8 && *t != '0')
  1013.                       *--t = '0'; /* octal leading 0 */
  1014.               }
  1015. !             size = (short)(buf + BUF - t);
  1016.   
  1017.   pforw:
  1018.               /*
  1019. diff -cr ../mntlib34/exec.c ./exec.c
  1020. *** ../mntlib34/exec.c    Mon Feb 22 09:33:24 1993
  1021. --- ./exec.c    Thu Sep  9 15:59:56 1993
  1022. ***************
  1023. *** 12,20 ****
  1024.   
  1025.   int
  1026.   execve(path, argv, envp)
  1027. !     char    *path;
  1028. !     char    **argv;
  1029. !     char    **envp;
  1030.   {
  1031.       return _spawnve(P_OVERLAY, path, argv, envp);
  1032.   }
  1033. --- 12,20 ----
  1034.   
  1035.   int
  1036.   execve(path, argv, envp)
  1037. !     const char *path;
  1038. !     char *const *argv;
  1039. !     char *const *envp;
  1040.   {
  1041.       return _spawnve(P_OVERLAY, path, argv, envp);
  1042.   }
  1043. ***************
  1044. *** 21,34 ****
  1045.   
  1046.   int
  1047.   execv(path, argv)
  1048. !     char *path;
  1049. !     char **argv;
  1050.   {
  1051.       return _spawnve(P_OVERLAY, path, argv, NULL);
  1052.   }
  1053.   
  1054.   #ifdef __STDC__
  1055. ! int execle(char *path, ...)
  1056.   #else
  1057.   int execle(path)
  1058.       char    *path;
  1059. --- 21,34 ----
  1060.   
  1061.   int
  1062.   execv(path, argv)
  1063. !     const char *path;
  1064. !     char *const *argv;
  1065.   {
  1066.       return _spawnve(P_OVERLAY, path, argv, NULL);
  1067.   }
  1068.   
  1069.   #ifdef __STDC__
  1070. ! int execle(const char *path, ...)
  1071.   #else
  1072.   int execle(path)
  1073.       char    *path;
  1074. ***************
  1075. *** 45,51 ****
  1076.   }
  1077.   
  1078.   #ifdef __STDC__
  1079. ! int execl(char *path, ...)
  1080.   #else
  1081.   int execl(path)
  1082.       char    *path;
  1083. --- 45,51 ----
  1084.   }
  1085.   
  1086.   #ifdef __STDC__
  1087. ! int execl(const char *path, ...)
  1088.   #else
  1089.   int execl(path)
  1090.       char    *path;
  1091. diff -cr ../mntlib34/execp.c ./execp.c
  1092. *** ../mntlib34/execp.c    Tue May 25 11:38:04 1993
  1093. --- ./execp.c    Thu Sep  9 15:59:58 1993
  1094. ***************
  1095. *** 20,34 ****
  1096.      first.
  1097.   */
  1098.   
  1099. ! static char *extensions[] = { "ttp", "prg", "tos", NULL };
  1100.   
  1101.   #ifdef __STDC__
  1102. ! int execvp(char *name, char **argv)
  1103.   #else
  1104.   int execvp(name, argv) char *name; char **argv;
  1105.   #endif
  1106.   {
  1107. !     char *execname;
  1108.       char buffer[PATH_MAX];
  1109.       execname = buffindfile(name, getenv("PATH"), extensions,buffer);
  1110.       if (!execname) {
  1111. --- 20,34 ----
  1112.      first.
  1113.   */
  1114.   
  1115. ! static char *const extensions[] = { "ttp", "prg", "tos", NULL };
  1116.   
  1117.   #ifdef __STDC__
  1118. ! int execvp(const char *name, char *const *argv)
  1119.   #else
  1120.   int execvp(name, argv) char *name; char **argv;
  1121.   #endif
  1122.   {
  1123. !     const char *execname;
  1124.       char buffer[PATH_MAX];
  1125.       execname = buffindfile(name, getenv("PATH"), extensions,buffer);
  1126.       if (!execname) {
  1127. ***************
  1128. *** 39,45 ****
  1129.   }
  1130.   
  1131.   #ifdef __STDC__
  1132. ! int execlp(char *name, ...)
  1133.   #else
  1134.   int execlp(name)
  1135.       char    *name;
  1136. --- 39,45 ----
  1137.   }
  1138.   
  1139.   #ifdef __STDC__
  1140. ! int execlp(const char *name, ...)
  1141.   #else
  1142.   int execlp(name)
  1143.       char    *name;
  1144. diff -cr ../mntlib34/fdopen.c ./fdopen.c
  1145. *** ../mntlib34/fdopen.c    Wed Aug 26 04:54:50 1992
  1146. --- ./fdopen.c    Thu Jul 15 07:56:08 1993
  1147. ***************
  1148. *** 7,13 ****
  1149.   
  1150.   FILE *fdopen(h, mode)
  1151.       register int h;
  1152. !     const register char *mode;
  1153.   {
  1154.       extern int __default_mode__;    /* see defmode.c */
  1155.       register int i, iomode = 0, f = __default_mode__;
  1156. --- 7,13 ----
  1157.   
  1158.   FILE *fdopen(h, mode)
  1159.       register int h;
  1160. !     register const char *mode;
  1161.   {
  1162.       extern int __default_mode__;    /* see defmode.c */
  1163.       register int i, iomode = 0, f = __default_mode__;
  1164. diff -cr ../mntlib34/ffs.c ./ffs.c
  1165. *** ../mntlib34/ffs.c    Thu Jul  8 07:46:18 1993
  1166. --- ./ffs.c    Thu Jul 15 04:14:54 1993
  1167. ***************
  1168. *** 1,8 ****
  1169.   /*
  1170. !   ffs.c - find first set bit
  1171. !   Carmine T. Guida
  1172. !   7 - 7 - 93 Public Domain
  1173. ! */
  1174.   
  1175.   #include <support.h>
  1176.   
  1177. --- 1,10 ----
  1178.   /*
  1179. !  *  ffs.c - find the lowest bit set
  1180. !  *  Returns a 2-exponent of position + 1 and 0 for 0
  1181. !  *  Michal Jaegermann, <ntomczak@vm.ucs.ualberta.ca>
  1182. !  *  10 July 1993
  1183. !  *  This piece of code is in a Public Domain
  1184. !  */
  1185.   
  1186.   #include <support.h>
  1187.   
  1188. ***************
  1189. *** 10,47 ****
  1190.   ffs(bits)
  1191.     int bits;
  1192.   {
  1193. !   register int i;
  1194.   
  1195. !   if (!bits)
  1196. !     return 0;
  1197.   
  1198. !   i = 1;
  1199.   #ifndef __MSHORT__
  1200. !   if (!(bits & 0x0000FFFF))    /* Check word */
  1201. !   {
  1202. !     bits >>= 16;
  1203. !     i += 16;
  1204. !   }
  1205. ! #endif
  1206. !   if (!(bits & 0x00FF))        /* Check byte */
  1207. !   {
  1208. !     bits >>= 8;
  1209. !     i += 8;
  1210. !   }
  1211. !   if (!(bits & 0x0F))        /* Check nybble */
  1212. !   {
  1213. !     bits >>= 4;
  1214. !     i += 4;
  1215. !   }
  1216. !   if (!(bits & 0x3))        /* Check 2 bits */
  1217. !   {
  1218. !     bits >>= 2;
  1219. !     i += 2;
  1220. !   }
  1221. !   if (!(bits & 0x1))        /* Check bit */
  1222. !     i += 1;
  1223. !   return i;
  1224.   }
  1225. --- 12,41 ----
  1226.   ffs(bits)
  1227.     int bits;
  1228.   {
  1229. !     register int count;
  1230.   
  1231. !     if (0 == bits)
  1232. !     return 0;
  1233.   
  1234. !     bits &= -bits;
  1235.   #ifndef __MSHORT__
  1236. !     count = (bits & 0x0000ffff ? 16 : 32);
  1237. !     if (bits & 0x00ff00ff)
  1238. !     count -= 8;
  1239. !     if (bits & 0x0f0f0f0f)
  1240. !     count -= 4;
  1241. !     if (bits & 0x33333333)
  1242. !     count -= 2;
  1243. !     if (bits & 0x55555555)
  1244. !     count -= 1;
  1245. ! #else
  1246. !     count = (bits & 0x00ff ? 8 : 16);
  1247. !     if (bits & 0x0f0f)
  1248. !     count -= 4;
  1249. !     if (bits & 0x3333)
  1250. !     count -= 2;
  1251. !     if (bits & 0x5555)
  1252. !     count -= 1;
  1253. ! #endif /* __MSHORT__ */
  1254. !     return count;
  1255.   }
  1256. diff -cr ../mntlib34/findfile.c ./findfile.c
  1257. *** ../mntlib34/findfile.c    Tue May 25 12:09:40 1993
  1258. --- ./findfile.c    Thu Sep  9 16:00:02 1993
  1259. ***************
  1260. *** 27,39 ****
  1261.   #define DIRSEP1         '\\'    /* native OS directory separator */
  1262.   #define DIRSEP2         '/'     /* for emulating another OS */
  1263.   
  1264. ! static char *nullext[] = { NULL };
  1265.   
  1266. ! static int EXISTS __PROTO((char *));
  1267.   
  1268.   static int
  1269.   EXISTS(name)
  1270. !     char *name;
  1271.   {
  1272.       struct stat dummy;
  1273.   
  1274. --- 27,39 ----
  1275.   #define DIRSEP1         '\\'    /* native OS directory separator */
  1276.   #define DIRSEP2         '/'     /* for emulating another OS */
  1277.   
  1278. ! static char *const nullext[] = { NULL };
  1279.   
  1280. ! static int EXISTS __PROTO((const char *));
  1281.   
  1282.   static int
  1283.   EXISTS(name)
  1284. !     const char *name;
  1285.   {
  1286.       struct stat dummy;
  1287.   
  1288. ***************
  1289. *** 47,53 ****
  1290.   
  1291.   char *
  1292.   findfile(fname, fpath, fext)
  1293. !         char *fname, *fpath, **fext;
  1294.   {
  1295.         /* simply calls buffindfile */
  1296.         static char try[PATH_MAX];
  1297. --- 47,54 ----
  1298.   
  1299.   char *
  1300.   findfile(fname, fpath, fext)
  1301. !         const char *fname, *fpath;
  1302. !     char *const *fext;
  1303.   {
  1304.         /* simply calls buffindfile */
  1305.         static char try[PATH_MAX];
  1306. ***************
  1307. *** 57,65 ****
  1308.   
  1309.   char *
  1310.   buffindfile(fname, fpath, fext, try)
  1311. !       char *fname, *fpath, **fext, *try;
  1312.   {
  1313. !       char *s, *t, *extplace, **nextext, c;
  1314.         int  hasext = 0, haspath = 0;
  1315.   
  1316.       if (!fname || !*fname)
  1317. --- 58,68 ----
  1318.   
  1319.   char *
  1320.   buffindfile(fname, fpath, fext, try)
  1321. !       const char *fname, *fpath;
  1322. !       char *const *fext, *try;
  1323.   {
  1324. !       char *s, *extplace, *const *nextext, c;
  1325. !       const char *t;
  1326.         int  hasext = 0, haspath = 0;
  1327.   
  1328.       if (!fname || !*fname)
  1329. ***************
  1330. *** 108,113 ****
  1331. --- 111,126 ----
  1332.   
  1333.   /* copy in next element of path list */
  1334.                 s = try;
  1335. +         /* an attempt to accomodate within reason TOS specs  -- mj */
  1336. +         if (*(fpath + 1) == ':') {
  1337. +             if ((*(fpath + 2) == DIRSEP1 ||
  1338. +                  *(fpath + 2) == DIRSEP2)   &&
  1339. +                 (*fpath != '.' && *fpath != ':')) {
  1340. +                 *s++ = *fpath++;
  1341. +                 *s++ = *fpath++;
  1342. +                 *s++ = *fpath++;
  1343. +             }
  1344. +         }
  1345.                 while ((c = *fpath) != 0 && c != PATHSEP1 && c != PATHSEP2) {
  1346.                         *s++ = c;
  1347.                         fpath++;
  1348. diff -cr ../mntlib34/fopen.c ./fopen.c
  1349. *** ../mntlib34/fopen.c    Sun Jun  6 08:44:34 1993
  1350. --- ./fopen.c    Wed Sep  8 19:06:20 1993
  1351. ***************
  1352. *** 65,71 ****
  1353.       else
  1354.           iomode |= O_RDWR;
  1355.       iomode |= O_NOCTTY;
  1356. !     h = open(filename, iomode, 0644);
  1357.       if(h < __SMALLEST_VALID_HANDLE)
  1358.           {
  1359.           return(NULL);        /* file open/create error */
  1360. --- 65,71 ----
  1361.       else
  1362.           iomode |= O_RDWR;
  1363.       iomode |= O_NOCTTY;
  1364. !     h = open(filename, iomode, 0666);
  1365.       if(h < __SMALLEST_VALID_HANDLE)
  1366.           {
  1367.           return(NULL);        /* file open/create error */
  1368. diff -cr ../mntlib34/fputs.c ./fputs.c
  1369. *** ../mntlib34/fputs.c    Sat Sep  5 08:31:36 1992
  1370. --- ./fputs.c    Thu Jul 15 07:54:40 1993
  1371. ***************
  1372. *** 5,11 ****
  1373.   #include <assert.h>
  1374.   
  1375.   int fputs(data, fp)
  1376. !     const register char *data;
  1377.       register FILE *fp;
  1378.       {
  1379.       register int n = 0;
  1380. --- 5,11 ----
  1381.   #include <assert.h>
  1382.   
  1383.   int fputs(data, fp)
  1384. !     register const char *data;
  1385.       register FILE *fp;
  1386.       {
  1387.       register int n = 0;
  1388. diff -cr ../mntlib34/fwrite.c ./fwrite.c
  1389. *** ../mntlib34/fwrite.c    Sun Jun  6 06:19:24 1993
  1390. --- ./fwrite.c    Tue Jul 13 17:17:56 1993
  1391. ***************
  1392. *** 94,101 ****
  1393.         line_flush=0;
  1394.         /* this relies on having at least one byte buffer,
  1395.            otherwise we'll hang up when trying to write CRLF */
  1396. !       while(n > 0)
  1397. !       {
  1398.             space = fp->_bsiz - fp->_cnt;
  1399.             restart_buf=data;
  1400.             while( space>0 && n>0 ) {
  1401. --- 94,100 ----
  1402.         line_flush=0;
  1403.         /* this relies on having at least one byte buffer,
  1404.            otherwise we'll hang up when trying to write CRLF */
  1405. !       while(n > 0) {
  1406.             space = fp->_bsiz - fp->_cnt;
  1407.             restart_buf=data;
  1408.             while( space>0 && n>0 ) {
  1409. ***************
  1410. *** 137,151 ****
  1411.               n--;
  1412.               data++;
  1413.             }
  1414. !           if( (m=_write(fp->_file, restart_buf, data-restart_buf ))
  1415. !               != data-restart_buf ) {
  1416.               fp->_flag |= _IOERR;
  1417.               return 0;
  1418.             }
  1419. !           l+=m;
  1420.           }
  1421.             }
  1422. !       }
  1423.         if( line_flush ) {
  1424.            if(fflush(fp))
  1425.            return 0;
  1426. --- 136,151 ----
  1427.               n--;
  1428.               data++;
  1429.             }
  1430. !           if( (m = _write(fp->_file, restart_buf, data - restart_buf))
  1431. !               != data - restart_buf) {
  1432.               fp->_flag |= _IOERR;
  1433.               return 0;
  1434.             }
  1435. !           l += (m - 1); /* we already counted one character, before
  1436. !                  * decrementing 'space' to zero */
  1437.           }
  1438.             }
  1439. !       } /* while */
  1440.         if( line_flush ) {
  1441.            if(fflush(fp))
  1442.            return 0;
  1443. diff -cr ../mntlib34/getdtabl.c ./getdtabl.c
  1444. *** ../mntlib34/getdtabl.c    Sun Jun 20 09:09:16 1993
  1445. --- ./getdtabl.c    Mon Jul 12 04:23:16 1993
  1446. ***************
  1447. *** 1,6 ****
  1448.   #include <stdio.h>
  1449.   #include <mintbind.h>
  1450. ! #include <unistd.h>
  1451.   
  1452.   extern int __mint;
  1453.   
  1454. --- 1,6 ----
  1455.   #include <stdio.h>
  1456.   #include <mintbind.h>
  1457. ! #include <support.h>
  1458.   
  1459.   extern int __mint;
  1460.   
  1461. diff -cr ../mntlib34/gethostn.c ./gethostn.c
  1462. *** ../mntlib34/gethostn.c    Tue Nov  5 02:17:32 1991
  1463. --- ./gethostn.c    Fri Jul 16 05:18:08 1993
  1464. ***************
  1465. *** 6,11 ****
  1466. --- 6,12 ----
  1467.   #include <stdlib.h>
  1468.   #include <fcntl.h>
  1469.   #include <unistd.h>
  1470. + #include <support.h>
  1471.   
  1472.   #define MAXLEN 127
  1473.   
  1474. diff -cr ../mntlib34/getpw.c ./getpw.c
  1475. *** ../mntlib34/getpw.c    Sun Jun  6 06:19:32 1993
  1476. --- ./getpw.c    Fri Jul 23 05:04:22 1993
  1477. ***************
  1478. *** 205,210 ****
  1479. --- 205,211 ----
  1480.   #include <unistd.h>
  1481.   #include <string.h>
  1482.   #include <stdlib.h>
  1483. + #include <types.h>
  1484.   
  1485.   static char *pwdfile = "/etc/passwd"; /* default passwd file */
  1486.   
  1487. ***************
  1488. *** 289,296 ****
  1489.   } /* End of getpwent() */
  1490.   
  1491.   /* Get first passwd entry from file with pw_uid matching uid */
  1492.   struct passwd *getpwuid(uid)
  1493. ! int uid;
  1494.   {
  1495.     setpwent();
  1496.     while (nextent(fp) != 0)
  1497. --- 290,301 ----
  1498.   } /* End of getpwent() */
  1499.   
  1500.   /* Get first passwd entry from file with pw_uid matching uid */
  1501. + #ifdef __STDC__
  1502. + struct passwd *getpwuid(uid_t uid)
  1503. + #else
  1504.   struct passwd *getpwuid(uid)
  1505. ! uid_t uid;
  1506. ! #endif
  1507.   {
  1508.     setpwent();
  1509.     while (nextent(fp) != 0)
  1510. diff -cr ../mntlib34/lattice/crt0.s ./lattice/crt0.s
  1511. *** ../mntlib34/lattice/crt0.s    Sun May 23 09:13:26 1993
  1512. --- ./lattice/crt0.s    Wed Sep  8 15:08:14 1993
  1513. ***************
  1514. *** 1,4 ****
  1515. --- 1,19 ----
  1516.       INCLUDE    inc.i
  1517. + _PRG    EQU    1    ; Default...
  1518. + _ACC    EQU    0
  1519. + _AUT    EQU    0
  1520. +     IFD    ACC
  1521. + _ACC    EQU    1
  1522. + _PRG    EQU 0
  1523. +     ELSE
  1524. +     IFD    AUT
  1525. + _AUT    EQU    1
  1526. + _ACC    EQU 1
  1527. +     ENDC
  1528. +     ENDC    ; !ACC
  1529.       
  1530.   ;
  1531.   ; Initilization code; this is common to both 16 and 32 bit libraries,
  1532. ***************
  1533. *** 34,43 ****
  1534. --- 49,61 ----
  1535.       lea    __LinkerDB,a4
  1536.       ENDC
  1537.       sub.l    a6,a6        ; clear a6 for debuggers
  1538. +     IF    _AUT
  1539.       cmp.w    #0,a0        ; test if acc or program
  1540.       beq.s    __startprg    ; if a program, go elsewhere
  1541.       tst.l    36(a0)        ; also test parent basepage pointer
  1542.       bne.s    __startprg    ; for acc's, it must be 0
  1543. +     ENDC
  1544. +     IF    _ACC
  1545.       move.l    a0,__base    ; acc basepage is in A0
  1546.       move.l    __heapbase,sp    ; stack must be set from heap
  1547.       add.l    __stksize,sp
  1548. ***************
  1549. *** 46,55 ****
  1550. --- 64,75 ----
  1551.       ELSE
  1552.       bra    __acc_main    ; function is in crtinit.c
  1553.       ENDC
  1554. +     ENDC
  1555.   ;
  1556.   ; program startup code: doesn't actually do much, other than push
  1557.   ; the basepage onto the stack and call _start1 in crtinit.c
  1558.   ;
  1559. +     IF    _PRG
  1560.   __startprg:
  1561.       move.l    4(sp),a0    ; get basepage
  1562.       move.l    a0,__base    ; save it
  1563. ***************
  1564. *** 60,65 ****
  1565. --- 80,86 ----
  1566.       bra    @_crtinit
  1567.       ELSE
  1568.       bra    __crtinit    ; in crtinit.c
  1569. +     ENDC
  1570.       ENDC
  1571.   
  1572.   ;
  1573. diff -cr ../mntlib34/lattice/inc.i ./lattice/inc.i
  1574. *** ../mntlib34/lattice/inc.i    Sun May 23 08:27:58 1993
  1575. --- ./lattice/inc.i    Sun Jul 11 05:42:20 1993
  1576. ***************
  1577. *** 22,31 ****
  1578.       
  1579.       IFND    __M020__
  1580.   _ARC32    EQU    0
  1581. ! _SIZ    EQU    2
  1582.       ELSE
  1583.   _ARC32    EQU    1
  1584. ! _SIZ    EQU    4
  1585.       ENDC
  1586.       
  1587.   XFUNC    MACRO
  1588. --- 22,31 ----
  1589.       
  1590.       IFND    __M020__
  1591.   _ARC32    EQU    0
  1592. ! _SIZ    EQU    1
  1593.       ELSE
  1594.   _ARC32    EQU    1
  1595. ! _SIZ    EQU    2
  1596.       ENDC
  1597.       
  1598.   XFUNC    MACRO
  1599. Only in .: lblong.target
  1600. diff -cr ../mntlib34/lib.h ./lib.h
  1601. *** ../mntlib34/lib.h    Sun Jun 20 09:23:26 1993
  1602. --- ./lib.h    Tue Jul 13 14:19:14 1993
  1603. ***************
  1604. *** 55,63 ****
  1605.   __EXTERN long        get_sysvar __PROTO((void *var));
  1606.   __EXTERN void        set_sysvar_to_long __PROTO((void *var, long val));
  1607.   
  1608. ! __EXTERN void        _setstack __PROTO((char *));
  1609. ! __EXTERN __EXITING     __exit __PROTO((long status));
  1610.   
  1611.   /* from the TOS GCC library */
  1612.   /* 5/5/92 sb -- definitions needed in malloc.c and realloc.c */
  1613.   
  1614. --- 55,71 ----
  1615.   __EXTERN long        get_sysvar __PROTO((void *var));
  1616.   __EXTERN void        set_sysvar_to_long __PROTO((void *var, long val));
  1617.   
  1618. ! __EXTERN void    _main        __PROTO((long, char **, char **));
  1619. ! __EXTERN void    _init_signal    __PROTO((void));
  1620. ! __EXTERN void     _monstartup    __PROTO((void *lowpc, void *highpc));
  1621. ! __EXTERN void    __mcleanup    __PROTO((void));
  1622. ! __EXTERN void    _moncontrol    __PROTO((long));
  1623. ! __EXTERN void    _setstack    __PROTO((char *));
  1624. ! __EXTERN void    _crtinit    __PROTO((void));
  1625. ! __EXTERN void    _acc_main    __PROTO((void));
  1626. ! __EXTERN __EXITING    __exit    __PROTO((long status));
  1627.   
  1628. + __EXTERN void    _fclose_all_files __PROTO((void));
  1629.   /* from the TOS GCC library */
  1630.   /* 5/5/92 sb -- definitions needed in malloc.c and realloc.c */
  1631.   
  1632. diff -cr ../mntlib34/link.c ./link.c
  1633. *** ../mntlib34/link.c    Sat Feb 13 04:57:28 1993
  1634. --- ./link.c    Tue Jul 13 13:49:16 1993
  1635. ***************
  1636. *** 3,9 ****
  1637.   #include <errno.h>
  1638.   #include <mintbind.h>
  1639.   #include <param.h>
  1640. ! #include <support.h>
  1641.   #include "lib.h"
  1642.   
  1643.   extern int __mint;
  1644. --- 3,9 ----
  1645.   #include <errno.h>
  1646.   #include <mintbind.h>
  1647.   #include <param.h>
  1648. ! #include <unistd.h>
  1649.   #include "lib.h"
  1650.   
  1651.   extern int __mint;
  1652. diff -cr ../mntlib34/main.c ./main.c
  1653. *** ../mntlib34/main.c    Thu Jul  1 06:36:40 1993
  1654. --- ./main.c    Sun Sep 12 20:16:28 1993
  1655. ***************
  1656. *** 25,35 ****
  1657.   FILE    _iob[_NFILE];    /* stream buffers initialized below */
  1658.   
  1659.   /* functions registered by user for calling at exit */
  1660. ! #ifdef __STDC__
  1661. ! typedef void (*ExitFn)(void);
  1662. ! #else
  1663. ! typedef void (*ExitFn)();
  1664. ! #endif
  1665.   ExitFn *_at_exit;
  1666.   int _num_at_exit;    /* number of functions registered - 1 */
  1667.   
  1668. --- 25,31 ----
  1669.   FILE    _iob[_NFILE];    /* stream buffers initialized below */
  1670.   
  1671.   /* functions registered by user for calling at exit */
  1672. ! typedef void (*ExitFn) __PROTO((void));
  1673.   ExitFn *_at_exit;
  1674.   int _num_at_exit;    /* number of functions registered - 1 */
  1675.   
  1676. ***************
  1677. *** 37,44 ****
  1678.    * get MiNT version number. Since this has to be done in supervisor mode,
  1679.    * we might as well set the start-up time of the system here, too.
  1680.    */
  1681.   
  1682. ! static void
  1683.   getMiNT()
  1684.   {
  1685.       long *cookie;
  1686. --- 33,41 ----
  1687.    * get MiNT version number. Since this has to be done in supervisor mode,
  1688.    * we might as well set the start-up time of the system here, too.
  1689.    */
  1690. + static long getMiNT __PROTO((void));
  1691.   
  1692. ! static long
  1693.   getMiNT()
  1694.   {
  1695.       long *cookie;
  1696. ***************
  1697. *** 54,73 ****
  1698.           while (*cookie) {
  1699.               if (*cookie == 0x4d694e54L) {    /* MiNT */
  1700.                   __mint = (int) cookie[1];
  1701. !                 return;
  1702.               }
  1703.               cookie += 2;
  1704.           }
  1705.       }
  1706.       __mint = 0;
  1707.   }
  1708.   
  1709.   /* supplied by the user */
  1710.   __EXTERN int main __PROTO((int, char **, char **));
  1711.   
  1712. - /* in getbuf.c */
  1713. - __EXTERN void _getbuf __PROTO((FILE *));
  1714.   #if __GNUC__ > 1
  1715.   /* in libgcc2.c */
  1716.   __EXTERN void __do_global_dtors __PROTO ((void));
  1717. --- 51,68 ----
  1718.           while (*cookie) {
  1719.               if (*cookie == 0x4d694e54L) {    /* MiNT */
  1720.                   __mint = (int) cookie[1];
  1721. !                 return 0;
  1722.               }
  1723.               cookie += 2;
  1724.           }
  1725.       }
  1726.       __mint = 0;
  1727. +     return 0;
  1728.   }
  1729.   
  1730.   /* supplied by the user */
  1731.   __EXTERN int main __PROTO((int, char **, char **));
  1732.   
  1733.   #if __GNUC__ > 1
  1734.   /* in libgcc2.c */
  1735.   __EXTERN void __do_global_dtors __PROTO ((void));
  1736. ***************
  1737. *** 81,86 ****
  1738. --- 76,83 ----
  1739.   long _fpuctrl;
  1740.   #endif
  1741.   
  1742. + void _main __PROTO((long, char **, char **));
  1743.   void
  1744.   _main(_argc, _argv, _envp)
  1745.       long _argc;
  1746. ***************
  1747. *** 246,263 ****
  1748.       exit(main((int) _argc, _argv, _envp));
  1749.   }
  1750.   
  1751. ! __EXITING exit(status)
  1752. !     int status;
  1753.   {
  1754.       register int i, f;
  1755.   
  1756. -     for(i = _num_at_exit - 1; i >= 0; --i)
  1757. -         (*_at_exit[i])();
  1758. - #if __GNUC__ > 1
  1759. -     __do_global_dtors ();
  1760. - #endif
  1761.       for(i=0; i<_NFILE; ++i) {
  1762.           f = _iob[i]._flag;
  1763.           if(f & (_IORW | _IOREAD | _IOWRT))
  1764. --- 243,253 ----
  1765.       exit(main((int) _argc, _argv, _envp));
  1766.   }
  1767.   
  1768. ! void
  1769. ! _fclose_all_files()
  1770.   {
  1771.       register int i, f;
  1772.   
  1773.       for(i=0; i<_NFILE; ++i) {
  1774.           f = _iob[i]._flag;
  1775.           if(f & (_IORW | _IOREAD | _IOWRT))
  1776. ***************
  1777. *** 266,270 ****
  1778. --- 256,275 ----
  1779.               else
  1780.                   fclose(&_iob[i]);
  1781.       }
  1782. + }
  1783. + __EXITING exit(status)
  1784. +     int status;
  1785. + {
  1786. +     register int i;
  1787. +     for(i = _num_at_exit - 1; i >= 0; --i)
  1788. +         (*_at_exit[i])();
  1789. + #if __GNUC__ > 1
  1790. +     __do_global_dtors ();
  1791. + #endif
  1792. +     _fclose_all_files();
  1793.       _exit(status);
  1794.   }
  1795. diff -cr ../mntlib34/malloc.c ./malloc.c
  1796. *** ../mntlib34/malloc.c    Thu Sep 17 05:36:04 1992
  1797. --- ./malloc.c    Wed Sep  8 22:20:24 1993
  1798. ***************
  1799. *** 70,75 ****
  1800. --- 70,82 ----
  1801.           if (MINHUNK < MAXHUNK)
  1802.               MINHUNK *= 2;
  1803.       }
  1804. +     if (_split_mem || _heapbase == NULL)
  1805. +       {
  1806. +         static int page_size = 0;
  1807. +         if (!page_size)
  1808. +           page_size = getpagesize ();
  1809. +         sz = (sz + page_size - 1) & -page_size;
  1810. +       }
  1811.       q = (struct mem_chunk * )_sbrk(sz);
  1812.   
  1813.       if (((long)q) == -1)         /* can't alloc any more? */
  1814. diff -cr ../mntlib34/mincl ./mincl
  1815. *** ../mntlib34/mincl    Sun Jun 27 06:11:22 1993
  1816. --- ./mincl    Sun Jul 18 08:48:18 1993
  1817. ***************
  1818. *** 43,49 ****
  1819.       ffs.o findfile.o fopenp.o frwbin.o \
  1820.       ftw.o getpw.o gethostn.o \
  1821.       getlogin.o getopt.o getpages.o getpass.o grp.o ident.o mktemp.o \
  1822. !     regexp.o regsup.o scandir.o strlwr.o strupr.o strrev.o \
  1823.       textio.o random.o \
  1824.       obstack.o utmp.o wtmp.o \
  1825.       il.o ic.o iw.o ig.o ip.o
  1826. --- 43,49 ----
  1827.       ffs.o findfile.o fopenp.o frwbin.o \
  1828.       ftw.o getpw.o gethostn.o \
  1829.       getlogin.o getopt.o getpages.o getpass.o grp.o ident.o mktemp.o \
  1830. !     regexp.o regsup.o scandir.o strlwr.o strupr.o strrev.o sync.o \
  1831.       textio.o random.o \
  1832.       obstack.o utmp.o wtmp.o \
  1833.       il.o ic.o iw.o ig.o ip.o
  1834. diff -cr ../mntlib34/mkdir.c ./mkdir.c
  1835. *** ../mntlib34/mkdir.c    Sat Jun 19 12:15:30 1993
  1836. --- ./mkdir.c    Wed Sep  8 19:06:24 1993
  1837. ***************
  1838. *** 40,46 ****
  1839.           return -1;
  1840.       }
  1841.       if (__mint >= 9) {
  1842. !         (void)Fchmod(path, mode);
  1843.       }
  1844.       return 0;
  1845.   }
  1846. --- 40,48 ----
  1847.           return -1;
  1848.       }
  1849.       if (__mint >= 9) {
  1850. !         int umask = Pumask (0);
  1851. !         (void) Pumask (umask);
  1852. !         (void)Fchmod(path, mode & ~umask);
  1853.       }
  1854.       return 0;
  1855.   }
  1856. diff -cr ../mntlib34/mknod.c ./mknod.c
  1857. *** ../mntlib34/mknod.c    Sun Jun 20 08:59:54 1993
  1858. --- ./mknod.c    Mon Jul 12 04:34:50 1993
  1859. ***************
  1860. *** 1,7 ****
  1861.   /* fake mknod -- this always fails */
  1862.   
  1863.   #include <errno.h>
  1864. ! #include <unistd.h>
  1865.   
  1866.   int
  1867.   mknod(path, mode, dev)
  1868. --- 1,7 ----
  1869.   /* fake mknod -- this always fails */
  1870.   
  1871.   #include <errno.h>
  1872. ! #include <support.h>
  1873.   
  1874.   int
  1875.   mknod(path, mode, dev)
  1876. diff -cr ../mntlib34/mktemp.c ./mktemp.c
  1877. *** ../mntlib34/mktemp.c    Thu Sep 17 20:02:50 1992
  1878. --- ./mktemp.c    Wed Sep  8 19:06:28 1993
  1879. ***************
  1880. *** 27,36 ****
  1881.   
  1882.     /* scan back over X's */
  1883.     for(p = pattern; *p; p++) ;
  1884. !   for(q = --p; *q == 'X'; --q) ;
  1885.     if((nx = p - q) == 0)  /* # of X's */
  1886.       return NULL;
  1887. -   q++;
  1888.   
  1889.     /* if MiNT is active and there's room, put in the pid */
  1890.     /* we need 5 X's for this: up to 3 for the pid, and up to 2 for the
  1891. --- 27,35 ----
  1892.   
  1893.     /* scan back over X's */
  1894.     for(p = pattern; *p; p++) ;
  1895. !   for(q = p; q[-1] == 'X'; --q) ;
  1896.     if((nx = p - q) == 0)  /* # of X's */
  1897.       return NULL;
  1898.   
  1899.     /* if MiNT is active and there's room, put in the pid */
  1900.     /* we need 5 X's for this: up to 3 for the pid, and up to 2 for the
  1901. ***************
  1902. *** 38,44 ****
  1903. --- 37,47 ----
  1904.     if (__mint && nx > 4 && startat < 256) {
  1905.       (void) _itoa(getpid(), q, 10);
  1906.       while (*q) q++;
  1907. +     /* be sure to generate each name only once */
  1908. +     if (startat < 16) *q++ = '0';
  1909.       (void) _itoa(startat++, q, 16);
  1910. +     while (*q) q++;
  1911. +     while (q < p) *q++ = '0'; /* fill with zeros */
  1912.       return pattern;
  1913.     }
  1914.   
  1915. diff -cr ../mntlib34/nice.c ./nice.c
  1916. *** ../mntlib34/nice.c    Tue Nov  5 02:21:00 1991
  1917. --- ./nice.c    Mon Jul 12 04:37:00 1993
  1918. ***************
  1919. *** 4,13 ****
  1920.    * ref seems to say "-20 to +19,  or -1 on error". Hmm.
  1921.    */
  1922.   
  1923. - #include <unistd.h>
  1924.   #include <errno.h>
  1925. - #include <stdlib.h>
  1926.   #include <mintbind.h>
  1927.   
  1928.   extern long __mint;
  1929.   
  1930. --- 4,12 ----
  1931.    * ref seems to say "-20 to +19,  or -1 on error". Hmm.
  1932.    */
  1933.   
  1934.   #include <errno.h>
  1935.   #include <mintbind.h>
  1936. + #include <support.h>
  1937.   
  1938.   extern long __mint;
  1939.   
  1940. diff -cr ../mntlib34/open.c ./open.c
  1941. *** ../mntlib34/open.c    Thu Jun 17 06:35:30 1993
  1942. --- ./open.c    Thu Jul 15 08:12:26 1993
  1943. ***************
  1944. *** 10,15 ****
  1945. --- 10,16 ----
  1946.   #include <errno.h>
  1947.   #include <unistd.h>
  1948.   #include <stdarg.h>
  1949. + #include <stat.h>
  1950.   #include "lib.h"
  1951.   
  1952.   /*
  1953. diff -cr ../mntlib34/osbind.cpp ./osbind.cpp
  1954. *** ../mntlib34/osbind.cpp    Thu Oct  1 15:25:10 1992
  1955. --- ./osbind.cpp    Wed Sep  8 22:20:16 1993
  1956. ***************
  1957. *** 58,65 ****
  1958.       .globl    _trap_1_w
  1959.   _trap_1_w:
  1960.       moveml    d2/a2, sp@-
  1961. !     movel    sp@(12), d0
  1962. !     movew    d0, sp@-
  1963.       trap    #1
  1964.       addql    #2, sp
  1965.       moveml    sp@+, d2/a2
  1966. --- 58,64 ----
  1967.       .globl    _trap_1_w
  1968.   _trap_1_w:
  1969.       moveml    d2/a2, sp@-
  1970. !     movew    sp@(14), sp@-
  1971.       trap    #1
  1972.       addql    #2, sp
  1973.       moveml    sp@+, d2/a2
  1974. ***************
  1975. *** 68,77 ****
  1976.       .globl    _trap_1_ww
  1977.   _trap_1_ww:
  1978.       moveml    d2/a2, sp@-
  1979. !     movel    sp@(16), d1
  1980. !     movel    sp@(12), d0
  1981. !     movew    d1, sp@-
  1982. !     movew    d0, sp@-
  1983.       trap    #1
  1984.       addql    #4, sp
  1985.       moveml    sp@+, d2/a2
  1986. --- 67,74 ----
  1987.       .globl    _trap_1_ww
  1988.   _trap_1_ww:
  1989.       moveml    d2/a2, sp@-
  1990. !     movew    sp@(18), sp@-
  1991. !     movew    sp@(14+2), sp@-
  1992.       trap    #1
  1993.       addql    #4, sp
  1994.       moveml    sp@+, d2/a2
  1995. ***************
  1996. *** 80,89 ****
  1997.       .globl    _trap_1_wl
  1998.   _trap_1_wl:
  1999.       moveml    d2/a2, sp@-
  2000. !     movel    sp@(16), d1
  2001. !     movel    sp@(12), d0
  2002. !     movel    d1, sp@-
  2003. !     movew    d0, sp@-
  2004.       trap    #1
  2005.       addql    #6, sp
  2006.       moveml    sp@+, d2/a2
  2007. --- 77,84 ----
  2008.       .globl    _trap_1_wl
  2009.   _trap_1_wl:
  2010.       moveml    d2/a2, sp@-
  2011. !     movel    sp@(16), sp@-
  2012. !     movew    sp@(14+4), sp@-
  2013.       trap    #1
  2014.       addql    #6, sp
  2015.       moveml    sp@+, d2/a2
  2016. ***************
  2017. *** 92,103 ****
  2018.       .globl    _trap_1_wlw
  2019.   _trap_1_wlw:
  2020.       moveml    d2/a2, sp@-
  2021. !     movel    sp@(20), a0
  2022. !     movel    sp@(16), d1
  2023. !     movel    sp@(12), d0
  2024. !     movew    a0, sp@-
  2025. !     movel    d1, sp@-
  2026. !     movew    d0, sp@-
  2027.       trap    #1
  2028.       addql    #8, sp        | addq is valid for 1-8
  2029.       moveml    sp@+, d2/a2
  2030. --- 87,95 ----
  2031.       .globl    _trap_1_wlw
  2032.   _trap_1_wlw:
  2033.       moveml    d2/a2, sp@-
  2034. !     movew    sp@(22), sp@-
  2035. !     movel    sp@(16+2), sp@-
  2036. !     movew    sp@(14+6), sp@-
  2037.       trap    #1
  2038.       addql    #8, sp        | addq is valid for 1-8
  2039.       moveml    sp@+, d2/a2
  2040. ***************
  2041. *** 106,117 ****
  2042.       .globl    _trap_1_wwl
  2043.   _trap_1_wwl:
  2044.       moveml    d2/a2, sp@-
  2045. !     movel    sp@(20), a0
  2046. !     movel    sp@(16), d1
  2047. !     movel    sp@(12), d0
  2048. !     movel    a0, sp@-
  2049. !     movew    d1, sp@-
  2050. !     movew    d0, sp@-
  2051.       trap    #1
  2052.       addql    #8, sp
  2053.       moveml    sp@+, d2/a2
  2054. --- 98,106 ----
  2055.       .globl    _trap_1_wwl
  2056.   _trap_1_wwl:
  2057.       moveml    d2/a2, sp@-
  2058. !     movel    sp@(20), sp@-
  2059. !     movew    sp@(18+4), sp@-
  2060. !     movew    sp@(14+6), sp@-
  2061.       trap    #1
  2062.       addql    #8, sp
  2063.       moveml    sp@+, d2/a2
  2064. ***************
  2065. *** 120,131 ****
  2066.       .globl    _trap_1_www
  2067.   _trap_1_www:
  2068.       moveml    d2/a2, sp@-
  2069. !     movel    sp@(20), a0
  2070. !     movel    sp@(16), d1
  2071. !     movel    sp@(12), d0
  2072. !     movew    a0, sp@-
  2073. !     movew    d1, sp@-
  2074. !     movew    d0, sp@-
  2075.       trap    #1
  2076.       addql    #6, sp
  2077.       moveml    sp@+, d2/a2
  2078. --- 109,117 ----
  2079.       .globl    _trap_1_www
  2080.   _trap_1_www:
  2081.       moveml    d2/a2, sp@-
  2082. !     movew    sp@(22), sp@-
  2083. !     movew    sp@(18+2), sp@-
  2084. !     movew    sp@(14+4), sp@-
  2085.       trap    #1
  2086.       addql    #6, sp
  2087.       moveml    sp@+, d2/a2
  2088. ***************
  2089. *** 134,161 ****
  2090.       .globl    _trap_1_wll
  2091.   _trap_1_wll:
  2092.       moveml    d2/a2, sp@-
  2093. !     movel    sp@(20), a0
  2094. !     movel    sp@(16), d1
  2095. !     movel    sp@(12), d0
  2096. !     movel    a0, sp@-
  2097. !     movel    d1, sp@-
  2098. !     movew    d0, sp@-
  2099.       trap    #1
  2100.       lea    sp@(10), sp
  2101.       moveml    sp@+, d2/a2
  2102.       rts
  2103.   
  2104.       .globl    _trap_1_wwll
  2105.   _trap_1_wwll:
  2106.       moveml    d2/a2, sp@-
  2107. !     movel    sp@(24), a1
  2108. !     movel    sp@(20), a0
  2109. !     movel    sp@(16), d1
  2110. !     movel    sp@(12), d0
  2111. !     movel    a1, sp@-
  2112. !     movel    a0, sp@-
  2113. !     movew    d1, sp@-
  2114. !     movew    d0, sp@-
  2115.       trap    #1
  2116.       lea    sp@(12), sp
  2117.       moveml    sp@+, d2/a2
  2118. --- 120,164 ----
  2119.       .globl    _trap_1_wll
  2120.   _trap_1_wll:
  2121.       moveml    d2/a2, sp@-
  2122. !     movel    sp@(20), sp@-
  2123. !     movel    sp@(16+4), sp@-
  2124. !     movew    sp@(14+8), sp@-
  2125.       trap    #1
  2126.       lea    sp@(10), sp
  2127.       moveml    sp@+, d2/a2
  2128.       rts
  2129.   
  2130. +     .globl    _trap_1_wwww
  2131. + _trap_1_wwww:
  2132. +     moveml    d2/a1, sp@-
  2133. +     movew    sp@(26), sp@-
  2134. +     movew    sp@(22+2), sp@-
  2135. +     movew    sp@(18+4), sp@-
  2136. +     movew    sp@(14+6), sp@-
  2137. +     trap    #1
  2138. +     addql    #8, sp
  2139. +     moveml    sp@+, d2/a2
  2140. +     rts
  2141. +     .globl    _trap_1_wwwl
  2142. + _trap_1_wwwl:
  2143. +     moveml    d2/a1, sp@-
  2144. +     movel    sp@(24), sp@-
  2145. +     movew    sp@(22+4), sp@-
  2146. +     movew    sp@(18+6), sp@-
  2147. +     movew    sp@(14+8), sp@-
  2148. +     trap    #1
  2149. +     addw    #10, sp
  2150. +     moveml    sp@+, d2/a2
  2151. +     rts
  2152.       .globl    _trap_1_wwll
  2153.   _trap_1_wwll:
  2154.       moveml    d2/a2, sp@-
  2155. !     movel    sp@(24), sp@-
  2156. !     movel    sp@(20+4), sp@-
  2157. !     movew    sp@(18+8), sp@-
  2158. !     movew    sp@(14+10), sp@-
  2159.       trap    #1
  2160.       lea    sp@(12), sp
  2161.       moveml    sp@+, d2/a2
  2162. ***************
  2163. *** 164,177 ****
  2164.       .globl    _trap_1_wlww
  2165.   _trap_1_wlww:
  2166.       moveml    d2/a2, sp@-
  2167. !     movel    sp@(24), a1
  2168. !     movel    sp@(20), a0
  2169. !     movel    sp@(16), d1
  2170. !     movel    sp@(12), d0
  2171. !     movew    a1, sp@-
  2172. !     movew    a0, sp@-
  2173. !     movel    d1, sp@-
  2174. !     movew    d0, sp@-
  2175.       trap    #1
  2176.       lea    sp@(10), sp
  2177.       moveml    sp@+, d2/a2
  2178. --- 167,176 ----
  2179.       .globl    _trap_1_wlww
  2180.   _trap_1_wlww:
  2181.       moveml    d2/a2, sp@-
  2182. !     movew    sp@(26), sp@-
  2183. !     movew    sp@(22+2), sp@-
  2184. !     movel    sp@(16+4), sp@-
  2185. !     movew    sp@(14+8), sp@-
  2186.       trap    #1
  2187.       lea    sp@(10), sp
  2188.       moveml    sp@+, d2/a2
  2189. ***************
  2190. *** 180,193 ****
  2191.       .globl    _trap_1_wwlw
  2192.   _trap_1_wwlw:
  2193.       moveml    d2/a2, sp@-
  2194. !     movel    sp@(24), a1
  2195. !     movel    sp@(20), a0
  2196. !     movel    sp@(16), d1
  2197. !     movel    sp@(12), d0
  2198. !     movew    a1, sp@-
  2199. !     movel    a0, sp@-
  2200. !     movew    d1, sp@-
  2201. !     movew    d0, sp@-
  2202.       trap    #1
  2203.       lea    sp@(10), sp
  2204.       moveml    sp@+, d2/a2
  2205. --- 179,188 ----
  2206.       .globl    _trap_1_wwlw
  2207.   _trap_1_wwlw:
  2208.       moveml    d2/a2, sp@-
  2209. !     movew    sp@(26), sp@-
  2210. !     movel    sp@(20+2), sp@-
  2211. !     movew    sp@(18+6), sp@-
  2212. !     movew    sp@(14+8), sp@-
  2213.       trap    #1
  2214.       lea    sp@(10), sp
  2215.       moveml    sp@+, d2/a2
  2216. ***************
  2217. *** 196,221 ****
  2218.       .globl    _trap_1_wwlll
  2219.   _trap_1_wwlll:
  2220.       moveml    d2/a2, sp@-
  2221. !     movel    sp@(28), a1
  2222. !     movel    sp@(24), a0
  2223. !     movel    sp@(20), d1
  2224. !     movel    a1, sp@-
  2225. !     movel    a0, sp@-
  2226. !     movel    d1, sp@-
  2227. !     movel    sp@(16+12), d1
  2228. !     movel    sp@(12+12), d0
  2229. !     movew    d1, sp@-
  2230. !     movew    d0, sp@-
  2231.       trap    #1
  2232.       lea    sp@(16), sp
  2233.       moveml    sp@+, d2/a2
  2234.       rts
  2235.   
  2236.       .globl    _trap_13_w
  2237.   _trap_13_w:
  2238.       moveml    d2/a2, sp@-
  2239. !     movel    sp@(12), d0
  2240. !     movew    d0, sp@-
  2241.       trap    #13
  2242.       addql    #2, sp
  2243.       moveml    sp@+, d2/a2
  2244. --- 191,223 ----
  2245.       .globl    _trap_1_wwlll
  2246.   _trap_1_wwlll:
  2247.       moveml    d2/a2, sp@-
  2248. !     movel    sp@(28), sp@-
  2249. !     movel    sp@(24+4), sp@-
  2250. !     movel    sp@(20+8), sp@-
  2251. !     movew    sp@(18+12), sp@-
  2252. !     movew    sp@(14+14), sp@-
  2253.       trap    #1
  2254.       lea    sp@(16), sp
  2255.       moveml    sp@+, d2/a2
  2256.       rts
  2257.   
  2258. +     .globl    _trap_1_wwwll
  2259. + _trap_1_wwwll:
  2260. +     moveml    d2/a2, sp@-
  2261. +     movel    sp@(28), sp@-
  2262. +     movel    sp@(24+4), sp@-
  2263. +     movew    sp@(22+8), sp@-
  2264. +     movew    sp@(18+10), sp@-
  2265. +     movew    sp@(14+12), sp@-
  2266. +     trap    #1
  2267. +     addw    #16, sp
  2268. +     moveml    sp@+, d2/a2
  2269. +     rts
  2270.       .globl    _trap_13_w
  2271.   _trap_13_w:
  2272.       moveml    d2/a2, sp@-
  2273. !     movew    sp@(14), sp@-
  2274.       trap    #13
  2275.       addql    #2, sp
  2276.       moveml    sp@+, d2/a2
  2277. ***************
  2278. *** 224,233 ****
  2279.       .globl    _trap_13_ww
  2280.   _trap_13_ww:
  2281.       moveml    d2/a2, sp@-
  2282. !     movel    sp@(16), d1
  2283. !     movel    sp@(12), d0
  2284. !     movew    d1, sp@-
  2285. !     movew    d0, sp@-
  2286.       trap    #13
  2287.       addql    #4, sp
  2288.       moveml    sp@+, d2/a2
  2289. --- 226,233 ----
  2290.       .globl    _trap_13_ww
  2291.   _trap_13_ww:
  2292.       moveml    d2/a2, sp@-
  2293. !     movew    sp@(18), sp@-
  2294. !     movew    sp@(14+2), sp@-
  2295.       trap    #13
  2296.       addql    #4, sp
  2297.       moveml    sp@+, d2/a2
  2298. ***************
  2299. *** 236,245 ****
  2300.       .globl    _trap_13_wl
  2301.   _trap_13_wl:
  2302.       moveml    d2/a2, sp@-
  2303. !     movel    sp@(16), d1
  2304. !     movel    sp@(12), d0
  2305. !     movel    d1, sp@-
  2306. !     movew    d0, sp@-
  2307.       trap    #13
  2308.       addql    #6, sp
  2309.       moveml    sp@+, d2/a2
  2310. --- 236,243 ----
  2311.       .globl    _trap_13_wl
  2312.   _trap_13_wl:
  2313.       moveml    d2/a2, sp@-
  2314. !     movel    sp@(16), sp@-
  2315. !     movew    sp@(14+4), sp@-
  2316.       trap    #13
  2317.       addql    #6, sp
  2318.       moveml    sp@+, d2/a2
  2319. ***************
  2320. *** 248,259 ****
  2321.       .globl    _trap_13_www
  2322.   _trap_13_www:
  2323.       moveml    d2/a2, sp@-
  2324. !     movel    sp@(20), a0
  2325. !     movel    sp@(16), d1
  2326. !     movel    sp@(12), d0
  2327. !     movew    a0, sp@-
  2328. !     movew    d1, sp@-
  2329. !     movew    d0, sp@-
  2330.       trap    #13
  2331.       addql    #6, sp
  2332.       moveml    sp@+, d2/a2
  2333. --- 246,254 ----
  2334.       .globl    _trap_13_www
  2335.   _trap_13_www:
  2336.       moveml    d2/a2, sp@-
  2337. !     movew    sp@(22), sp@-
  2338. !     movew    sp@(18+2), sp@-
  2339. !     movew    sp@(14+4), sp@-
  2340.       trap    #13
  2341.       addql    #6, sp
  2342.       moveml    sp@+, d2/a2
  2343. ***************
  2344. *** 262,273 ****
  2345.       .globl    _trap_13_wwl
  2346.   _trap_13_wwl:
  2347.       moveml    d2/a2, sp@-
  2348. !     movel    sp@(20), a0
  2349. !     movel    sp@(16), d1
  2350. !     movel    sp@(12), d0
  2351. !     movel    a0, sp@-
  2352. !     movew    d1, sp@-
  2353. !     movew    d0, sp@-
  2354.       trap    #13
  2355.       addql    #8, sp
  2356.       moveml    sp@+, d2/a2
  2357. --- 257,265 ----
  2358.       .globl    _trap_13_wwl
  2359.   _trap_13_wwl:
  2360.       moveml    d2/a2, sp@-
  2361. !     movel    sp@(20), sp@-
  2362. !     movew    sp@(18+4), sp@-
  2363. !     movew    sp@(14+6), sp@-
  2364.       trap    #13
  2365.       addql    #8, sp
  2366.       moveml    sp@+, d2/a2
  2367. ***************
  2368. *** 276,293 ****
  2369.       .globl    _trap_13_wwlwww
  2370.   _trap_13_wwlwww:
  2371.       moveml    d2/a2, sp@-
  2372. !     movel    sp@(32), a0
  2373. !     movel    sp@(28), d1
  2374. !     movel    sp@(24), d0
  2375. !     movew    a0, sp@-
  2376. !     movew    d1, sp@-
  2377. !     movew    d0, sp@-
  2378. !     movel    sp@(20+6), a0
  2379. !     movel    sp@(16+6), d1
  2380. !     movel    sp@(12+6), d0
  2381. !     movel    a0, sp@-
  2382. !     movew    d1, sp@-
  2383. !     movew    d0, sp@-
  2384.       trap    #13
  2385.       lea    sp@(14), sp
  2386.       moveml    sp@+, d2/a2
  2387. --- 268,279 ----
  2388.       .globl    _trap_13_wwlwww
  2389.   _trap_13_wwlwww:
  2390.       moveml    d2/a2, sp@-
  2391. !     movew    sp@(34), sp@-
  2392. !     movew    sp@(30+2), sp@-
  2393. !     movew    sp@(26+4), sp@-
  2394. !     movel    sp@(20+6), sp@-
  2395. !     movew    sp@(18+10), sp@-
  2396. !     movew    sp@(14+12), sp@-
  2397.       trap    #13
  2398.       lea    sp@(14), sp
  2399.       moveml    sp@+, d2/a2
  2400. ***************
  2401. *** 296,303 ****
  2402.       .globl    _trap_14_w
  2403.   _trap_14_w:
  2404.       moveml    d2/a2, sp@-
  2405. !     movel    sp@(12), d0
  2406. !     movew    d0, sp@-
  2407.       trap    #14
  2408.       addql    #2, sp
  2409.       moveml    sp@+, d2/a2
  2410. --- 282,288 ----
  2411.       .globl    _trap_14_w
  2412.   _trap_14_w:
  2413.       moveml    d2/a2, sp@-
  2414. !     movew    sp@(14), sp@-
  2415.       trap    #14
  2416.       addql    #2, sp
  2417.       moveml    sp@+, d2/a2
  2418. ***************
  2419. *** 306,315 ****
  2420.       .globl    _trap_14_ww
  2421.   _trap_14_ww:
  2422.       moveml    d2/a2, sp@-
  2423. !     movel    sp@(16), d1
  2424. !     movel    sp@(12), d0
  2425. !     movew    d1, sp@-
  2426. !     movew    d0, sp@-
  2427.       trap    #14
  2428.       addql    #4, sp
  2429.       moveml    sp@+, d2/a2
  2430. --- 291,298 ----
  2431.       .globl    _trap_14_ww
  2432.   _trap_14_ww:
  2433.       moveml    d2/a2, sp@-
  2434. !     movew    sp@(18), sp@-
  2435. !     movew    sp@(14+2), sp@-
  2436.       trap    #14
  2437.       addql    #4, sp
  2438.       moveml    sp@+, d2/a2
  2439. ***************
  2440. *** 318,327 ****
  2441.       .globl    _trap_14_wl
  2442.   _trap_14_wl:
  2443.       moveml    d2/a2, sp@-
  2444. !     movel    sp@(16), d1
  2445. !     movel    sp@(12), d0
  2446. !     movel    d1, sp@-
  2447. !     movew    d0, sp@-
  2448.       trap    #14
  2449.       addql    #6, sp
  2450.       moveml    sp@+, d2/a2
  2451. --- 301,308 ----
  2452.       .globl    _trap_14_wl
  2453.   _trap_14_wl:
  2454.       moveml    d2/a2, sp@-
  2455. !     movel    sp@(16), sp@-
  2456. !     movew    sp@(14+4), sp@-
  2457.       trap    #14
  2458.       addql    #6, sp
  2459.       moveml    sp@+, d2/a2
  2460. ***************
  2461. *** 330,341 ****
  2462.       .globl    _trap_14_www
  2463.   _trap_14_www:
  2464.       moveml    d2/a2, sp@-
  2465. !     movel    sp@(20), a0
  2466. !     movel    sp@(16), d1
  2467. !     movel    sp@(12), d0
  2468. !     movew    a0, sp@-
  2469. !     movew    d1, sp@-
  2470. !     movew    d0, sp@-
  2471.       trap    #14
  2472.       addql    #6, sp
  2473.       moveml    sp@+, d2/a2
  2474. --- 311,319 ----
  2475.       .globl    _trap_14_www
  2476.   _trap_14_www:
  2477.       moveml    d2/a2, sp@-
  2478. !     movew    sp@(22), sp@-
  2479. !     movew    sp@(18+2), sp@-
  2480. !     movew    sp@(14+4), sp@-
  2481.       trap    #14
  2482.       addql    #6, sp
  2483.       moveml    sp@+, d2/a2
  2484. ***************
  2485. *** 344,355 ****
  2486.       .globl    _trap_14_wwl
  2487.   _trap_14_wwl:
  2488.       moveml    d2/a2, sp@-
  2489. !     movel    sp@(20), a0
  2490. !     movel    sp@(16), d1
  2491. !     movel    sp@(12), d0
  2492. !     movel    a0, sp@-
  2493. !     movew    d1, sp@-
  2494. !     movew    d0, sp@-
  2495.       trap    #14
  2496.       addql    #8, sp
  2497.       moveml    sp@+, d2/a2
  2498. --- 322,330 ----
  2499.       .globl    _trap_14_wwl
  2500.   _trap_14_wwl:
  2501.       moveml    d2/a2, sp@-
  2502. !     movel    sp@(20), sp@-
  2503. !     movew    sp@(18+4), sp@-
  2504. !     movew    sp@(14+6), sp@-
  2505.       trap    #14
  2506.       addql    #8, sp
  2507.       moveml    sp@+, d2/a2
  2508. ***************
  2509. *** 358,371 ****
  2510.       .globl    _trap_14_wwll
  2511.   _trap_14_wwll:
  2512.       moveml    d2/a2, sp@-
  2513. !     movel    sp@(24), a1
  2514. !     movel    sp@(20), a0
  2515. !     movel    sp@(16), d1
  2516. !     movel    sp@(12), d0
  2517. !     movel    a1, sp@-
  2518. !     movel    a0, sp@-
  2519. !     movew    d1, sp@-
  2520. !     movew    d0, sp@-
  2521.       trap    #14
  2522.       lea    sp@(12), sp
  2523.       moveml    sp@+, d2/a2
  2524. --- 333,342 ----
  2525.       .globl    _trap_14_wwll
  2526.   _trap_14_wwll:
  2527.       moveml    d2/a2, sp@-
  2528. !     movel    sp@(24), sp@-
  2529. !     movel    sp@(20+4), sp@-
  2530. !     movew    sp@(18+8), sp@-
  2531. !     movew    sp@(14+10), sp@-
  2532.       trap    #14
  2533.       lea    sp@(12), sp
  2534.       moveml    sp@+, d2/a2
  2535. ***************
  2536. *** 374,387 ****
  2537.       .globl    _trap_14_wllw
  2538.   _trap_14_wllw:
  2539.       moveml    d2/a2, sp@-
  2540. !     movel    sp@(24), a1
  2541. !     movel    sp@(20), a0
  2542. !     movel    sp@(16), d1
  2543. !     movel    sp@(12), d0
  2544. !     movew    a1, sp@-
  2545. !     movel    a0, sp@-
  2546. !     movel    d1, sp@-
  2547. !     movew    d0, sp@-
  2548.       trap    #14
  2549.       lea    sp@(12), sp
  2550.       moveml    sp@+, d2/a2
  2551. --- 345,354 ----
  2552.       .globl    _trap_14_wllw
  2553.   _trap_14_wllw:
  2554.       moveml    d2/a2, sp@-
  2555. !     movew    sp@(26), sp@-
  2556. !     movel    sp@(20+2), sp@-
  2557. !     movel    sp@(16+6), sp@-
  2558. !     movew    sp@(14+10), sp@-
  2559.       trap    #14
  2560.       lea    sp@(12), sp
  2561.       moveml    sp@+, d2/a2
  2562. ***************
  2563. *** 390,403 ****
  2564.       .globl    _trap_14_wlll
  2565.   _trap_14_wlll:
  2566.       moveml    d2/a2, sp@-
  2567. !     movel    sp@(24), a1
  2568. !     movel    sp@(20), a0
  2569. !     movel    sp@(16), d1
  2570. !     movel    sp@(12), d0
  2571. !     movel    a1, sp@-
  2572. !     movel    a0, sp@-
  2573. !     movel    d1, sp@-
  2574. !     movew    d0, sp@-
  2575.       trap    #14
  2576.       lea    sp@(14), sp
  2577.       moveml    sp@+, d2/a2
  2578. --- 357,366 ----
  2579.       .globl    _trap_14_wlll
  2580.   _trap_14_wlll:
  2581.       moveml    d2/a2, sp@-
  2582. !     movel    sp@(24), sp@-
  2583. !     movel    sp@(20+4), sp@-
  2584. !     movel    sp@(16+8), sp@-
  2585. !     movew    sp@(14+12), sp@-
  2586.       trap    #14
  2587.       lea    sp@(14), sp
  2588.       moveml    sp@+, d2/a2
  2589. ***************
  2590. *** 406,419 ****
  2591.       .globl    _trap_14_wwwl
  2592.   _trap_14_wwwl:
  2593.       moveml    d2/a2, sp@-
  2594. !     movel    sp@(24), a1
  2595. !     movel    sp@(20), a0
  2596. !     movel    sp@(16), d1
  2597. !     movel    sp@(12), d0
  2598. !     movel    a1, sp@-
  2599. !     movew    a0, sp@-
  2600. !     movew    d1, sp@-
  2601. !     movew    d0, sp@-
  2602.       trap    #14
  2603.       lea    sp@(10), sp
  2604.       moveml    sp@+, d2/a2
  2605. --- 369,378 ----
  2606.       .globl    _trap_14_wwwl
  2607.   _trap_14_wwwl:
  2608.       moveml    d2/a2, sp@-
  2609. !     movel    sp@(24), sp@-
  2610. !     movew    sp@(22+4), sp@-
  2611. !     movew    sp@(18+6), sp@-
  2612. !     movew    sp@(14+8), sp@-
  2613.       trap    #14
  2614.       lea    sp@(10), sp
  2615.       moveml    sp@+, d2/a2
  2616. ***************
  2617. *** 422,437 ****
  2618.       .globl    _trap_14_wwwwl
  2619.   _trap_14_wwwwl:
  2620.       moveml    d2/a2, sp@-
  2621. !     movel    sp@(28), d0
  2622. !     movel    d0, sp@-
  2623. !     movel    sp@(24+4), a1
  2624. !     movel    sp@(20+4), a0
  2625. !     movel    sp@(16+4), d1
  2626. !     movel    sp@(12+4), d0
  2627. !     movew    a1, sp@-
  2628. !     movew    a0, sp@-
  2629. !     movew    d1, sp@-
  2630. !     movew    d0, sp@-
  2631.       trap    #14
  2632.       lea    sp@(12), sp
  2633.       moveml    sp@+, d2/a2
  2634. --- 381,391 ----
  2635.       .globl    _trap_14_wwwwl
  2636.   _trap_14_wwwwl:
  2637.       moveml    d2/a2, sp@-
  2638. !     movel    sp@(28), sp@-
  2639. !     movew    sp@(26+4), sp@-
  2640. !     movew    sp@(22+6), sp@-
  2641. !     movew    sp@(18+8), sp@-
  2642. !     movew    sp@(14+10), sp@-
  2643.       trap    #14
  2644.       lea    sp@(12), sp
  2645.       moveml    sp@+, d2/a2
  2646. ***************
  2647. *** 440,455 ****
  2648.       .globl    _trap_14_wllww
  2649.   _trap_14_wllww:
  2650.       moveml    d2/a2, sp@-
  2651. !     movel    sp@(28), d1
  2652. !     movel    sp@(24), d0
  2653. !     movew    d1, sp@-
  2654. !     movew    d0, sp@-
  2655. !     movel    sp@(20+4), a0
  2656. !     movel    sp@(16+4), d1
  2657. !     movel    sp@(12+4), d0
  2658. !     movel    a0, sp@-
  2659. !     movel    d1, sp@-
  2660. !     movew    d0, sp@-
  2661.       trap    #14
  2662.       lea    sp@(14), sp
  2663.       moveml    sp@+, d2/a2
  2664. --- 394,431 ----
  2665.       .globl    _trap_14_wllww
  2666.   _trap_14_wllww:
  2667.       moveml    d2/a2, sp@-
  2668. !     movew    sp@(30), sp@-
  2669. !     movew    sp@(26+2), sp@-
  2670. !     movel    sp@(20+4), sp@-
  2671. !     movel    sp@(16+8), sp@-
  2672. !     movew    sp@(14+12), sp@-
  2673. !     trap    #14
  2674. !     lea    sp@(14), sp
  2675. !     moveml    sp@+, d2/a2
  2676. !     rts
  2677. !     
  2678. !     .globl    _trap_14_wlwlw
  2679. ! _trap_14_wlwlw:
  2680. !     moveml    d2/a2, sp@-
  2681. !     movew    sp@(30), sp@-
  2682. !     movel    sp@(24+2), sp@-
  2683. !     movew    sp@(22+6), sp@-
  2684. !     movel    sp@(16+8), sp@-
  2685. !     movew    sp@(14+12), sp@-
  2686. !     trap    #14
  2687. !     addw    #14, sp
  2688. !     moveml    sp@+, d2/a2
  2689. !     rts
  2690. !     .globl    _trap_14_wwwwww
  2691. ! _trap_14_wwwwww:
  2692. !     moveml    d2/a2, sp@-
  2693. !     movew    sp@(34), sp@-
  2694. !     movew    sp@(30+2), sp@-
  2695. !     movew    sp@(26+4), sp@-
  2696. !     movew    sp@(22+6), sp@-
  2697. !     movew    sp@(18+8), sp@-
  2698. !     movew    sp@(14+10), sp@-
  2699.       trap    #14
  2700.       lea    sp@(14), sp
  2701.       moveml    sp@+, d2/a2
  2702. ***************
  2703. *** 458,477 ****
  2704.       .globl    _trap_14_wwwwwww
  2705.   _trap_14_wwwwwww:
  2706.       moveml    d2/a2, sp@-
  2707. !     movel    sp@(36), a1
  2708. !     movel    sp@(32), a0
  2709. !     movel    sp@(28), d1
  2710. !     movel    sp@(24), d0
  2711. !     movew    a1, sp@-
  2712. !     movew    a0, sp@-
  2713. !     movew    d1, sp@-
  2714. !     movew    d0, sp@-
  2715. !     movel    sp@(20+8), a0
  2716. !     movel    sp@(16+8), d1
  2717. !     movel    sp@(12+8), d0
  2718. !     movew    a0, sp@-
  2719. !     movew    d1, sp@-
  2720. !     movew    d0, sp@-
  2721.       trap    #14
  2722.       lea    sp@(14), sp
  2723.       moveml    sp@+, d2/a2
  2724. --- 434,446 ----
  2725.       .globl    _trap_14_wwwwwww
  2726.   _trap_14_wwwwwww:
  2727.       moveml    d2/a2, sp@-
  2728. !     movew    sp@(38), sp@-
  2729. !     movew    sp@(34+2), sp@-
  2730. !     movew    sp@(30+4), sp@-
  2731. !     movew    sp@(26+6), sp@-
  2732. !     movew    sp@(22+8), sp@-
  2733. !     movew    sp@(18+10), sp@-
  2734. !     movew    sp@(14+12), sp@-
  2735.       trap    #14
  2736.       lea    sp@(14), sp
  2737.       moveml    sp@+, d2/a2
  2738. ***************
  2739. *** 480,501 ****
  2740.       .globl    _trap_14_wllwwwww
  2741.   _trap_14_wllwwwww:
  2742.       moveml    d2/a2, sp@-
  2743. !     movel    sp@(40), a1
  2744. !     movel    sp@(36), a0
  2745. !     movel    sp@(32), d1
  2746. !     movel    sp@(28), d0
  2747. !     movew    a1, sp@-
  2748. !     movew    a0, sp@-
  2749. !     movew    d1, sp@-
  2750. !     movew    d0, sp@-
  2751. !     movel    sp@(24+8), a1
  2752. !     movel    sp@(20+8), a0
  2753. !     movel    sp@(16+8), d1
  2754. !     movel    sp@(12+8), d0
  2755. !     movew    a1, sp@-
  2756. !     movel    a0, sp@-
  2757. !     movel    d1, sp@-
  2758. !     movew    d0, sp@-
  2759.       trap    #14
  2760.       lea    sp@(20), sp
  2761.       moveml    sp@+, d2/a2
  2762. --- 449,462 ----
  2763.       .globl    _trap_14_wllwwwww
  2764.   _trap_14_wllwwwww:
  2765.       moveml    d2/a2, sp@-
  2766. !     movew    sp@(42), sp@-
  2767. !     movew    sp@(38+2), sp@-
  2768. !     movew    sp@(34+4), sp@-
  2769. !     movew    sp@(30+6), sp@-
  2770. !     movew    sp@(26+8), sp@-
  2771. !     movel    sp@(20+10), sp@-
  2772. !     movel    sp@(16+14), sp@-
  2773. !     movew    sp@(14+18), sp@-
  2774.       trap    #14
  2775.       lea    sp@(20), sp
  2776.       moveml    sp@+, d2/a2
  2777. ***************
  2778. *** 504,527 ****
  2779.       .globl    _trap_14_wllwwwwlw
  2780.   _trap_14_wllwwwwlw:
  2781.       moveml    d2/a2, sp@-
  2782. !     movel    sp@(44), a1
  2783. !     movel    sp@(40), a0
  2784. !     movel    sp@(36), d1
  2785. !     movel    sp@(32), d0
  2786. !     movew    a1, sp@-
  2787. !     movel    a0, sp@-
  2788. !     movew    d1, sp@-
  2789. !     movew    d0, sp@-
  2790. !     movel    sp@(28+10), a1
  2791. !     movel    sp@(24+10), a0
  2792. !     movel    sp@(20+10), d1
  2793. !     movel    sp@(16+10), d0
  2794. !     movel    sp@(12+10), d2
  2795. !     movew    a1, sp@-
  2796. !     movew    a0, sp@-
  2797. !     movel    d1, sp@-
  2798. !     movel    d0, sp@-
  2799. !     movew    d2, sp@-
  2800.       trap    #14
  2801.       lea    sp@(24), sp
  2802.       moveml    sp@+, d2/a2
  2803. --- 465,479 ----
  2804.       .globl    _trap_14_wllwwwwlw
  2805.   _trap_14_wllwwwwlw:
  2806.       moveml    d2/a2, sp@-
  2807. !     movew    sp@(46), sp@-
  2808. !     movel    sp@(40+2), sp@-
  2809. !     movew    sp@(38+6), sp@-
  2810. !     movew    sp@(34+8), sp@-
  2811. !     movew    sp@(30+10), sp@-
  2812. !     movew    sp@(26+12), sp@-
  2813. !     movel    sp@(20+14), sp@-
  2814. !     movel    sp@(16+18), sp@-
  2815. !     movew    sp@(14+22), sp@-
  2816.       trap    #14
  2817.       lea    sp@(24), sp
  2818.       moveml    sp@+, d2/a2
  2819. ***************
  2820. *** 530,555 ****
  2821.       .globl    _trap_14_wllwwwwwlw
  2822.   _trap_14_wllwwwwwlw:
  2823.       moveml    d2/a2, sp@-
  2824. !     movel    sp@(48), a1
  2825. !     movel    sp@(44), a0
  2826. !     movel    sp@(40), d1
  2827. !     movel    sp@(36), d0
  2828. !     movew    a1, sp@-
  2829. !     movel    a0, sp@-
  2830. !     movew    d1, sp@-
  2831. !     movew    d0, sp@-
  2832. !     movel    sp@(32+10), a1
  2833. !     movel    sp@(28+10), a0
  2834. !     movel    sp@(24+10), d1
  2835. !     movel    sp@(20+10), d0
  2836. !     movel    sp@(8+10), d2
  2837. !     movel    sp@(4+10), a2
  2838. !     movew    a1, sp@-
  2839. !     movew    a0, sp@-
  2840. !     movew    d1, sp@-
  2841. !     movel    d0, sp@-
  2842. !     movel    d2, sp@-
  2843. !     movew    a2, sp@-
  2844.       trap    #14
  2845.       lea    sp@(26), sp
  2846.       moveml    sp@+, d2/a2
  2847. --- 482,497 ----
  2848.       .globl    _trap_14_wllwwwwwlw
  2849.   _trap_14_wllwwwwwlw:
  2850.       moveml    d2/a2, sp@-
  2851. !     movew    sp@(50), sp@-
  2852. !     movel    sp@(44+2), sp@-
  2853. !     movew    sp@(42+6), sp@-
  2854. !     movew    sp@(38+8), sp@-
  2855. !     movew    sp@(34+10), sp@-
  2856. !     movew    sp@(30+12), sp@-
  2857. !     movew    sp@(26+14), sp@-
  2858. !     movel    sp@(20+16), sp@-
  2859. !     movel    sp@(16+20), sp@-
  2860. !     movew    sp@(14+24), sp@-
  2861.       trap    #14
  2862.       lea    sp@(26), sp
  2863.       moveml    sp@+, d2/a2
  2864. diff -cr ../mntlib34/pgrp.c ./pgrp.c
  2865. *** ../mntlib34/pgrp.c    Mon Jun  7 11:11:08 1993
  2866. --- ./pgrp.c    Mon Sep 13 06:08:20 1993
  2867. ***************
  2868. *** 45,51 ****
  2869.   _bsd_getpgrp(pid)
  2870.     int pid;
  2871.   {
  2872. !   if (__mint >= 103) return _bsd_setpgrp(pid, -1);
  2873.     return 0;
  2874.   }
  2875.   
  2876. --- 45,51 ----
  2877.   _bsd_getpgrp(pid)
  2878.     int pid;
  2879.   {
  2880. !   if (__mint >= 0x103) return _bsd_setpgrp(pid, -1);
  2881.     return 0;
  2882.   }
  2883.   
  2884. diff -cr ../mntlib34/putenv.c ./putenv.c
  2885. *** ../mntlib34/putenv.c    Sat Jun 19 12:37:58 1993
  2886. --- ./putenv.c    Mon Jul 12 04:38:56 1993
  2887. ***************
  2888. *** 7,12 ****
  2889. --- 7,13 ----
  2890.   #ifndef _COMPILER_H
  2891.   #include <compiler.h>
  2892.   #endif
  2893. + #include <support.h>
  2894.   
  2895.   extern char ** environ;
  2896.   
  2897. diff -cr ../mntlib34/scanf.c ./scanf.c
  2898. *** ../mntlib34/scanf.c    Tue Sep 22 20:01:52 1992
  2899. --- ./scanf.c    Mon Sep 13 11:11:10 1993
  2900. ***************
  2901. *** 53,59 ****
  2902.   #define FC_SIGN        3
  2903.   
  2904.   /* given transition,state do what action? */
  2905. ! int fp_do[][NSTATE] = {
  2906.   {F_INT,F_INT,F_INT,
  2907.        F_FRAC,F_FRAC,
  2908.        F_EXP,F_EXP,F_EXP},    /* see digit */
  2909. --- 53,59 ----
  2910.   #define FC_SIGN        3
  2911.   
  2912.   /* given transition,state do what action? */
  2913. ! const int fp_do[][NSTATE] = {
  2914.   {F_INT,F_INT,F_INT,
  2915.        F_FRAC,F_FRAC,
  2916.        F_EXP,F_EXP,F_EXP},    /* see digit */
  2917. ***************
  2918. *** 66,72 ****
  2919.        F_ESIGN,F_QUIT,F_QUIT},    /* see sign */
  2920.   };
  2921.   /* given transition,state what is new state? */
  2922. ! int fp_ns[][NSTATE] = {
  2923.   {FS_DIGS,FS_DIGS,FS_DIGS,
  2924.        FS_DD,FS_DD,
  2925.        FS_EDIGS,FS_EDIGS,FS_EDIGS},    /* see digit */
  2926. --- 66,72 ----
  2927.        F_ESIGN,F_QUIT,F_QUIT},    /* see sign */
  2928.   };
  2929.   /* given transition,state what is new state? */
  2930. ! const int fp_ns[][NSTATE] = {
  2931.   {FS_DIGS,FS_DIGS,FS_DIGS,
  2932.        FS_DD,FS_DD,
  2933.        FS_EDIGS,FS_EDIGS,FS_EDIGS},    /* see digit */
  2934. ***************
  2935. *** 79,86 ****
  2936.        FS_ESIGN,0,0},    /* see sign */
  2937.   };
  2938.   /* which states are valid terminators? */
  2939. ! int fp_sval[NSTATE] = {
  2940. !     0,0,1,0,1,0,0,1
  2941.   };
  2942.   #endif
  2943.   
  2944. --- 79,86 ----
  2945.        FS_ESIGN,0,0},    /* see sign */
  2946.   };
  2947.   /* which states are valid terminators? */
  2948. ! const int fp_sval[NSTATE] = {
  2949. !     0,0,1,0,1,1,1,1
  2950.   };
  2951.   #endif
  2952.   
  2953. ***************
  2954. *** 99,104 ****
  2955. --- 99,108 ----
  2956.   {
  2957.       register long n;
  2958.       register int c, width, lval, sval, cnt = 0, charcnt = 1;
  2959. + #ifdef PRINTF_LONGLONG
  2960. +     register int llval=0;
  2961. +     register long long lln;
  2962. + #endif
  2963.       int store, neg, base, wide1, endnull, rngflag, c2;
  2964.       register unsigned char *p = 0;
  2965.       unsigned char delim[128], digits[17], *q;
  2966. ***************
  2967. *** 123,128 ****
  2968. --- 127,136 ----
  2969.           wide1    = 1;
  2970.           base    = 10;
  2971.           lval    = FALSE;
  2972. + #ifdef PRINTF_LONGLONG
  2973. +         llval    = FALSE;
  2974. +         lln     = 0;
  2975. + #endif
  2976.           sval    = FALSE;
  2977.           store    = TRUE;
  2978.           endnull    = TRUE;
  2979. ***************
  2980. *** 153,158 ****
  2981. --- 161,170 ----
  2982.           goto fmtnxt;
  2983.           
  2984.             case 'l':    /* long data */
  2985. + #ifdef PRINTF_LONGLONG
  2986. +         if (lval)
  2987. +             llval = TRUE;
  2988. + #endif
  2989.           lval = TRUE;
  2990.             case 'h':    /* short data (for compatibility) */
  2991.           sval = TRUE;
  2992. ***************
  2993. *** 181,189 ****
  2994.             case 'u':    /* unsigned decimal */
  2995.             numfmt:                    skip();
  2996.           
  2997. !         if (isupper(*fmt))
  2998.               lval = TRUE;
  2999. !         
  3000.           if (!base)
  3001.           {
  3002.               base = 10;
  3003. --- 193,204 ----
  3004.             case 'u':    /* unsigned decimal */
  3005.             numfmt:                    skip();
  3006.           
  3007. !         if (isupper(*fmt)) {
  3008. ! #ifdef PRINTF_LONGLONG
  3009. !             if (lval) llval = TRUE;
  3010. ! #endif
  3011.               lval = TRUE;
  3012. !         }        
  3013.           if (!base)
  3014.           {
  3015.               base = 10;
  3016. ***************
  3017. *** 230,236 ****
  3018.           
  3019.           while (p && width-- && c)
  3020.           {
  3021. !             n = (n * base) + (p - digits);
  3022.               charcnt++;
  3023.               c = (*get)(ip);
  3024.             zeroin:
  3025. --- 245,256 ----
  3026.           
  3027.           while (p && width-- && c)
  3028.           {
  3029. ! #ifdef PRINTF_LONGLONG
  3030. !             if (llval)
  3031. !             lln = (lln * base) + (p - digits);
  3032. !             else
  3033. ! #endif
  3034. !             n = (n * base) + (p - digits);
  3035.               charcnt++;
  3036.               c = (*get)(ip);
  3037.             zeroin:
  3038. ***************
  3039. *** 245,259 ****
  3040.   #else
  3041.               p = ((unsigned char *) *args);
  3042.   #endif
  3043. !             if (neg == TRUE)
  3044. !             n = -n;
  3045. !             if (lval)
  3046. !             *((long*) p) = n;
  3047. !             else if (sval)
  3048. !             *((short *) p) = (short) n;
  3049.               else
  3050. !             *((int *) p) = (int) n;
  3051. !             ++cnt;
  3052.           }
  3053.           break;
  3054.           
  3055. --- 265,290 ----
  3056.   #else
  3057.               p = ((unsigned char *) *args);
  3058.   #endif
  3059. ! #ifdef PRINTF_LONGLONG
  3060. !             if (llval)
  3061. !             {
  3062. !             if (neg == TRUE)
  3063. !                 lln=-lln;
  3064. !             *((long long*) p) = lln;
  3065. !             }
  3066.               else
  3067. ! #endif
  3068. !             {
  3069. !             if (neg == TRUE)
  3070. !                 n = -n;
  3071. !             if (lval)
  3072. !                 *((long*) p) = n;
  3073. !             else if (sval)
  3074. !                 *((short *) p) = (short) n;
  3075. !             else
  3076. !                 *((int *) p) = (int) n;
  3077. !             ++cnt;
  3078. !             }
  3079.           }
  3080.           break;
  3081.           
  3082. diff -cr ../mntlib34/select.c ./select.c
  3083. *** ../mntlib34/select.c    Wed Jul  7 09:22:12 1993
  3084. --- ./select.c    Mon Sep 13 22:53:08 1993
  3085. ***************
  3086. *** 18,26 ****
  3087.      value under MiNT. A non-null pointer to a 0 valued struct means
  3088.      to poll; in MiNT we simulate this with a minimum timeout value.
  3089.    */
  3090. !     unsigned short mtime;
  3091.       int rval;
  3092.   
  3093.       if (timeout) {
  3094.           mtime = timeout->tv_sec * 1000 + timeout->tv_usec/1000;
  3095.           if (mtime == 0) mtime = 1;
  3096. --- 18,31 ----
  3097.      value under MiNT. A non-null pointer to a 0 valued struct means
  3098.      to poll; in MiNT we simulate this with a minimum timeout value.
  3099.    */
  3100. !     unsigned long mtime;
  3101. !     unsigned short stime;
  3102.       int rval;
  3103. +     long save_rfds = 0, save_wfds = 0, save_xfds = 0;
  3104.   
  3105. +     if (rfds) save_rfds = *rfds;
  3106. +     if (wfds) save_wfds = *wfds;
  3107. +     if (xfds) save_xfds = *xfds;
  3108.       if (timeout) {
  3109.           mtime = timeout->tv_sec * 1000 + timeout->tv_usec/1000;
  3110.           if (mtime == 0) mtime = 1;
  3111. ***************
  3112. *** 28,37 ****
  3113.       else
  3114.           mtime = 0;
  3115.   
  3116. !     rval = Fselect(mtime, rfds, wfds, xfds);
  3117. !     if (rval < 0) {
  3118.           errno = -rval;
  3119.           return -1;
  3120. !     }
  3121. !     return rval;
  3122.   }
  3123. --- 33,60 ----
  3124.       else
  3125.           mtime = 0;
  3126.   
  3127. !     /* Unfortunately, Fselect can only handle at most 65535ms timeout.
  3128. !        We have to loop for a bigger timeout. */
  3129. !     for (;;)
  3130. !       {
  3131. !         if (mtime > 65535)
  3132. !           stime = 65535;
  3133. !         else
  3134. !           stime = mtime;
  3135. !         mtime -= stime;
  3136. !         rval = Fselect (stime, rfds, wfds, xfds);
  3137. !         if (rval < 0)
  3138. !           {
  3139.           errno = -rval;
  3140.           return -1;
  3141. !           }
  3142. !         if (rval == 0 && mtime > 0)
  3143. !           {
  3144. !         if (rfds) *rfds = save_rfds;
  3145. !         if (wfds) *wfds = save_wfds;
  3146. !         if (xfds) *xfds = save_xfds;
  3147. !           }
  3148. !         else
  3149. !           return rval;
  3150. !       }
  3151.   }
  3152. diff -cr ../mntlib34/setjmp.cpp ./setjmp.cpp
  3153. *** ../mntlib34/setjmp.cpp    Wed Jun  9 05:10:28 1993
  3154. --- ./setjmp.cpp    Wed Sep  8 22:20:20 1993
  3155. ***************
  3156. *** 18,48 ****
  3157.   _sigsetjmp:
  3158.       movel    sp@(4), a0        | address of sigjmp_buf[]
  3159.   #ifdef __MSHORT__
  3160. !     movew    sp@(8), d0
  3161. !     extl    d0
  3162.   #else
  3163. !     movel    sp@(8), d0
  3164.   #endif
  3165. !     movel    d0, a0@(56)        | save sigmask for siglongjmp?
  3166.       beq    SETJMP            | no -- call common code
  3167. !     movel    Sigmask, a0@(52)    | save tos emulation signal mask
  3168.   #ifdef __MSHORT__
  3169.       tstw    Mint            | see if MiNT is active
  3170.   #else
  3171.       tstl    Mint
  3172.   #endif
  3173. !     beq    SETJMP            | no -- call common code
  3174. !     movel    #0, sp@-        | add no signals to sigmask
  3175.       movew    #0x116, sp@-        | Psigblock() system call
  3176.       trap    #1            |
  3177.       addqw    #6, sp
  3178. !     movel    d0, a0@(52)        | save MiNT signal mask
  3179. !     jmp    SETJMP            | call common code
  3180.   
  3181.       .globl _setjmp
  3182.   _setjmp:
  3183.       movel    sp@(4),a0        | address of jmp_buf[]
  3184. !     movel    #0, a0@(56)        | do not restore sigmask on longjmp
  3185.   SETJMP:
  3186.       movel    sp@,a0@            | save return address
  3187.       moveml    d2-d7/a2-a7,a0@(4)    | save registers d2-d7/a2-a7
  3188. --- 18,49 ----
  3189.   _sigsetjmp:
  3190.       movel    sp@(4), a0        | address of sigjmp_buf[]
  3191.   #ifdef __MSHORT__
  3192. !     movew    sp@(8), a1
  3193.   #else
  3194. !     movel    sp@(8), a1
  3195.   #endif
  3196. !     movel    a1, a0@(52)        | save sigmask for siglongjmp?
  3197.       beq    SETJMP            | no -- call common code
  3198. !     movel    Sigmask, d0        | save tos emulation signal mask
  3199.   #ifdef __MSHORT__
  3200.       tstw    Mint            | see if MiNT is active
  3201.   #else
  3202.       tstl    Mint
  3203.   #endif
  3204. !     beq    nomint            | no -- call common code
  3205. !     clrl    sp@-            | add no signals to sigmask
  3206.       movew    #0x116, sp@-        | Psigblock() system call
  3207.       trap    #1            |
  3208.       addqw    #6, sp
  3209. ! nomint:
  3210. !     orw    #1,d0            | make it != 0 (SIGNULL is unmaskable)
  3211. !     movel    d0, a0@(52)        | save signal mask
  3212. !     bra    SETJMP            | call common code
  3213.   
  3214.       .globl _setjmp
  3215.   _setjmp:
  3216.       movel    sp@(4),a0        | address of jmp_buf[]
  3217. !     clrl    a0@(52)            | do not restore sigmask on longjmp
  3218.   SETJMP:
  3219.       movel    sp@,a0@            | save return address
  3220.       moveml    d2-d7/a2-a7,a0@(4)    | save registers d2-d7/a2-a7
  3221. ***************
  3222. *** 64,72 ****
  3223.       addqw    #2, sp
  3224.   NOMINT:
  3225.       movel    sp@(4),a0        | address of jmp_buf[]
  3226. !     tstl    a0@(56)            | want to restore sigmask?
  3227.       beq    NORESTORE        | no -- skip restore code
  3228. !     movel    a0@(52), Sigmask    | restore tos emulation signal mask
  3229.   #ifdef __MSHORT__
  3230.       tstw    Mint            | see if MiNT is active
  3231.   #else
  3232. --- 65,74 ----
  3233.       addqw    #2, sp
  3234.   NOMINT:
  3235.       movel    sp@(4),a0        | address of jmp_buf[]
  3236. !     movel    a0@(52),d0        | want to restore sigmask?
  3237.       beq    NORESTORE        | no -- skip restore code
  3238. !     andw    #-2,d0
  3239. !     movel    d0, Sigmask        | restore tos emulation signal mask
  3240.   #ifdef __MSHORT__
  3241.       tstw    Mint            | see if MiNT is active
  3242.   #else
  3243. ***************
  3244. *** 73,79 ****
  3245.       tstl    Mint
  3246.   #endif
  3247.       beq    NORESTORE        | no -- do not call sigsetmask
  3248. !     movel    a0@(52), sp@-        | restore signal mask
  3249.       movew    #0x117, sp@-        | Psigsetmask() system call
  3250.       trap    #1            |
  3251.       addqw    #6, sp
  3252. --- 75,81 ----
  3253.       tstl    Mint
  3254.   #endif
  3255.       beq    NORESTORE        | no -- do not call sigsetmask
  3256. !     movel    d0, sp@-        | restore signal mask
  3257.       movew    #0x117, sp@-        | Psigsetmask() system call
  3258.       trap    #1            |
  3259.       addqw    #6, sp
  3260. ***************
  3261. *** 84,90 ****
  3262.       movel    sp@(8),d0        | value to return
  3263.   #endif
  3264.       bne    L1            | may not be 0
  3265. !     movl    #1, d0
  3266.   L1:
  3267.       moveml    a0@(4),d2-d7/a2-a7    | restore saved reggies
  3268.       movl    a0@,sp@            | and the saved return address
  3269. --- 86,92 ----
  3270.       movel    sp@(8),d0        | value to return
  3271.   #endif
  3272.       bne    L1            | may not be 0
  3273. !     movql    #1, d0
  3274.   L1:
  3275.       moveml    a0@(4),d2-d7/a2-a7    | restore saved reggies
  3276.       movl    a0@,sp@            | and the saved return address
  3277. diff -cr ../mntlib34/sigactio.c ./sigactio.c
  3278. *** ../mntlib34/sigactio.c    Tue Jul  6 08:04:36 1993
  3279. --- ./sigactio.c    Sun Jul 18 08:20:38 1993
  3280. ***************
  3281. *** 6,12 ****
  3282.   #include <signal.h>
  3283.   
  3284.   /* vector of signal handlers (for TOS, or for MiNT with -mshort) */
  3285. ! extern __Sigfunc _sig_handler[NSIG];
  3286.   
  3287.   #ifdef __MSHORT__
  3288.   typedef void __CDECL (*__KerSigfunc) __PROTO((long));
  3289. --- 6,12 ----
  3290.   #include <signal.h>
  3291.   
  3292.   /* vector of signal handlers (for TOS, or for MiNT with -mshort) */
  3293. ! extern __Sigfunc _sig_handler[__NSIG];
  3294.   
  3295.   #ifdef __MSHORT__
  3296.   typedef void __CDECL (*__KerSigfunc) __PROTO((long));
  3297. ***************
  3298. *** 29,75 ****
  3299.           struct ksigact {
  3300.               __KerSigfunc    sa_handler;    /* pointer to signal handler */
  3301.               long        sa_mask;    /* additional signals masked during delivery */
  3302. !             union {
  3303. !                 short    kernel;
  3304. !                 int        posix;
  3305. !             } sa_flags;        /* signal specific flags, kernel */
  3306. !         } temp;
  3307. !         
  3308.   #ifdef __MSHORT__
  3309.   /* NOTE: MiNT passes 32 bit numbers for signals, so we want our
  3310.    * own signal dispatcher to switch these to 16 bit ints
  3311.    */
  3312. -         if (sig < 0 || sig >= NSIG) {
  3313. -             errno = ERANGE;
  3314. -             return -1;
  3315. -         }
  3316.           oldfunc = _sig_handler[sig];
  3317.           if (act) {
  3318. !             temp = *(struct ksigact *)act;
  3319. !             _sig_handler[sig] = (__Sigfunc)temp.sa_handler;
  3320.               if (_sig_handler[sig] != SIG_DFL && _sig_handler[sig] != SIG_IGN) {
  3321. !                 temp.sa_handler = _trampoline;
  3322.               }
  3323. !             act = (struct sigaction *)&temp;
  3324.           }
  3325. ! #else
  3326. !         if (act) {
  3327. !             temp = *(struct ksigact *)act;    /* dept. of sleaze */
  3328. !             temp.sa_flags.kernel = temp.sa_flags.posix;
  3329. !             act = (struct sigaction *)&temp;
  3330.           }
  3331. ! #endif
  3332. !         r = Psigaction(sig, act, oact);
  3333.   #ifdef __MSHORT__
  3334. !         if (oact && oact->sa_handler == (__Sigfunc) _trampoline)
  3335. !             oact->sa_handler = oldfunc;
  3336.   #else
  3337. !         if (oact)
  3338. !             oact->sa_flags = ((struct ksigact *)oact)->sa_flags.kernel;
  3339.   #endif
  3340. -         if (r < 0) {
  3341. -             errno = (int) -r;
  3342. -             return -1;
  3343.           }
  3344.       }
  3345.       else {
  3346. --- 29,75 ----
  3347.           struct ksigact {
  3348.               __KerSigfunc    sa_handler;    /* pointer to signal handler */
  3349.               long        sa_mask;    /* additional signals masked during delivery */
  3350. !             short        sa_flags;    /* signal specific flags, kernel */
  3351. !         } kact, koact;
  3352. !         if (sig < 0 || sig >= __NSIG) {
  3353. !             errno = ERANGE;
  3354. !             return -1;
  3355. !         }
  3356.   #ifdef __MSHORT__
  3357.   /* NOTE: MiNT passes 32 bit numbers for signals, so we want our
  3358.    * own signal dispatcher to switch these to 16 bit ints
  3359.    */
  3360.           oldfunc = _sig_handler[sig];
  3361. + #endif
  3362.           if (act) {
  3363. !             kact.sa_handler = (__KerSigfunc) act->sa_handler;
  3364. !             kact.sa_mask = act->sa_mask.__sigset_data[0];
  3365. !             kact.sa_flags = (short) act->sa_flags;
  3366. ! #ifdef __MSHORT__
  3367. !             _sig_handler[sig] = (__Sigfunc)kact.sa_handler;
  3368.               if (_sig_handler[sig] != SIG_DFL && _sig_handler[sig] != SIG_IGN) {
  3369. !                 kact.sa_handler = _trampoline;
  3370.               }
  3371. ! #endif
  3372.           }
  3373. !         r = Psigaction(sig, (act ? &kact : 0L), (oact ? &koact : 0L));
  3374. !         if (r < 0) {
  3375. !             errno = (int) -r;
  3376. !             return -1;
  3377.           }
  3378. !         if (oact) {
  3379. !             oact->sa_mask.__sigset_data[0] = koact.sa_mask;
  3380. !             oact->sa_flags = (int) koact.sa_flags;
  3381.   #ifdef __MSHORT__
  3382. !             oact->sa_handler =
  3383. !               ((koact.sa_handler == (__KerSigfunc) _trampoline)
  3384. !                ? oldfunc
  3385. !                : (__Sigfunc) koact.sa_handler);
  3386.   #else
  3387. !             oact->sa_handler = (__Sigfunc) koact.sa_handler;
  3388.   #endif
  3389.           }
  3390.       }
  3391.       else {
  3392. ***************
  3393. *** 89,95 ****
  3394.               oact->sa_handler = oldfunc;
  3395.               /* we could do something useful with sa_mask when __mint */
  3396.               oact->sa_flags = 0;
  3397. !             oact->sa_mask = 0;
  3398.           }
  3399.       }
  3400.       return 0;
  3401. --- 89,95 ----
  3402.               oact->sa_handler = oldfunc;
  3403.               /* we could do something useful with sa_mask when __mint */
  3404.               oact->sa_flags = 0;
  3405. !             oact->sa_mask.__sigset_data[0] = 0;
  3406.           }
  3407.       }
  3408.       return 0;
  3409. ***************
  3410. *** 103,109 ****
  3411.     int idx;
  3412.     int pos;
  3413.   
  3414. !   if ((!set) || (signo >= NSIG)) {
  3415.       errno = EINVAL;
  3416.       return -1;
  3417.     }
  3418. --- 103,109 ----
  3419.     int idx;
  3420.     int pos;
  3421.   
  3422. !   if ((!set) || (signo >= __NSIG)) {
  3423.       errno = EINVAL;
  3424.       return -1;
  3425.     }
  3426. ***************
  3427. *** 121,127 ****
  3428.     int idx;
  3429.     int pos;
  3430.   
  3431. !   if ((!set) || (signo >= NSIG)) {
  3432.       errno = EINVAL;
  3433.       return -1;
  3434.     }
  3435. --- 121,127 ----
  3436.     int idx;
  3437.     int pos;
  3438.   
  3439. !   if ((!set) || (signo >= __NSIG)) {
  3440.       errno = EINVAL;
  3441.       return -1;
  3442.     }
  3443. ***************
  3444. *** 171,177 ****
  3445.     int idx;
  3446.     int pos;
  3447.   
  3448. !   if ((!set) || (signo >= NSIG)) {
  3449.       errno = EINVAL;
  3450.       return -1;
  3451.     }
  3452. --- 171,177 ----
  3453.     int idx;
  3454.     int pos;
  3455.   
  3456. !   if ((!set) || (signo >= __NSIG)) {
  3457.       errno = EINVAL;
  3458.       return -1;
  3459.     }
  3460. diff -cr ../mntlib34/sozobon/linea.s ./sozobon/linea.s
  3461. *** ../mntlib34/sozobon/linea.s    Thu Jun 17 04:47:50 1993
  3462. --- ./sozobon/linea.s    Mon Sep 13 06:13:04 1993
  3463. ***************
  3464. *** 3,16 ****
  3465.       .bss
  3466.   
  3467.       .globl ___aline
  3468. ! ;___aline:
  3469. ! ;    .ds.l    1
  3470.       .globl ___fonts
  3471. ! ;___fonts:
  3472. ! ;    .ds.b    1
  3473.       .globl ___funcs
  3474. ! ;___funcs:
  3475. ! ;    .ds.l    1
  3476.   
  3477.       .text
  3478.   
  3479. --- 3,16 ----
  3480.       .bss
  3481.   
  3482.       .globl ___aline
  3483. ! ___aline:
  3484. !     .ds.l    1
  3485.       .globl ___fonts
  3486. ! ___fonts:
  3487. !     .ds.l    1
  3488.       .globl ___funcs
  3489. ! ___funcs:
  3490. !     .ds.l    1
  3491.   
  3492.       .text
  3493.   
  3494. diff -cr ../mntlib34/sozobon/makefile ./sozobon/makefile
  3495. *** ../mntlib34/sozobon/makefile    Mon Jun  7 10:23:18 1993
  3496. --- ./sozobon/makefile    Mon Sep 13 06:18:44 1993
  3497. ***************
  3498. *** 31,42 ****
  3499.   # Unfortunately, there is an optimizer bug in 1.40 that bites here; if
  3500.   # you're using that version, you must use the non-optimizing version.
  3501.   CFLAGS = -O -D__NO_FLOAT__ -DNDEBUG $(SHORTNAMES)
  3502. ! #NOOPT = -D__NO_FLOAT__ -DNDEBUG $(SHORTNAMES)    # without debugging
  3503. ! NOOPT = $(CFLAGS)                # with debugging
  3504.   
  3505.   # If you prefer more "standard" Unix-like names for your library files, use
  3506.   # the alternate definitions of CRT0 and LIBC -- assuming, of course, that
  3507. ! # your cc has been modified to recognize those names!
  3508.   # CRT0 = crt0.o
  3509.   # LIBC = libc.a
  3510.   CRT0 = dstart.o
  3511. --- 31,42 ----
  3512.   # Unfortunately, there is an optimizer bug in 1.40 that bites here; if
  3513.   # you're using that version, you must use the non-optimizing version.
  3514.   CFLAGS = -O -D__NO_FLOAT__ -DNDEBUG $(SHORTNAMES)
  3515. ! #NOOPT = -D__NO_FLOAT__ -DNDEBUG $(SHORTNAMES)    # without optimizing
  3516. ! NOOPT = $(CFLAGS)                # with optimizing
  3517.   
  3518.   # If you prefer more "standard" Unix-like names for your library files, use
  3519.   # the alternate definitions of CRT0 and LIBC -- assuming, of course, that
  3520. ! # you have a cc that recognizes those names!
  3521.   # CRT0 = crt0.o
  3522.   # LIBC = libc.a
  3523.   CRT0 = dstart.o
  3524. ***************
  3525. *** 47,60 ****
  3526.   
  3527.   # These are in alphabetical order to make it easy to find one.
  3528.   OBJECTS = \
  3529. !     abort.o abs.o access.o alarm.o alglobal.o alloca.o alphasor.o \
  3530.       atexit.o atol.o \
  3531.       bcmp.o bcopy.o binmode.o bsearch.o bzero.o \
  3532.       calloc.o chdir.o chmod.o clock.o close.o console.o crtinit.o \
  3533. !     ctermid.o ctime.o ctype.o \
  3534.       defmode.o difftime.o dirent.o doprnt.o dup.o \
  3535.       eprintf.o exec.o execp.o\
  3536. !     fclose.o fcntl.o fdopen.o fflush.o fgetc.o fgets.o filbuf.o \
  3537.       findfile.o fopen.o fopenp.o fork.o fprintf.o fputc.o fputs.o \
  3538.       fread.o frwbin.o fscanf.o fseek.o fsetpos.o ftw.o fungetc.o \
  3539.       fwrite.o \
  3540. --- 47,60 ----
  3541.   
  3542.   # These are in alphabetical order to make it easy to find one.
  3543.   OBJECTS = \
  3544. !     abort.o abs.o access.o alarm.o alloca.o alphasor.o \
  3545.       atexit.o atol.o \
  3546.       bcmp.o bcopy.o binmode.o bsearch.o bzero.o \
  3547.       calloc.o chdir.o chmod.o clock.o close.o console.o crtinit.o \
  3548. !     ctermid.o ctime.o ctype.o cuserid.o\
  3549.       defmode.o difftime.o dirent.o doprnt.o dup.o \
  3550.       eprintf.o exec.o execp.o\
  3551. !     fclose.o fcntl.o fdopen.o fflush.o ffs.o fgetc.o fgets.o filbuf.o \
  3552.       findfile.o fopen.o fopenp.o fork.o fprintf.o fputc.o fputs.o \
  3553.       fread.o frwbin.o fscanf.o fseek.o fsetpos.o ftw.o fungetc.o \
  3554.       fwrite.o \
  3555. diff -cr ../mntlib34/sozobon/readme ./sozobon/readme
  3556. *** ../mntlib34/sozobon/readme    Sun Jun  6 05:57:34 1993
  3557. --- ./sozobon/readme    Mon Sep 13 06:18:46 1993
  3558. ***************
  3559. *** 1,4 ****
  3560. ! MiNT library for Heat-n-Serve/Sozobon C, patchlevel 30
  3561.   
  3562.   This is a port of Eric Smith's MiNT library to Heat-n-Serve C, based on
  3563.   Dave Gymer's original port.  It replaces the files dlibs.a, dstart.o,
  3564. --- 1,4 ----
  3565. ! MiNT library for Heat-n-Serve/Sozobon C, patchlevel 34
  3566.   
  3567.   This is a port of Eric Smith's MiNT library to Heat-n-Serve C, based on
  3568.   Dave Gymer's original port.  It replaces the files dlibs.a, dstart.o,
  3569. ***************
  3570. *** 64,72 ****
  3571.       directory.
  3572.   
  3573.   3)  Edit osbind.h from the MiNT include distribution.  Find the macro
  3574. !     definition for trap_14_wllwwwwwlw(), spanning lines 830-874 (or
  3575. !     thereabouts).  Delete every scrap of white space you can from this
  3576. !     macro.  Otherwise, it overruns HSC's static line buffer.
  3577.   
  3578.   4)  Replace the gemfast.h from the MiNT distribution with the gemfast.h
  3579.       from the Heat-n-Serve distribution (the GEMfast that comes with
  3580. --- 64,73 ----
  3581.       directory.
  3582.   
  3583.   3)  Edit osbind.h from the MiNT include distribution.  Find the macro
  3584. !     definitions for trap_14_wllwwwwwlw(), spanning lines 1309-1349 and
  3585. !     1456-1500 (or thereabouts).  Delete every scrap of white space you
  3586. !     can from these macros.  Otherwise, they overrun HSC's static line
  3587. !     buffer.
  3588.   
  3589.   4)  Replace the gemfast.h from the MiNT distribution with the gemfast.h
  3590.       from the Heat-n-Serve distribution (the GEMfast that comes with
  3591. diff -cr ../mntlib34/spawn.c ./spawn.c
  3592. *** ../mntlib34/spawn.c    Sat Jun 19 12:20:58 1993
  3593. --- ./spawn.c    Mon Sep 13 22:59:12 1993
  3594. ***************
  3595. *** 20,25 ****
  3596. --- 20,34 ----
  3597.      uo, 3.5.93, throw away some static characterarrays (path[] and
  3598.      cmd[]).
  3599.   
  3600. +    10 Jul 1993 ole
  3601. +    added emulation for script execution.
  3602. +    This feature is controlable by the Environment variable "UNIXMODE".
  3603. +    The switch 's' in UNIXMODE says that executable text files with a
  3604. +    hash as their first character are interpretable.
  3605. +    Files which have only '#'  as their first character are interpreted
  3606. +    using /bin/sh
  3607. +    Files which have i.e '#!/usr/bin/awk -f' as their first character
  3608. +    are interpreted with "/usr/bin/awk -f <file>"
  3609.   */
  3610.   
  3611.   #include    <stdarg.h>
  3612. ***************
  3613. *** 32,37 ****
  3614. --- 41,47 ----
  3615.   #include    <time.h>
  3616.   #include    <string.h>
  3617.   #include    <unistd.h>
  3618. + #include    <support.h>
  3619.   #include    "lib.h"
  3620.   
  3621.   #define TOS_ARGS 126
  3622. ***************
  3623. *** 39,64 ****
  3624.   extern char **environ;
  3625.   extern int __mint;
  3626.   
  3627.   
  3628. ! int
  3629. ! _spawnve(mode, _path, argv, envp)
  3630. !     int    mode;
  3631. !     char    *_path;
  3632.       char    **argv;
  3633.       char    **envp;
  3634.   {
  3635.       char        path[MAXPATHLEN];
  3636.       char        cmd[TOS_ARGS + 1];
  3637.       size_t        cmlen;
  3638.       size_t        enlen = 0;
  3639.       size_t        left, min_left;
  3640. !     char        *p;
  3641.       char        *s, *t;
  3642.       char        *env;
  3643.       long        rval;
  3644. !     char *pconv, *pc, *tmp;
  3645.       size_t len, cnt;
  3646.       int i, done;
  3647.   
  3648.       if (mode != P_WAIT && mode != P_OVERLAY && mode != P_NOWAIT) {
  3649.           errno = EINVAL;
  3650. --- 49,227 ----
  3651.   extern char **environ;
  3652.   extern int __mint;
  3653.   
  3654. + /* comment this out, if you don't want script execution */
  3655. + #define HASH_BANG
  3656.   
  3657. ! #ifdef HASH_BANG
  3658. ! static char *extensions[] = { "ttp", "prg", "tos", NULL };
  3659. ! static int interpret_script __PROTO((int mode, char *path, 
  3660. !                     char **argv, char **envp));
  3661. ! static int
  3662. ! interpret_script(mode, path, argv, envp)
  3663. !     int        mode;
  3664. !     char    *path;
  3665.       char    **argv;
  3666.       char    **envp;
  3667.   {
  3668. +     char    shellpath[MAXPATHLEN];
  3669. +     char    tmppath[MAXPATHLEN];
  3670. +     char    args[TOS_ARGS + 1];
  3671. +     char    *shell;
  3672. +     char    *shellargs;
  3673. +     char    **shellargv;
  3674. +     int        nargcount;
  3675. +     int        fd;
  3676. +     int        argcount;
  3677. +     int        i, rv;
  3678. +     char    buf;
  3679. +     
  3680. +     /* path is already converted to dos */
  3681. +     if ((fd = (int)Fopen(path, 0)) < 0)
  3682. +         return -fd;
  3683. +     if (Fread(fd, 1L, &buf) != 1L) {
  3684. +         Fclose(fd);
  3685. +         return -1;
  3686. +     }
  3687. +     if (buf == '#') {
  3688. +         if (Fread(fd, 1L, &buf) != 1L) {
  3689. +             Fclose(fd);
  3690. +             return -1;
  3691. +         }
  3692. +         if (buf == '!') {
  3693. +             /* skip blanks */
  3694. +             do {
  3695. +                 if (Fread(fd, 1L, &buf) != 1L) {
  3696. +                     Fclose(fd);
  3697. +                     return -1;
  3698. +                 }
  3699. +             } while (buf == ' ' || buf == '\t');
  3700. +             /* read filename */
  3701. +             for (i = 0; i < MAXPATHLEN; i++) {
  3702. +                 if (buf == ' ' || buf == '\t' ||
  3703. +                         buf == '\r' || buf == '\n')
  3704. +                     break;
  3705. +                 shellpath[i] = buf;
  3706. +                 if (Fread(fd, 1L, &buf) != 1L) {
  3707. +                     Fclose(fd);
  3708. +                     return -1;
  3709. +                 }
  3710. +             }
  3711. +             shellpath[i] = '\0';
  3712. +             shell = shellpath;
  3713. +             /* 
  3714. +              * read arguments if any
  3715. +              * maximum is TOS_ARGS (only restricted for my comfort :-)
  3716. +              */
  3717. +             nargcount = 0;
  3718. +             i = 0;
  3719. +             while(i < TOS_ARGS && buf != '\r' && buf != '\n') {
  3720. +                 /* skip blanks */
  3721. +                 do {
  3722. +                     if (Fread(fd, 1L, &buf) != 1L) {
  3723. +                         Fclose(fd);
  3724. +                         return -1;
  3725. +                     }
  3726. +                 } while (buf == ' ' || buf == '\t');
  3727. +                 if (buf == '\r' || buf == '\n')
  3728. +                     break;
  3729. +                 
  3730. +                 while ( buf != ' '  && buf != '\t' &&
  3731. +                         buf != '\r' && buf != '\n' && i < TOS_ARGS) {
  3732. +                     args[i++] = buf;
  3733. +                     if (Fread(fd, 1L, &buf) != 1L) {
  3734. +                         Fclose(fd);
  3735. +                         return -1;
  3736. +                     }
  3737. +                 }
  3738. +                 args[i++] = '\0';
  3739. +                 nargcount++;
  3740. +             }
  3741. +             args[i] = '\0';
  3742. +             shellargs    = args;
  3743. +         }
  3744. +         else {
  3745. +             shell = "/bin/sh";
  3746. +             nargcount = 0;
  3747. +             args[0] = '\0';
  3748. +             shellargs = args;
  3749. +         }
  3750. +         Fclose(fd);
  3751. +         
  3752. +         if (*shell) {
  3753. +             shell = buffindfile(shell, getenv("PATH"), extensions, tmppath);
  3754. +             if (!shell) {
  3755. +                 errno = ENOENT;
  3756. +                 return -1;        /* file not found */
  3757. +             }
  3758. +             /* count old args */
  3759. +             for (i = 0; argv[i] != 0; i++);
  3760. +             argcount = i;
  3761. +             
  3762. +             shellargv = (char **)Malloc((argcount + nargcount + 2) * sizeof(char *));
  3763. +             if (!shellargv) {
  3764. +                 errno = ENOMEM;
  3765. +                 return -1;
  3766. +             }
  3767. +             
  3768. +             i = 0;
  3769. +             shellargv[i++] = shell;
  3770. +             while(*shellargs != '\0') {
  3771. +                 shellargv[i++] = shellargs;
  3772. +                 while (*shellargs++ != '\0');
  3773. +             }
  3774. +     
  3775. +             while (*argv != NULL)
  3776. +                 shellargv[i++] = *argv++;
  3777. +             shellargv[i] = NULL;
  3778. +             
  3779. +             rv = _spawnve(mode, shell, shellargv, envp);
  3780. +             (void)Mfree(shellargv);
  3781. +             return rv;
  3782. +         }
  3783. +     }
  3784. +     return -1;
  3785. + }
  3786. + #endif /* HASH_BANG */
  3787. + int
  3788. + _spawnve(mode, _path, argv, envp)
  3789. + int    mode;
  3790. + const char    *_path;
  3791. + char    *const *argv;
  3792. + char    *const *envp;
  3793. + {
  3794.       char        path[MAXPATHLEN];
  3795.       char        cmd[TOS_ARGS + 1];
  3796.       size_t        cmlen;
  3797.       size_t        enlen = 0;
  3798.       size_t        left, min_left;
  3799. !     const char    *p;
  3800.       char        *s, *t;
  3801.       char        *env;
  3802.       long        rval;
  3803. !     const char *pconv, *pc, *tmp;
  3804.       size_t len, cnt;
  3805.       int i, done;
  3806. + #ifdef HASH_BANG
  3807. +     char        **_envp;
  3808. +     char        **_argv;
  3809. + #endif
  3810.   
  3811.       if (mode != P_WAIT && mode != P_OVERLAY && mode != P_NOWAIT) {
  3812.           errno = EINVAL;
  3813. ***************
  3814. *** 68,73 ****
  3815. --- 231,241 ----
  3816.       if (!envp)
  3817.           envp = environ;
  3818.   
  3819. + #ifdef HASH_BANG
  3820. +         _envp = envp;
  3821. +         _argv = argv;
  3822. + #endif
  3823.   /* try to find PCONVERT environment variable */
  3824.       for (i = 0; (pconv = envp[i]) != 0; i++) {
  3825.           if (! strncmp(pconv, "PCONVERT=", 9)) {
  3826. ***************
  3827. *** 203,209 ****
  3828.           unsigned long null_params = 0;
  3829.           int digits, i;
  3830.           unsigned long idx, val;
  3831. !         char **ap;
  3832.           
  3833.           /* communicate empty arguments thru ARGV= value
  3834.            */
  3835. --- 371,377 ----
  3836.           unsigned long null_params = 0;
  3837.           int digits, i;
  3838.           unsigned long idx, val;
  3839. !         char *const *ap;
  3840.           
  3841.           /* communicate empty arguments thru ARGV= value
  3842.            */
  3843. ***************
  3844. *** 242,250 ****
  3845.                   }
  3846.                   
  3847.                   left -= digits + 2; /* 2 = sizeof( ',' in NULL:
  3848. !                              * list + ' ' we put in place
  3849. !                              * of empty params
  3850. !                              */
  3851.                   if (left < min_left)
  3852.                       goto need_more_core;
  3853.               }
  3854. --- 410,418 ----
  3855.                   }
  3856.                   
  3857.                   left -= digits + 2; /* 2 = sizeof( ',' in NULL:
  3858. !                                       * list + ' ' we put in place
  3859. !                                      * of empty params
  3860. !                                      */
  3861.                   if (left < min_left)
  3862.                       goto need_more_core;
  3863.               }
  3864. ***************
  3865. *** 262,268 ****
  3866.               *s++ = ' ';    /* replace by space */
  3867.           } else {
  3868.                do {
  3869. !             *s++ = *p++;
  3870.                } while (*p);
  3871.           }
  3872.           *s++ = '\0';
  3873. --- 430,436 ----
  3874.               *s++ = ' ';    /* replace by space */
  3875.           } else {
  3876.                do {
  3877. !                 *s++ = *p++;
  3878.                } while (*p);
  3879.           }
  3880.           *s++ = '\0';
  3881. ***************
  3882. *** 273,279 ****
  3883.   /* s points at the environment's copy of the args */
  3884.   /* t points at the command line copy to be put in the basepage */
  3885.   
  3886. !         cmlen = 0;
  3887.       if (argv && *argv) {
  3888.           t++;
  3889.           while (*++argv) {
  3890. --- 441,447 ----
  3891.   /* s points at the environment's copy of the args */
  3892.   /* t points at the command line copy to be put in the basepage */
  3893.   
  3894. !     cmlen = 0;
  3895.       if (argv && *argv) {
  3896.           t++;
  3897.           while (*++argv) {
  3898. ***************
  3899. *** 290,304 ****
  3900.                    }
  3901.               } else {
  3902.                    do {
  3903. !                               if (cmlen < TOS_ARGS) {
  3904. !                                       *t++ = *p; cmlen++;
  3905. !                               }
  3906. !                 *s++ = *p++;
  3907.                    } while (*p);
  3908.               }
  3909. !                         if (cmlen < TOS_ARGS && *(argv+1)) {
  3910. !                                 *t++ = ' '; cmlen++;
  3911. !                         }
  3912.               *s++ = '\0';
  3913.           }
  3914.   /*                *cmd = (char) cmlen;  NOT ANY MORE */
  3915. --- 458,472 ----
  3916.                    }
  3917.               } else {
  3918.                    do {
  3919. !                     if (cmlen < TOS_ARGS) {
  3920. !                         *t++ = *p; cmlen++;
  3921. !                     }
  3922. !                     *s++ = *p++;
  3923.                    } while (*p);
  3924.               }
  3925. !             if (cmlen < TOS_ARGS && *(argv+1)) {
  3926. !                 *t++ = ' '; cmlen++;
  3927. !             }
  3928.               *s++ = '\0';
  3929.           }
  3930.   /*                *cmd = (char) cmlen;  NOT ANY MORE */
  3931. ***************
  3932. *** 324,329 ****
  3933. --- 492,509 ----
  3934.       {
  3935.           errno = (int) -rval;
  3936.           rval = -1;
  3937. + #ifdef HASH_BANG
  3938. +         if (errno == ENOEXEC) {
  3939. +             char    *umode;
  3940. +              /* try to find UNIXMODE in environment */
  3941. +             if ((umode = getenv("UNIXMODE")) != NULL &&
  3942. +                     strchr(umode, 's') != NULL ) {
  3943. +                 (void)Mfree(env);
  3944. +                 return interpret_script(mode, path, _argv, _envp);
  3945. +             }
  3946. +         }
  3947. + #endif
  3948.       }
  3949.       else if (mode == P_OVERLAY)
  3950.       /* note that we get here only if MiNT is not active! */
  3951. ***************
  3952. *** 331,333 ****
  3953. --- 511,528 ----
  3954.       (void)Mfree(env);
  3955.       return (int) rval;
  3956.   }
  3957. + #ifdef TEST
  3958. + int
  3959. + main (int argc, char **argv, char **envp)
  3960. + {
  3961. +     if (argc == 2) {
  3962. +         if (spawnve(P_WAIT, argv[1], &argv[1], envp) < 0) {
  3963. +             perror("spawn failed");
  3964. +             return errno;
  3965. +         }
  3966. +         return 0;
  3967. +     }
  3968. +     return 1;
  3969. + }
  3970. + #endif
  3971. diff -cr ../mntlib34/spawnve.c ./spawnve.c
  3972. *** ../mntlib34/spawnve.c    Tue Apr 16 07:51:18 1991
  3973. --- ./spawnve.c    Thu Sep  9 16:00:20 1993
  3974. ***************
  3975. *** 11,19 ****
  3976.   int
  3977.   spawnve(mode, path, argv, envp)
  3978.       int    mode;
  3979. !     char    *path;
  3980. !     char    **argv;
  3981. !     char    **envp;
  3982.   {
  3983.       return _spawnve(mode, path, argv, envp);
  3984.   }
  3985. --- 11,19 ----
  3986.   int
  3987.   spawnve(mode, path, argv, envp)
  3988.       int    mode;
  3989. !     const char *path;
  3990. !     char    *const *argv;
  3991. !     char    *const *envp;
  3992.   {
  3993.       return _spawnve(mode, path, argv, envp);
  3994.   }
  3995. ***************
  3996. *** 21,34 ****
  3997.   int
  3998.   spawnv(mode, path, argv)
  3999.       int mode;
  4000. !     char *path;
  4001. !     char **argv;
  4002.   {
  4003.       return _spawnve(mode, path, argv, environ);
  4004.   }
  4005.   
  4006.   #ifdef __STDC__
  4007. ! int spawnle(int mode, char *path, ...)
  4008.   #else
  4009.   int spawnle(mode, path)
  4010.       int    mode;
  4011. --- 21,34 ----
  4012.   int
  4013.   spawnv(mode, path, argv)
  4014.       int mode;
  4015. !     const char *path;
  4016. !     char *const *argv;
  4017.   {
  4018.       return _spawnve(mode, path, argv, environ);
  4019.   }
  4020.   
  4021.   #ifdef __STDC__
  4022. ! int spawnle(int mode, const char *path, ...)
  4023.   #else
  4024.   int spawnle(mode, path)
  4025.       int    mode;
  4026. ***************
  4027. *** 49,55 ****
  4028.   }
  4029.   
  4030.   #ifdef __STDC__
  4031. ! int spawnl(int mode, char *path, ...)
  4032.   #else
  4033.   int spawnl(mode, path)
  4034.       int    mode;
  4035. --- 49,55 ----
  4036.   }
  4037.   
  4038.   #ifdef __STDC__
  4039. ! int spawnl(int mode, const char *path, ...)
  4040.   #else
  4041.   int spawnl(mode, path)
  4042.       int    mode;
  4043. diff -cr ../mntlib34/spawnvp.c ./spawnvp.c
  4044. *** ../mntlib34/spawnvp.c    Tue May 25 11:43:18 1993
  4045. --- ./spawnvp.c    Thu Sep  9 16:00:24 1993
  4046. ***************
  4047. *** 15,29 ****
  4048.   #include <support.h>
  4049.   #include <limits.h>
  4050.   
  4051. ! static char *extensions[] = { "ttp", "prg", "tos", NULL };
  4052.   
  4053.   #ifdef __STDC__
  4054. ! int spawnvp(int mode, char *name, char **argv)
  4055.   #else
  4056.   int spawnvp(mode, name, argv) int mode; char *name; char **argv;
  4057.   #endif
  4058.   {
  4059. !     char *execname;
  4060.         char buffer[PATH_MAX];
  4061.         execname = buffindfile(name, getenv("PATH"), extensions,buffer);
  4062.       if (!execname) {
  4063. --- 15,29 ----
  4064.   #include <support.h>
  4065.   #include <limits.h>
  4066.   
  4067. ! static char *const extensions[] = { "ttp", "prg", "tos", NULL };
  4068.   
  4069.   #ifdef __STDC__
  4070. ! int spawnvp(int mode, const char *name, char *const *argv)
  4071.   #else
  4072.   int spawnvp(mode, name, argv) int mode; char *name; char **argv;
  4073.   #endif
  4074.   {
  4075. !     const char *execname;
  4076.         char buffer[PATH_MAX];
  4077.         execname = buffindfile(name, getenv("PATH"), extensions,buffer);
  4078.       if (!execname) {
  4079. ***************
  4080. *** 34,40 ****
  4081.   }
  4082.   
  4083.   #ifdef __STDC__
  4084. ! int spawnlp(int mode, char *name, ...)
  4085.   #else
  4086.   int spawnlp(mode, name) int mode; char *name;
  4087.   #endif
  4088. --- 34,40 ----
  4089.   }
  4090.   
  4091.   #ifdef __STDC__
  4092. ! int spawnlp(int mode, const char *name, ...)
  4093.   #else
  4094.   int spawnlp(mode, name) int mode; char *name;
  4095.   #endif
  4096. diff -cr ../mntlib34/statfs.c ./statfs.c
  4097. *** ../mntlib34/statfs.c    Fri Jun 11 02:00:12 1993
  4098. --- ./statfs.c    Mon Sep 13 23:05:20 1993
  4099. ***************
  4100. *** 11,16 ****
  4101. --- 11,17 ----
  4102.   #include <mintbind.h>
  4103.   #include <unistd.h> /* for chdir, getcwd */
  4104.   #include <limits.h> /* for PATH_MAX */
  4105. + #include <support.h>
  4106.   #ifdef __TURBOC__
  4107.   #include <sys\statfs.h>
  4108.   #else
  4109. ***************
  4110. *** 20,26 ****
  4111.   extern int __mint;
  4112.   
  4113.   int statfs(path, buf)
  4114. !   char *path;
  4115.     struct statfs *buf;
  4116.   {
  4117.     int r;
  4118. --- 21,27 ----
  4119.   extern int __mint;
  4120.   
  4121.   int statfs(path, buf)
  4122. !   const char *path;
  4123.     struct statfs *buf;
  4124.   {
  4125.     int r;
  4126. ***************
  4127. *** 33,38 ****
  4128. --- 34,40 ----
  4129.       short increment;
  4130.       long res1, res2, res3, res4;
  4131.     } mfsinfo;
  4132. +   char _path[PATH_MAX];
  4133.   
  4134.     if (!buf || !path)
  4135.     {
  4136. ***************
  4137. *** 52,58 ****
  4138.    * Also f_type is 1 for V1 filesystems and 2 for V2 (it
  4139.    * is zero for TOS).
  4140.    */
  4141. !   if(Dcntl(0x104,path, (long) &mfsinfo)==0)
  4142.     {
  4143.       buf->f_type = 1+mfsinfo.version;
  4144.       buf->f_bsize = 1024;
  4145. --- 54,61 ----
  4146.    * Also f_type is 1 for V1 filesystems and 2 for V2 (it
  4147.    * is zero for TOS).
  4148.    */
  4149. !   _unx2dos (path, _path);
  4150. !   if(Dcntl(0x104,_path, (long) &mfsinfo)==0)
  4151.     {
  4152.       buf->f_type = 1+mfsinfo.version;
  4153.       buf->f_bsize = 1024;
  4154. diff -cr ../mntlib34/symlink.c ./symlink.c
  4155. *** ../mntlib34/symlink.c    Sun May 23 09:03:10 1993
  4156. --- ./symlink.c    Thu Jul 15 08:01:36 1993
  4157. ***************
  4158. *** 4,9 ****
  4159. --- 4,10 ----
  4160.   #include <errno.h>
  4161.   #include <string.h>
  4162.   #include <limits.h>
  4163. + #include <unistd.h>
  4164.   #include "lib.h"
  4165.   
  4166.   extern int __mint;
  4167. Only in .: sync.c
  4168. diff -cr ../mntlib34/sysconf.c ./sysconf.c
  4169. *** ../mntlib34/sysconf.c    Sun Feb 28 13:08:04 1993
  4170. --- ./sysconf.c    Wed Sep  8 19:06:10 1993
  4171. ***************
  4172. *** 62,68 ****
  4173.       }
  4174.       switch(var) {
  4175.       case _PC_LAST:
  4176. !         return 3;
  4177.       case _PC_IOPEN_MAX:
  4178.           return 45; /* -ish, maybe... */
  4179.       case _PC_LINK_MAX:
  4180. --- 62,68 ----
  4181.       }
  4182.       switch(var) {
  4183.       case _PC_LAST:
  4184. !         return 4;
  4185.       case _PC_IOPEN_MAX:
  4186.           return 45; /* -ish, maybe... */
  4187.       case _PC_LINK_MAX:
  4188. diff -cr ../mntlib34/thread.c ./thread.c
  4189. *** ../mntlib34/thread.c    Sat Jun 19 12:12:04 1993
  4190. --- ./thread.c    Mon Sep 13 06:19:18 1993
  4191. ***************
  4192. *** 38,44 ****
  4193.   /* and this is used to retrieve the child's time */
  4194.   long __waittime = 0;
  4195.   
  4196. ! __EXTERN static void __CDECL startup __PROTO((BASEPAGE *));
  4197.   
  4198.   static void __CDECL
  4199.   startup(b)
  4200. --- 38,44 ----
  4201.   /* and this is used to retrieve the child's time */
  4202.   long __waittime = 0;
  4203.   
  4204. ! static void __CDECL startup __PROTO((BASEPAGE *));
  4205.   
  4206.   static void __CDECL
  4207.   startup(b)
  4208. ***************
  4209. *** 46,52 ****
  4210.   {
  4211.       register int (*func) __PROTO((long));
  4212.       register long arg;
  4213. -     extern void _setstack();    /* in crt0.s */
  4214.   
  4215.   #ifdef __TURBOC__
  4216.       extern void *_StkLim;    /* avoid stack checking */
  4217. --- 46,51 ----
  4218. diff -cr ../mntlib34/uname.c ./uname.c
  4219. *** ../mntlib34/uname.c    Sat Sep  5 22:12:10 1992
  4220. --- ./uname.c    Sun Sep 12 20:13:24 1993
  4221. ***************
  4222. *** 29,35 ****
  4223.    * get operating system information; must execute in supervisor mode
  4224.    */
  4225.   
  4226. ! static void
  4227.   getinfo()
  4228.   {
  4229.       long *cookie, *sysbase;
  4230. --- 29,37 ----
  4231.    * get operating system information; must execute in supervisor mode
  4232.    */
  4233.   
  4234. ! static long getinfo __PROTO((void));
  4235. ! static long
  4236.   getinfo()
  4237.   {
  4238.       long *cookie, *sysbase;
  4239. ***************
  4240. *** 49,54 ****
  4241. --- 51,57 ----
  4242.   /* get TOS version number */
  4243.       sysbase = *((long **)(0x4f2L));
  4244.       tosvers = (int)(sysbase[0] & 0x0000ffff);
  4245. +     return 0;
  4246.   }
  4247.   
  4248.   #define HILO(x) (int) ((x >> 8) & 255), (int) (x & 255)
  4249. diff -cr ../mntlib34/unx2dos.c ./unx2dos.c
  4250. *** ../mntlib34/unx2dos.c    Sun Jun 20 09:20:34 1993
  4251. --- ./unx2dos.c    Mon Sep 13 07:20:00 1993
  4252. ***************
  4253. *** 30,36 ****
  4254.           u += 5;
  4255.       /* make /dev/A/foo the same as A:/foo */
  4256.   
  4257. !         if (*u && (u[1] == 0 || (u[1] == '/' || u[1] == '\\'))) {
  4258.               d[0] = *u++;
  4259.               d[1] = ':';
  4260.               d += 2;
  4261. --- 30,37 ----
  4262.           u += 5;
  4263.       /* make /dev/A/foo the same as A:/foo */
  4264.   
  4265. !         if (*u && isalpha (*u)
  4266. !             && (u[1] == 0 || (u[1] == '/' || u[1] == '\\'))) {
  4267.               d[0] = *u++;
  4268.               d[1] = ':';
  4269.               d += 2;
  4270. diff -cr ../mntlib34/utime.c ./utime.c
  4271. *** ../mntlib34/utime.c    Tue Jun  1 06:40:12 1993
  4272. --- ./utime.c    Wed Sep  8 14:57:32 1993
  4273. ***************
  4274. *** 19,24 ****
  4275. --- 19,25 ----
  4276.   #include <mintbind.h>
  4277.   #include <ioctl.h>
  4278.   #include <assert.h>
  4279. + #include <unistd.h>
  4280.   #ifdef __TURBOC__
  4281.   #include <sys\types.h>
  4282.   #else
  4283. ***************
  4284. *** 87,95 ****
  4285.       }
  4286.   
  4287.       res = -EINVAL;
  4288. !     if (__mint > 90)
  4289. !         res = Fcntl(fh, (long)&settime, FUTIME);
  4290.       if (res == -EINVAL)
  4291.           (void)Fdatime((_DOSTIME *) &dtime, fh, 1);
  4292.   
  4293. --- 88,99 ----
  4294.       }
  4295.   
  4296.       res = -EINVAL;
  4297. !     if (__mint > 90) {
  4298. !         if (tset)
  4299. !             res = Fcntl(fh, (long)&settime, FUTIME);
  4300. !         else
  4301. !             res = Fcntl(fh, (long)0, FUTIME);
  4302. !     }
  4303.       if (res == -EINVAL)
  4304.           (void)Fdatime((_DOSTIME *) &dtime, fh, 1);
  4305.   
  4306. diff -cr ../mntlib34/utmp.c ./utmp.c
  4307. *** ../mntlib34/utmp.c    Sat Jun 19 12:48:48 1993
  4308. --- ./utmp.c    Thu Jul 15 08:19:20 1993
  4309. ***************
  4310. *** 10,16 ****
  4311.   
  4312.   #define UTMP_FILE    "/etc/utmp"
  4313.   
  4314. ! void write_utmp(line, name, host, time)
  4315.   const char *line, *name, *host;
  4316.   unsigned long time;
  4317.   {
  4318. --- 10,16 ----
  4319.   
  4320.   #define UTMP_FILE    "/etc/utmp"
  4321.   
  4322. ! void _write_utmp(line, name, host, time)
  4323.   const char *line, *name, *host;
  4324.   unsigned long time;
  4325.   {
  4326. ***************
  4327. *** 23,29 ****
  4328.   
  4329.       if ((fd = open(UTMP_FILE, O_RDWR)) == -1)
  4330.       {
  4331. !         perror("write_utmp");
  4332.           return;
  4333.       }
  4334.   
  4335. --- 23,29 ----
  4336.   
  4337.       if ((fd = open(UTMP_FILE, O_RDWR)) == -1)
  4338.       {
  4339. !         perror("_write_utmp");
  4340.           return;
  4341.       }
  4342.   
  4343. ***************
  4344. *** 40,46 ****
  4345.   
  4346.       if (lseek(fd, (long)(counter * sizeof(struct utmp)), 0) == -1)
  4347.       {
  4348. !         perror("write_utmp: lseek");
  4349.           close(fd);
  4350.           return;
  4351.       }
  4352. --- 40,46 ----
  4353.   
  4354.       if (lseek(fd, (long)(counter * sizeof(struct utmp)), 0) == -1)
  4355.       {
  4356. !         perror("_write_utmp: lseek");
  4357.           close(fd);
  4358.           return;
  4359.       }
  4360. ***************
  4361. *** 59,70 ****
  4362.       entry.ut_time = time;
  4363.   
  4364.       if ((returned_val = write(fd, &entry, (unsigned) sizeof(struct utmp))) == -1)
  4365. !         perror("write_utmp: write");
  4366.       else
  4367.           if (returned_val != sizeof(struct utmp))
  4368. !             fprintf(stderr, "write_utmp: write: wrote too few bytes!\n");
  4369.   #ifdef DEBUG
  4370. !     printf("write_utmp: wrote %d bytes\n", returned_val);
  4371.   #endif
  4372.       close(fd);
  4373.   }
  4374. --- 59,70 ----
  4375.       entry.ut_time = time;
  4376.   
  4377.       if ((returned_val = write(fd, &entry, (unsigned) sizeof(struct utmp))) == -1)
  4378. !         perror("_write_utmp: write");
  4379.       else
  4380.           if (returned_val != sizeof(struct utmp))
  4381. !             fprintf(stderr, "_write_utmp: write: wrote too few bytes!\n");
  4382.   #ifdef DEBUG
  4383. !     printf("_write_utmp: wrote %d bytes\n", returned_val);
  4384.   #endif
  4385.       close(fd);
  4386.   }
  4387. diff -cr ../mntlib34/wait.c ./wait.c
  4388. *** ../mntlib34/wait.c    Sun May 16 06:40:46 1993
  4389. --- ./wait.c    Mon Sep 13 06:59:22 1993
  4390. ***************
  4391. *** 12,23 ****
  4392.   /* under TOS, vfork() puts its result in __waitval */
  4393.   extern long __waitval;    /* in thread.c */
  4394.   
  4395. ! pid_t wait(status)
  4396. !     int *status;
  4397.   {
  4398.       long r;
  4399.       int exit_status, sig_term, pid;
  4400.       extern int __mint;
  4401.   
  4402.       if (__mint == 0) {    /* wait is faked by vfork() */
  4403.           r = __waitval;
  4404. --- 12,28 ----
  4405.   /* under TOS, vfork() puts its result in __waitval */
  4406.   extern long __waitval;    /* in thread.c */
  4407.   
  4408. ! pid_t wait(_status)
  4409. !     __WP _status;
  4410.   {
  4411.       long r;
  4412.       int exit_status, sig_term, pid;
  4413.       extern int __mint;
  4414. + #ifdef __GNUC__    
  4415. +     int *status = _status.__wi;
  4416. + #else    
  4417. +     int *status = _status;
  4418. + #endif
  4419.   
  4420.       if (__mint == 0) {    /* wait is faked by vfork() */
  4421.           r = __waitval;
  4422. ***************
  4423. *** 40,42 ****
  4424. --- 45,59 ----
  4425.       }
  4426.       return pid;
  4427.   }
  4428. + #ifdef TEST
  4429. + /* small test for parameter of wait */
  4430. + void a()
  4431. + {
  4432. +     union wait u;
  4433. +     int i;
  4434. +     
  4435. +     wait(&u);
  4436. +     wait(&i);
  4437. + }
  4438. + #endif
  4439. diff -cr ../mntlib34/waitpid.c ./waitpid.c
  4440. *** ../mntlib34/waitpid.c    Sun May 16 06:47:18 1993
  4441. --- ./waitpid.c    Mon Sep 13 06:58:12 1993
  4442. ***************
  4443. *** 14,28 ****
  4444.   extern long __waitval;        /* in thread.c */
  4445.   
  4446.   pid_t
  4447. ! waitpid(pid, status, options)
  4448.       pid_t pid;
  4449. !     int *status;
  4450.       int options;
  4451.   {
  4452.       long r;
  4453.       int exit_status, sig_term;
  4454.       union wait *statwait;
  4455.       statwait = (union wait *) status;
  4456.       if (__mint == 0) {
  4457.           r = __waitval;
  4458. --- 14,29 ----
  4459.   extern long __waitval;        /* in thread.c */
  4460.   
  4461.   pid_t
  4462. ! waitpid(pid, _status, options)
  4463.       pid_t pid;
  4464. !     __WP _status;
  4465.       int options;
  4466.   {
  4467.       long r;
  4468.       int exit_status, sig_term;
  4469.       union wait *statwait;
  4470. !     int *status = _status.__wi;
  4471. !     
  4472.       statwait = (union wait *) status;
  4473.       if (__mint == 0) {
  4474.           r = __waitval;
  4475. diff -cr ../mntlib34/wtmp.c ./wtmp.c
  4476. *** ../mntlib34/wtmp.c    Sat Jun 19 12:49:00 1993
  4477. --- ./wtmp.c    Thu Jul 15 08:18:58 1993
  4478. ***************
  4479. *** 10,16 ****
  4480.   
  4481.   #define WTMP_FILE    "/var/adm/wtmp"
  4482.   
  4483. ! void write_wtmp(line, name, host, time)
  4484.   const char *line, *name, *host;
  4485.   unsigned long time;
  4486.   {
  4487. --- 10,16 ----
  4488.   
  4489.   #define WTMP_FILE    "/var/adm/wtmp"
  4490.   
  4491. ! void _write_wtmp(line, name, host, time)
  4492.   const char *line, *name, *host;
  4493.   unsigned long time;
  4494.   {
  4495. ***************
  4496. *** 20,26 ****
  4497.       if ((fd = open(WTMP_FILE, O_WRONLY | O_APPEND)) < 0)
  4498.       {
  4499.   #ifdef DEBUG
  4500. !         perror("write_wtmp");
  4501.   #endif
  4502.           return;
  4503.       }
  4504. --- 20,26 ----
  4505.       if ((fd = open(WTMP_FILE, O_WRONLY | O_APPEND)) < 0)
  4506.       {
  4507.   #ifdef DEBUG
  4508. !         perror("_write_wtmp");
  4509.   #endif
  4510.           return;
  4511.       }
  4512.