1 /* Reentrant versions of execution system calls. These
2 implementations just call the usual system calls. */
9 /* Some targets provides their own versions of these functions. Those
10 targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
13 #ifndef REENTRANT_SYSCALLS_PROVIDED
14 #define REENTRANT_SYSCALLS_PROVIDED
18 /* If NO_EXEC is defined, we don't need these functions. */
20 #if defined (REENTRANT_SYSCALLS_PROVIDED) || defined (NO_EXEC)
22 int _dummy_exec_syscalls
= 1;
26 /* We use the errno variable used by the system dependent layer. */
32 <<_execve_r>>---Reentrant version of execve
38 int _execve_r(struct _reent *<[ptr]>, const char *<[name]>,
39 char *const <[argv]>[], char *const <[env]>[]);
42 This is a reentrant version of <<execve>>. It
43 takes a pointer to the global data block, which holds
48 _execve_r (struct _reent
*ptr
,
56 if ((ret
= _execve (name
, argv
, env
)) == -1 && errno
!= 0)
57 _REENT_ERRNO(ptr
) = errno
;
65 <<_fork_r>>---Reentrant version of fork
72 int _fork_r(struct _reent *<[ptr]>);
75 This is a reentrant version of <<fork>>. It
76 takes a pointer to the global data block, which holds
83 _fork_r (struct _reent
*ptr
)
88 if ((ret
= _fork ()) == -1 && errno
!= 0)
89 _REENT_ERRNO(ptr
) = errno
;
98 <<_wait_r>>---Reentrant version of wait
105 int _wait_r(struct _reent *<[ptr]>, int *<[status]>);
108 This is a reentrant version of <<wait>>. It
109 takes a pointer to the global data block, which holds
114 _wait_r (struct _reent
*ptr
,
120 if ((ret
= _wait (status
)) == -1 && errno
!= 0)
121 _REENT_ERRNO(ptr
) = errno
;
125 #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */