OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [posix/] [src/] [sleep.c] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *  3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
3
 *
4
 *  sleep.c,v 1.2 2001/01/24 14:17:28 joel Exp
5
 */
6
 
7
#if HAVE_CONFIG_H
8
#include "config.h"
9
#endif
10
 
11
#include <time.h>
12
#include <unistd.h>
13
 
14
#include <rtems/system.h>
15
 
16
 
17
unsigned int sleep(
18
  unsigned int seconds
19
)
20
{
21
  /* XXX can we get away with this implementation? */
22
  struct timespec tp;
23
  struct timespec tm;
24
 
25
  tp.tv_sec = seconds;
26
  tp.tv_nsec = 0;
27
 
28
  nanosleep( &tp, &tm );
29
 
30
  return tm.tv_sec;       /* seconds remaining */
31
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.