diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-05-14 04:16:35 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-05-14 04:16:35 +0000 |
commit | 64bc6412188b141c010ac3b8e813b837dd991e80 (patch) | |
tree | ffa12b79ea4b13191754f54b872eb1a4f9e3a04b /include/sys |
Initial revision
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/bitypes.h | 94 | ||||
-rw-r--r-- | include/sys/cdefs.h | 36 | ||||
-rw-r--r-- | include/sys/dir.h | 17 | ||||
-rw-r--r-- | include/sys/errno.h | 1 | ||||
-rw-r--r-- | include/sys/fcntl.h | 1 | ||||
-rw-r--r-- | include/sys/file.h | 35 | ||||
-rw-r--r-- | include/sys/ioctl.h | 17 | ||||
-rw-r--r-- | include/sys/mman.h | 35 | ||||
-rw-r--r-- | include/sys/mount.h | 17 | ||||
-rw-r--r-- | include/sys/param.h | 46 | ||||
-rw-r--r-- | include/sys/resource.h | 73 | ||||
-rw-r--r-- | include/sys/signal.h | 1 | ||||
-rw-r--r-- | include/sys/socket.h | 135 | ||||
-rw-r--r-- | include/sys/socketcall.h | 22 | ||||
-rw-r--r-- | include/sys/socketio.h | 1 | ||||
-rw-r--r-- | include/sys/socketvar.h | 8 | ||||
-rw-r--r-- | include/sys/stat.h | 192 | ||||
-rw-r--r-- | include/sys/syscall.h | 182 | ||||
-rw-r--r-- | include/sys/syslog.h | 200 | ||||
-rw-r--r-- | include/sys/termios.h | 4 | ||||
-rw-r--r-- | include/sys/time.h | 81 | ||||
-rw-r--r-- | include/sys/times.h | 21 | ||||
-rw-r--r-- | include/sys/types.h | 4 | ||||
-rw-r--r-- | include/sys/uio.h | 65 | ||||
-rw-r--r-- | include/sys/un.h | 1 | ||||
-rw-r--r-- | include/sys/utsname.h | 18 | ||||
-rw-r--r-- | include/sys/vfs.h | 17 | ||||
-rw-r--r-- | include/sys/vm86.h | 125 | ||||
-rw-r--r-- | include/sys/wait.h | 146 |
29 files changed, 1595 insertions, 0 deletions
diff --git a/include/sys/bitypes.h b/include/sys/bitypes.h new file mode 100644 index 000000000..e2ac0ab45 --- /dev/null +++ b/include/sys/bitypes.h @@ -0,0 +1,94 @@ +/* + * bitypes.h,v 1.4 1995/08/24 01:58:54 hjl Exp + */ + +/* + * ++Copyright++ 1993 + * - + * Copyright (c) 1993 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * - + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * - + * --Copyright-- + */ + +/* +#ifdef __USE_BSD +*/ + +/* +#ifndef __BIT_TYPES_DEFINED__ +# if (defined(BSD) && (BSD >= 199306)) || \ + (defined(_BSDI_VERSION) && (_BSDI_VERSION >= 199312)) +# define __BIT_TYPES_DEFINED__ +# endif +#endif +*/ + +#ifndef __BIT_TYPES_DEFINED__ +#define __BIT_TYPES_DEFINED__ + + /* + * Basic integral types. Omit the typedef if + * not possible for a machine/compiler combination. + */ + typedef /*signed*/ char int8_t; + typedef unsigned char u_int8_t; + typedef short int16_t; + typedef unsigned short u_int16_t; + typedef int int32_t; + typedef unsigned int u_int32_t; + +# if __GNUC__ >= 2 && !defined(__STRICT_ANSI__) + typedef long long int64_t; + typedef unsigned long long u_int64_t; +# endif + +#endif /* __BIT_TYPES_DEFINED__ */ + +/* #endif __USE_BSD */ diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h new file mode 100644 index 000000000..0afc8830f --- /dev/null +++ b/include/sys/cdefs.h @@ -0,0 +1,36 @@ + +#ifndef __SYS_CDEFS_H +#define __SYS_CDEFS_H +#include <features.h> + +#if defined (__STDC__) && __STDC__ + +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +/* This is not a typedef so `const __ptr_t' does the right thing. */ +#define __ptr_t void * +typedef long double __long_double_t; + +#else + +#define __CONCAT(x,y) x/**/y +#define __STRING(x) "x" + +#define __ptr_t char * + +#ifndef __HAS_NO_FLOATS__ +typedef double __long_double_t; +#endif + +#endif + +/* No C++ */ +#define __BEGIN_DECLS +#define __END_DECLS + +/* GNUish things */ +#define __CONSTVALUE +#define __CONSTVALUE2 + +#endif diff --git a/include/sys/dir.h b/include/sys/dir.h new file mode 100644 index 000000000..1c2cea7df --- /dev/null +++ b/include/sys/dir.h @@ -0,0 +1,17 @@ +#ifdef _SYS_DIRENT_H +#error "Can't include both sys/dir.h and sys/dirent.h" +#define _SYS_DIR_H +#endif + +#ifndef _SYS_DIR_H +#define _SYS_DIR_H + +#include <dirent.h> + +#define direct dirent + +#undef DIRSIZ +#define DIRSIZ(dp) ((sizeof (struct direct) - (MAXNAMLEN+1)) + \ + (((dp)->d_namlen+1 + 3) &~ 3)) + +#endif diff --git a/include/sys/errno.h b/include/sys/errno.h new file mode 100644 index 000000000..339f4fc10 --- /dev/null +++ b/include/sys/errno.h @@ -0,0 +1 @@ +#include <errno.h> diff --git a/include/sys/fcntl.h b/include/sys/fcntl.h new file mode 100644 index 000000000..cd304557e --- /dev/null +++ b/include/sys/fcntl.h @@ -0,0 +1 @@ +#include <fcntl.h> diff --git a/include/sys/file.h b/include/sys/file.h new file mode 100644 index 000000000..2401b155a --- /dev/null +++ b/include/sys/file.h @@ -0,0 +1,35 @@ +#ifndef _SYS_FILE_H +#define _SYS_FILE_H + +#include <features.h> +#include <fcntl.h> + +#ifndef L_SET + +#define L_SET 0 /* absolute offset */ +#define L_INCR 1 /* relative to current offset */ +#define L_XTND 2 /* relative to end of file */ + +#endif + +#ifndef LOCK_SH + +/* Operations for the `flock' call. */ +#define LOCK_SH 1 /* Shared lock. */ +#define LOCK_EX 2 /* Exclusive lock. */ +#define LOCK_UN 8 /* Unlock. */ + +/* Can be OR'd in to one of the above. */ +#define LOCK_NB 4 /* Don't block when locking. */ + +#endif + +__BEGIN_DECLS + +/* Apply or remove an advisory lock, according to OPERATION, + on the file FD refers to. */ +extern int flock __P ((int __fd, int __operation)); + +__END_DECLS + +#endif diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h new file mode 100644 index 000000000..11dd06edb --- /dev/null +++ b/include/sys/ioctl.h @@ -0,0 +1,17 @@ +#ifndef _SYS_IOCTL_H +#define _SYS_IOCTL_H + +#include <linux/ioctl.h> +#include <features.h> +#include <termios.h> +#include <sys/socketio.h> + +__BEGIN_DECLS + +extern int ioctl __P ((int __fildes, int __cmd, ...)); +extern int __ioctl __P ((int __fildes, int __cmd, ...)); + +__END_DECLS + + +#endif diff --git a/include/sys/mman.h b/include/sys/mman.h new file mode 100644 index 000000000..8dc79d909 --- /dev/null +++ b/include/sys/mman.h @@ -0,0 +1,35 @@ +#ifndef _SYS_MMAN_H +#define _SYS_MMAN_H + +#include <features.h> +#include <sys/types.h> +#include <linux/mman.h> + +#ifndef MAP_ANON +#define MAP_ANON MAP_ANONYMOUS /* idem */ +#endif +#ifndef MAP_FILE +#define MAP_FILE 0x00 /* The 'normal' way: mapped from file */ +#endif + +__BEGIN_DECLS + +extern __ptr_t mmap __P((__ptr_t __addr, size_t __len, + int __prot, int __flags, int __fd, off_t __off)); +extern int munmap __P((__ptr_t __addr, size_t __len)); +extern int mprotect __P ((__const __ptr_t __addr, size_t __len, int __prot)); + +extern int msync __P((__ptr_t __addr, size_t __len, int __flags)); + +extern int mlock __P((__const __ptr_t __addr, size_t __len)); +extern int munlock __P((__const __ptr_t __addr, size_t __len)); + +extern int mlockall __P((int __flags)); +extern int munlockall __P((void)); + +extern __ptr_t mremap __P((__ptr_t __addr, size_t __old_len, + size_t __new_len, int __may_move)); + +__END_DECLS + +#endif /* _SYS_MMAN_H */ diff --git a/include/sys/mount.h b/include/sys/mount.h new file mode 100644 index 000000000..a0765e2ee --- /dev/null +++ b/include/sys/mount.h @@ -0,0 +1,17 @@ +#ifndef _SYS_MOUNT_H +#define _SYS_MOUNT_H + +#include <features.h> + +__BEGIN_DECLS + +extern int mount __P ((__const char* __specialfile, + __const char* __dir,__const char* __filesystemype, + unsigned long __rwflag,__const void *__data)); + +extern int umount __P ((__const char* __specialfile)); + + +__END_DECLS + +#endif diff --git a/include/sys/param.h b/include/sys/param.h new file mode 100644 index 000000000..906a0a230 --- /dev/null +++ b/include/sys/param.h @@ -0,0 +1,46 @@ +/* Copyright (C) 1996 Robert de Bath <rdebath@cix.compulink.co.uk> + * This file is part of the Linux-8086 C library and is distributed + * under the GNU Library General Public License. + */ + +#ifndef _PARAM_H +#define _PARAM_H + +#include <features.h> +#include <limits.h> +#include <linux/limits.h> +#include <linux/param.h> + +#include <sys/types.h> + +#define MAXPATHLEN PATH_MAX + +#ifndef NR_OPEN +#define NR_OPEN 32 +#endif +#ifndef NR_FILE +#define NR_FILE 32 +#endif + +/* Bit map related macros. */ +#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) +#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) +#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) +#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) + +/* Macros for counting and rounding. */ +#ifndef howmany +#define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#define powerof2(x) ((((x)-1)&(x))==0) + +/* Macros for min/max. */ +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) + + +/* Unit of `st_blocks'. */ +#define DEV_BSIZE 512 + +#endif /* _PARAM_H */ diff --git a/include/sys/resource.h b/include/sys/resource.h new file mode 100644 index 000000000..19ed06f50 --- /dev/null +++ b/include/sys/resource.h @@ -0,0 +1,73 @@ +/* + * Resource control/accounting header file for linux-86 + */ + +#ifndef _SYS_RESOURCE_H +#define _SYS_RESOURCE_H + +#include <features.h> +#include <sys/time.h> +#include <limits.h> + +#define RUSAGE_SELF 0 +#define RUSAGE_CHILDREN (-1) +#define RUSAGE_BOTH (-2) /* sys_wait4() uses this */ + +struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + long ru_maxrss; /* maximum resident set size */ + long ru_ixrss; /* integral shared memory size */ + long ru_idrss; /* integral unshared data size */ + long ru_isrss; /* integral unshared stack size */ + long ru_minflt; /* page reclaims */ + long ru_majflt; /* page faults */ + long ru_nswap; /* swaps */ + long ru_inblock; /* block input operations */ + long ru_oublock; /* block output operations */ + long ru_msgsnd; /* messages sent */ + long ru_msgrcv; /* messages received */ + long ru_nsignals; /* signals received */ + long ru_nvcsw; /* voluntary context switches */ + long ru_nivcsw; /* involuntary " */ +}; + +#define RLIM_INFINITY ((long)(~0UL>>1)) + +struct rlimit { + long rlim_cur; + long rlim_max; +}; + +#define PRIO_MIN (-20) +#define PRIO_MAX 20 + +#define PRIO_PROCESS 0 +#define PRIO_PGRP 1 +#define PRIO_USER 2 + +#define RLIMIT_CPU 0 /* CPU time in ms */ +#define RLIMIT_FSIZE 1 /* Maximum filesize */ +#define RLIMIT_DATA 2 /* max data size */ +#define RLIMIT_STACK 3 /* max stack size */ +#define RLIMIT_CORE 4 /* max core file size */ +#define RLIMIT_RSS 5 /* max resident set size */ +#define RLIMIT_NPROC 6 /* max number of processes */ +#define RLIMIT_NOFILE 7 /* max number of open files */ +#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ + +#define RLIM_NLIMITS 9 + +extern int getrlimit __P ((int __resource, + struct rlimit *__rlp)); +extern int setrlimit __P ((int __resource, + __const struct rlimit *__rlp)); + +extern int getpriority __P((int __which, int __who)); +extern int setpriority __P((int __which, int __who, + int __prio)); + +extern int __getrusage __P ((int __who, struct rusage *__rusage)); +extern int getrusage __P ((int __who, struct rusage *__rusage)); + +#endif /* _SYS_RESOURCE_H */ diff --git a/include/sys/signal.h b/include/sys/signal.h new file mode 100644 index 000000000..2e602dad8 --- /dev/null +++ b/include/sys/signal.h @@ -0,0 +1 @@ +#include <signal.h> diff --git a/include/sys/socket.h b/include/sys/socket.h new file mode 100644 index 000000000..5dcef2d1b --- /dev/null +++ b/include/sys/socket.h @@ -0,0 +1,135 @@ +#ifndef _SYS_SOCKET_H +#define _SYS_SOCKET_H + +#include <features.h> +#include <sys/types.h> +#include <linux/socket.h> + +#ifdef _MIT_POSIX_THREADS +#include <pthread/mit/posix.h> +#endif + +__BEGIN_DECLS + +/* struct msghdr is not defined in linux 1.2. This will allow sendmsg + and recvmsg in libc 5.2.9 to compile under 1.2.x and shouldn't cause + any problem for 1.3.x */ +struct msghdr; + +/* Create a new socket of type TYPE in domain DOMAIN, using + protocol PROTOCOL. If PROTOCOL is zero, one is chosen + automatically. Returns a file descriptor for the new socket, + or -1 for errors. */ +int socket __P ((int __family, int __type, int __protocol)); + +/* Create two new sockets, of type TYPE in domain DOMAIN and using + protocol PROTOCOL, which are connected to each other, and put file + descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero, + one will be chosen automatically. Returns 0 on success, -1 + for errors. */ +int socketpair __P ((int __family, int __type, int __protocol, + int __sockvec[2])); + +/* Give the socket FD the local address ADDR (which is LEN bytes + long). */ +int bind __P ((int __sockfd, __const struct sockaddr *__my_addr, + int __addrlen)); + +/* Open a connection on socket FD to peer at ADDR (which LEN bytes + long). For connectionless socket types, just set the default + address to send to and the only address from which to accept + transmissions. Return 0 on success, -1 for errors. */ +int connect __P ((int __sockfd, __const struct sockaddr *__serv_addr, + int __addrlen)); + +/* Prepare to accept connections on socket FD. + N connection requests will be queued before further requests are + refused. Returns 0 on success, -1 for errors. */ +int listen __P ((int __sockfd, int __n)); + +/* Await a connection on socket FD. + When a connection arrives, open a new socket to communicate with it, + set *ADDR (which is *ADDR_LEN bytes long) to the address of the + connecting peer and *ADDR_LEN to the address's actual length, and + return the new socket's descriptor, or -1 for errors. */ +int accept __P ((int __sockfd, __const struct sockaddr *__peer, + int *__paddrlen)); + +/* Put the current value for socket FD's option OPTNAME at protocol + level LEVEL into OPTVAL (which is *OPTLEN bytes long), and set + *OPTLEN to the value's actual length. Returns 0 on success, -1 for + errors. */ +int getsockopt __P ((int __s, int __level, int __optname, + void *__optval, int *__optlen)); + +/* Set socket FD's option OPTNAME at protocol level LEVEL + to *OPTVAL (which is OPTLEN bytes long). + Returns 0 on success, -1 for errors. */ +int setsockopt __P ((int __s, int __level, int __optname, + __const void *__optval, int optlen)); + +/* Put the local address of FD into *ADDR and its length in *LEN. */ +int getsockname __P ((int __sockfd, struct sockaddr *__addr, + int *__paddrlen)); + +/* Put the address of the peer connected to socket FD into *ADDR + (which is *LEN bytes long), and its actual length into *LEN. */ +int getpeername __P ((int __sockfd, struct sockaddr *__peer, + int *__paddrlen)); + +/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */ +int send __P ((int __sockfd, __const void *__buff, size_t __len, + unsigned int __flags)); + +/* Read N bytes into BUF from socket FD. + Returns the number read or -1 for errors. */ +int recv __P ((int __sockfd, void *__buff, size_t __len, + unsigned int __flags)); + +/* Send N bytes of BUF on socket FD to peer at address ADDR (which is + ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */ +int sendto __P ((int __sockfd, __const void *__buff, size_t __len, + unsigned int __flags, __const struct sockaddr *__to, + int __tolen)); + +/* Read N bytes into BUF through socket FD. + If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address + of the sender, and store the actual size of the address in + *ADDR_LEN. Returns the number of bytes read or -1 for errors. */ +int recvfrom __P ((int __sockfd, void *__buff, size_t __len, + unsigned int __flags, struct sockaddr *__from, + int *__fromlen)); + +/* Send a message described MESSAGE on socket FD. + Returns the number of bytes sent, or -1 for errors. */ +extern int sendmsg __P ((int __fd, __const struct msghdr *__message, + unsigned int __flags)); + +/* Receive a message as described by MESSAGE from socket FD. + Returns the number of bytes read or -1 for errors. */ +extern int recvmsg __P ((int __fd, struct msghdr *__message, + unsigned int __flags)); + +/* Shut down all or part of the connection open on socket FD. + HOW determines what to shut down: + 0 = No more receptions; + 1 = No more transmissions; + 2 = No more receptions or transmissions. + Returns 0 on success, -1 for errors. */ +int shutdown __P ((int __sockfd, int __how)); + + +/* belongs here or elsewhere? */ +int rcmd __P ((char **__ahost, unsigned short __inport, + __const char *__locuser, __const char *__remuser, + __const char *__cmd, int *__fd2p)); +int rresvport __P ((int *__port)); +int ruserok __P ((__const char *__rhost, int __superuser, + __const char *__ruser, __const char *__luser)); +int rexec __P ((char **__ahost, int __inport, __const char *__user, + __const char *__passwd, __const char *__cmd, + int *__fd2p)); + +__END_DECLS + +#endif /* _SYS_SOCKET_H */ diff --git a/include/sys/socketcall.h b/include/sys/socketcall.h new file mode 100644 index 000000000..52e958395 --- /dev/null +++ b/include/sys/socketcall.h @@ -0,0 +1,22 @@ +#ifndef _SYS_SOCKETCALL_H +#define _SYS_SOCKETCALL_H + +#define SYS_SOCKET 1 +#define SYS_BIND 2 +#define SYS_CONNECT 3 +#define SYS_LISTEN 4 +#define SYS_ACCEPT 5 +#define SYS_GETSOCKNAME 6 +#define SYS_GETPEERNAME 7 +#define SYS_SOCKETPAIR 8 +#define SYS_SEND 9 +#define SYS_RECV 10 +#define SYS_SENDTO 11 +#define SYS_RECVFROM 12 +#define SYS_SHUTDOWN 13 +#define SYS_SETSOCKOPT 14 +#define SYS_GETSOCKOPT 15 +#define SYS_SENDMSG 16 +#define SYS_RECVMSG 17 + +#endif _SYS_SOCKETCALL_H diff --git a/include/sys/socketio.h b/include/sys/socketio.h new file mode 100644 index 000000000..332bcf0dc --- /dev/null +++ b/include/sys/socketio.h @@ -0,0 +1 @@ +#include <linux/sockios.h> diff --git a/include/sys/socketvar.h b/include/sys/socketvar.h new file mode 100644 index 000000000..283356534 --- /dev/null +++ b/include/sys/socketvar.h @@ -0,0 +1,8 @@ +/* + * This seems the best way to handle this. sys/socket.h already has + * all the right bits in it. In fact there isn't a single useful thing + * in the BSD net-2 sys/socketvar.h anyway but people persist in including + * it... + * Alan + */ +#include <sys/socket.h> diff --git a/include/sys/stat.h b/include/sys/stat.h new file mode 100644 index 000000000..e486d755c --- /dev/null +++ b/include/sys/stat.h @@ -0,0 +1,192 @@ +#ifndef _SYS_STAT_H +#define _SYS_STAT_H + +#include <features.h> +#include <sys/types.h> +#undef __NOT_KERNEL +#define __NOT_KERNEL +#include <linux/stat.h> +#undef __NOT_KERNEL + +#ifdef __SVR4_I386_ABI_L1__ +#include <sys/time.h> /* For timestruc_t */ +#endif /* __SVR4_I386_ABI_L1__ */ + +__BEGIN_DECLS + +struct stat { + dev_t st_dev; + +#ifdef __SVR4_I386_ABI_L1__ + long st_pad1[3]; +#else + unsigned short __pad1; +#endif + + ino_t st_ino; + umode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + +#ifdef __SVR4_I386_ABI_L1__ + long st_pad2[2]; +#else + unsigned short __pad2; +#endif + + off_t st_size; + +#ifdef __SVR4_I386_ABI_L1__ + timestruc_t st_atim; + timestruc_t st_mtim; + timestruc_t st_ctim; + long st_blksize; + long st_blocks; + +#define FSTYPSZ 16 + + char st_fstype[FSTYPSZ]; + long st_pad4[8]; + +#define st_atime st_atim.tv_sec +#define st_mtime st_mtim.tv_sec +#define st_ctime st_ctim.tv_sec + +#else /*! __SVR4_I386_ABI_L1__*/ + unsigned long st_blksize; + unsigned long st_blocks; + time_t st_atime; + unsigned long __unused1; + time_t st_mtime; + unsigned long __unused2; + time_t st_ctime; + unsigned long __unused3; + unsigned long __unused4; + unsigned long __unused5; +#endif /*! __SVR4_I386_ABI_L1__*/ +}; + + +#define LINUX_MKNOD_VERSION 1 /* SVr4 */ +#define LINUX_STAT_VERSION 1 /* SVr4 */ + +extern int _fxstat __P ((int __ver, int __fildes, + struct stat *__stat_buf)); + +extern int _xstat __P ((int __ver, __const char *__filename, + struct stat *__stat_buf)); + +extern int _lxstat __P ((int __ver, __const char *__filename, + struct stat *__stat_buf)); + +#ifdef _MIT_POSIX_THREADS +extern int __machdep_sys__fxstat __P ((int __ver, int __fd, + struct stat *__stat_buf)); +#endif + +extern int _xmknod __P ((int __ver, __const char *__path, + mode_t __mode, dev_t *__dev)); + +/* Some synonyms used historically in the kernel and elsewhere */ +#define S_IREAD S_IRUSR /* read permission, owner */ +#define S_IWRITE S_IWUSR /* write permission, owner */ +#define S_IEXEC S_IXUSR /* execute/search permission, owner */ + +extern int __chmod __P ((__const char *__path, mode_t __mode)); +extern int chmod __P ((__const char *__path, mode_t __mode)); + +extern int __fchmod __P ((int __fildes, mode_t __mode)); +extern int fchmod __P ((int __fildes, mode_t __mode)); + +extern int __mkdir __P ((__const char *__path, mode_t __mode)); +extern int mkdir __P ((__const char *__path, mode_t __mode)); + +extern int mkfifo __P ((__const char *__path, mode_t __mode)); + +#if 1 + +extern int __fstat __P ((int __fildes, struct stat *__stat_buf)); +extern int fstat __P ((int __fildes, struct stat *__stat_buf)); + +extern int __stat __P ((__const char *__filename, + struct stat *__stat_buf)); +extern int stat __P ((__const char *__filename, + struct stat *__stat_buf)); + +extern int __lstat __P ((__const char *__filename, + struct stat *__stat_buf)); +extern int lstat __P ((__const char *__filename, + struct stat *__stat_buf)); + +extern int __mknod __P ((__const char *__path, mode_t __mode, + dev_t __dev)); +extern int mknod __P ((__const char *__path, mode_t __mode, + dev_t __dev)); +#endif /* #if 0 */ + +extern mode_t __umask __P ((mode_t __mask)); +extern mode_t umask __P ((mode_t __mask)); + +__END_DECLS + +#if 0 + +static __inline__ int __stat(__const char * __path, struct stat * __statbuf) +{ + return _xstat(LINUX_STAT_VERSION, __path, __statbuf); +} + +static __inline__ int stat(__const char * __path, struct stat * __statbuf) +{ + return _xstat(LINUX_STAT_VERSION, __path, __statbuf); +} + +static __inline__ int __lstat(__const char * __path, struct stat * __statbuf) +{ + return _lxstat(LINUX_STAT_VERSION, __path, __statbuf); +} + +static __inline__ int lstat(__const char * __path, struct stat * __statbuf) +{ + return _lxstat(LINUX_STAT_VERSION, __path, __statbuf); +} + +static __inline__ int __fstat(int __fd, struct stat * __statbuf) +{ + return _fxstat(LINUX_STAT_VERSION, __fd, __statbuf); +} + +static __inline__ int fstat(int __fd, struct stat * __statbuf) +{ + return _fxstat(LINUX_STAT_VERSION, __fd, __statbuf); +} + +static __inline__ int __mknod(__const char * __path, mode_t __mode, dev_t __dev) +{ + return _xmknod(LINUX_MKNOD_VERSION, __path, __mode, &__dev); +} + +static __inline__ int mknod(__const char * __path, mode_t __mode, dev_t __dev) +{ + return _xmknod(LINUX_MKNOD_VERSION, __path, __mode, &__dev); +} + +#ifdef _MIT_POSIX_THREADS + +static __inline__ int __machdep_sys_fstat(int __fd, struct stat * __statbuf) +{ + return __machdep_sys__fxstat(LINUX_STAT_VERSION, __fd, __statbuf); +} + +static __inline__ int machdep_sys_fstat(int __fd, struct stat * __statbuf) +{ + return __machdep_sys__fxstat(LINUX_STAT_VERSION, __fd, __statbuf); +} + +#endif + +#endif + +#endif diff --git a/include/sys/syscall.h b/include/sys/syscall.h new file mode 100644 index 000000000..f4ca99f18 --- /dev/null +++ b/include/sys/syscall.h @@ -0,0 +1,182 @@ +#ifndef _SYS_SYSCALL_H +#define _SYS_SYSCALL_H + +#define SYS_setup 0 /* Used only by init, to get system going. */ +#define SYS_exit 1 +#define SYS_fork 2 +#define SYS_read 3 +#define SYS_write 4 +#define SYS_open 5 +#define SYS_close 6 +#define SYS_waitpid 7 +#define SYS_creat 8 +#define SYS_link 9 +#define SYS_unlink 10 +#define SYS_execve 11 +#define SYS_chdir 12 +#define SYS_time 13 +#define SYS_mknod 14 +#define SYS_prev_mknod 14 +#define SYS_chmod 15 +#define SYS_chown 16 +#define SYS_break 17 +#define SYS_oldstat 18 +#define SYS_lseek 19 +#define SYS_getpid 20 +#define SYS_mount 21 +#define SYS_umount 22 +#define SYS_setuid 23 +#define SYS_getuid 24 +#define SYS_stime 25 +#define SYS_ptrace 26 +#define SYS_alarm 27 +#define SYS_oldfstat 28 +#define SYS_pause 29 +#define SYS_utime 30 +#define SYS_stty 31 +#define SYS_gtty 32 +#define SYS_access 33 +#define SYS_nice 34 +#define SYS_ftime 35 +#define SYS_sync 36 +#define SYS_kill 37 +#define SYS_rename 38 +#define SYS_mkdir 39 +#define SYS_rmdir 40 +#define SYS_dup 41 +#define SYS_pipe 42 +#define SYS_times 43 +#define SYS_prof 44 +#define SYS_brk 45 +#define SYS_setgid 46 +#define SYS_getgid 47 +#define SYS_signal 48 +#define SYS_geteuid 49 +#define SYS_getegid 50 +#define SYS_acct 51 +#define SYS_phys 52 +#define SYS_lock 53 +#define SYS_ioctl 54 +#define SYS_fcntl 55 +#define SYS_mpx 56 +#define SYS_setpgid 57 |