On Fri, 18 Aug 2006, Alan Robertson wrote:

> I know what Linux does with the attached code, but for the *BSDs and
> also for Solaris and other plaforms, could someone try this C code out
> on each platform and let me know what the results are?

I can help with Solaris:  Tried a Sun compiler and a few versions of gcc
on Solaris 8, 9 10.  (Not a complete combination matrix, but a smattering
across it.)

All compiled successfully (including with "gcc -Wall": no warnings, no
errors).

All ran to completion with the same result:
   times(NULL) failure: Bad address

>From "times(2)" man page for Solaris 8:

---------------------------------------------------
                         [...]  The return  value  may  overflow
       the  possible  range  of type clock_t. If times() fails,
       (clock_t)-1 is returned and errno is set to indicate the error.

ERRORS
       The times() function will fail if:

       EFAULT
             The buffer argument points to an illegal address.
---------------------------------------------------

So that looks consistent (always a nice bonus).

Incidentally, have you seen
   http://www.freebsd.org/cgi/man.cgi

as a useful source of man pages for a wide variety of systems?  Includes
SunOS (aka Solaris), *BSD, HP-UX, Ultrix, various Linuxes, ...


-- 

:  David Lee                                I.T. Service          :
:  Senior Systems Programmer                Computer Centre       :
:                                           Durham University     :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham DH1 3LE        :
:  Phone: +44 191 334 2752                  U.K.                  :
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to