home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib32.zoo / Bugs < prev    next >
Text File  |  1993-06-17  |  12KB  |  241 lines

  1. This text files describes some bugs in the MiNT library, as well as some
  2. ways in which the library's behaviour differes from most UNIX systems.  If
  3. the document looks like I'm talking to myself in places, it's because it was
  4. originally compiled by boender@dutiws.TWI.TUDelft.NL (Hildo Biersma), and
  5. I've marked it up to use as a sort of checklist of things to fix.  Since
  6. some of these problems will be resolved in later releases of the library,
  7. try not to depend too heavily on the behavior described here.
  8.  
  9. entropy@terminator.rs.itd.umich.edu (Nick Castellano)
  10.  
  11. --------------------------------------------------------------------------
  12.  
  13. *.c: ++boender
  14.   Currently, the code for the mintlibs does various checks
  15.   according to the various versions of MiNT. Now, this is all very
  16.   well, but in some cases, this causes *three* versions of the
  17.   code to exist: TOS, old MiNT and new MiNT. Should this be cleaned
  18.   up at some time, i.e. do we stop supporting MiNT before 0.8 or 0.9?
  19.   Some obvious candidates are killpg.c and unx2dos.c.
  20.  
  21. *.h:  ++boender
  22.   I have a problem using gcc and GNU programs. If a Makefile from a
  23.   GNU program sets a gcc parameter of -I../lib, and a C file does
  24.   #include "wait.h", "../lib/wait.h" will be included. Now this file
  25.   includes <sys/wait.h>, which does an #include <wait.h>. This, in turn,
  26.   includes the GNU lib/wait.h! (Wow, recursive, recursive, .....)
  27.   
  28.   This could be solved in various ways. I make a symbolic link to
  29.   <sys/wait.h> from <wait.h>. <sys/wait.h> could do a #include "../wait.h".
  30.   The parameter -I/usr/include could be added in the GNU Makefile.
  31.   For you to decide upon the correct action!
  32.  
  33.   [I'm not sure I understand this.  It sounds like it could happen if you
  34.   put the Mint library header files in a directory such as /usr/lib, and then
  35.   compile some GNU program in a dir such as /usr/gnu.  Solution:  name your
  36.   include directory something else (e.g. /usr/include) -entropy]
  37.  
  38. abort.c: ++entropy
  39.   Should fclose() all streams in the same way of exit().  Also, if my
  40.   understanding is correct, it should unmask SIGABRT, and also set SIGABRT's
  41.   signal handler to SIG_DFL if it was SIG_IGN, before raising the signal.
  42.  
  43. access.c: ++entropy
  44.   I think my "superuser can access anything" assumption is wrong, especially
  45.   if checking execute permissions.
  46.  
  47. alarm.c: ++entropy
  48.   alarm() will silently "round down" any requested time greater than
  49.   LONG_MAX / 1000 (approximately 2 million seconds).  Most UNIXes allow much
  50.   larger maximum values (usually LONG_MAX).  MiNT needs this extremely small
  51.   maximum value because wakeup scheduling is calculated in milliseconds by
  52.   the kernel.  This cannot be fixed without changing MiNT.  alarm() does not
  53.   work at all under TOS.
  54.  
  55. clock.c: ++boender, ++entropy
  56.   clock() is currently implemented as an alias for _clock(), which makes it
  57.   hopelessly different from the UNIX version, since it returns time elapsed
  58.   since the program started, and not the CPU time used by the process and
  59.   its children that have terminated so far.  Also, the time units used are
  60.   different (200 Hz ticks instead of microseconds).  When clock() is fixed,
  61.   CLOCKS_PER_SEC in time.h will need to be changed, as ANSI specifies that
  62.   clock()/CLOCKS_PER_SEC gives the CPU time used, in seconds, since the
  63.   beginning of execution.  It may be a good idea to change CLK_TCK to agree,
  64.   or maybe CLK_TCK should be used for the actual 200 Hz hardware tick, and
  65.   change only CLOCKS_PER_SEC.  CLK_TCK is used in times.c.  CLOCKS_PER_SEC
  66.   is used in sleep.c.
  67.  
  68. fcntl.c: ++entropy
  69.   Need emulation for POSIX-required F_SETLKW.  Should be trivial.
  70.  
  71. getopt.c, unistd.h: ++boender
  72.   The three externally usable variables defined in getopt.c should be
  73.   included in <unistd.h>, where getopt() is declared too.  These
  74.   are: 'extern char *optarg', 'extern int opterr' and 'extern int optind'.
  75.   [Not really a bug.  Leave it this way because UNIX doesn't have these
  76.   vars in any headers either. -entropy]
  77.  
  78. ioctl.c: ++nox
  79.   TIOCSETP is #defined to be == TIOCSETN, but they are not really...
  80.   also still looks like it disables RTSCTS every time, unless i
  81.   specifically set that bit (0x2000), and thats not #defined in ioctl.h.
  82.   (and more things like TIOCFLUSH... but Eric knows them already. :-)
  83.  
  84. kill.c: ++boender, ++entropy 
  85.   On UNIX (SysV), system processes (PID 0 and 1) are treated specially.
  86.   This is somewhat different under MiNT, where init(1), if run at all, need
  87.   not have PID 1.  PID 0 is already treated in the correct manner by
  88.   Pkill().  PID 1 really deserves special treatment under MiNT in any case,
  89.   because shooting signals at MiNT's child process (be it init(1), or some
  90.   shell, or whatever) isn't likely to have the expected results.  I'm not
  91.   sure if this can reasonably be resolved in the library alone.
  92.  
  93.   Ultrix defines a system process as any process with a parent PID of 0.
  94.   This definition may be helpful for implementing kill() correctly in the
  95.   library.
  96.  
  97.   The man page for the MiNT call Pkill() forgets to mention that
  98.   either the effective user ID of the caller must be zero (super-user) or
  99.   else the real user IDs must match.  Note that, on UNIX, the caller must
  100.   be super-user or else the real or effective user IDs of both processes
  101.   must match.  This might be a bug in MiNT or the MiNT documentation.
  102.   Ask Eric?
  103.  
  104. limits.h: ++Uwe_Ohse@pb2.maus.de
  105.   CLK_TCK should be defined here and not just in time.h, since SVR4 does.
  106.   [I disagree, limits.h should be strictly ANSI and is already polluted
  107.   as it is -entropy]
  108.  
  109. main.c: ++boender
  110.   In exit(), stdin, stdout and stderr are flushed, all other file
  111.   descriptors are closed. I don't know what POSIX says, but System V
  112.   wants stdin, stdout and stderr to be closed too.
  113.  
  114. mktemp.c: ++entropy
  115.   Produces different sorts of filenames than UNIX does.
  116.  
  117. open.c, dup.c: ++entropy
  118.   Should clear the close-on-exec flag to be more UNIX-like.
  119.   [and maybe use O_EXCL to mean O_DENYRW also when used without O_CREAT?
  120.   (and always pass O_DENYRW thru, currently it gets lost when open calls
  121.   Fcreate().) -nox@jelal.north.de]
  122.   open() returns -4 instead of -1 on errors when __MSHORT__ is defined.
  123.  
  124. pgrp.c: ++entropy
  125.   The setsid() function never really disassociates the controlling tty from
  126.   the current process, since MiNT doesn't seem to have any such concept.  It
  127.   gets around this with a bunch of kludges in setsid(), ioctl(), and open().
  128.  
  129. popen.c: ++boender
  130.   This function reads the environment variable SHELL to find your shell,
  131.   and takes /bin/sh as an alternative. I think the opposite should be
  132.   done: only take SHELL of /bin/sh does not exist.
  133.   [See my comments on system.c -entropy]
  134.  
  135. read.c, write.c: ++entropy
  136.   When a backgrounded process is reading from or writing to its controlling 
  137.   tty, and its process group has no controlling tty, it should get a return
  138.   value of -1 from the read() or write() with errno set to EIO.  I'm
  139.   not really sure what the controlling tty of a process _group_ is, so
  140.   I'm clueless as to how to try to implement this.
  141.  
  142. scanf.c: ++jrb
  143.   Evidently loses big time.  Run Gcctests and find out what's what.
  144.  
  145. sigaction.c: ++nox@jelal.north.de, ++entropy
  146.   sigblock() could be declared int at least #ifndef __MSHORT__.  The
  147.   functions sigpending(), sigprocmask(), and sigsuspend() have not been
  148.   tested.  The other new POSIX sig*() functions have been tested but not
  149.   exhaustively.
  150.  
  151. sleep.c: ++boender, ++entropy
  152.   sleep() will never sleep for more than LONG_MAX / 1000 (approximately 2
  153.   million) seconds because Talarm() is used in its implementation (see
  154.   alarm.c).  usleep() is of type void.  This may not be correct:  it is of
  155.   type unsigned on UN*X, and should be of type unsigned long in the mintlibs.
  156.  
  157. stat.c: +nox
  158.   In lstat(), maybe make filenames with trailing slash follow symlinks?
  159.   sometimes it would be nice if i could do `ls -l /usr/' and get whats 
  160.   in there, not just the link...
  161.   [This sounds like a bad idea to me.  Sounds like a kludge in ls is
  162.   what's needed here, if anything. -entropy]
  163.  
  164. statfs.c: ++entropy
  165.   Hildo's kludge for /PROC, /PIPE, /SHM will have really unexpected results
  166.   for any signal handler that deals with the current directory, if it is
  167.   called in the small period of time while the current directory is
  168.   changed.  Shouldn't cause major problems.
  169.  
  170. system.c: ++boender
  171.   Currently, this function emulates the UN*X function, including
  172.   simple input/output redirection. It might be wise to check
  173.   if "/bin/sh" exists; if it exists, to call "/bin/sh -c <cmdline>".
  174.   If it does not exist, keep the current behaviour (emulation).
  175.   [I feel better about the way this is currently handled as there are
  176.   too many broken shells out there, and too many problems with figuring
  177.   out what a user means by "/bin" on a tos file system, and so on.  The
  178.   current scheme is more likely to work for more users more of the time...
  179.   -entropy]
  180.   [well you could argue over that now that there are `real' shells
  181.   available at least for MiNT...  but more important, if it `emulates' it
  182.   could do better, like in system ("uux foobox!foo '>bar'") pass the
  183.   quoted '>bar' to uux at least as long as the `emulation' doesn't know
  184.   how to uucp back output of remote commands... :-) -nox@jelal.north.de]
  185.   [OK, if someone wants to write a fix for system() that execs a shell,
  186.   I'll accept it so long as there is a way (via an environment variable)
  187.   for the user to select the emulation as it is currently working.  Fixes
  188.   to make the emulation more robust would also be welcome. -entropy]
  189.  
  190. types.h: ++entropy
  191.   Need ssize_t for POSIX compliance.
  192.  
  193. unistd.h: ++entropy 
  194.   The following should be #ifndef _POSIX_SOURCE:  abort(), chmod(), creat(),
  195.   getwd(), kill(), mkdir(), mktemp(), open(), psignal(), _read(),
  196.   setlinebuf(), setegid(), seteuid(), setregid(), setreuid(), stime(),
  197.   tell(), umask(), _write(), system(), getpass().  Some of them should be in
  198.   a different header when _POSIX_SOURCE is defined (or always?).
  199.  
  200. unlink.c: ++nox@jelal.north.de
  201.   When a file is still open on a GEMDOS filesystem MiNT already sets some
  202.   flag and unlinks after the close, but until then open() still finds the
  203.   file!  (which can be annoying on things like lock files...)
  204.   [I don't think this can be fixed in the library.  MiNT acts this
  205.   way on purpose.  -entropy]
  206.  
  207. utime.c: ++boender
  208.   stime(): My System V.3 manual state that `The stime() call will
  209.   fail if the effective user ID of the calling process is not
  210.   super-user.'. Now, I know the underlying system calls Tsetdate()
  211.   and Tsettime() are not privileged, and possibly the clock itself
  212.   can also be set on hardware level. What do we do here? Perhaps
  213.   MiNT should be fixed to check the effective user ID in Tsetdate()
  214.   and Tsettime() (a trivial fix in MiNT source file dos.c), or
  215.   perhaps we should do a check in stime(). I personally would prefer
  216.   MiNT to be fixed. Could you raise this subject with Eric Smith?
  217.   [I did, and I believe someone mentioned that it is now a privileged
  218.   call in MiNT 1.05, but I'm still running 1.04 so I cannot verify this.
  219.   As to the hardware clock, I'd hope that would be in protected memory
  220.   on newer machines, but I don't know.  Anyone want to give me a TT
  221.   so I can try it? <grin> -entropy]
  222.  
  223. utmp.c: ++boender
  224.   The utmp structure as defined differs from the System V structure.
  225.   Now, I don't know what BSD does, but I'll look it up. Do you
  226.   know what POSIX says about the utmp structure?
  227.   Also, the System V getutent, getutid, etc. calls are missing from
  228.   the mintlibs, but they are so dependent on fields in the utmp
  229.   structure that are missing in the mintlibs that they cannot be
  230.   written without changing the utmp structure.
  231.   I think complying with POSIX on this would be a Good Thing; if
  232.   someone could send me the relevant parts, I'll write the routines.
  233.   Note that all kind of stuff is dependent on this and has to be
  234.   emulated in the mintlibs, like getlogin(), or left out altogether,
  235.   like ttyslot().
  236.   Oh, and this: changing the utmp structure is a pretty large
  237.   operation, since init(1) will have to be overhauled completely.
  238.   As I don't think MiNT will ever write /etc/utmp and /etc/wtmp
  239.   structures on booting, perhaps we should leave this be.
  240.  
  241.