home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-02-19 | 29.4 KB | 1,099 lines |
- diff -c ../mntlib27/a64l.c ./a64l.c
- *** ../mntlib27/a64l.c Thu Jan 14 10:37:02 1993
- --- ./a64l.c Sat Feb 13 03:45:54 1993
- ***************
- *** 14,19 ****
- --- 14,20 ----
- a64l, l64a - convert between long integer and base-64 ASCII string
-
- SYNOPSIS
- + #include <support.h>
- long a64l(const char *s);
- char *l64a(long l);
-
- diff -c ../mntlib27/access.c ./access.c
- *** ../mntlib27/access.c Sat Sep 5 07:03:50 1992
- --- ./access.c Sat Feb 13 10:17:54 1993
- ***************
- *** 20,29 ****
- if (mode == F_OK)
- return 0; /* existence test succeeded */
-
- /* somewhat crufty code -- relies on R_OK, etc. matching the bits in the
- file mode, but what the heck, we can do this
- */
- ! if (__mint < 9 || ( geteuid() == sb.st_uid ) ) {
- if ( ((sb.st_mode >> 6) & mode) == mode )
- return 0;
- else
- --- 20,31 ----
- if (mode == F_OK)
- return 0; /* existence test succeeded */
-
- + if (getuid() == 0) return 0; /* super user can access anything */
- +
- /* somewhat crufty code -- relies on R_OK, etc. matching the bits in the
- file mode, but what the heck, we can do this
- */
- ! if (__mint < 9 || ( getuid() == sb.st_uid ) ) {
- if ( ((sb.st_mode >> 6) & mode) == mode )
- return 0;
- else
- ***************
- *** 30,36 ****
- goto accdn;
- }
-
- ! if ( getegid() == sb.st_gid ) {
- if ( ((sb.st_mode >> 3) & mode) == mode )
- return 0;
- else
- --- 32,38 ----
- goto accdn;
- }
-
- ! if ( getgid() == sb.st_gid ) {
- if ( ((sb.st_mode >> 3) & mode) == mode )
- return 0;
- else
- diff -c ../mntlib27/alarm.c ./alarm.c
- *** ../mntlib27/alarm.c Sat Sep 5 07:11:32 1992
- --- ./alarm.c Fri Feb 19 09:25:30 1993
- ***************
- *** 4,9 ****
- --- 4,10 ----
-
- #include <errno.h>
- #include <mintbind.h>
- + #include <limits.h>
-
- extern int __mint;
-
- ***************
- *** 14,26 ****
- long r;
-
- if (__mint == 0)
- ! r = -EINVAL;
- ! else
- ! r = Talarm((long)secs);
-
- - if (r < 0) {
- - errno = - (int)r;
- - r = -1;
- - }
- return (unsigned int) r;
- }
- --- 15,26 ----
- long r;
-
- if (__mint == 0)
- ! return 0;
- ! #ifndef __MSHORT__
- ! if (secs > ((unsigned int) (LONG_MAX/1000)))
- ! secs = ((unsigned int) (LONG_MAX/1000));
- ! #endif
- ! r = Talarm((long) secs);
-
- return (unsigned int) r;
- }
- diff -c ../mntlib27/bugs ./bugs
- *** ../mntlib27/bugs Wed Feb 10 07:11:42 1993
- --- ./bugs Fri Feb 19 09:18:44 1993
- ***************
- *** 18,74 ****
- up at some time, i.e. do we stop supporting MiNT before 0.8 or 0.9?
- Some obvious candidates are killpg.c and unx2dos.c.
-
- ! a64l.c: ++boender
- ! Include `#include <support.h>' in the man page, just above the
- ! prototype. I know few people will notice, but I try to keep
- ! things in sync with my Pure-C helpfile.
- !
- ! access.c: ++boender
- ! My System V.3 manpages state `access checks for accessibility, using
- ! the real user ID in place of the effective user ID and the real group
- ! ID in place of the effective group ID.'.
- ! The access() in the mintlibs uses the effective user ID and the
- ! effective group ID. Could you check your UN*X manpages to see
- ! whether this is a BSD vs. AT&T difference or if the mintlibs
- ! got it wrong? Fixing this would of course be trivial.
- !
- ! alarm.c: ++boender
- ! This call will fail when used in 32-bit mode (gcc -mlong) with a
- ! value >= 2^31, since this will result in an `enquire' call to
- ! Talarm(). I think these calls should be filtered out. Just
- ! checking "if ((long)secs < 0) {return _EINVAL;}" should do the trick.
- ! Dynix manual pages also state that "the largest allowed value is
- ! 2^31".
-
- bsearch.c: ++entropy
- Someone on the net said the args were wrong; it looks right to me.
- What's the problem?
-
- ! clock.c: ++boender
- ! This function is hopelessly different from the UNIX version, since
- ! it returns time elapsed since the program started, and not the CPU
- ! time used by the process and its children that have terminated so
- ! far. Also, the time units used are different. This may be hard to
- ! fix...
- !
- ! getcwd.c: ++boender
- ! This function would be easier to implement using the Dgetcwd() call
- ! available since MiNT 0.96. Since that function does better checking
- ! anyway (it will not overflow the buffer if the path doesn't fit),
- ! testing "if (__mint <= 95) {old-code} else {Dgetcwd()}" would be
- ! a Good Thing.
-
- getopt.c, unistd.h: ++boender
- The three externally usable variables defined in getopt.c should be
- included in <unistd.h>, where getopt() is declared too. These
- are: 'extern char *optarg', 'extern int opterr' and 'extern int optind'.
-
- - Not really a bug. Leave it this way because UNIX doesn't have these
- - vars in any headers either.
- -
- - getpass.c: ++entropy
- - getpass() reads from stdin, should read /dev/tty like UNIX.
- -
- getuid.c: ++boender, ++entropy
- Under UNIX Sys VR3 (didn't check SunOS), setpgrp() takes no parameters
- and sets the process group ID of the calling process to its own process
- --- 18,55 ----
- up at some time, i.e. do we stop supporting MiNT before 0.8 or 0.9?
- Some obvious candidates are killpg.c and unx2dos.c.
-
- ! alarm.c: ++entropy
- ! alarm() will silently "round down" any requested time greater than 2
- ! million "or so" seconds. Most UNIXes allow much larger maximum values
- ! (usually LONG_MAX). MiNT needs this extremely small maximum value because
- ! wakeup scheduling is calculated in milliseconds by the kernel. This
- ! cannot be fixed without changing MiNT. alarm() does not work at all under
- ! TOS.
-
- bsearch.c: ++entropy
- Someone on the net said the args were wrong; it looks right to me.
- What's the problem?
-
- ! clock.c: ++boender, ++entropy
- ! clock() is currently implemented as an alias for _clock(), which makes it
- ! hopelessly different from the UNIX version, since it returns time elapsed
- ! since the program started, and not the CPU time used by the process and
- ! its children that have terminated so far. Also, the time units used are
- ! different (200 Hz ticks instead of microseconds). When clock() is fixed,
- ! CLOCKS_PER_SEC in time.h will need to be changed, as ANSI specifies that
- ! clock()/CLOCKS_PER_SEC gives the CPU time used, in seconds, since the
- ! beginning of execution. It may be a good idea to change CLK_TCK to agree,
- ! or maybe CLK_TCK should be used for the actual 200 Hz hardware tick, and
- ! change only CLOCKS_PER_SEC. CLK_TCK is used in times.c. CLOCKS_PER_SEC
- ! is used in sleep.c.
-
- getopt.c, unistd.h: ++boender
- The three externally usable variables defined in getopt.c should be
- included in <unistd.h>, where getopt() is declared too. These
- are: 'extern char *optarg', 'extern int opterr' and 'extern int optind'.
- + [Not really a bug. Leave it this way because UNIX doesn't have these
- + vars in any headers either. -entropy]
-
- getuid.c: ++boender, ++entropy
- Under UNIX Sys VR3 (didn't check SunOS), setpgrp() takes no parameters
- and sets the process group ID of the calling process to its own process
- ***************
- *** 113,129 ****
- Could test for (r != x) instead of (r < 0) just to be safe, in setuid() and
- setgid().
-
- ! kill.c: ++boender, ++entropy
- On UNIX (SysV), system processes (PID 0 and 1) are treated specially.
- ! This is somewhat different under MiNT, where init(1), if run at all,
- ! need not have PID 1. PID 0 is already treated in the correct manner by
- ! Pkill().
- ! and 1 definitely deserve special treatment
- ! under MiNT in any case, because killing MiNT is a bad idea, and shooting
- ! signals at MiNT's child process (be it init(1), or some shell, or whatever)
- ! isn't likely to
-
- ! Check behavior against UNIX (SysV).
-
- The man page for the MiNT call Pkill() forgets to mention that
- either the effective user ID of the caller must be zero (super-user) or
- --- 94,109 ----
- Could test for (r != x) instead of (r < 0) just to be safe, in setuid() and
- setgid().
-
- ! kill.c: ++boender, ++entropy
- On UNIX (SysV), system processes (PID 0 and 1) are treated specially.
- ! This is somewhat different under MiNT, where init(1), if run at all, need
- ! not have PID 1. PID 0 is already treated in the correct manner by
- ! Pkill(). PID 1 really deserves special treatment under MiNT in any case,
- ! because shooting signals at MiNT's child process (be it init(1), or some
- ! shell, or whatever) isn't likely to have the expected results. I'm not
- ! sure if this can reasonably be resolved in the library alone.
-
- ! [Check behavior against UNIX (SysV). -entropy]
-
- The man page for the MiNT call Pkill() forgets to mention that
- either the effective user ID of the caller must be zero (super-user) or
- ***************
- *** 159,181 ****
- - void pause(void)
- - void sigpause(long mask)
-
- ! sleep.c: ++boender
- ! The TOS version of these routine uses clock(). This may cause
- ! trouble is clock() is ever repaired.
- ! The MiNT version of these routines repeatedly calls Fselect().
- ! This had better be re-implemented using Psigpause(), since
- ! on UN*X, any caught signal causes sleep() to be stopped early,
- ! with the "unslept" amount of time as return value.
- ! Currently, the mintlibs sleep() the full amount of time, then
- ! return zero. This is a bug.
- ! usleep() is of type void. This may not be correct: it is
- ! of type unsigned on UN*X, and should be of type unsigned
- ! long in the mintlibs.
- ! I'll rewrite these functions if you feel they should be changed.
- !
- ! support.h: ++boender
- ! Would it be possible to define link(), symlink(), etc. to take
- ! `const char *' parameters, or will MiNT need to be changed for that?
-
- system.c: ++boender
- Currently, this function emulates the UN*X function, including
- --- 139,149 ----
- - void pause(void)
- - void sigpause(long mask)
-
- ! sleep.c: ++boender, ++entropy
- ! usleep() is of type void. This may not be correct: it is of type
- ! unsigned on UN*X, and should be of type unsigned long in the mintlibs.
- ! usleep() is not interruptable by signals (is it on UNIX?). sleep() is
- ! only interruptable with 1-second granularity.
-
- system.c: ++boender
- Currently, this function emulates the UN*X function, including
- ***************
- *** 187,195 ****
- out what a user means by "/bin" on a tos file system, and so on. The
- current scheme is more likely to work for more users more of the time...
- -entropy]
- -
- - times.c: ++entropy
- - Also uses clock(). (See clock.c, sleep.c).
-
- utime.c: ++boender
- stime(): My System V.3 manual state that `The stime() call will
- --- 155,160 ----
- diff -c ../mntlib27/changes ./changes
- *** ../mntlib27/changes Thu Feb 11 11:54:28 1993
- --- ./changes Fri Feb 19 09:22:34 1993
- ***************
- *** 4,9 ****
- --- 4,62 ----
- Changes are listed in *reverse* order, most recent changes being
- first.
-
- + PATCHLEVEL28::
- +
- + a64l.c: ++boender@dutiws.twi.tudelft.nl
- + Add to comments a note that prototypes are in support.h.
- + alarm.c: ++boender, ++entropy
- + If requested time is greater than MiNT can handle, "round down" to
- + (LONG_MAX/1000) seconds, to prevent unexpected "inquiry" calls to
- + Talarm() (or even possible crashes). This is only relevant if long
- + integers are used, since (USHRT_MAX < (LONG_MAX/1000)). Do NOT set
- + errno if an error results (the only error that can be recognized,
- + anyway, is that alarm() was called when MiNT was not active. In
- + this case, 0 is returned and no alarm is set.)
- + getpass.c:
- + Read password from /dev/tty, instead of stdin, if MiNT is active.
- + link.c, symlink.c, support.h:
- + Functions link(), symlink() now take "const char *" instead of
- + "char *" parmeters.
- + getcwd.c: ++boender, ++entropy
- + Use Dgetcwd() when running on MiNT 0.96 or newer.
- + limits.h: ++jrb (bammi@cadence.com)
- + Fix definition of INT_MIN, evidently casting it to float didn't work
- + with the old (equivalent) value.
- + stdlib.h: ++jrb
- + Changed alloca macro for better parameter checking.
- + eprintf.c: ++jrb
- + Make _say() a function instead of a macro.
- + fwrite.c, linea.c: ++jrb
- + Some stuff I missed in patchlevel 26.
- + vdiesc1.h: ++jrb
- + DELETED file, seems this was some leftover temp file, everything in
- + it is already in vdibind.h.
- + access.c: ++boender, ++entropy
- + Use real, not effective, user id's for access() checks.
- + Fix so access() always returns success on existing files if real
- + user id is 0 (root), regardless of file mode.
- + stat.c: ++ers
- + Fix so stat("foo\\") is equivalent to stat("foo"), under TOS.
- + unx2dos.c: ++hohmuth
- + Support unx2dos() and dos2unx() on non-GCC compilers (to the minimal
- + extent to which they are supported on GCC).
- + sleep.c: ++entropy, ++boender
- + Allow sleep() to be interrupted by signals under MiNT (0.95 or
- + greater) by re-implementing with Psigpause() etc.
- + clock.c, getrusag.c, sleep.c, thread.c, times.c, time.h: ++boender, ++entropy
- + Replace all occurrences of clock() with _clock(), temporarily
- + alias clock() to call _clock() until we have something better.
- + times.c:
- + Set errno and return -1 on error.
- + mintbind.h:
- + Add new GEMDOS functions (macros) Dgetcwd() and Salert().
- + errno.h: ++boender
- + Define ENODEV as alias for EUKDEV/EUNDEV.
- +
- PATCHLEVEL27::
-
- isatty.c:
- diff -c ../mntlib27/clock.c ./clock.c
- *** ../mntlib27/clock.c Tue Jun 23 17:10:44 1992
- --- ./clock.c Wed Feb 17 14:23:24 1993
- ***************
- *** 1,4 ****
- ! /* clock -- return process time used so far, in units of CLK_TCK ticks
- per second (under TOS, 200 per second) */
- /* written by ERS */
-
- --- 1,4 ----
- ! /* _clock -- return process time used so far, in units of CLK_TCK ticks
- per second (under TOS, 200 per second) */
- /* written by ERS */
-
- ***************
- *** 16,23 ****
- static void getnow() { now = *((unsigned long *) 0x4baL); }
-
- clock_t
- ! clock()
- {
- (void)Supexec(getnow);
- return (now - _starttime);
- }
- --- 16,35 ----
- static void getnow() { now = *((unsigned long *) 0x4baL); }
-
- clock_t
- ! _clock()
- {
- (void)Supexec(getnow);
- return (now - _starttime);
- }
- +
- + /* This next bit of nonsense is temporary...clock() should be fixed! */
- +
- + #ifdef __GNUC__
- + asm(".stabs \"_clock\",5,0,0,__clock"); /* dept of clean tricks */
- + #else /* ! __GNUC__ */
- + clock_t
- + clock()
- + {
- + return _clock();
- + }
- + #endif /* ! __GNUC__ */
- diff -c ../mntlib27/eprintf.c ./eprintf.c
- *** ../mntlib27/eprintf.c Sat Sep 5 19:20:08 1992
- --- ./eprintf.c Sat Feb 13 07:23:24 1993
- ***************
- *** 14,22 ****
- Modified to do its own work rather than call fprintf().
- */
-
- - #define _say(s) _write(2,s,(long)strlen(s))
-
- static char buf[20]; /* big enough for any value of a long */
-
- /* This is used by the `assert' macro. */
- void __eprintf (expression, line, filename)
- --- 14,27 ----
- Modified to do its own work rather than call fprintf().
- */
-
-
- static char buf[20]; /* big enough for any value of a long */
- +
- + static void _say(s)
- + char *s;
- + {
- + _write(2,s,(long)(strlen(s)));
- + }
-
- /* This is used by the `assert' macro. */
- void __eprintf (expression, line, filename)
- diff -c ../mntlib27/fwrite.c ./fwrite.c
- *** ../mntlib27/fwrite.c Thu Jan 21 16:16:00 1993
- --- ./fwrite.c Sat Feb 13 07:23:38 1993
- ***************
- *** 8,14 ****
- #include <string.h>
- #include "lib.h"
-
- ! extern short __FRW_BIN__;
-
- size_t fwrite(_data, size, count, fp)
- const void *_data;
- --- 8,14 ----
- #include <string.h>
- #include "lib.h"
-
- ! extern short __FRW_BIN__;
-
- size_t fwrite(_data, size, count, fp)
- const void *_data;
- ***************
- *** 26,32 ****
- int wrote_cr;
- int line_flush;
-
- ! if( (f & _IORW) || __FRW_BIN__ )
- {
- fp->_flag |= _IOWRT;
- f = (fp->_flag &= ~(_IOREAD | _IOEOF));
- --- 26,32 ----
- int wrote_cr;
- int line_flush;
-
- ! if(f & _IORW)
- {
- fp->_flag |= _IOWRT;
- f = (fp->_flag &= ~(_IOREAD | _IOEOF));
- ***************
- *** 41,47 ****
- n = count * size;
- assert ( n <= (size_t)LONG_MAX); /* otherwise impl will not work */
-
- ! if( f&_IOBIN ) {
- space = fp->_bsiz - fp->_cnt;
- while(n > 0)
- {
- --- 41,47 ----
- n = count * size;
- assert ( n <= (size_t)LONG_MAX); /* otherwise impl will not work */
-
- ! if( (f&_IOBIN) || __FRW_BIN__ ) {
- space = fp->_bsiz - fp->_cnt;
- while(n > 0)
- {
- diff -c ../mntlib27/getcwd.c ./getcwd.c
- *** ../mntlib27/getcwd.c Sat Sep 5 19:57:32 1992
- --- ./getcwd.c Fri Feb 19 06:24:12 1993
- ***************
- *** 4,9 ****
- --- 4,10 ----
- #include <limits.h>
- #include <errno.h>
- #include <osbind.h>
- + #include <mintbind.h>
- #include "lib.h"
-
- /*******************************************************************
- ***************
- *** 29,38 ****
- char *path;
- #endif
- char drv;
-
- ! if (!buf)
- if ((buf = (char *) malloc((size_t)size)) == 0)
- return NULL;
-
- drv = Dgetdrv() + 'a';
- _path[0] = drv;
- --- 30,43 ----
- char *path;
- #endif
- char drv;
- + int buf_malloced = 0;
- + int r;
-
- ! if (!buf) {
- if ((buf = (char *) malloc((size_t)size)) == 0)
- return NULL;
- + buf_malloced = 1;
- + }
-
- drv = Dgetdrv() + 'a';
- _path[0] = drv;
- ***************
- *** 39,45 ****
- _path[1] = ':';
- _path[2] = '\0';
- path = _path + 2;
- ! (void)Dgetpath(path, 0);
-
- if (_rootdir && drv == _rootdir) {
- if (!*path) {
- --- 44,59 ----
- _path[1] = ':';
- _path[2] = '\0';
- path = _path + 2;
- ! if (__mint >= 96) {
- ! if ((r = Dgetcwd(path, 0, size - 2)) != 0) {
- ! if (buf_malloced)
- ! free(buf);
- ! errno = -r;
- ! return NULL;
- ! }
- ! } else {
- ! (void)Dgetpath(path, 0);
- ! }
-
- if (_rootdir && drv == _rootdir) {
- if (!*path) {
- diff -c ../mntlib27/getpass.c ./getpass.c
- *** ../mntlib27/getpass.c Fri Jan 15 04:26:10 1993
- --- ./getpass.c Wed Feb 17 18:34:56 1993
- ***************
- *** 4,9 ****
- --- 4,11 ----
- #include <string.h>
- #include <limits.h>
-
- + extern int __mint;
- +
- char *
- getpass(prompt)
- const char *prompt;
- ***************
- *** 11,30 ****
- static char buf[PASS_MAX + 1];
- char *ret;
- struct sgttyb oldsb, newsb;
-
- fflush(stdin);
- ! gtty(0, &oldsb);
- newsb = oldsb;
- newsb.sg_flags &= ~ECHO;
- ! stty(0, &newsb);
- fputs(prompt, stderr);
- fflush(stderr);
- ! if ((ret = fgets(buf, PASS_MAX + 1, stdin)) != 0)
- {
- /* zap the newline */
- if (buf[strlen(buf) - 1] == '\n')
- buf[strlen(buf) - 1] = 0;
- }
- ! stty(0, &oldsb);
- return ret;
- }
- --- 13,43 ----
- static char buf[PASS_MAX + 1];
- char *ret;
- struct sgttyb oldsb, newsb;
- + FILE *tty;
- + int ttyfd = 0;
-
- fflush(stdin);
- ! tty = stdin;
- ! if (__mint) {
- ! if ((tty = fopen("U:\\DEV\\TTY", "r")) == NULL)
- ! return NULL;
- ! }
- ! ttyfd = fileno(tty);
- ! fflush(tty);
- ! gtty(ttyfd, &oldsb);
- newsb = oldsb;
- newsb.sg_flags &= ~ECHO;
- ! stty(ttyfd, &newsb);
- fputs(prompt, stderr);
- fflush(stderr);
- ! if ((ret = fgets(buf, PASS_MAX + 1, tty)) != 0)
- {
- /* zap the newline */
- if (buf[strlen(buf) - 1] == '\n')
- buf[strlen(buf) - 1] = 0;
- }
- ! stty(ttyfd, &oldsb);
- ! if (__mint)
- ! (void) fclose(tty);
- return ret;
- }
- diff -c ../mntlib27/getrusag.c ./getrusag.c
- *** ../mntlib27/getrusag.c Sat Sep 5 20:06:44 1992
- --- ./getrusag.c Wed Feb 17 14:09:36 1993
- ***************
- *** 52,58 ****
- }
- } else {
- usage[0] = usage[2] = 0;
- ! usage[1] = clock() - _childtime;
- usage[3] = _childtime;
- }
-
- --- 52,58 ----
- }
- } else {
- usage[0] = usage[2] = 0;
- ! usage[1] = _clock() - _childtime;
- usage[3] = _childtime;
- }
-
- diff -c ../mntlib27/linea.c ./linea.c
- *** ../mntlib27/linea.c Thu Oct 1 14:41:22 1992
- --- ./linea.c Sat Feb 13 07:23:50 1993
- ***************
- *** 94,108 ****
-
- void linea7(BBPB *P)
- {
- __asm__ volatile
- ("
- movml d2/a2/a6, sp@-;
- movl %0,a6;
- .word 0xA007;
- ! movml sp@+,d2/a2/a6"
- : /* outputs */
- : "r"(P) /* inputs */
- ! : "d0", "d1", "a0", "a1" /* clobbered regs */
- );
- }
-
- --- 94,109 ----
-
- void linea7(BBPB *P)
- {
- +
- __asm__ volatile
- ("
- movml d2/a2/a6, sp@-;
- movl %0,a6;
- .word 0xA007;
- ! movml sp@+, d2/a2/a6"
- : /* outputs */
- : "r"(P) /* inputs */
- ! : "d0", "d1", "a0", "a1" /* clobbered regs */ \
- );
- }
-
- ***************
- *** 160,171 ****
- __asm__ volatile
- ("
- movl %0,a2;
- ! movl a6,sp@-;
- ! .word 0xA00C;
- ! movl sp@+,a6"
- : /* outputs */
- ! : "g"(P) /* inputs */
- ! : "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */
- );
- }
-
- --- 161,170 ----
- __asm__ volatile
- ("
- movl %0,a2;
- ! .word 0xA00C"
- : /* outputs */
- ! : "r"(P) /* inputs */
- ! : "d0", "d1", "d2", "a0", "a1", "a2", "a6" /* clobbered regs */
- );
- }
-
- ***************
- *** 178,189 ****
- movw %1,d1;
- movl %2,a0;
- movl %3,a2;
- ! movl a6,sp@-;
- ! .word 0xA00D;
- ! movl sp@+,a6"
- : /* outputs */
- ! : "g"((short)x), "g"((short)y), "g"(sd), "g"(ss) /* inputs */
- ! : "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */
- );
- }
-
- --- 177,186 ----
- movw %1,d1;
- movl %2,a0;
- movl %3,a2;
- ! .word 0xA00D"
- : /* outputs */
- ! : "r"((short)x), "r"((short)y), "r"(sd), "r"(ss) /* inputs */
- ! : "d0", "d1", "d2", "a0", "a1", "a2", "a6" /* clobbered regs */
- );
- }
-
- diff -c ../mntlib27/link.c ./link.c
- *** ../mntlib27/link.c Sat Sep 5 20:59:16 1992
- --- ./link.c Sat Feb 13 05:57:28 1993
- ***************
- *** 3,8 ****
- --- 3,9 ----
- #include <errno.h>
- #include <mintbind.h>
- #include <param.h>
- + #include <support.h>
- #include "lib.h"
-
- extern int __mint;
- ***************
- *** 13,19 ****
-
- int
- link(_old, _new)
- ! char *_old, *_new;
- {
- long r;
- char old[MAXPATHLEN], new[MAXPATHLEN];
- --- 14,20 ----
-
- int
- link(_old, _new)
- ! const char *_old, *_new;
- {
- long r;
- char old[MAXPATHLEN], new[MAXPATHLEN];
- diff -c ../mntlib27/makefile ./makefile
- *** ../mntlib27/makefile Thu Jan 21 15:21:38 1993
- --- ./makefile Sat Feb 13 09:25:56 1993
- ***************
- *** 50,56 ****
- # This reflects my setup, your mileage may vary.
-
- AR := ar
- ! LIB := newlib
-
- endif
-
- --- 50,56 ----
- # This reflects my setup, your mileage may vary.
-
- AR := ar
- ! LIB := /src/newlib
-
- endif
-
- diff -c ../mntlib27/patchlev.h ./patchlev.h
- *** ../mntlib27/patchlev.h Sun Jan 17 08:54:30 1993
- --- ./patchlev.h Sat Feb 13 03:24:10 1993
- ***************
- *** 3,6 ****
- * directory.
- */
-
- ! #define PatchLevel "27"
- --- 3,6 ----
- * directory.
- */
-
- ! #define PatchLevel "28"
- diff -c ../mntlib27/sleep.c ./sleep.c
- *** ../mntlib27/sleep.c Sat Sep 5 21:28:48 1992
- --- ./sleep.c Wed Feb 17 14:10:08 1993
- ***************
- *** 1,15 ****
- /* sleep -- sleep for a specified number of seconds */
- /* usleep -- sleep for a specified number of microSecond */
- /* written by Eric R. Smith and placed in the public domain */
-
- #include <time.h>
- #include <mintbind.h>
-
- ! /* clock() has a rez of CLOCKS_PER_SEC ticks/sec */
-
- #define USEC_PER_TICK (1000000L / ((unsigned long)CLOCKS_PER_SEC))
- #define USEC_TO_CLOCK_TICKS(us) ((us) / USEC_PER_TICK )
-
- unsigned int
- sleep(n)
- unsigned int n;
- --- 1,30 ----
- /* sleep -- sleep for a specified number of seconds */
- /* usleep -- sleep for a specified number of microSecond */
- /* written by Eric R. Smith and placed in the public domain */
- + /* extensively rehacked by entropy for mint >= 0.95, still public domain */
-
- #include <time.h>
- #include <mintbind.h>
- + #include <signal.h>
-
- ! #ifndef sigmask /* will not be defined if __STRICT_ANSI__ or not __MINT__ */
- ! #define sigmask(sig) (1L << (sig))
- ! #endif
-
- + /* _clock() has a rez of CLOCKS_PER_SEC ticks/sec */
- +
- #define USEC_PER_TICK (1000000L / ((unsigned long)CLOCKS_PER_SEC))
- #define USEC_TO_CLOCK_TICKS(us) ((us) / USEC_PER_TICK )
-
- + static void alarm_catch __PROTO((int signum));
- +
- + static void
- + alarm_catch(signum)
- + int signum;
- + {
- + return;
- + }
- +
- unsigned int
- sleep(n)
- unsigned int n;
- ***************
- *** 16,32 ****
- {
- unsigned long stop;
- extern int __mint;
-
- if (__mint) {
- ! while (n > 32) {
- ! (void)Fselect(32000, 0L, 0L, 0L);
- ! n -= 32;
- }
- ! (void)Fselect(1000*n, 0L, 0L, 0L);
- }
- else {
- ! stop = clock() + n * CLOCKS_PER_SEC;
- ! while (clock() < stop)
- ;
- }
- return 0;
- --- 31,87 ----
- {
- unsigned long stop;
- extern int __mint;
- + __Sigfunc old_alarm_func;
- + long old_sigmask;
- + long alarm_sec;
- + long unslept = 0L;
- + long remain;
-
- if (__mint) {
- ! if (__mint < 95) {
- ! while (n > 32) {
- ! (void)Fselect(32000, 0L, 0L, 0L);
- ! n -= 32;
- ! }
- ! (void)Fselect(1000*n, 0L, 0L, 0L);
- ! return 0;
- ! }
- ! if (n == 0)
- ! return 0;
- ! alarm_sec = Talarm(0L);
- ! if (alarm_sec && (alarm_sec < n)) {
- ! unslept = n - alarm_sec;
- ! n = alarm_sec;
- ! }
- ! stop = _clock() + n * CLOCKS_PER_SEC;
- ! old_sigmask = Psigblock(~0L);
- ! old_alarm_func = (__Sigfunc) Psignal(SIGALRM, alarm_catch);
- ! (void) Psigblock(~0L);
- ! while ((_clock() < stop) && !(Psigpending()
- ! & ~old_sigmask
- ! & ~sigmask(SIGALRM))) {
- ! Talarm(1L);
- ! Psigpause(~sigmask(SIGALRM));
- ! }
- ! remain = ((long) stop - (long) _clock())
- ! / (long) CLOCKS_PER_SEC;
- ! (void) Talarm(0L);
- ! (void) Psignal(SIGALRM, old_alarm_func);
- ! (void) Psigblock(~0L);
- ! if (alarm_sec > 0) {
- ! alarm_sec -= (n - remain);
- ! if (alarm_sec <= 0)
- ! (void) Pkill(Pgetpid(), SIGALRM);
- ! else
- ! (void) Talarm(alarm_sec);
- }
- ! (void) Psigsetmask(old_sigmask);
- ! unslept += remain;
- ! return ((unslept > 0) ? (unsigned) unslept : 0);
- }
- else {
- ! stop = _clock() + n * CLOCKS_PER_SEC;
- ! while (_clock() < stop)
- ;
- }
- return 0;
- ***************
- *** 48,55 ****
- (void)Fselect((unsigned)(usec/1000), 0L, 0L, 0L);
- }
- else {
- ! stop = clock() + USEC_TO_CLOCK_TICKS(usec);
- ! while (clock() < stop)
- ;
- }
- }
- --- 103,110 ----
- (void)Fselect((unsigned)(usec/1000), 0L, 0L, 0L);
- }
- else {
- ! stop = _clock() + USEC_TO_CLOCK_TICKS(usec);
- ! while (_clock() < stop)
- ;
- }
- }
- diff -c ../mntlib27/stat.c ./stat.c
- *** ../mntlib27/stat.c Sat Sep 5 21:00:48 1992
- --- ./stat.c Wed Feb 17 06:32:56 1993
- ***************
- *** 133,138 ****
- --- 133,140 ----
- * so we kludge around this by using the fact that Fsfirst(".\*.*"
- * or "..\*.*" will return the correct file first (except, of course,
- * in root directories :-( ).
- + * NOTE2: Some versions of TOS don't like Fsfirst("RCS\\", -1) either,
- + * so we do the same thing if the path ends in '\\'.
- */
-
- /* find the end of the string */
- ***************
- *** 142,147 ****
- --- 144,152 ----
- if (*ext == '.' && (ext == path || ext[-1] == '\\' || ext[-1] == '.')) {
- isdot = 1;
- strcat(path, "\\*.*");
- + } else if (*ext == '\\') {
- + isdot = 1;
- + strcat(path, "*.*");
- }
- olddta = Fgetdta();
- Fsetdta(&d);
- diff -c ../mntlib27/symlink.c ./symlink.c
- *** ../mntlib27/symlink.c Sat Sep 5 21:01:12 1992
- --- ./symlink.c Sat Feb 13 05:58:42 1993
- ***************
- *** 16,22 ****
-
- int
- symlink(old, new)
- ! char *old, *new;
- {
- char linkname[PATH_MAX];
- char path[PATH_MAX];
- --- 16,22 ----
-
- int
- symlink(old, new)
- ! const char *old, *new;
- {
- char linkname[PATH_MAX];
- char path[PATH_MAX];
- diff -c ../mntlib27/thread.c ./thread.c
- *** ../mntlib27/thread.c Sat Sep 5 21:01:20 1992
- --- ./thread.c Wed Feb 17 14:10:52 1993
- ***************
- *** 91,97 ****
- savbase = _base;
- _base = b;
-
- ! now = clock();
- pid = Pexec(4, 0L, b, 0L);
- (void)Mfree(b->p_env); /* free the memory */
- (void)Mfree(b);
- --- 91,97 ----
- savbase = _base;
- _base = b;
-
- ! now = _clock();
- pid = Pexec(4, 0L, b, 0L);
- (void)Mfree(b->p_env); /* free the memory */
- (void)Mfree(b);
- ***************
- *** 109,115 ****
- pid = ((long)b) >> 8;
- __waitval = (pid << 16) | retval;
- raise(SIGCHLD);
- ! __waittime = clock() - now;
- _childtime += __waittime;
- }
- }
- --- 109,115 ----
- pid = ((long)b) >> 8;
- __waitval = (pid << 16) | retval;
- raise(SIGCHLD);
- ! __waittime = _clock() - now;
- _childtime += __waittime;
- }
- }
- diff -c ../mntlib27/times.c ./times.c
- *** ../mntlib27/times.c Wed Feb 10 06:56:00 1993
- --- ./times.c Wed Feb 17 15:21:26 1993
- ***************
- *** 5,10 ****
- --- 5,11 ----
- #endif
- #include <time.h>
- #include <mintbind.h>
- + #include <errno.h>
-
- extern int __mint;
- extern long _childtime;
- ***************
- *** 18,24 ****
- {
- long usage[8], r, real_time;
-
- ! real_time = clock();
-
- if (__mint) {
- r = Prusage(usage);
- --- 19,25 ----
- {
- long usage[8], r, real_time;
-
- ! real_time = _clock();
-
- if (__mint) {
- r = Prusage(usage);
- ***************
- *** 29,34 ****
- --- 30,39 ----
- buffer->tms_stime = CVRT(usage[0]);
- return real_time;
- }
- + if (!buffer)
- + errno = EFAULT;
- + errno = -r;
- + return -1;
- }
-
- if (buffer) {
- diff -c ../mntlib27/unx2dos.c ./unx2dos.c
- *** ../mntlib27/unx2dos.c Mon Jun 8 05:22:24 1992
- --- ./unx2dos.c Wed Feb 17 06:36:28 1993
- ***************
- *** 3,8 ****
- --- 3,9 ----
- #include <ctype.h>
- #include <osbind.h>
- #include <types.h>
- + #include <support.h>
-
- extern int __mint;
- extern char _rootdir; /* in main.c: user's preferred root directory */
- ***************
- *** 98,103 ****
- --- 99,124 ----
- }
-
- #ifdef __GNUC__
- +
- asm(".stabs \"_unx2dos\",5,0,0,__unx2dos"); /* dept of clean tricks */
- asm(".stabs \"_dos2unx\",5,0,0,__dos2unx"); /* dept of clean tricks */
- +
- + #else /* ! __GNUC__ */
- +
- + int
- + unx2dos(unx, dos)
- + const char *unx;
- + char *dos;
- + {
- + return _unx2dos(unx, dos);
- + }
- +
- + int
- + dos2unx(dos, unx)
- + const char *dos;
- + char *unx;
- + {
- + return _dos2unx(dos, unx);
- + }
- +
- #endif
-