summaryrefslogtreecommitdiffstats
path: root/gnu/libexec/uucp/libunix/sleep.c
blob: 910c9292e1981527f773f945c06626daec52f4b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* sleep.c
   Sleep for a number of seconds.  */

#include "uucp.h"

#include "sysdep.h"
#include "system.h"

void
usysdep_sleep (c)
     int c;
{
#if HAVE_NAPMS || HAVE_NAP || HAVE_USLEEP || HAVE_SELECT || HAVE_POLL
  int i;

  /* In this case, usysdep_pause is accurate.  */
  for (i = 2 * c; i > 0; i--)
    usysdep_pause ();
#else
  /* On some system sleep (1) may not sleep at all.  Avoid this sort
     of problem by always doing at least sleep (2).  */
  if (c < 2)
    c = 2;
  (void) sleep (c);
#endif
}
OpenPOWER on IntegriCloud