2.4 x86: clock_gettime

2.4 x86: clock_gettime

Post by Orit Shach » Mon, 26 Dec 1994 06:14:44



   I must be doing something wrong, else this would have been in the FAQ.
But the sorry excuse for tech support we have here has less of a clue
than...  never mind.  Here's my problem:

(Solaris 2.4 x86)

#include <time.h>
main()
{
   struct timespec now;
..
   clock_gettime(CLOCK_REALTIME, &now);
..

Quote:}

  This gets a segmentation fault on the "clock_gettime" call.  Why?

  (Please e-mail replies, even if posting.  News gets here 2-10 days late,
and expires promptly).

Orit

 
 
 

1. Solaris x86 clock_gettime problem

I'm having a problem with the clock_gettime() function from the POSIX
real time library on Solaris x86 2.4.  The attached C++ program compiles
and runs fine on a SPARC.  On an x86 box, the call to clock_getres
does fine, but I get a segmentation fault in the call to clock_gettime.
The same thing happens in a similar C program.

Anybody else experienced this?  Do you know of a workaround?

Lewis Barnett -- Dept. of Math & CS, U. of Richmond, VA 23173

              -- http://www.urich.edu/~barnett/
________________________________________________________________________
#include <time.h>
#include <iostream.h>

main ()
{
    timespec_t  t1, t2;

    clock_getres(CLOCK_REALTIME, &t1);

    cout << endl << "Clock resolution:  " << t1.tv_sec << " sec, "
        << t1.tv_nsec << " nsec" << endl << endl;

    clock_gettime(CLOCK_REALTIME, &t2);

    cout << "Clock time = " << t2.tv_sec << " secs "
        << t2.tv_nsec << " nanoseconds." << endl;

    return 0;

2. collisions on the NICs - news @ 5

3. diff from x86 2.4 to x86 2.5 ?

4. ports question: ksh93

5. Solaris x86 2.4 && firewall sendmail problem

6. Which firewall technique/product does this best?

7. 2.4 X86: ftp error, socket permission denied?

8. Large hd problem: what to do?

9. Solaris 2.4 x86, nanosleep workaround

10. Solaris 2.4 x86 & win95 --> Possible??

11. Installing 2nd IDE Drive on Solaris 2.4 X86

12. X86 2.4 showrev -p, Single-user mode

13. Install problem 2.4 X86 w/Adaptec 2940UW