home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / utils / bug / 2067 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.8 KB  |  117 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!stanford.edu!agate!spool.mu.edu!sdd.hp.com!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!csd.uu.SE!Henrik.Bakman
  3. From: Henrik.Bakman@csd.uu.SE (Henrik B}kman  CSD)
  4. Subject: time 1.4
  5. Message-ID: <199211161647.AA12468@woody.csd.uu.se>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 16 Nov 1992 18:47:27 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 104
  12.  
  13. Program: gnu time 1.4
  14. Machine: HP 9000/730
  15. OS: HPUX 8.07
  16. Compiler: gcc (2.?.?)
  17. ======================================================================
  18. Here is a fix to make time 1.4 compile on hpux 8.07. Unfortunately
  19. hpux doesn't support getrusage() but atleast you get something.
  20.  
  21. The system call wait3() in hpux is, for the moment, incompatible
  22. with the one used here so I am using the one in wait3.c. Bevare
  23. of the ugly patch to get rid of the conflicting-prototypes-error
  24. for wait3() !
  25.  
  26. *** /local/share/src/gnu/time-1.4/time.c    Wed Oct 28 20:21:05 1992
  27. --- time.c    Mon Nov 16 17:09:58 1992
  28. ***************
  29. *** 89,99 ****
  30. --- 89,114 ----
  31.   void error P_((int status, int errnum, char *message, ...));
  32.   
  33.   int gettimeofday P_((struct timeval *tp, struct timezone *tz));
  34. + /* 
  35. +  * HB 921116: HPUX 8.07 does have wait3() BUT it is incompatible
  36. +  * with the one used here :-( Therefor this ugly fix. You can't
  37. +  * just make an macro for wait3() because the prototype in sys/wait.h
  38. +  * is incompatible with the one below.
  39. +  */
  40. + #if defined HAVE_WAIT3
  41.   #ifdef HAVE_SYS_RESOURCE_H
  42.   int wait3 P_((union wait *status, int options, struct rusage *rusage));
  43.   #else
  44.   int wait3 P_((int *status, int options, struct rusage *rusage));
  45.   #endif
  46. + #define wait_3(status, options, rusage) \
  47. +   wait3((status), (options), (rusage))
  48. + #else /* HAVE_WAIT3 */
  49. + int emul_wait3 P_((int *status, int options, struct rusage *rusage));
  50. + #define wait_3(status, options, rusage) \
  51. +   emul_wait3((status), (options), (rusage))
  52. + #endif /* HAVE_WAIT3 */
  53.   
  54.   #include "getpagesize.h"
  55.   #ifndef getpagesize
  56. ***************
  57. *** 644,650 ****
  58.   
  59.     /* Ignore signals, but don't ignore the children.  When wait3
  60.        returns the child process, set the time the command finished. */
  61. !   while ((caught = wait3 (&status, 0, ruse)) != pid)
  62.       {
  63.         if (caught == -1)
  64.       error (1, errno, "error waiting for child process");
  65. --- 659,665 ----
  66.   
  67.     /* Ignore signals, but don't ignore the children.  When wait3
  68.        returns the child process, set the time the command finished. */
  69. !   while ((caught = wait_3 (&status, 0, ruse)) != pid)
  70.       {
  71.         if (caught == -1)
  72.       error (1, errno, "error waiting for child process");
  73. *** /local/share/src/gnu/time-1.4/wait3.c    Fri Jul  3 21:20:02 1992
  74. --- wait3.c    Mon Nov 16 17:05:06 1992
  75. ***************
  76. *** 1,6 ****
  77. --- 1,7 ----
  78.   /* Partial wait3 emulation for non-BSD systems.
  79.      Written by Franc,ois Pinard.  */
  80.   
  81. + #if ! defined HAVE_WAIT3
  82.   #include <sys/types.h>
  83.   #include <sys/times.h>
  84.   #include <sys/param.h>
  85. ***************
  86. *** 20,26 ****
  87.   /* Must be used with the below gettimeofday emulation.  */
  88.   
  89.   int
  90. ! wait3 (status, options, rusage)
  91.        int *status;
  92.        int options;
  93.        struct rusage *rusage;
  94. --- 21,27 ----
  95.   /* Must be used with the below gettimeofday emulation.  */
  96.   
  97.   int
  98. ! emul_wait3 (status, options, rusage)
  99.        int *status;
  100.        int options;
  101.        struct rusage *rusage;
  102. ***************
  103. *** 54,56 ****
  104. --- 55,58 ----
  105.     tp->tv_sec = value / HZ;
  106.     tp->tv_usec = value % HZ * (1000000 / HZ);
  107.   }
  108. + #endif /* ! HAVE_WAIT3 */
  109.  
  110. ----------------------------------------------------------------------
  111. Henrik Bakman           Adress: Box 520          Tel: +46 18 181044
  112. System Manager                  751 20 UPPSALA   Fax: +46 18 521270
  113. Computing Science Dep.          SWEDEN           Email: hb@csd.uu.se
  114. Uppsala University
  115.  
  116.