source: rtems/cpukit/posix/src/sleep.c @ 3bacb250

4.104.115
Last change on this file since 3bacb250 was 1749cef, checked in by Ralf Corsepius <ralf.corsepius@…>, on 12/05/08 at 06:44:40

Compile contents conditionally.

  • Property mode set to 100644
File size: 675 bytes
Line 
1/*
2 *  3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#ifndef HAVE_SLEEP
19#include <time.h>
20#include <unistd.h>
21
22#include <rtems/system.h>
23
24
25unsigned int sleep(
26  unsigned int seconds
27)
28{
29  struct timespec tp;
30  struct timespec tm;
31
32  tp.tv_sec = seconds;
33  tp.tv_nsec = 0;
34
35  nanosleep( &tp, &tm );
36
37  return tm.tv_sec;       /* seconds remaining */
38}
39
40#endif
Note: See TracBrowser for help on using the repository browser.