From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,1c44795abdadca8 X-Google-Attributes: gidfee84,public From: werme@alingo.zk3.dec.com (Eric Werme) Subject: Re: nanosleep on DEC3000 for OSF/1 v3.0 Date: 1995/10/13 Message-ID: #1/1 X-Deja-AN: 117503074 references: <45h6k9$pm4@hammer.msfc.nasa.gov> organization: Digital Equipment Corporation keywords: sleep nanosleep reply-to: werme@zk3.dec.com newsgroups: comp.unix.osf.osf1 hintze@mohave.NoSubdomain.NoDomain (Geoffrey C. Hintze) writes: > I tried the nanosleep >function (which was nanosleep_d9 in the library) but it returned a -1 >and an errno of 78 (which means the function is not implemented). Does >anyone have any suggestions? Try usleep: usleep(3) usleep(3) NAME usleep - Suspends execution for an interval LIBRARY Standard C Library (libc.a) SYNOPSIS void usleep( unsigned mseconds ); PARAMETERS mseconds The number of microseconds to suspend execution for. DESCRIPTION The usleep() function suspends the current process from execution for the number of microseconds specified by the mseconds parameter. Because of other activity in the system, or because of the time spent in processing the call, the actual suspension time may be longer than specified. The usleep() function sets an interval timer and pauses until it expires. The previous state of this timer is saved and restored. If the sleep time exceeds the time to the expiration of the previous timer, the process sleeps only until the signal would have occurred, and the signal is sent a short time later. The usleep() function uses the setitimer() function. It requires eight system calls each time it is invoked. A similar but less compatible func- tion can be obtained with a single select; it would not restart after sig- nals, but would not interfere with other uses of setitimer(). RELATED INFORMATION Functions: alarm(3), getitimer(2), sigaction(2), sigvec(2), sleep(3) -- Eric (Ric) Werme | werme@zk3.dec.com Digital Equipment Corp. | This space intentionally left blank.