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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [reent/] [signalr.c] - Blame information for rev 864

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

Line No. Rev Author Line
1 148 jeremybenn
/* Reentrant versions of syscalls need to support signal/raise.
2
   These implementations just call the usual system calls.  */
3
 
4
#include <reent.h>
5
#include <signal.h>
6
#include <unistd.h>
7
#include <_syslist.h>
8
 
9
/* Some targets provides their own versions of these functions.  Those
10
   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
11
 
12
#ifdef _REENT_ONLY
13
#ifndef REENTRANT_SYSCALLS_PROVIDED
14
#define REENTRANT_SYSCALLS_PROVIDED
15
#endif
16
#endif
17
 
18
#ifdef REENTRANT_SYSCALLS_PROVIDED
19
 
20
int _dummy_link_syscalls = 1;
21
 
22
#else
23
 
24
/* We use the errno variable used by the system dependent layer.  */
25
#undef errno
26
extern int errno;
27
 
28
/*
29
FUNCTION
30
        <<_kill_r>>---Reentrant version of kill
31
 
32
INDEX
33
        _kill_r
34
 
35
ANSI_SYNOPSIS
36
        #include <reent.h>
37
        int _kill_r(struct _reent *<[ptr]>, int <[pid]>, int <[sig]>);
38
 
39
TRAD_SYNOPSIS
40
        #include <reent.h>
41
        int _kill_r(<[ptr]>, <[pid]>, <[sig]>)
42
        struct _reent *<[ptr]>;
43
        int <[pid]>;
44
        int <[sig]>;
45
 
46
DESCRIPTION
47
        This is a reentrant version of <<kill>>.  It
48
        takes a pointer to the global data block, which holds
49
        <<errno>>.
50
*/
51
 
52
int
53
_DEFUN (_kill_r, (ptr, pid, sig),
54
     struct _reent *ptr _AND
55
     int pid _AND
56
     int sig)
57
{
58
  int ret;
59
 
60
  errno = 0;
61
  if ((ret = _kill (pid, sig)) == -1 && errno != 0)
62
    ptr->_errno = errno;
63
  return ret;
64
}
65
 
66
/*
67
FUNCTION
68
        <<_getpid_r>>---Reentrant version of getpid
69
 
70
INDEX
71
        _getpid_r
72
 
73
ANSI_SYNOPSIS
74
        #include <reent.h>
75
        int _getpid_r(struct _reent *<[ptr]>);
76
 
77
TRAD_SYNOPSIS
78
        #include <reent.h>
79
        int _getpid_r(<[ptr]>)
80
        struct _reent *<[ptr]>;
81
 
82
DESCRIPTION
83
        This is a reentrant version of <<getpid>>.  It
84
        takes a pointer to the global data block, which holds
85
        <<errno>>.
86
 
87
        We never need <<errno>>, of course, but for consistency we
88
        still must have the reentrant pointer argument.
89
*/
90
 
91
int
92
_DEFUN (_getpid_r, (ptr),
93
     struct _reent *ptr)
94
{
95
  int ret;
96
  ret = _getpid ();
97
  return ret;
98
}
99
 
100
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */

powered by: WebSVN 2.1.0

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