source: rtems/cpukit/libcsupport/src/no_posix.c @ a29d2e7

4.104.114.84.95
Last change on this file since a29d2e7 was 50f32b11, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/18/04 at 06:05:35

Remove stray white spaces.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  Marginal implementations of some POSIX API routines
3 *  to be used when POSIX is disabled.
4 *
5 *    + kill
6 *    + _kill_r
7 *    + __kill
8 *    + sleep
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems.h>
22
23#include <unistd.h>
24
25/*
26 *  These are directly supported (and completely correct) in the posix api.
27 */
28
29#if !defined(RTEMS_POSIX_API)
30int kill( pid_t pid, int sig )
31{
32  return 0;
33}
34
35#if defined(RTEMS_NEWLIB)
36#include <reent.h>
37
38int _kill_r( struct _reent *ptr, pid_t pid, int sig )
39{
40  return 0;
41}
42#endif
43#endif
44
45int __kill( pid_t pid, int sig )
46{
47  return 0;
48}
49
50
51/*
52 *  3.4.3 Delay Process Execution, P1003.1b-1993, p. 81
53 *
54 *  $Id$
55 */
56
57#include <time.h>
58#include <unistd.h>
59
60#include <rtems.h>
61
62#if !defined(RTEMS_POSIX_API)
63unsigned int sleep(
64  unsigned int seconds
65)
66{
67  rtems_status_code status;
68  rtems_interval    ticks_per_second;
69  rtems_interval    ticks;
70
71  status = rtems_clock_get(
72  RTEMS_CLOCK_GET_TICKS_PER_SECOND,
73  &ticks_per_second
74  );
75
76  ticks = seconds * ticks_per_second;
77
78  status = rtems_task_wake_after( ticks );
79
80  /*
81   *  Returns the "unslept" amount of time.  In RTEMS signals are not
82   *  interruptable, so tasks really sleep all of the requested time.
83   */
84
85  return 0;
86}
87#endif
Note: See TracBrowser for help on using the repository browser.