diff --git a/include/unistd.h b/include/unistd.h index e0b9bbac9580..ae11e40e9173 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,188 +1,198 @@ /*- * Copyright (c) 1991, 1993, 1994 * The 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. * * @(#)unistd.h 8.12 (Berkeley) 4/27/95 */ #ifndef _UNISTD_H_ #define _UNISTD_H_ #include #include #include #define STDIN_FILENO 0 /* standard input file descriptor */ #define STDOUT_FILENO 1 /* standard output file descriptor */ #define STDERR_FILENO 2 /* standard error file descriptor */ #ifndef NULL #define NULL 0 /* null pointer constant */ #endif __BEGIN_DECLS void _exit __P((int)) __dead2; int access __P((const char *, int)); unsigned int alarm __P((unsigned int)); int chdir __P((const char *)); int chown __P((const char *, uid_t, gid_t)); int close __P((int)); int dup __P((int)); int dup2 __P((int, int)); int execl __P((const char *, const char *, ...)); int execle __P((const char *, const char *, ...)); int execlp __P((const char *, const char *, ...)); int execv __P((const char *, char * const *)); int execve __P((const char *, char * const *, char * const *)); int execvp __P((const char *, char * const *)); pid_t fork __P((void)); long fpathconf __P((int, int)); char *getcwd __P((char *, size_t)); gid_t getegid __P((void)); uid_t geteuid __P((void)); gid_t getgid __P((void)); int getgroups __P((int, gid_t [])); char *getlogin __P((void)); pid_t getpgrp __P((void)); pid_t getpid __P((void)); pid_t getppid __P((void)); uid_t getuid __P((void)); int isatty __P((int)); int link __P((const char *, const char *)); +#ifndef _LSEEK_DECLARED +#define _LSEEK_DECLARED off_t lseek __P((int, off_t, int)); +#endif long pathconf __P((const char *, int)); int pause __P((void)); int pipe __P((int *)); ssize_t read __P((int, void *, size_t)); int rmdir __P((const char *)); int setgid __P((gid_t)); int setpgid __P((pid_t, pid_t)); pid_t setsid __P((void)); int setuid __P((uid_t)); unsigned int sleep __P((unsigned int)); long sysconf __P((int)); pid_t tcgetpgrp __P((int)); int tcsetpgrp __P((int, pid_t)); char *ttyname __P((int)); int unlink __P((const char *)); ssize_t write __P((int, const void *, size_t)); extern char *optarg; /* getopt(3) external variables */ extern int optind, opterr, optopt; int getopt __P((int, char * const [], const char *)); #ifndef _POSIX_SOURCE #ifdef __STDC__ struct timeval; /* select(2) */ #endif int acct __P((const char *)); int async_daemon __P((void)); char *brk __P((const char *)); int chroot __P((const char *)); size_t confstr __P((int, char *, size_t)); char *crypt __P((const char *, const char *)); int des_cipher __P((const char *, char *, long, int)); int des_setkey __P((const char *key)); int encrypt __P((char *, int)); void endusershell __P((void)); int exect __P((const char *, char * const *, char * const *)); int fchdir __P((int)); int fchown __P((int, uid_t, gid_t)); int fsync __P((int)); +#ifndef _FTRUNCATE_DECLARED +#define _FTRUNCATE_DECLARED int ftruncate __P((int, off_t)); +#endif int getdomainname __P((char *, int)); int getdtablesize __P((void)); int getgrouplist __P((const char *, int, int *, int *)); long gethostid __P((void)); int gethostname __P((char *, int)); mode_t getmode __P((const void *, mode_t)); int getpagesize __P((void)) __pure2; char *getpass __P((const char *)); char *getusershell __P((void)); char *getwd __P((char *)); /* obsoleted by getcwd() */ int initgroups __P((const char *, int)); int iruserok __P((unsigned long, int, const char *, const char *)); int issetugid __P((void)); int lchown __P((const char *, uid_t, gid_t)); int mknod __P((const char *, mode_t, dev_t)); int mkstemp __P((char *)); char *mktemp __P((char *)); int nfssvc __P((int, void *)); int nice __P((int)); void psignal __P((unsigned int, const char *)); extern __const char *__const sys_siglist[]; int profil __P((char *, int, int, int)); int rcmd __P((char **, int, const char *, const char *, const char *, int *)); char *re_comp __P((const char *)); int re_exec __P((const char *)); int readlink __P((const char *, char *, int)); int reboot __P((int)); int revoke __P((const char *)); pid_t rfork __P((int)); int rresvport __P((int *)); int ruserok __P((const char *, int, const char *, const char *)); char *sbrk __P((int)); int select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); int setdomainname __P((const char *, int)); int setegid __P((gid_t)); int seteuid __P((uid_t)); int setgroups __P((int, const gid_t *)); void sethostid __P((long)); int sethostname __P((const char *, int)); int setkey __P((const char *)); int setlogin __P((const char *)); void *setmode __P((const char *)); int setpgrp __P((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */ int setregid __P((gid_t, gid_t)); int setreuid __P((uid_t, uid_t)); int setrgid __P((gid_t)); int setruid __P((uid_t)); void setusershell __P((void)); int swapon __P((const char *)); int symlink __P((const char *, const char *)); void sync __P((void)); int syscall __P((int, ...)); off_t __syscall __P((quad_t, ...)); +#ifndef _TRUNCATE_DECLARED +#define _TRUNCATE_DECLARED int truncate __P((const char *, off_t)); +#endif int ttyslot __P((void)); unsigned int ualarm __P((unsigned int, unsigned int)); +int undelete __P((const char *)); int unwhiteout __P((const char *)); void usleep __P((unsigned int)); void *valloc __P((size_t)); /* obsoleted by malloc() */ pid_t vfork __P((void)); extern char *suboptarg; /* getsubopt(3) external variable */ int getsubopt __P((char **, char * const *, char **)); #endif /* !_POSIX_SOURCE */ __END_DECLS #endif /* !_UNISTD_H_ */ diff --git a/sys/sys/mman.h b/sys/sys/mman.h index ba1b9b24c8a3..f8d9a0400966 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -1,120 +1,123 @@ /*- * Copyright (c) 1982, 1986, 1993 * The 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. * * @(#)mman.h 8.2 (Berkeley) 1/9/95 - * $Id$ + * $Id: mman.h,v 1.17 1997/02/22 09:45:34 peter Exp $ */ #ifndef _SYS_MMAN_H_ #define _SYS_MMAN_H_ /* * Protections are chosen from these bits, or-ed together */ #define PROT_NONE 0x00 /* no permissions */ #define PROT_READ 0x01 /* pages can be read */ #define PROT_WRITE 0x02 /* pages can be written */ #define PROT_EXEC 0x04 /* pages can be executed */ /* * Flags contain sharing type and options. * Sharing types; choose one. */ #define MAP_SHARED 0x0001 /* share changes */ #define MAP_PRIVATE 0x0002 /* changes are private */ #define MAP_COPY MAP_PRIVATE /* Obsolete */ /* * Other flags */ #define MAP_FIXED 0x0010 /* map addr must be exactly as requested */ #define MAP_RENAME 0x0020 /* Sun: rename private pages to file */ #define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */ #define MAP_INHERIT 0x0080 /* region is retained after exec */ #define MAP_NOEXTEND 0x0100 /* for MAP_FILE, don't change file size */ #define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ /* * Error return from mmap() */ #define MAP_FAILED ((caddr_t)-1) /* * msync() flags */ #define MS_ASYNC 0x0001 /* return immediately */ #define MS_INVALIDATE 0x0002 /* invalidate all cached data */ /* * Mapping type */ #define MAP_FILE 0x0000 /* map from file (default) */ #define MAP_ANON 0x1000 /* allocated from memory, swap space */ /* * Advice to madvise */ #define MADV_NORMAL 0 /* no further special treatment */ #define MADV_RANDOM 1 /* expect random page references */ #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* dont need these pages */ #define MADV_FREE 5 /* dont need these pages, and junk contents */ /* * Return bits from mincore */ #define MINCORE_INCORE 0x1 /* Page is incore */ #define MINCORE_REFERENCED 0x2 /* Page has been referenced by us */ #define MINCORE_MODIFIED 0x4 /* Page has been modified by us */ #define MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */ #define MINCORE_MODIFIED_OTHER 0x10 /* Page has been modified */ #ifndef KERNEL #include __BEGIN_DECLS +#ifndef _MMAP_DECLARED +#define _MMAP_DECLARED caddr_t mmap __P((caddr_t, size_t, int, int, int, off_t)); +#endif int mprotect __P((caddr_t, size_t, int)); int munmap __P((caddr_t, size_t)); int msync __P((caddr_t, size_t, int)); int mlock __P((caddr_t, size_t)); int munlock __P((caddr_t, size_t)); int madvise __P((caddr_t, size_t, int)); int mincore __P((caddr_t, size_t, char *)); int minherit __P((caddr_t, size_t, int)); __END_DECLS #endif /* !KERNEL */ #endif diff --git a/sys/sys/types.h b/sys/sys/types.h index dd9e4dfdfdcb..7469a963e5fc 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -1,175 +1,191 @@ /*- * Copyright (c) 1982, 1986, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * 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. * * @(#)types.h 8.6 (Berkeley) 2/19/95 - * $Id: types.h,v 1.18 1997/02/22 09:46:18 peter Exp $ + * $Id: types.h,v 1.19 1997/04/13 15:27:12 bde Exp $ */ #ifndef _SYS_TYPES_H_ #define _SYS_TYPES_H_ /* Machine type dependent parameters. */ #include /* XXX for __signed in machine/ansi.h */ #include #include #ifndef _POSIX_SOURCE typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef unsigned short ushort; /* Sys V compatibility */ typedef unsigned int uint; /* Sys V compatibility */ #endif typedef u_int64_t u_quad_t; /* quads */ typedef int64_t quad_t; typedef quad_t * qaddr_t; typedef char * caddr_t; /* core address */ typedef int32_t daddr_t; /* disk address */ typedef u_int32_t dev_t; /* device number */ typedef u_int32_t fixpt_t; /* fixed point number */ typedef u_int32_t gid_t; /* group id */ typedef u_int32_t ino_t; /* inode number */ typedef long key_t; /* IPC key (for Sys V IPC) */ typedef u_int16_t mode_t; /* permissions */ typedef u_int16_t nlink_t; /* link count */ typedef _BSD_OFF_T_ off_t; /* file offset */ typedef _BSD_PID_T_ pid_t; /* process id */ typedef quad_t rlim_t; /* resource limit */ typedef int32_t segsz_t; /* segment size */ typedef int32_t swblk_t; /* swap offset */ typedef u_int32_t uid_t; /* user id */ #ifdef KERNEL typedef int boolean_t; typedef struct vm_page *vm_page_t; #endif -/* - * This belongs in unistd.h, but is placed here to ensure that programs - * casting the second parameter of lseek to off_t will get the correct - * version of lseek. - */ -#ifndef KERNEL -__BEGIN_DECLS -off_t lseek __P((int, off_t, int)); -__END_DECLS -#endif - #ifndef _POSIX_SOURCE /* * minor() gives a cookie instead of an index since we don't want to * change the meanings of bits 0-15 or waste time and space shifting * bits 16-31 for devices that don't use them. */ #define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ #define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ #define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ #endif #include #ifdef _BSD_CLOCK_T_ typedef _BSD_CLOCK_T_ clock_t; #undef _BSD_CLOCK_T_ #endif #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ #endif #ifdef _BSD_SSIZE_T_ typedef _BSD_SSIZE_T_ ssize_t; #undef _BSD_SSIZE_T_ #endif #ifdef _BSD_TIME_T_ typedef _BSD_TIME_T_ time_t; #undef _BSD_TIME_T_ #endif #ifndef _POSIX_SOURCE #define NBBY 8 /* number of bits in a byte */ /* * Select uses bit masks of file descriptors in longs. These macros * manipulate such bit fields (the filesystem macros use chars). * FD_SETSIZE may be defined by the user, but the default here should * be enough for most uses. */ #ifndef FD_SETSIZE #define FD_SETSIZE 1024 #endif typedef long fd_mask; #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ #ifndef howmany #define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif typedef struct fd_set { fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; } fd_set; #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) #define FD_COPY(f, t) bcopy(f, t, sizeof(*(f))) #define FD_ZERO(p) bzero(p, sizeof(*(p))) +/* + * These declarations belong elsewhere, but are repeated here and in + * to give broken programs a better chance of working with + * 64-bit off_t's. + */ +#ifndef KERNEL +#include +__BEGIN_DECLS +#ifndef _FTRUNCATE_DECLARED +#define _FTRUNCATE_DECLARED +int ftruncate __P((int, off_t)); +#endif +#ifndef _LSEEK_DECLARED +#define _LSEEK_DECLARED +off_t lseek __P((int, off_t, int)); +#endif +#ifndef _MMAP_DECLARED +#define _MMAP_DECLARED +caddr_t mmap __P((caddr_t, size_t, int, int, int, off_t)); +#endif +#ifndef _TRUNCATE_DECLARED +#define _TRUNCATE_DECLARED +int truncate __P((const char *, off_t)); +#endif +__END_DECLS +#endif /* !KERNEL */ + #if defined(__STDC__) && defined(KERNEL) /* * Forward structure declarations for function prototypes. We include the * common structures that cross subsystem boundaries here; others are mostly * used in the same place that the structure is defined. */ struct proc; struct pgrp; struct ucred; struct rusage; struct file; struct buf; struct tty; struct uio; #endif #endif /* !_POSIX_SOURCE */ #endif /* !_SYS_TYPES_H_ */