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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [c/] [src/] [exec/] [posix/] [src/] [sleep.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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