Search
lxdream.org :: lxdream/test/include/reent.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/include/reent.h
changeset 185:6755a04c447f
author nkeynes
date Wed Aug 02 04:13:15 2006 +0000 (17 years ago)
permissions -rw-r--r--
last change Add many more TA test cases (a couple of corner cases aren't 100% correct
yet, TBA)
Add new test "testregs" to check register masks (currently just PVR registers)
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/include/reent.h Wed Aug 02 04:13:15 2006 +0000
1.3 @@ -0,0 +1,87 @@
1.4 +/* This header file provides the reentrancy. */
1.5 +
1.6 +/* The reentrant system calls here serve two purposes:
1.7 +
1.8 + 1) Provide reentrant versions of the system calls the ANSI C library
1.9 + requires.
1.10 + 2) Provide these system calls in a namespace clean way.
1.11 +
1.12 + It is intended that *all* system calls that the ANSI C library needs
1.13 + be declared here. It documents them all in one place. All library access
1.14 + to the system is via some form of these functions.
1.15 +
1.16 + There are three ways a target may provide the needed syscalls.
1.17 +
1.18 + 1) Define the reentrant versions of the syscalls directly.
1.19 + (eg: _open_r, _close_r, etc.). Please keep the namespace clean.
1.20 + When you do this, set "syscall_dir" to "syscalls" in configure.in,
1.21 + and add -DREENTRANT_SYSCALLS_PROVIDED to target_cflags in configure.in.
1.22 +
1.23 + 2) Define namespace clean versions of the system calls by prefixing
1.24 + them with '_' (eg: _open, _close, etc.). Technically, there won't be
1.25 + true reentrancy at the syscall level, but the library will be namespace
1.26 + clean.
1.27 + When you do this, set "syscall_dir" to "syscalls" in configure.in.
1.28 +
1.29 + 3) Define or otherwise provide the regular versions of the syscalls
1.30 + (eg: open, close, etc.). The library won't be reentrant nor namespace
1.31 + clean, but at least it will work.
1.32 + When you do this, add -DMISSING_SYSCALL_NAMES to target_cflags in
1.33 + configure.in.
1.34 +
1.35 + Stubs of the reentrant versions of the syscalls exist in the libc/reent
1.36 + source directory and are used if REENTRANT_SYSCALLS_PROVIDED isn't defined.
1.37 + They use the native system calls: _open, _close, etc. if they're available
1.38 + (MISSING_SYSCALL_NAMES is *not* defined), otherwise open, close, etc.
1.39 + (MISSING_SYSCALL_NAMES *is* defined). */
1.40 +
1.41 +/* WARNING: All identifiers here must begin with an underscore. This file is
1.42 + included by stdio.h and others and we therefore must only use identifiers
1.43 + in the namespace allotted to us. */
1.44 +
1.45 +#ifndef _REENT_H_
1.46 +#ifdef __cplusplus
1.47 +extern "C" {
1.48 +#endif
1.49 +#define _REENT_H_
1.50 +
1.51 +#include <sys/reent.h>
1.52 +#include <sys/_types.h>
1.53 +#include <machine/types.h>
1.54 +
1.55 +#define __need_size_t
1.56 +#include <stddef.h>
1.57 +
1.58 +/* FIXME: not namespace clean */
1.59 +struct stat;
1.60 +struct tms;
1.61 +struct timeval;
1.62 +struct timezone;
1.63 +
1.64 +/* Reentrant versions of system calls. */
1.65 +
1.66 +extern int _close_r _PARAMS ((struct _reent *, int));
1.67 +extern int _execve_r _PARAMS ((struct _reent *, char *, char **, char **));
1.68 +extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int));
1.69 +extern int _fork_r _PARAMS ((struct _reent *));
1.70 +extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *));
1.71 +extern int _getpid_r _PARAMS ((struct _reent *));
1.72 +extern int _kill_r _PARAMS ((struct _reent *, int, int));
1.73 +extern int _link_r _PARAMS ((struct _reent *, const char *, const char *));
1.74 +extern _off_t _lseek_r _PARAMS ((struct _reent *, int, _off_t, int));
1.75 +extern int _open_r _PARAMS ((struct _reent *, const char *, int, int));
1.76 +extern _ssize_t _read_r _PARAMS ((struct _reent *, int, void *, size_t));
1.77 +extern void *_sbrk_r _PARAMS ((struct _reent *, size_t));
1.78 +extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *));
1.79 +extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *));
1.80 +extern int _unlink_r _PARAMS ((struct _reent *, const char *));
1.81 +extern int _wait_r _PARAMS ((struct _reent *, int *));
1.82 +extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t));
1.83 +
1.84 +/* This one is not guaranteed to be available on all targets. */
1.85 +extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *tp, struct timezone *tzp));
1.86 +
1.87 +#ifdef __cplusplus
1.88 +}
1.89 +#endif
1.90 +#endif /* _REENT_H_ */
.