2000-02-18 03:39:52 +08:00
|
|
|
#ifndef _SYS_UNISTD_H
|
|
|
|
#define _SYS_UNISTD_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <_ansi.h>
|
|
|
|
#include <sys/types.h>
|
2001-08-30 03:47:43 +08:00
|
|
|
#include <sys/_types.h>
|
2000-02-18 03:39:52 +08:00
|
|
|
#define __need_size_t
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#define __need_ptrdiff_t
|
2000-02-18 03:39:52 +08:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2000-08-26 04:14:45 +08:00
|
|
|
extern char **environ;
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((noreturn)));
|
|
|
|
|
|
|
|
int _EXFUN(access,(const char *__path, int __amode ));
|
|
|
|
unsigned _EXFUN(alarm, (unsigned __secs ));
|
|
|
|
int _EXFUN(chdir, (const char *__path ));
|
|
|
|
int _EXFUN(chmod, (const char *__path, mode_t __mode ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#endif
|
2001-08-29 Joel Sherrill <joel@OARcorp.com>
* libc/include/sys/unistd.h: Prototype chroot() for RTEMS.
2001-08-29 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* libc/machine/i386/f_atan2.S, libc/machine/i386/f_atan2f.S,
libc/machine/i386/f_exp.c, libc/machine/i386/f_expf.c,
libc/machine/i386/f_frexp.S, libc/machine/i386/f_frexpf.S,
libc/machine/i386/f_ldexp.S, libc/machine/i386/f_ldexpf.S,
libc/machine/i386/f_log.S, libc/machine/i386/f_log10.S,
libc/machine/i386/f_log10f.S, libc/machine/i386/f_logf.S,
libc/machine/i386/f_pow.c, libc/machine/i386/f_powf.c,
libc/machine/i386/f_tan.S, libc/machine/i386/f_tanf.S:
Add conditional compilation to avoid HW FPU instructions
when compiled for soft-float.
2001-08-30 04:09:31 +08:00
|
|
|
#if defined(__CYGWIN__) || defined(__rtems__)
|
2000-12-14 09:07:23 +08:00
|
|
|
int _EXFUN(chroot, (const char *__path ));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(close, (int __fildes ));
|
|
|
|
char _EXFUN(*ctermid, (char *__s ));
|
|
|
|
char _EXFUN(*cuserid, (char *__s ));
|
2003-09-10 23:53:44 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
int _EXFUN(daemon, (int nochdir, int noclose));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(dup, (int __fildes ));
|
|
|
|
int _EXFUN(dup2, (int __fildes, int __fildes2 ));
|
2001-11-06 02:06:24 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
void _EXFUN(endusershell, (void));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(execl, (const char *__path, const char *, ... ));
|
|
|
|
int _EXFUN(execle, (const char *__path, const char *, ... ));
|
|
|
|
int _EXFUN(execlp, (const char *__file, const char *, ... ));
|
|
|
|
int _EXFUN(execv, (const char *__path, char * const __argv[] ));
|
|
|
|
int _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] ));
|
|
|
|
int _EXFUN(execvp, (const char *__file, char * const __argv[] ));
|
2001-10-18 03:28:35 +08:00
|
|
|
#if defined(__CYGWIN__) || defined(__rtems__)
|
2001-10-18 02:16:43 +08:00
|
|
|
int _EXFUN(fchdir, (int __fildes));
|
|
|
|
#endif
|
2000-04-03 04:42:42 +08:00
|
|
|
int _EXFUN(fchmod, (int __fildes, mode_t __mode ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
2000-04-03 04:42:42 +08:00
|
|
|
int _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
pid_t _EXFUN(fork, (void ));
|
|
|
|
long _EXFUN(fpathconf, (int __fd, int __name ));
|
|
|
|
int _EXFUN(fsync, (int __fd));
|
2004-02-09 10:22:01 +08:00
|
|
|
#ifndef __CYGWIN__
|
2004-01-09 03:25:21 +08:00
|
|
|
int _EXFUN(fdatasync, (int __fd));
|
2004-02-09 10:22:01 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
char _EXFUN(*getcwd, (char *__buf, size_t __size ));
|
2002-05-04 10:22:01 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
int _EXFUN(getdomainname ,(char *__name, size_t __len));
|
|
|
|
#endif
|
2003-03-10 05:08:51 +08:00
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
2000-02-18 03:39:52 +08:00
|
|
|
gid_t _EXFUN(getegid, (void ));
|
|
|
|
uid_t _EXFUN(geteuid, (void ));
|
|
|
|
gid_t _EXFUN(getgid, (void ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] ));
|
2003-04-16 04:13:49 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
long _EXFUN(gethostid, (void));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
char _EXFUN(*getlogin, (void ));
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#if defined(_POSIX_THREAD_SAFE_FUNCTIONS)
|
|
|
|
int _EXFUN(getlogin_r, (char *name, size_t namesize) );
|
|
|
|
#endif
|
2004-08-24 02:39:52 +08:00
|
|
|
char _EXFUN(*getpass, (const char *__prompt));
|
2000-02-18 03:39:52 +08:00
|
|
|
size_t _EXFUN(getpagesize, (void));
|
2001-02-09 08:13:54 +08:00
|
|
|
pid_t _EXFUN(getpgid, (pid_t));
|
2000-02-18 03:39:52 +08:00
|
|
|
pid_t _EXFUN(getpgrp, (void ));
|
|
|
|
pid_t _EXFUN(getpid, (void ));
|
|
|
|
pid_t _EXFUN(getppid, (void ));
|
2002-08-18 14:08:39 +08:00
|
|
|
#ifdef __CYGWIN__
|
|
|
|
pid_t _EXFUN(getsid, (pid_t));
|
|
|
|
#endif
|
2003-03-10 05:08:51 +08:00
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
2000-02-18 03:39:52 +08:00
|
|
|
uid_t _EXFUN(getuid, (void ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#endif
|
2000-12-14 09:07:23 +08:00
|
|
|
#ifdef __CYGWIN__
|
2001-11-06 02:06:24 +08:00
|
|
|
char * _EXFUN(getusershell, (void));
|
2000-12-14 09:07:23 +08:00
|
|
|
char _EXFUN(*getwd, (char *__buf ));
|
2001-11-06 02:06:24 +08:00
|
|
|
int _EXFUN(iruserok, (unsigned long raddr, int superuser, const char *ruser, const char *luser));
|
2000-12-14 09:07:23 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(isatty, (int __fildes ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
2000-04-03 04:42:42 +08:00
|
|
|
int _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(link, (const char *__path1, const char *__path2 ));
|
|
|
|
int _EXFUN(nice, (int __nice_value ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
2000-02-18 03:39:52 +08:00
|
|
|
off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
long _EXFUN(pathconf, (const char *__path, int __name ));
|
|
|
|
int _EXFUN(pause, (void ));
|
2001-04-13 23:37:47 +08:00
|
|
|
#ifdef __CYGWIN__
|
|
|
|
int _EXFUN(pthread_atfork, (void (*)(void), void (*)(void), void (*)(void)));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(pipe, (int __fildes[2] ));
|
2002-04-30 03:31:23 +08:00
|
|
|
ssize_t _EXFUN(pread, (int __fd, void *__buf, size_t __nbytes, off_t __offset));
|
|
|
|
ssize_t _EXFUN(pwrite, (int __fd, const void *__buf, size_t __nbytes, off_t __offset));
|
2001-03-06 09:04:43 +08:00
|
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte ));
|
2001-11-06 02:06:24 +08:00
|
|
|
#if defined(__CYGWIN__)
|
2003-01-20 23:28:02 +08:00
|
|
|
int _EXFUN(rresvport, (int *__alport));
|
|
|
|
int _EXFUN(revoke, (char *__path));
|
2001-11-06 02:06:24 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(rmdir, (const char *__path ));
|
2001-11-06 02:06:24 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
int _EXFUN(ruserok, (const char *rhost, int superuser, const char *ruser, const char *luser));
|
|
|
|
#endif
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
void * _EXFUN(sbrk, (ptrdiff_t __incr));
|
2003-03-10 05:08:51 +08:00
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
2000-06-17 05:04:37 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
int _EXFUN(setegid, (gid_t __gid ));
|
|
|
|
int _EXFUN(seteuid, (uid_t __uid ));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(setgid, (gid_t __gid ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#endif
|
2002-07-30 19:35:03 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
int _EXFUN(setgroups, (int ngroups, const gid_t *grouplist ));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));
|
2001-02-09 08:13:54 +08:00
|
|
|
int _EXFUN(setpgrp, (void ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#if defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__)
|
2003-01-24 23:25:24 +08:00
|
|
|
int _EXFUN(setregid, (gid_t __rgid, gid_t __egid));
|
|
|
|
int _EXFUN(setreuid, (uid_t __ruid, uid_t __euid));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
pid_t _EXFUN(setsid, (void ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(setuid, (uid_t __uid ));
|
2003-03-10 05:08:51 +08:00
|
|
|
#endif
|
2001-11-06 02:06:24 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
void _EXFUN(setusershell, (void));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
unsigned _EXFUN(sleep, (unsigned int __seconds ));
|
|
|
|
void _EXFUN(swab, (const void *, void *, ssize_t));
|
|
|
|
long _EXFUN(sysconf, (int __name ));
|
|
|
|
pid_t _EXFUN(tcgetpgrp, (int __fildes ));
|
|
|
|
int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id ));
|
|
|
|
char _EXFUN(*ttyname, (int __fildes ));
|
2004-04-20 19:09:36 +08:00
|
|
|
#if defined(__CYGWIN__)
|
2004-04-20 19:14:02 +08:00
|
|
|
int _EXFUN(ttyname_r, (int, char *, size_t));
|
2004-04-20 19:09:36 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(unlink, (const char *__path ));
|
2001-02-09 08:13:54 +08:00
|
|
|
int _EXFUN(vhangup, (void ));
|
2001-03-06 09:04:43 +08:00
|
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte ));
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2002-12-29 07:20:47 +08:00
|
|
|
#ifdef __CYGWIN__
|
2003-03-08 12:57:41 +08:00
|
|
|
# define __UNISTD_GETOPT__
|
2002-12-29 07:20:47 +08:00
|
|
|
# include <getopt.h>
|
2003-03-08 12:57:41 +08:00
|
|
|
# undef __UNISTD_GETOPT__
|
2002-12-29 07:20:47 +08:00
|
|
|
#else
|
2002-07-20 04:36:09 +08:00
|
|
|
extern char *optarg; /* getopt(3) external variables */
|
|
|
|
extern int optind, opterr, optopt;
|
|
|
|
int getopt(int, char * const [], const char *);
|
|
|
|
extern int optreset; /* getopt(3) external variable */
|
2002-12-29 07:20:47 +08:00
|
|
|
#endif
|
2002-07-20 04:36:09 +08:00
|
|
|
|
2000-08-25 06:32:38 +08:00
|
|
|
#ifndef _POSIX_SOURCE
|
|
|
|
pid_t _EXFUN(vfork, (void ));
|
2002-07-20 04:36:09 +08:00
|
|
|
|
|
|
|
extern char *suboptarg; /* getsubopt(3) external variable */
|
|
|
|
int getsubopt(char **, char * const *, char **);
|
2000-08-25 06:32:38 +08:00
|
|
|
#endif /* _POSIX_SOURCE */
|
|
|
|
|
2003-11-27 03:15:17 +08:00
|
|
|
#ifdef _COMPILING_NEWLIB
|
2000-02-18 03:39:52 +08:00
|
|
|
/* Provide prototypes for most of the _<systemcall> names that are
|
|
|
|
provided in newlib for some compilers. */
|
|
|
|
int _EXFUN(_close, (int __fildes ));
|
|
|
|
pid_t _EXFUN(_fork, (void ));
|
|
|
|
pid_t _EXFUN(_getpid, (void ));
|
|
|
|
int _EXFUN(_link, (const char *__path1, const char *__path2 ));
|
2003-03-15 02:39:05 +08:00
|
|
|
_off_t _EXFUN(_lseek, (int __fildes, _off_t __offset, int __whence ));
|
2003-11-19 03:17:17 +08:00
|
|
|
#ifdef __LARGE64_FILES
|
|
|
|
_off64_t _EXFUN(_lseek64, (int __filedes, _off64_t __offset, int __whence ));
|
|
|
|
#endif
|
2001-03-06 09:04:43 +08:00
|
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(_read, (int __fd, void *__buf, size_t __nbyte ));
|
2002-08-17 13:19:18 +08:00
|
|
|
void * _EXFUN(_sbrk, (ptrdiff_t __incr));
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(_unlink, (const char *__path ));
|
2001-03-06 09:04:43 +08:00
|
|
|
_READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nbyte ));
|
2000-08-25 06:32:38 +08:00
|
|
|
int _EXFUN(_execve, (const char *__path, char * const __argv[], char * const __envp[] ));
|
2003-11-27 03:15:17 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2003-07-10 23:31:30 +08:00
|
|
|
#if defined(__CYGWIN__) || defined(__rtems__) || defined(__sh__)
|
|
|
|
#if !defined(__INSIDE_CYGWIN__)
|
|
|
|
int _EXFUN(ftruncate, (int __fd, off_t __length));
|
|
|
|
int _EXFUN(truncate, (const char *, off_t __length));
|
|
|
|
#endif
|
|
|
|
#endif
|
2000-05-31 01:18:05 +08:00
|
|
|
#if defined(__CYGWIN__) || defined(__rtems__)
|
2000-10-10 08:28:49 +08:00
|
|
|
int _EXFUN(getdtablesize, (void));
|
2001-01-18 12:24:03 +08:00
|
|
|
int _EXFUN(setdtablesize, (int));
|
2001-12-07 03:00:14 +08:00
|
|
|
useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval));
|
2000-02-18 03:39:52 +08:00
|
|
|
unsigned _EXFUN(usleep, (unsigned int __useconds));
|
2001-03-21 03:27:56 +08:00
|
|
|
#if !(defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS))
|
|
|
|
/* winsock[2].h defines as __stdcall, and with int as 2nd arg */
|
|
|
|
int _EXFUN(gethostname, (char *__name, size_t __len));
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
char * _EXFUN(mktemp, (char *));
|
2004-04-11 04:39:47 +08:00
|
|
|
#if defined(__CYGWIN__)
|
|
|
|
void _EXFUN(sync, (void));
|
|
|
|
#else /* defined(__rtems__) */
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(sync, (void));
|
2004-04-11 04:39:47 +08:00
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
int _EXFUN(readlink, (const char *__path, char *__buf, int __buflen));
|
|
|
|
int _EXFUN(symlink, (const char *__name1, const char *__name2));
|
|
|
|
#endif
|
|
|
|
|
2001-04-23 07:52:06 +08:00
|
|
|
#define F_OK 0
|
|
|
|
#define R_OK 4
|
|
|
|
#define W_OK 2
|
2001-05-08 09:15:06 +08:00
|
|
|
#define X_OK 1
|
2001-03-05 13:13:06 +08:00
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
# define SEEK_SET 0
|
|
|
|
# define SEEK_CUR 1
|
|
|
|
# define SEEK_END 2
|
|
|
|
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#include <sys/features.h>
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
#define STDIN_FILENO 0 /* standard input file descriptor */
|
|
|
|
#define STDOUT_FILENO 1 /* standard output file descriptor */
|
|
|
|
#define STDERR_FILENO 2 /* standard error file descriptor */
|
|
|
|
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
/*
|
|
|
|
* 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
|
|
|
|
*
|
|
|
|
* NOTE: Table 4-2, Configurable System Variables, p. 96
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define _SC_ARG_MAX 0
|
|
|
|
#define _SC_CHILD_MAX 1
|
|
|
|
#define _SC_CLK_TCK 2
|
|
|
|
#define _SC_NGROUPS_MAX 3
|
|
|
|
#define _SC_OPEN_MAX 4
|
|
|
|
/* no _SC_STREAM_MAX */
|
|
|
|
#define _SC_JOB_CONTROL 5
|
|
|
|
#define _SC_SAVED_IDS 6
|
|
|
|
#define _SC_VERSION 7
|
|
|
|
#define _SC_PAGESIZE 8
|
2000-12-13 07:41:23 +08:00
|
|
|
/* CYGWIN-specific values .. do not touch */
|
|
|
|
#define _SC_NPROCESSORS_CONF 9
|
|
|
|
#define _SC_NPROCESSORS_ONLN 10
|
|
|
|
#define _SC_PHYS_PAGES 11
|
|
|
|
#define _SC_AVPHYS_PAGES 12
|
|
|
|
/* end of CYGWIN-specific values */
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#define _SC_MQ_OPEN_MAX 13
|
|
|
|
#define _SC_MQ_PRIO_MAX 14
|
|
|
|
#define _SC_RTSIG_MAX 15
|
|
|
|
#define _SC_SEM_NSEMS_MAX 16
|
|
|
|
#define _SC_SEM_VALUE_MAX 17
|
|
|
|
#define _SC_SIGQUEUE_MAX 18
|
|
|
|
#define _SC_TIMER_MAX 19
|
|
|
|
#define _SC_TZNAME_MAX 20
|
|
|
|
|
|
|
|
#define _SC_ASYNCHRONOUS_IO 21
|
|
|
|
#define _SC_FSYNC 22
|
|
|
|
#define _SC_MAPPED_FILES 23
|
|
|
|
#define _SC_MEMLOCK 24
|
|
|
|
#define _SC_MEMLOCK_RANGE 25
|
|
|
|
#define _SC_MEMORY_PROTECTION 26
|
|
|
|
#define _SC_MESSAGE_PASSING 27
|
|
|
|
#define _SC_PRIORITIZED_IO 28
|
|
|
|
#define _SC_REALTIME_SIGNALS 29
|
|
|
|
#define _SC_SEMAPHORES 30
|
|
|
|
#define _SC_SHARED_MEMORY_OBJECTS 31
|
|
|
|
#define _SC_SYNCHRONIZED_IO 32
|
|
|
|
#define _SC_TIMERS 33
|
2000-12-13 07:41:23 +08:00
|
|
|
#define _SC_AIO_LISTIO_MAX 34
|
|
|
|
#define _SC_AIO_MAX 35
|
|
|
|
#define _SC_AIO_PRIO_DELTA_MAX 36
|
|
|
|
#define _SC_DELAYTIMER_MAX 37
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* P1003.1c/D10, p. 52 adds the following.
|
|
|
|
*/
|
2000-10-25 02:27:54 +08:00
|
|
|
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
#define _SC_THREAD_KEYS_MAX 38
|
|
|
|
#define _SC_THREAD_STACK_MIN 39
|
|
|
|
#define _SC_THREAD_THREADS_MAX 40
|
|
|
|
#define _SC_TTY_NAME_MAX 41
|
|
|
|
|
|
|
|
#define _SC_THREADS 42
|
|
|
|
#define _SC_THREAD_ATTR_STACKADDR 43
|
|
|
|
#define _SC_THREAD_ATTR_STACKSIZE 44
|
|
|
|
#define _SC_THREAD_PRIORITY_SCHEDULING 45
|
|
|
|
#define _SC_THREAD_PRIO_INHERIT 46
|
|
|
|
/* _SC_THREAD_PRIO_PROTECT was _SC_THREAD_PRIO_CEILING in early drafts */
|
|
|
|
#define _SC_THREAD_PRIO_PROTECT 47
|
|
|
|
#define _SC_THREAD_PRIO_CEILING _SC_THREAD_PRIO_PROTECT
|
|
|
|
#define _SC_THREAD_PROCESS_SHARED 48
|
|
|
|
#define _SC_THREAD_SAFE_FUNCTIONS 49
|
2000-12-13 07:41:23 +08:00
|
|
|
#define _SC_GETGR_R_SIZE_MAX 50
|
|
|
|
#define _SC_GETPW_R_SIZE_MAX 51
|
|
|
|
#define _SC_LOGIN_NAME_MAX 52
|
|
|
|
#define _SC_THREAD_DESTRUCTOR_ITERATIONS 53
|
2002-04-05 06:41:11 +08:00
|
|
|
|
|
|
|
#if !defined(__CYGWIN__) && !defined(__rtems__)
|
|
|
|
#define _SC_STREAM_MAX 100
|
|
|
|
#define _SC_PRIORITY_SCHEDULING 101
|
|
|
|
#endif
|
2000-12-11 Joel Sherrill <joel@OARcorp.com>
* Merge RTEMS specific .h files into main libc/include.
* libc/sys/rtems/include/signal.h: Removed.
* libc/sys/rtems/include/time.h: Removed.
* libc/sys/rtems/sys/features.h: Removed.
* libc/sys/rtems/sys/sched.h: Removed.
* libc/sys/rtems/sys/siginfo.h: Removed.
* libc/sys/rtems/sys/signal.h: Removed.
* libc/sys/rtems/sys/time.h: Removed.
* libc/sys/rtems/sys/times.h: Removed.
definitions for time_t and clock_t since these are
no longer in time.h.
* libc/include/pthread.h: New file.
* libc/include/sys/sched.h: New file.
* libc/include/sys/features.h: New file.
* libc/include/time.h: Removed duplicate definition of clock_t
and time_t, get them from <sys/types.h> instead. Add prototypes for POSIX clock and timer functionality.
* libc/sys/linux/sys/types.h: Changed to include
* libc/include/machine/types.h: Add _CLOCKID_T_ and _TIMER_T_.
* libc/include/sys/signal.h: Add more complete set of POSIX
signal functionality including real-time and threaded signals.
* libc/include/sys/types.h: Add clock_t, time_t, struct
timespec, and struct itimerspec. Centralizing these makes
things cleaner. RTEMS uses 64-bit dev_t.
Added numerous primitive definitions
for pthreads including macros, pthread_attr_t,
pthread_mutexattr_t, pthread_condattr_t, pthread_key_t,
pthread_once_t, and pthread_t.
* libc/include/sys/unistd.h: Added getlogin_r() prototype.
If RTEMS follow POSIX on read(), write() and sbrk() prototype.
Feature flags removed and moved to new file <sys/features.h>.
Full set of POSIX sysconf() constants
2000-12-12 09:24:09 +08:00
|
|
|
|
2000-10-25 02:27:54 +08:00
|
|
|
# define _PC_LINK_MAX 0
|
|
|
|
# define _PC_MAX_CANON 1
|
|
|
|
# define _PC_MAX_INPUT 2
|
|
|
|
# define _PC_NAME_MAX 3
|
|
|
|
# define _PC_PATH_MAX 4
|
|
|
|
# define _PC_PIPE_BUF 5
|
|
|
|
# define _PC_CHOWN_RESTRICTED 6
|
|
|
|
# define _PC_NO_TRUNC 7
|
|
|
|
# define _PC_VDISABLE 8
|
|
|
|
# define _PC_ASYNC_IO 9
|
|
|
|
# define _PC_PRIO_IO 10
|
|
|
|
# define _PC_SYNC_IO 11
|
2001-03-19 18:54:55 +08:00
|
|
|
#ifdef __CYGWIN__
|
|
|
|
/* Ask for POSIX permission bits support. */
|
|
|
|
# define _PC_POSIX_PERMISSIONS 90
|
|
|
|
/* Ask for full POSIX permission support including uid/gid settings. */
|
|
|
|
# define _PC_POSIX_SECURITY 91
|
|
|
|
#endif
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
/* FIXME: This is temporary until winsup gets sorted out. */
|
2000-05-31 01:18:05 +08:00
|
|
|
#ifdef __CYGWIN__
|
2000-02-18 03:39:52 +08:00
|
|
|
#define MAXPATHLEN (260 - 1 /* NUL */)
|
|
|
|
#else
|
|
|
|
# define MAXPATHLEN 1024
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* _SYS_UNISTD_H */
|