Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* nanosleep on DEC3000 for OSF/1 v3.0
@ 1995-10-11  4:00 Geoffrey C. Hintze
  1995-10-12  4:00 ` Brian Field
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geoffrey C. Hintze @ 1995-10-11  4:00 UTC (permalink / raw)


I'm developing a program that needs to wait.  Sleep works but I want
to wait less than 1 sec(more like 50 millisec).  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?
-- 
-------------------------------------------------------------------------
	Geoffrey Hintze		EMail:	geoffrey.hintze@msfc.nasa.gov
	NASA/MSFC		Phone:	(205) 544-3792
	EB45			Fax:	(205) 544-8480
	MSFC, AL 35812
-------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: nanosleep on DEC3000 for OSF/1 v3.0
  1995-10-11  4:00 nanosleep on DEC3000 for OSF/1 v3.0 Geoffrey C. Hintze
@ 1995-10-12  4:00 ` Brian Field
  1995-10-13  4:00 ` Jeffrey Mogul
  1995-10-13  4:00 ` Eric Werme
  2 siblings, 0 replies; 4+ messages in thread
From: Brian Field @ 1995-10-12  4:00 UTC (permalink / raw)


In article <45h6k9$pm4@hammer.msfc.nasa.gov>,
Geoffrey C. Hintze <hintze@mohave.NoSubdomain.NoDomain> wrote:
>I'm developing a program that needs to wait.  Sleep works but I want
>to wait less than 1 sec(more like 50 millisec).  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?

See select (2).

Brian




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: nanosleep on DEC3000 for OSF/1 v3.0
  1995-10-11  4:00 nanosleep on DEC3000 for OSF/1 v3.0 Geoffrey C. Hintze
  1995-10-12  4:00 ` Brian Field
@ 1995-10-13  4:00 ` Jeffrey Mogul
  1995-10-13  4:00 ` Eric Werme
  2 siblings, 0 replies; 4+ messages in thread
From: Jeffrey Mogul @ 1995-10-13  4:00 UTC (permalink / raw)


In article <45h6k9$pm4@hammer.msfc.nasa.gov> hintze@mohave.NoSubdomain.NoDomain (Geoffrey C. Hintze) writes:
>I'm developing a program that needs to wait.  Sleep works but I want
>to wait less than 1 sec(more like 50 millisec).  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?

This might only be available in a real-time kernel.  Try either
napms() or usleep() (both have man pages).  Note that the resolution
of any of these mechanisms is about 1 msec (1/1024 seconds, actually).

-Jeff



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: nanosleep on DEC3000 for OSF/1 v3.0
  1995-10-11  4:00 nanosleep on DEC3000 for OSF/1 v3.0 Geoffrey C. Hintze
  1995-10-12  4:00 ` Brian Field
  1995-10-13  4:00 ` Jeffrey Mogul
@ 1995-10-13  4:00 ` Eric Werme
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Werme @ 1995-10-13  4:00 UTC (permalink / raw)


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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1995-10-13  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-10-11  4:00 nanosleep on DEC3000 for OSF/1 v3.0 Geoffrey C. Hintze
1995-10-12  4:00 ` Brian Field
1995-10-13  4:00 ` Jeffrey Mogul
1995-10-13  4:00 ` Eric Werme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox