|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Where is nanosleep?
I use nanosleep under solaris10,like follows: Code:
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
struct to_info{
void (*to_fn)(void *);
void *to_arg;
struct timespec to_wait;
};
void *timeout_helper(void *arg){
struct to_info *tip;
nanosleep(&tip->to_wait,NULL);
}when I compile above,it raise following error: undefined:nanosleep Why? Which header file include nanosleep function? How to find this header file? thanks Last edited by pludi; 11-03-2009 at 02:19 AM.. Reason: code tags, please... |
| Sponsored Links |
|
|
|
||||
|
See: nanosleep(3RT)high resolution sleep (man pages section 3: Realtime Library Functions)
You have the right header file. You also need the right library. That is why the -lrt is in bold at the top of the page. |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| nanosleep returns prematurely, with return value 0 | MeMyself | Programming | 1 | 12-21-2008 11:22 PM |
| nanosleep | ameya | Programming | 2 | 03-08-2005 01:24 AM |