home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / minix / 4323 < prev    next >
Encoding:
Text File  |  1992-08-27  |  2.0 KB  |  47 lines

  1. Newsgroups: comp.os.minix
  2. Path: sparky!uunet!email!hp
  3. From: hp@vmars.tuwien.ac.at (Peter Holzer)
  4. Subject: Re: Question init.c <--> /etc/utmp
  5. Message-ID: <1992Aug27.120305.1001@email.tuwien.ac.at>
  6. Keywords: init login utmp wtmp
  7. Sender: news@email.tuwien.ac.at
  8. Nntp-Posting-Host: quasi.vmars.tuwien.ac.at
  9. Organization: Technical University Vienna, Dept. for Realtime Systems, AUSTRIA
  10. References: <1992Aug25.135457.26129@walter.cray.com> <meulenbr.714819852@cstw168> <8341@sirius.ucs.adelaide.edu.au>
  11. Date: Thu, 27 Aug 1992 12:03:05 GMT
  12. Lines: 33
  13.  
  14. newton@iagu.itd.adelaide.edu.au (Mark Newton) writes:
  15.  
  16. >Actually, there is a need to change init to handle wtmp properly in the
  17. >Amiga MINIX Prentice-Hall distribution (and probably the other m68k
  18. >MINIXes as well).
  19.  
  20. >There's a call to time() that looks something like "ut.ut_time = time()"
  21. >which doesn't work due to the fact that init.c doesn't #include <time.h>.
  22.  
  23. Is init different on 68k and PC-Minix? Init.c on PC-Minix 1.5 _does_
  24. include <time.h> and the parameter is (time_t *)0, so there is no
  25. problem.
  26.  
  27. >The compiler thinks, "Duh!  time() hasn't been prototyped, so I'll
  28. >assume that it returns an int!" when it should be returning a long.
  29. >m68k byte ordering no doubt makes it work properly under PC MINIX,
  30. >but the 68000 version of the ACK compiler makes time() (and most other
  31. >functions, for that matter) return incorrect values if they're not
  32. >prototyped.
  33.  
  34. Byte ordering has nothing to do with that. The upper 16 bits of the
  35. return value are simply discarded, and the resulting value is sign
  36. extended by the assignment to a long. Both PC-Minix and 68k-Minix
  37. should deliver the same resultsvalue are simply discarded, and the resulting value is sign
  38. extended by the assignment to a long. Both PC-Minix and 68k-Minix
  39. should deliver the same results. 
  40.  
  41.     Peter
  42. -- 
  43. |    _  | Peter J. Holzer                       | Think of it   |
  44. | |_|_) | Technical University Vienna           | as evolution  |
  45. | | |   | Dept. for Real-Time Systems           | in action!    |
  46. | __/   | hp@vmars.tuwien.ac.at                 |     Tony Rand |
  47.