source: rtems/cpukit/posix/src/sleep.c @ 860c34e

4.104.114.95
Last change on this file since 860c34e was 812da54, checked in by Joel Sherrill <joel.sherrill@…>, on 04/02/07 at 18:23:59

2007-04-02 Joel Sherrill <joel@…>

  • itron/src/itrontime.c, libcsupport/src/gettod.c, posix/include/rtems/posix/time.h, posix/include/rtems/posix/timer.h, posix/src/clockgettime.c, posix/src/clocksettime.c, posix/src/nanosleep.c, posix/src/posixtimespecsubtract.c, posix/src/posixtimespectointerval.c, posix/src/ptimer1.c, posix/src/sleep.c, rtems/Makefile.am, rtems/include/rtems/rtems/clock.h, rtems/include/rtems/rtems/timer.h, rtems/include/rtems/rtems/types.h, rtems/src/clockget.c, rtems/src/clockset.c, rtems/src/clocktodtoseconds.c, rtems/src/clocktodvalidate.c, rtems/src/taskwakewhen.c, score/Makefile.am, score/include/rtems/score/tod.h, score/inline/rtems/score/tod.inl, score/src/coretod.c, score/src/coretodset.c: Convert from Classic API style TOD_Control as fundamental time structure to POSIX struct timespec. Add clock_get_uptime().
  • rtems/src/clockgetuptime.c, score/src/coretodget.c, score/src/coretodgetuptime.c: New files.
  • score/src/coretodtickle.c, score/src/coretodtoseconds.c, score/src/coretodvalidate.c: Removed.
  • Property mode set to 100644
File size: 401 bytes
Line 
1/*
2 *  3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
3 *
4 *  $Id$
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
17unsigned int sleep(
18  unsigned int seconds
19)
20{
21  struct timespec tp;
22  struct timespec tm;
23
24  tp.tv_sec = seconds;
25  tp.tv_nsec = 0;
26
27  nanosleep( &tp, &tm );
28
29  return tm.tv_sec;       /* seconds remaining */
30}
Note: See TracBrowser for help on using the repository browser.