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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [reent/] [signalr.c] - Blame information for rev 1774

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

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