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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [src/] [sleep.c] - Blame information for rev 532

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

Line No. Rev Author Line
1 30 unneback
/*
2
 *  3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
3
 *
4
 *  $Id: sleep.c,v 1.2 2001-09-27 11:59:17 chris Exp $
5
 */
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.