Index: head/sys/sys/_sigset.h =================================================================== --- head/sys/sys/_sigset.h (revision 92718) +++ head/sys/sys/_sigset.h (revision 92719) @@ -1,309 +1,308 @@ /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 * 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. * * @(#)signal.h 8.4 (Berkeley) 5/4/95 * $FreeBSD$ */ #ifndef _SYS_SIGNAL_H_ #define _SYS_SIGNAL_H_ #include #include /* * sigset_t macros. */ #define _SIG_WORDS 4 #define _SIG_MAXSIG 128 #define _SIG_IDX(sig) ((sig) - 1) #define _SIG_WORD(sig) (_SIG_IDX(sig) >> 5) #define _SIG_BIT(sig) (1 << (_SIG_IDX(sig) & 31)) #define _SIG_VALID(sig) ((sig) <= _SIG_MAXSIG && (sig) > 0) /* * System defined signals. */ #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt */ #define SIGQUIT 3 /* quit */ #define SIGILL 4 /* illegal instr. (not reset when caught) */ #ifndef _POSIX_SOURCE #define SIGTRAP 5 /* trace trap (not reset when caught) */ #endif #define SIGABRT 6 /* abort() */ #ifndef _POSIX_SOURCE #define SIGIOT SIGABRT /* compatibility */ #define SIGEMT 7 /* EMT instruction */ #endif #define SIGFPE 8 /* floating point exception */ #define SIGKILL 9 /* kill (cannot be caught or ignored) */ #ifndef _POSIX_SOURCE #define SIGBUS 10 /* bus error */ #endif #define SIGSEGV 11 /* segmentation violation */ #ifndef _POSIX_SOURCE #define SIGSYS 12 /* non-existent system call invoked */ #endif #define SIGPIPE 13 /* write on a pipe with no one to read it */ #define SIGALRM 14 /* alarm clock */ #define SIGTERM 15 /* software termination signal from kill */ #ifndef _POSIX_SOURCE #define SIGURG 16 /* urgent condition on IO channel */ #endif #define SIGSTOP 17 /* sendable stop signal not from tty */ #define SIGTSTP 18 /* stop signal from tty */ #define SIGCONT 19 /* continue a stopped process */ #define SIGCHLD 20 /* to parent on child stop or exit */ #define SIGTTIN 21 /* to readers pgrp upon background tty read */ #define SIGTTOU 22 /* like TTIN if (tp->t_local<OSTOP) */ #ifndef _POSIX_SOURCE #define SIGIO 23 /* input/output possible signal */ #define SIGXCPU 24 /* exceeded CPU time limit */ #define SIGXFSZ 25 /* exceeded file size limit */ #define SIGVTALRM 26 /* virtual time alarm */ #define SIGPROF 27 /* profiling time alarm */ #define SIGWINCH 28 /* window size changes */ #define SIGINFO 29 /* information request */ #endif #define SIGUSR1 30 /* user defined signal 1 */ #define SIGUSR2 31 /* user defined signal 2 */ /*- * Type of a signal handling function. * * Language spec sez signal handlers take exactly one arg, even though we * actually supply three. Ugh! * * We don't try to hide the difference by leaving out the args because * that would cause warnings about conformant programs. Nonconformant * programs can avoid the warnings by casting to (__sighandler_t *) or * sig_t before calling signal() or assigning to sa_handler or sv_handler. * * The kernel should reverse the cast before calling the function. It * has no way to do this, but on most machines 1-arg and 3-arg functions * have the same calling protocol so there is no problem in practice. * A bit in sa_flags could be used to specify the number of args. */ -typedef void __sighandler_t __P((int)); +typedef void __sighandler_t(int); #define SIG_DFL ((__sighandler_t *)0) #define SIG_IGN ((__sighandler_t *)1) #define SIG_ERR ((__sighandler_t *)-1) #if defined(_P1003_1B_VISIBLE) || defined(_KERNEL) union sigval { /* Members as suggested by Annex C of POSIX 1003.1b. */ int sigval_int; void *sigval_ptr; }; struct sigevent { int sigev_notify; /* Notification type */ union { int __sigev_signo; /* Signal number */ int __sigev_notify_kqueue; } __sigev_u; union sigval sigev_value; /* Signal value */ }; #define sigev_signo __sigev_u.__sigev_signo #define sigev_notify_kqueue __sigev_u.__sigev_notify_kqueue #define SIGEV_NONE 0 /* No async notification */ #define SIGEV_SIGNAL 1 /* Generate a queued signal */ #define SIGEV_KEVENT 3 /* Generate a kevent */ typedef struct __siginfo { int si_signo; /* signal number */ int si_errno; /* errno association */ /* * Cause of signal, one of the SI_ macros or signal-specific * values, i.e. one of the FPE_... values for SIGFPE. This * value is equivalent to the second argument to an old-style * FreeBSD signal handler. */ int si_code; /* signal code */ int si_pid; /* sending process */ unsigned int si_uid; /* sender's ruid */ int si_status; /* exit value */ void *si_addr; /* faulting instruction */ union sigval si_value; /* signal value */ long si_band; /* band event for SIGPOLL */ int __spare__[7]; /* gimme some slack */ } siginfo_t; #endif /* _P1003_1B_VISIBLE */ typedef struct __sigset { unsigned int __bits[_SIG_WORDS]; } sigset_t; /* * XXX - there are some nasty dependencies on include file order. Now that * sigset_t has been defined we can include the MD header. */ #include /* sig_atomic_t; trap codes; sigcontext */ #if !defined(_ANSI_SOURCE) struct __siginfo; /* * Signal vector "template" used in sigaction call. */ struct sigaction { union { - void (*__sa_handler) __P((int)); - void (*__sa_sigaction) __P((int, struct __siginfo *, - void *)); + void (*__sa_handler)(int); + void (*__sa_sigaction)(int, struct __siginfo *, void *); } __sigaction_u; /* signal handler */ int sa_flags; /* see signal options below */ sigset_t sa_mask; /* signal mask to apply */ }; /* if SA_SIGINFO is set, sa_sigaction is to be used instead of sa_handler. */ #define sa_handler __sigaction_u.__sa_handler #define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ #if !defined(_POSIX_SOURCE) #define sa_sigaction __sigaction_u.__sa_sigaction #define SA_ONSTACK 0x0001 /* take signal on signal stack */ #define SA_RESTART 0x0002 /* restart system call on signal return */ #define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ #define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ #define SA_NOCLDWAIT 0x0020 /* don't keep zombies around */ #define SA_SIGINFO 0x0040 /* signal handler with SA_SIGINFO args */ #ifdef COMPAT_SUNOS #define SA_USERTRAMP 0x0100 /* do not bounce off kernel's sigtramp */ #endif #define NSIG 32 /* number of old signals (counting 0) */ /* POSIX 1003.1b required values. */ #define SI_USER 0x10001 #define SI_QUEUE 0x10002 #define SI_TIMER 0x10003 #define SI_ASYNCIO 0x10004 #define SI_MESGQ 0x10005 /* Additional FreeBSD values. */ #define SI_UNDEFINED 0 -typedef void __siginfohandler_t __P((int, struct __siginfo *, void *)); +typedef void __siginfohandler_t(int, struct __siginfo *, void *); typedef __sighandler_t *sig_t; /* type of pointer to a signal function */ #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ #endif /* * Structure used in sigaltstack call. */ typedef struct sigaltstack { char *ss_sp; /* signal stack base */ size_t ss_size; /* signal stack length */ int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ } stack_t; #define SS_ONSTACK 0x0001 /* take signal on alternate stack */ #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ /* * Forward declaration for __ucontext so that sigreturn can use it * without having to include . */ struct __ucontext; /* * 4.3 compatibility: * Signal vector "template" used in sigvec call. */ struct sigvec { __sighandler_t *sv_handler; /* signal handler */ int sv_mask; /* signal mask to apply */ int sv_flags; /* see signal options below */ }; #define SV_ONSTACK SA_ONSTACK #define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */ #define SV_RESETHAND SA_RESETHAND #define SV_NODEFER SA_NODEFER #define SV_NOCLDSTOP SA_NOCLDSTOP #define SV_SIGINFO SA_SIGINFO #define sv_onstack sv_flags /* isn't compatibility wonderful! */ /* * Structure used in sigstack call. */ struct sigstack { char *ss_sp; /* signal stack pointer */ int ss_onstack; /* current status */ }; /* * Macro for converting signal number to a mask suitable for * sigblock(). */ #define sigmask(m) (1 << ((m)-1)) #define BADSIG SIG_ERR #endif /* !_POSIX_SOURCE */ /* * Flags for sigprocmask: */ #define SIG_BLOCK 1 /* block specified signal set */ #define SIG_UNBLOCK 2 /* unblock specified signal set */ #define SIG_SETMASK 3 /* set specified signal set */ #endif /* !_ANSI_SOURCE */ /* * For historical reasons; programs expect signal's return value to be * defined by . */ __BEGIN_DECLS -__sighandler_t *signal __P((int, __sighandler_t *)); +__sighandler_t *signal(int, __sighandler_t *); __END_DECLS #endif /* !_SYS_SIGNAL_H_ */ Index: head/sys/sys/acct.h =================================================================== --- head/sys/sys/acct.h (revision 92718) +++ head/sys/sys/acct.h (revision 92719) @@ -1,93 +1,93 @@ /*- * Copyright (c) 1990, 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. * * @(#)acct.h 8.4 (Berkeley) 1/9/95 * $FreeBSD$ */ #ifndef _SYS_ACCT_H_ #define _SYS_ACCT_H_ /* * Accounting structures; these use a comp_t type which is a 3 bits base 8 * exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ * seconds. */ typedef u_int16_t comp_t; #ifdef _KERNEL #define __dev_t udev_t #else #define __dev_t dev_t #endif #define AC_COMM_LEN 16 struct acct { char ac_comm[AC_COMM_LEN]; /* command name */ comp_t ac_utime; /* user time */ comp_t ac_stime; /* system time */ comp_t ac_etime; /* elapsed time */ time_t ac_btime; /* starting time */ uid_t ac_uid; /* user id */ gid_t ac_gid; /* group id */ u_int16_t ac_mem; /* average memory usage */ comp_t ac_io; /* count of IO blocks */ __dev_t ac_tty; /* controlling tty */ #define AFORK 0x01 /* forked but not exec'ed */ /* ASU is no longer supported */ #define ASU 0x02 /* used super-user permissions */ #define ACOMPAT 0x04 /* used compatibility mode */ #define ACORE 0x08 /* dumped core */ #define AXSIG 0x10 /* killed by a signal */ u_int8_t ac_flag; /* accounting flags */ }; #undef __dev_t /* * 1/AHZ is the granularity of the data encoded in the comp_t fields. * This is not necessarily equal to hz. */ #define AHZ 64 #ifdef _KERNEL struct thread; -int acct_process __P((struct thread *td)); +int acct_process(struct thread *td); #endif #endif /* !_SYS_ACCT_H_ */ Index: head/sys/sys/acl.h =================================================================== --- head/sys/sys/acl.h (revision 92718) +++ head/sys/sys/acl.h (revision 92719) @@ -1,197 +1,197 @@ /*- * Copyright (c) 1999-2001 Robert N. M. Watson * All rights reserved. * * This software was developed by Robert Watson for the TrustedBSD Project. * * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ /* * Developed by the TrustedBSD Project. * Support for POSIX.1e access control lists. */ #ifndef _SYS_ACL_H #define _SYS_ACL_H /* * POSIX.1e ACL types and related constants. */ #define POSIX1E_ACL_ACCESS_EXTATTR_NAMESPACE EXTATTR_NAMESPACE_SYSTEM #define POSIX1E_ACL_ACCESS_EXTATTR_NAME "posix1e.acl_access" #define POSIX1E_ACL_DEFAULT_EXTATTR_NAMESPACE EXTATTR_NAMESPACE_SYSTEM #define POSIX1E_ACL_DEFAULT_EXTATTR_NAME "posix1e.acl_default" #define ACL_MAX_ENTRIES 32 /* maximum entries in an ACL */ typedef int acl_type_t; typedef int acl_tag_t; typedef mode_t acl_perm_t; typedef mode_t *acl_permset_t; struct acl_entry { acl_tag_t ae_tag; uid_t ae_id; acl_perm_t ae_perm; }; typedef struct acl_entry *acl_entry_t; /* internal ACL structure */ struct acl { int acl_cnt; struct acl_entry acl_entry[ACL_MAX_ENTRIES]; }; /* external ACL structure */ struct acl_t_struct { struct acl ats_acl; int ats_cur_entry; }; typedef struct acl_t_struct *acl_t; /* * Possible valid values for ae_tag field. */ #define ACL_UNDEFINED_TAG 0x00000000 #define ACL_USER_OBJ 0x00000001 #define ACL_USER 0x00000002 #define ACL_GROUP_OBJ 0x00000004 #define ACL_GROUP 0x00000008 #define ACL_MASK 0x00000010 #define ACL_OTHER 0x00000020 #define ACL_OTHER_OBJ ACL_OTHER /* * Possible valid values for acl_type_t arguments. */ #define ACL_TYPE_ACCESS 0x00000000 #define ACL_TYPE_DEFAULT 0x00000001 #define ACL_TYPE_AFS 0x00000002 #define ACL_TYPE_CODA 0x00000003 #define ACL_TYPE_NTFS 0x00000004 #define ACL_TYPE_NWFS 0x00000005 /* * Possible flags in ae_perm field. */ #define ACL_EXECUTE 0x0001 #define ACL_WRITE 0x0002 #define ACL_READ 0x0004 #define ACL_PERM_NONE 0x0000 #define ACL_PERM_BITS (ACL_EXECUTE | ACL_WRITE | ACL_READ) #define ACL_POSIX1E_BITS (ACL_EXECUTE | ACL_WRITE | ACL_READ) /* * Possible entry_id values for acl_get_entry() */ #define ACL_FIRST_ENTRY 0 #define ACL_NEXT_ENTRY 1 /* * Undefined value in ae_id field */ #define ACL_UNDEFINED_ID ((uid_t)-1) #ifdef _KERNEL /* * Storage for ACLs and support structures. */ #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_ACL); #endif -acl_perm_t acl_posix1e_mode_to_perm __P((acl_tag_t tag, mode_t mode)); -struct acl_entry acl_posix1e_mode_to_entry __P((acl_tag_t tag, uid_t uid, - gid_t gid, mode_t mode)); -mode_t acl_posix1e_perms_to_mode __P((struct acl_entry *acl_user_obj_entry, - struct acl_entry *acl_group_obj_entry, struct acl_entry *acl_other_entry)); +acl_perm_t acl_posix1e_mode_to_perm(acl_tag_t tag, mode_t mode); +struct acl_entry acl_posix1e_mode_to_entry(acl_tag_t tag, uid_t uid, + gid_t gid, mode_t mode); +mode_t acl_posix1e_perms_to_mode(struct acl_entry *acl_user_obj_entry, + struct acl_entry *acl_group_obj_entry, struct acl_entry *acl_other_entry); int acl_posix1e_check(struct acl *acl); #else /* !_KERNEL */ /* * Syscall interface -- use the library calls instead as the syscalls * have strict acl entry ordering requirements. */ __BEGIN_DECLS int __acl_aclcheck_fd(int _filedes, acl_type_t _type, struct acl *_aclp); int __acl_aclcheck_file(const char *_path, acl_type_t _type, struct acl *_aclp); int __acl_delete_fd(int _filedes, acl_type_t _type); int __acl_delete_file(const char *_path_p, acl_type_t _type); int __acl_get_fd(int _filedes, acl_type_t _type, struct acl *_aclp); int __acl_get_file(const char *_path, acl_type_t _type, struct acl *_aclp); int __acl_set_fd(int _filedes, acl_type_t _type, struct acl *_aclp); int __acl_set_file(const char *_path, acl_type_t _type, struct acl *_aclp); __END_DECLS /* * Supported POSIX.1e ACL manipulation and assignment/retrieval API * _np calls are local extensions that reflect an environment capable of * opening file descriptors of directories, and allowing additional * ACL type for different file systems (i.e., AFS). */ __BEGIN_DECLS int acl_add_perm(acl_permset_t _permset_d, acl_perm_t _perm); int acl_calc_mask(acl_t *_acl_p); int acl_clear_perms(acl_permset_t _permset_d); int acl_copy_entry(acl_entry_t _dest_d, acl_entry_t _src_d); ssize_t acl_copy_ext(void *_buf_p, acl_t _acl, ssize_t _size); acl_t acl_copy_int(const void *_buf_p); int acl_create_entry(acl_t *_acl_p, acl_entry_t *_entry_p); int acl_delete_fd_np(int _filedes, acl_type_t _type); int acl_delete_entry(acl_t _acl, acl_entry_t _entry_d); int acl_delete_file_np(const char *_path_p, acl_type_t _type); int acl_delete_def_file(const char *_path_p); int acl_delete_perm(acl_permset_t _permset_d, acl_perm_t _perm); acl_t acl_dup(acl_t _acl); int acl_free(void *_obj_p); acl_t acl_from_text(const char *_buf_p); int acl_get_entry(acl_t _acl, int _entry_id, acl_entry_t *_entry_p); acl_t acl_get_fd(int _fd); acl_t acl_get_fd_np(int fd, acl_type_t _type); acl_t acl_get_file(const char *_path_p, acl_type_t _type); void *acl_get_qualifier(acl_entry_t _entry_d); int acl_get_perm_np(acl_permset_t _permset_d, acl_perm_t _perm); int acl_get_permset(acl_entry_t _entry_d, acl_permset_t *_permset_p); int acl_get_tag_type(acl_entry_t _entry_d, acl_tag_t *_tag_type_p); acl_t acl_init(int _count); int acl_set_fd(int _fd, acl_t _acl); int acl_set_fd_np(int _fd, acl_t _acl, acl_type_t _type); int acl_set_file(const char *_path_p, acl_type_t _type, acl_t _acl); int acl_set_permset(acl_entry_t _entry_d, acl_permset_t _permset_d); int acl_set_qualifier(acl_entry_t _entry_d, const void *_tag_qualifier_p); int acl_set_tag_type(acl_entry_t _entry_d, acl_tag_t _tag_type); ssize_t acl_size(acl_t _acl); char *acl_to_text(acl_t _acl, ssize_t *_len_p); int acl_valid(acl_t _acl); int acl_valid_fd_np(int _fd, acl_type_t _type, acl_t _acl); int acl_valid_file_np(const char *_path_p, acl_type_t _type, acl_t _acl); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_ACL_H */ Index: head/sys/sys/bio.h =================================================================== --- head/sys/sys/bio.h (revision 92718) +++ head/sys/sys/bio.h (revision 92719) @@ -1,204 +1,204 @@ /* * Copyright (c) 1982, 1986, 1989, 1993 * 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. * * @(#)buf.h 8.9 (Berkeley) 3/30/95 * $FreeBSD$ */ #ifndef _SYS_BIO_H_ #define _SYS_BIO_H_ #include struct bio; struct buf; struct g_consumer; struct g_provider; struct iodone_chain { long ic_prev_flags; - void (*ic_prev_iodone) __P((struct bio *)); + void (*ic_prev_iodone)(struct bio *); void *ic_prev_iodone_chain; struct { long ia_long; void *ia_ptr; } ic_args[5]; }; /* * The bio structure describes an I/O operation in the kernel. */ struct bio { u_int bio_cmd; /* I/O operation. */ dev_t bio_dev; /* Device to do I/O on. */ daddr64_t bio_blkno; /* Underlying physical block number. */ off_t bio_offset; /* Offset into file. */ long bio_bcount; /* Valid bytes in buffer. */ caddr_t bio_data; /* Memory, superblocks, indirect etc. */ u_int bio_flags; /* BIO_ flags. */ struct buf *_bio_buf; /* Parent buffer. */ int bio_error; /* Errno for BIO_ERROR. */ long bio_resid; /* Remaining I/0 in bytes. */ - void (*bio_done) __P((struct bio *)); + void (*bio_done)(struct bio *); void *bio_driver1; /* Private use by the callee. */ void *bio_driver2; /* Private use by the callee. */ void *bio_caller1; /* Private use by the caller. */ void *bio_caller2; /* Private use by the caller. */ TAILQ_ENTRY(bio) bio_queue; /* Disksort queue. */ /* XXX: these go away when bio chaining is introduced */ daddr64_t bio_pblkno; /* physical block number */ struct iodone_chain *bio_done_chain; struct bio *bio_linkage; off_t bio_length; char *bio_attribute; off_t bio_completed; struct g_consumer *bio_from; struct g_provider *bio_to; }; /* bio_cmd */ #define BIO_READ 0x00000001 #define BIO_WRITE 0x00000002 #define BIO_DELETE 0x00000004 #define BIO_FORMAT 0x00000008 #define BIO_GETATTR 0x00000010 #define BIO_SETATTR 0x00000020 #define BIO_CMD1 0x40000000 /* Available for local hacks */ #define BIO_CMD2 0x80000000 /* Available for local hacks */ /* bio_flags */ #define BIO_ERROR 0x00000001 #define BIO_DONE 0x00000004 #define BIO_FLAG2 0x40000000 /* Available for local hacks */ #define BIO_FLAG1 0x80000000 /* Available for local hacks */ #ifdef _KERNEL static __inline__ void biodone(struct bio *bp) { bp->bio_flags |= BIO_DONE; bp->bio_done(bp); } #ifndef _DEVICESTAT_H struct devstat; void devstat_end_transaction_bio(struct devstat *, struct bio *); #endif static __inline__ void biofinish(struct bio *bp, struct devstat *stat, int error) { if (error) { bp->bio_error = error; bp->bio_flags |= BIO_ERROR; } if (stat != NULL) devstat_end_transaction_bio(stat, bp); biodone(bp); } struct bio_queue_head { TAILQ_HEAD(bio_queue, bio) queue; daddr64_t last_pblkno; struct bio *insert_point; struct bio *switch_point; int busy; }; -static __inline void bioq_init __P((struct bio_queue_head *head)); -static __inline void bioq_insert_tail __P((struct bio_queue_head *head, - struct bio *bp)); -static __inline void bioq_remove __P((struct bio_queue_head *head, - struct bio *bp)); -static __inline struct bio *bioq_first __P((struct bio_queue_head *head)); +static __inline void bioq_init(struct bio_queue_head *head); +static __inline void bioq_insert_tail(struct bio_queue_head *head, + struct bio *bp); +static __inline void bioq_remove(struct bio_queue_head *head, + struct bio *bp); +static __inline struct bio *bioq_first(struct bio_queue_head *head); static __inline void bioq_init(struct bio_queue_head *head) { TAILQ_INIT(&head->queue); head->last_pblkno = 0; head->insert_point = NULL; head->switch_point = NULL; } static __inline void bioq_insert_tail(struct bio_queue_head *head, struct bio *bp) { TAILQ_INSERT_TAIL(&head->queue, bp, bio_queue); } static __inline void bioq_remove(struct bio_queue_head *head, struct bio *bp) { if (bp == head->switch_point) head->switch_point = TAILQ_NEXT(bp, bio_queue); if (bp == head->insert_point) { head->insert_point = TAILQ_PREV(bp, bio_queue, bio_queue); if (head->insert_point == NULL) head->last_pblkno = 0; } else if (bp == TAILQ_FIRST(&head->queue)) head->last_pblkno = bp->bio_pblkno; TAILQ_REMOVE(&head->queue, bp, bio_queue); if (TAILQ_FIRST(&head->queue) == head->switch_point) head->switch_point = NULL; } static __inline struct bio * bioq_first(struct bio_queue_head *head) { return (TAILQ_FIRST(&head->queue)); } /* * Zero out the bio's data area. */ #define clrbio(bp) { \ bzero((bp)->bio_data, (u_int)(bp)->bio_bcount); \ (bp)->bio_resid = 0; \ } -int physio __P((dev_t dev, struct uio *uio, int ioflag)); +int physio(dev_t dev, struct uio *uio, int ioflag); #define physread physio #define physwrite physio #endif /* _KERNEL */ #endif /* !_SYS_BIO_H_ */ Index: head/sys/sys/buf.h =================================================================== --- head/sys/sys/buf.h (revision 92718) +++ head/sys/sys/buf.h (revision 92719) @@ -1,513 +1,512 @@ /* * Copyright (c) 1982, 1986, 1989, 1993 * 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. * * @(#)buf.h 8.9 (Berkeley) 3/30/95 * $FreeBSD$ */ #ifndef _SYS_BUF_H_ #define _SYS_BUF_H_ #include #include #include struct bio; struct buf; struct mount; struct vnode; /* * To avoid including */ LIST_HEAD(workhead, worklist); /* * These are currently used only by the soft dependency code, hence * are stored once in a global variable. If other subsystems wanted * to use these hooks, a pointer to a set of bio_ops could be added * to each buffer. */ extern struct bio_ops { - void (*io_start) __P((struct buf *)); - void (*io_complete) __P((struct buf *)); - void (*io_deallocate) __P((struct buf *)); - void (*io_movedeps) __P((struct buf *, struct buf *)); - int (*io_countdeps) __P((struct buf *, int)); + void (*io_start)(struct buf *); + void (*io_complete)(struct buf *); + void (*io_deallocate)(struct buf *); + void (*io_movedeps)(struct buf *, struct buf *); + int (*io_countdeps)(struct buf *, int); } bioops; struct buf_ops { char *bop_name; - int (*bop_write) __P((struct buf *)); + int (*bop_write)(struct buf *); }; extern struct buf_ops buf_ops_bio; /* * The buffer header describes an I/O operation in the kernel. * * NOTES: * b_bufsize, b_bcount. b_bufsize is the allocation size of the * buffer, either DEV_BSIZE or PAGE_SIZE aligned. b_bcount is the * originally requested buffer size and can serve as a bounds check * against EOF. For most, but not all uses, b_bcount == b_bufsize. * * b_dirtyoff, b_dirtyend. Buffers support piecemeal, unaligned * ranges of dirty data that need to be written to backing store. * The range is typically clipped at b_bcount ( not b_bufsize ). * * b_resid. Number of bytes remaining in I/O. After an I/O operation * completes, b_resid is usually 0 indicating 100% success. */ struct buf { /* XXX: b_io must be the first element of struct buf for now /phk */ /* XXX: if you change this, fix BIOTOBUF macro below */ struct bio b_io; /* "Builtin" I/O request. */ #define BIOTOBUF(biop) ((struct buf *)(biop)) #define b_bcount b_io.bio_bcount #define b_blkno b_io.bio_blkno #define b_caller1 b_io.bio_caller1 #define b_data b_io.bio_data #define b_dev b_io.bio_dev #define b_driver1 b_io.bio_driver1 #define b_driver2 b_io.bio_driver2 #define b_error b_io.bio_error #define b_iocmd b_io.bio_cmd #define b_ioflags b_io.bio_flags #define b_pblkno b_io.bio_pblkno #define b_resid b_io.bio_resid struct buf_ops *b_op; unsigned b_magic; #define B_MAGIC_BIO 0x10b10b10 #define B_MAGIC_NFS 0x67238234 - void (*b_iodone) __P((struct buf *)); + void (*b_iodone)(struct buf *); off_t b_offset; /* Offset into file. */ LIST_ENTRY(buf) b_hash; /* Hash chain. */ TAILQ_ENTRY(buf) b_vnbufs; /* Buffer's associated vnode. */ TAILQ_ENTRY(buf) b_freelist; /* Free list position if not active. */ TAILQ_ENTRY(buf) b_act; /* Device driver queue when active. *new* */ long b_flags; /* B_* flags. */ unsigned short b_qindex; /* buffer queue index */ unsigned char b_xflags; /* extra flags */ struct lock b_lock; /* Buffer lock */ long b_bufsize; /* Allocated buffer size. */ long b_runningbufspace; /* when I/O is running, pipelining */ caddr_t b_kvabase; /* base kva for buffer */ int b_kvasize; /* size of kva for buffer */ daddr64_t b_lblkno; /* Logical block number. */ struct vnode *b_vp; /* Device vnode. */ int b_dirtyoff; /* Offset in buffer of dirty region. */ int b_dirtyend; /* Offset of end of dirty region. */ struct ucred *b_rcred; /* Read credentials reference. */ struct ucred *b_wcred; /* Write credentials reference. */ void *b_saveaddr; /* Original b_addr for physio. */ union pager_info { void *pg_spc; int pg_reqpage; } b_pager; union cluster_info { TAILQ_HEAD(cluster_list_head, buf) cluster_head; TAILQ_ENTRY(buf) cluster_entry; } b_cluster; struct vm_page *b_pages[btoc(MAXPHYS)]; int b_npages; struct workhead b_dep; /* List of filesystem dependencies. */ }; #define b_spc b_pager.pg_spc /* * These flags are kept in b_flags. * * Notes: * * B_ASYNC VOP calls on bp's are usually async whether or not * B_ASYNC is set, but some subsystems, such as NFS, like * to know what is best for the caller so they can * optimize the I/O. * * B_PAGING Indicates that bp is being used by the paging system or * some paging system and that the bp is not linked into * the b_vp's clean/dirty linked lists or ref counts. * Buffer vp reassignments are illegal in this case. * * B_CACHE This may only be set if the buffer is entirely valid. * The situation where B_DELWRI is set and B_CACHE is * clear MUST be committed to disk by getblk() so * B_DELWRI can also be cleared. See the comments for * getblk() in kern/vfs_bio.c. If B_CACHE is clear, * the caller is expected to clear BIO_ERROR and B_INVAL, * set BIO_READ, and initiate an I/O. * * The 'entire buffer' is defined to be the range from * 0 through b_bcount. * * B_MALLOC Request that the buffer be allocated from the malloc * pool, DEV_BSIZE aligned instead of PAGE_SIZE aligned. * * B_CLUSTEROK This flag is typically set for B_DELWRI buffers * by filesystems that allow clustering when the buffer * is fully dirty and indicates that it may be clustered * with other adjacent dirty buffers. Note the clustering * may not be used with the stage 1 data write under NFS * but may be used for the commit rpc portion. * * B_VMIO Indicates that the buffer is tied into an VM object. * The buffer's data is always PAGE_SIZE aligned even * if b_bufsize and b_bcount are not. ( b_bufsize is * always at least DEV_BSIZE aligned, though ). * * B_DIRECT Hint that we should attempt to completely free * the pages underlying the buffer. B_DIRECT is * sticky until the buffer is released and typically * only has an effect when B_RELBUF is also set. * * B_NOWDRAIN This flag should be set when a device (like MD) * does a turn-around VOP_WRITE from its strategy * routine. This flag prevents bwrite() from blocking * in wdrain, avoiding a deadlock situation. */ #define B_AGE 0x00000001 /* Move to age queue when I/O done. */ #define B_NEEDCOMMIT 0x00000002 /* Append-write in progress. */ #define B_ASYNC 0x00000004 /* Start I/O, do not wait. */ #define B_DIRECT 0x00000008 /* direct I/O flag (pls free vmio) */ #define B_DEFERRED 0x00000010 /* Skipped over for cleaning */ #define B_CACHE 0x00000020 /* Bread found us in the cache. */ #define B_VALIDSUSPWRT 0x00000040 /* Valid write during suspension. */ #define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */ #define B_DONE 0x00000200 /* I/O completed. */ #define B_EINTR 0x00000400 /* I/O was interrupted */ #define B_NOWDRAIN 0x00000800 /* Avoid wdrain deadlock */ #define B_SCANNED 0x00001000 /* VOP_FSYNC funcs mark written bufs */ #define B_INVAL 0x00002000 /* Does not contain valid info. */ #define B_LOCKED 0x00004000 /* Locked in core (not reusable). */ #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ #define B_MALLOC 0x00010000 /* malloced b_data */ #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ #define B_PHYS 0x00040000 /* I/O to user memory. */ #define B_RAW 0x00080000 /* Set by physio for raw transfers. */ #define B_DIRTY 0x00200000 /* Needs writing later. */ #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ #define B_WANT 0x00800000 /* Used by vm_pager.c */ #define B_WRITEINPROG 0x01000000 /* Write in progress. */ #define B_XXX 0x02000000 /* Debugging flag. */ #define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */ #define B_08000000 0x08000000 /* Available flag. */ #define B_RAM 0x10000000 /* Read ahead mark (flag) */ #define B_VMIO 0x20000000 /* VMIO flag */ #define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */ #define B_80000000 0x80000000 /* Available flag. */ #define PRINT_BUF_FLAGS "\20\40autochain\37cluster\36vmio\35ram\34ordered" \ "\33paging\32xxx\31writeinprog\30want\27relbuf\26dirty" \ "\25read\24raw\23phys\22clusterok\21malloc\20nocache" \ "\17locked\16inval\15scanned\14error\13eintr\12done\11freebuf" \ "\10delwri\7call\6cache\4direct\3async\2needcommit\1age" /* * These flags are kept in b_xflags. */ #define BX_VNDIRTY 0x00000001 /* On vnode dirty list */ #define BX_VNCLEAN 0x00000002 /* On vnode clean list */ #define BX_BKGRDWRITE 0x00000004 /* Do writes in background */ #define BX_BKGRDINPROG 0x00000008 /* Background write in progress */ #define BX_BKGRDWAIT 0x00000010 /* Background write waiting */ #define NOOFFSET (-1LL) /* No buffer offset calculated yet */ #ifdef _KERNEL /* * Buffer locking */ extern struct mtx buftimelock; /* Interlock on setting prio and timo */ extern const char *buf_wmesg; /* Default buffer lock message */ #define BUF_WMESG "bufwait" #include /* XXX for curthread */ #include /* * Initialize a lock. */ #define BUF_LOCKINIT(bp) \ lockinit(&(bp)->b_lock, PRIBIO + 4, buf_wmesg, 0, 0) /* * * Get a lock sleeping non-interruptably until it becomes available. */ -static __inline int BUF_LOCK __P((struct buf *, int)); +static __inline int BUF_LOCK(struct buf *, int); static __inline int BUF_LOCK(struct buf *bp, int locktype) { int s, ret; s = splbio(); mtx_lock(&buftimelock); locktype |= LK_INTERLOCK; bp->b_lock.lk_wmesg = buf_wmesg; bp->b_lock.lk_prio = PRIBIO + 4; ret = lockmgr(&(bp)->b_lock, locktype, &buftimelock, curthread); splx(s); return ret; } /* * Get a lock sleeping with specified interruptably and timeout. */ -static __inline int BUF_TIMELOCK __P((struct buf *, int, char *, int, int)); +static __inline int BUF_TIMELOCK(struct buf *, int, char *, int, int); static __inline int BUF_TIMELOCK(struct buf *bp, int locktype, char *wmesg, int catch, int timo) { int s, ret; s = splbio(); mtx_lock(&buftimelock); locktype |= LK_INTERLOCK | LK_TIMELOCK; bp->b_lock.lk_wmesg = wmesg; bp->b_lock.lk_prio = (PRIBIO + 4) | catch; bp->b_lock.lk_timo = timo; ret = lockmgr(&(bp)->b_lock, (locktype), &buftimelock, curthread); splx(s); return ret; } /* * Release a lock. Only the acquiring process may free the lock unless * it has been handed off to biodone. */ -static __inline void BUF_UNLOCK __P((struct buf *)); +static __inline void BUF_UNLOCK(struct buf *); static __inline void BUF_UNLOCK(struct buf *bp) { int s; s = splbio(); lockmgr(&(bp)->b_lock, LK_RELEASE, NULL, curthread); splx(s); } /* * Free a buffer lock. */ #define BUF_LOCKFREE(bp) \ do { \ if (BUF_REFCNT(bp) > 0) \ panic("free locked buf"); \ lockdestroy(&(bp)->b_lock); \ } while (0) #ifdef _SYS_PROC_H_ /* Avoid #include pollution */ /* * When initiating asynchronous I/O, change ownership of the lock to the * kernel. Once done, the lock may legally released by biodone. The * original owning process can no longer acquire it recursively, but must * wait until the I/O is completed and the lock has been freed by biodone. */ -static __inline void BUF_KERNPROC __P((struct buf *)); +static __inline void BUF_KERNPROC(struct buf *); static __inline void BUF_KERNPROC(struct buf *bp) { struct thread *td = curthread; if ((td != PCPU_GET(idlethread)) && bp->b_lock.lk_lockholder == td->td_proc->p_pid) td->td_locks--; bp->b_lock.lk_lockholder = LK_KERNPROC; } #endif /* * Find out the number of references to a lock. */ -static __inline int BUF_REFCNT __P((struct buf *)); +static __inline int BUF_REFCNT(struct buf *); static __inline int BUF_REFCNT(struct buf *bp) { int s, ret; s = splbio(); ret = lockcount(&(bp)->b_lock); splx(s); return ret; } #endif /* _KERNEL */ struct buf_queue_head { TAILQ_HEAD(buf_queue, buf) queue; daddr64_t last_pblkno; struct buf *insert_point; struct buf *switch_point; }; /* * This structure describes a clustered I/O. It is stored in the b_saveaddr * field of the buffer on which I/O is done. At I/O completion, cluster * callback uses the structure to parcel I/O's to individual buffers, and * then free's this structure. */ struct cluster_save { long bs_bcount; /* Saved b_bcount. */ long bs_bufsize; /* Saved b_bufsize. */ void *bs_saveaddr; /* Saved b_addr. */ int bs_nchildren; /* Number of associated buffers. */ struct buf **bs_children; /* List of associated buffers. */ }; #ifdef _KERNEL #define BUF_WRITE(bp) \ (bp)->b_op->bop_write(bp) #define BUF_STRATEGY(bp) VOP_STRATEGY((bp)->b_vp, (bp)) static __inline void buf_start(struct buf *bp) { if (bioops.io_start) (*bioops.io_start)(bp); } static __inline void buf_complete(struct buf *bp) { if (bioops.io_complete) (*bioops.io_complete)(bp); } static __inline void buf_deallocate(struct buf *bp) { if (bioops.io_deallocate) (*bioops.io_deallocate)(bp); BUF_LOCKFREE(bp); } static __inline void buf_movedeps(struct buf *bp, struct buf *bp2) { if (bioops.io_movedeps) (*bioops.io_movedeps)(bp, bp2); } static __inline int buf_countdeps(struct buf *bp, int i) { if (bioops.io_countdeps) return ((*bioops.io_countdeps)(bp, i)); else return (0); } #endif /* _KERNEL */ /* * Zero out the buffer's data area. */ #define clrbuf(bp) { \ bzero((bp)->b_data, (u_int)(bp)->b_bcount); \ (bp)->b_resid = 0; \ } /* Flags to low-level allocation routines. */ #define B_CLRBUF 0x01 /* Request allocated buffer be cleared. */ #define B_SYNC 0x02 /* Do all allocations synchronously. */ #define B_METAONLY 0x04 /* Return indirect block buffer. */ #define B_NOWAIT 0x08 /* do not sleep to await lock */ #ifdef _KERNEL extern int nbuf; /* The number of buffer headers */ extern int maxswzone; /* Max KVA for swap structures */ extern int maxbcache; /* Max KVA for buffer cache */ extern int runningbufspace; extern int buf_maxio; /* nominal maximum I/O for buffer */ extern struct buf *buf; /* The buffer headers. */ extern char *buffers; /* The buffer contents. */ extern int bufpages; /* Number of memory pages in the buffer pool. */ extern struct buf *swbuf; /* Swap I/O buffer headers. */ extern int nswbuf; /* Number of swap I/O buffer headers. */ struct uio; -caddr_t kern_vfs_bio_buffer_alloc __P((caddr_t v, int physmem_est)); -void bufinit __P((void)); -void bwillwrite __P((void)); -int buf_dirty_count_severe __P((void)); -void bremfree __P((struct buf *)); -int bread __P((struct vnode *, daddr_t, int, - struct ucred *, struct buf **)); -int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int, - struct ucred *, struct buf **)); -int bwrite __P((struct buf *)); -void bdwrite __P((struct buf *)); -void bawrite __P((struct buf *)); -void bdirty __P((struct buf *)); -void bundirty __P((struct buf *)); -void brelse __P((struct buf *)); -void bqrelse __P((struct buf *)); -int vfs_bio_awrite __P((struct buf *)); -struct buf * getpbuf __P((int *)); -struct buf *incore __P((struct vnode *, daddr_t)); -struct buf *gbincore __P((struct vnode *, daddr_t)); -int inmem __P((struct vnode *, daddr_t)); -struct buf *getblk __P((struct vnode *, daddr_t, int, int, int)); -struct buf *geteblk __P((int)); -int bufwait __P((struct buf *)); -void bufdone __P((struct buf *)); -void bufdonebio __P((struct bio *)); +caddr_t kern_vfs_bio_buffer_alloc(caddr_t v, int physmem_est); +void bufinit(void); +void bwillwrite(void); +int buf_dirty_count_severe(void); +void bremfree(struct buf *); +int bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **); +int breadn(struct vnode *, daddr_t, int, daddr_t *, int *, int, + struct ucred *, struct buf **); +int bwrite(struct buf *); +void bdwrite(struct buf *); +void bawrite(struct buf *); +void bdirty(struct buf *); +void bundirty(struct buf *); +void brelse(struct buf *); +void bqrelse(struct buf *); +int vfs_bio_awrite(struct buf *); +struct buf * getpbuf(int *); +struct buf *incore(struct vnode *, daddr_t); +struct buf *gbincore(struct vnode *, daddr_t); +int inmem(struct vnode *, daddr_t); +struct buf *getblk(struct vnode *, daddr_t, int, int, int); +struct buf *geteblk(int); +int bufwait(struct buf *); +void bufdone(struct buf *); +void bufdonebio(struct bio *); -void cluster_callback __P((struct buf *)); -int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long, - struct ucred *, long, int, struct buf **)); -int cluster_wbuild __P((struct vnode *, long, daddr_t, int)); -void cluster_write __P((struct buf *, u_quad_t, int)); -void vfs_bio_set_validclean __P((struct buf *, int base, int size)); -void vfs_bio_clrbuf __P((struct buf *)); -void vfs_busy_pages __P((struct buf *, int clear_modify)); -void vfs_unbusy_pages __P((struct buf *)); -void vwakeup __P((struct buf *)); -void vmapbuf __P((struct buf *)); -void vunmapbuf __P((struct buf *)); -void relpbuf __P((struct buf *, int *)); -void brelvp __P((struct buf *)); -void bgetvp __P((struct vnode *, struct buf *)); -void pbgetvp __P((struct vnode *, struct buf *)); -void pbrelvp __P((struct buf *)); -int allocbuf __P((struct buf *bp, int size)); -void reassignbuf __P((struct buf *, struct vnode *)); -void pbreassignbuf __P((struct buf *, struct vnode *)); -struct buf *trypbuf __P((int *)); +void cluster_callback(struct buf *); +int cluster_read(struct vnode *, u_quad_t, daddr_t, long, + struct ucred *, long, int, struct buf **); +int cluster_wbuild(struct vnode *, long, daddr_t, int); +void cluster_write(struct buf *, u_quad_t, int); +void vfs_bio_set_validclean(struct buf *, int base, int size); +void vfs_bio_clrbuf(struct buf *); +void vfs_busy_pages(struct buf *, int clear_modify); +void vfs_unbusy_pages(struct buf *); +void vwakeup(struct buf *); +void vmapbuf(struct buf *); +void vunmapbuf(struct buf *); +void relpbuf(struct buf *, int *); +void brelvp(struct buf *); +void bgetvp(struct vnode *, struct buf *); +void pbgetvp(struct vnode *, struct buf *); +void pbrelvp(struct buf *); +int allocbuf(struct buf *bp, int size); +void reassignbuf(struct buf *, struct vnode *); +void pbreassignbuf(struct buf *, struct vnode *); +struct buf *trypbuf(int *); #endif /* _KERNEL */ #endif /* !_SYS_BUF_H_ */ Index: head/sys/sys/callout.h =================================================================== --- head/sys/sys/callout.h (revision 92718) +++ head/sys/sys/callout.h (revision 92719) @@ -1,87 +1,87 @@ /*- * Copyright (c) 1990, 1993 * 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. * * @(#)callout.h 8.2 (Berkeley) 1/21/94 * $FreeBSD$ */ #ifndef _SYS_CALLOUT_H_ #define _SYS_CALLOUT_H_ #include SLIST_HEAD(callout_list, callout); TAILQ_HEAD(callout_tailq, callout); struct callout { union { SLIST_ENTRY(callout) sle; TAILQ_ENTRY(callout) tqe; } c_links; int c_time; /* ticks to the event */ void *c_arg; /* function argument */ - void (*c_func) __P((void *)); /* function to call */ + void (*c_func)(void *); /* function to call */ int c_flags; /* state of this entry */ }; #define CALLOUT_LOCAL_ALLOC 0x0001 /* was allocated from callfree */ #define CALLOUT_ACTIVE 0x0002 /* callout is currently active */ #define CALLOUT_PENDING 0x0004 /* callout is waiting for timeout */ #define CALLOUT_MPSAFE 0x0008 /* callout handler is mp safe */ struct callout_handle { struct callout *callout; }; #ifdef _KERNEL extern struct callout_list callfree; extern struct callout *callout; extern int ncallout; extern struct callout_tailq *callwheel; extern int callwheelsize, callwheelbits, callwheelmask, softticks; extern struct mtx callout_lock; #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) -void callout_init __P((struct callout *, int)); +void callout_init(struct callout *, int); #define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING) -void callout_reset __P((struct callout *, int, void (*)(void *), void *)); -int callout_stop __P((struct callout *)); +void callout_reset(struct callout *, int, void (*)(void *), void *); +int callout_stop(struct callout *); #endif #endif /* _SYS_CALLOUT_H_ */ Index: head/sys/sys/conf.h =================================================================== --- head/sys/sys/conf.h (revision 92718) +++ head/sys/sys/conf.h (revision 92719) @@ -1,360 +1,358 @@ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 2000 * Poul-Henning Kamp. 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. * * @(#)conf.h 8.5 (Berkeley) 1/9/95 * $FreeBSD$ */ #ifndef _SYS_CONF_H_ #define _SYS_CONF_H_ #ifdef _KERNEL #include struct tty; struct disk; struct vnode; struct buf; TAILQ_HEAD(snaphead, inode); struct specinfo { u_int si_flags; #define SI_STASHED 0x0001 /* created in stashed storage */ #define SI_ALIAS 0x0002 /* carrier of alias name */ #define SI_NAMED 0x0004 /* make_dev{_alias} has been called */ #define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */ #define SI_CHILD 0x0010 /* child of another dev_t */ #define SI_DEVOPEN 0x0020 /* opened by device */ #define SI_CONSOPEN 0x0040 /* opened by console */ struct timespec si_atime; struct timespec si_ctime; struct timespec si_mtime; udev_t si_udev; LIST_ENTRY(specinfo) si_hash; SLIST_HEAD(, vnode) si_hlist; LIST_HEAD(, specinfo) si_children; LIST_ENTRY(specinfo) si_siblings; dev_t si_parent; struct snaphead si_snapshots; int (*si_copyonwrite)(struct vnode *, struct buf *); u_int si_inode; char si_name[SPECNAMELEN + 1]; void *si_drv1, *si_drv2; struct cdevsw *si_devsw; int si_iosize_max; /* maximum I/O size (for physio &al) */ uid_t si_uid; gid_t si_gid; mode_t si_mode; union { struct { struct tty *__sit_tty; } __si_tty; struct { struct disk *__sid_disk; struct mount *__sid_mountpoint; int __sid_bsize_phys; /* min physical block size */ int __sid_bsize_best; /* optimal block size */ } __si_disk; } __si_u; }; #define si_tty __si_u.__si_tty.__sit_tty #define si_disk __si_u.__si_disk.__sid_disk #define si_mountpoint __si_u.__si_disk.__sid_mountpoint #define si_bsize_phys __si_u.__si_disk.__sid_bsize_phys #define si_bsize_best __si_u.__si_disk.__sid_bsize_best /* * Special device management */ #define SPECHSZ 64 #define SPECHASH(rdev) (((unsigned)(minor(rdev)))%SPECHSZ) /* * Definitions of device driver entry switches */ struct bio; struct buf; struct thread; struct uio; struct knote; /* * Note: d_thread_t is provided as a transition aid for those drivers * that treat struct proc/struct thread as an opaque data type and * exist in substantially the same form in both 4.x and 5.x. Writers * of drivers that dips into the d_thread_t structure should use * struct thread or struct proc as appropriate for the version of the * OS they are using. It is provided in lieu of each device driver * inventing its own way of doing this. While it does violate style(9) * in a number of ways, this violation is deemed to be less * important than the benefits that a uniform API between releases * gives. * * Users of struct thread/struct proc that aren't device drivers should * not use d_thread_t. */ typedef struct thread d_thread_t; -typedef int d_open_t __P((dev_t dev, int oflags, int devtype, - struct thread *td)); -typedef int d_close_t __P((dev_t dev, int fflag, int devtype, - struct thread *td)); -typedef void d_strategy_t __P((struct bio *bp)); -typedef int d_ioctl_t __P((dev_t dev, u_long cmd, caddr_t data, - int fflag, struct thread *td)); -typedef int d_dump_t __P((dev_t dev)); -typedef int d_psize_t __P((dev_t dev)); +typedef int d_open_t(dev_t dev, int oflags, int devtype, struct thread *td); +typedef int d_close_t(dev_t dev, int fflag, int devtype, struct thread *td); +typedef void d_strategy_t(struct bio *bp); +typedef int d_ioctl_t(dev_t dev, u_long cmd, caddr_t data, + int fflag, struct thread *td); +typedef int d_dump_t(dev_t dev); +typedef int d_psize_t(dev_t dev); -typedef int d_read_t __P((dev_t dev, struct uio *uio, int ioflag)); -typedef int d_write_t __P((dev_t dev, struct uio *uio, int ioflag)); -typedef int d_poll_t __P((dev_t dev, int events, struct thread *td)); -typedef int d_kqfilter_t __P((dev_t dev, struct knote *kn)); -typedef int d_mmap_t __P((dev_t dev, vm_offset_t offset, int nprot)); +typedef int d_read_t(dev_t dev, struct uio *uio, int ioflag); +typedef int d_write_t(dev_t dev, struct uio *uio, int ioflag); +typedef int d_poll_t(dev_t dev, int events, struct thread *td); +typedef int d_kqfilter_t(dev_t dev, struct knote *kn); +typedef int d_mmap_t(dev_t dev, vm_offset_t offset, int nprot); -typedef int l_open_t __P((dev_t dev, struct tty *tp)); -typedef int l_close_t __P((struct tty *tp, int flag)); -typedef int l_read_t __P((struct tty *tp, struct uio *uio, int flag)); -typedef int l_write_t __P((struct tty *tp, struct uio *uio, int flag)); -typedef int l_ioctl_t __P((struct tty *tp, u_long cmd, caddr_t data, - int flag, struct thread*td)); -typedef int l_rint_t __P((int c, struct tty *tp)); -typedef int l_start_t __P((struct tty *tp)); -typedef int l_modem_t __P((struct tty *tp, int flag)); +typedef int l_open_t(dev_t dev, struct tty *tp); +typedef int l_close_t(struct tty *tp, int flag); +typedef int l_read_t(struct tty *tp, struct uio *uio, int flag); +typedef int l_write_t(struct tty *tp, struct uio *uio, int flag); +typedef int l_ioctl_t(struct tty *tp, u_long cmd, caddr_t data, + int flag, struct thread *td); +typedef int l_rint_t(int c, struct tty *tp); +typedef int l_start_t(struct tty *tp); +typedef int l_modem_t(struct tty *tp, int flag); /* * XXX: The dummy argument can be used to do what strategy1() never * did anywhere: Create a per device flag to lock the device during * label/slice surgery, all calls with a dummy == 0 gets stalled on * a queue somewhere, whereas dummy == 1 are let through. Once out * of surgery, reset the flag and restart all the stuff on the stall * queue. */ #define BIO_STRATEGY(bp, dummy) \ do { \ if ((!(bp)->bio_cmd) || ((bp)->bio_cmd & ((bp)->bio_cmd - 1))) \ Debugger("bio_cmd botch"); \ (*devsw((bp)->bio_dev)->d_strategy)(bp); \ } while (0) #define DEV_STRATEGY(bp, dummy) \ do { \ if ((bp)->b_flags & B_PHYS) \ (bp)->b_io.bio_offset = (bp)->b_offset; \ else \ (bp)->b_io.bio_offset = dbtob((bp)->b_blkno); \ (bp)->b_io.bio_done = bufdonebio; \ (bp)->b_io.bio_caller2 = (bp); \ BIO_STRATEGY(&(bp)->b_io, dummy); \ } while (0) #endif /* _KERNEL */ /* * Types for d_flags. */ #define D_TAPE 0x0001 #define D_DISK 0x0002 #define D_TTY 0x0004 #define D_MEM 0x0008 #ifdef _KERNEL #define D_TYPEMASK 0xffff /* * Flags for d_flags. */ #define D_MEMDISK 0x00010000 /* memory type disk */ #define D_NAGGED 0x00020000 /* nagged about missing make_dev() */ #define D_CANFREE 0x00040000 /* can free blocks */ #define D_TRACKCLOSE 0x00080000 /* track all closes */ #define D_MMAP_ANON 0x00100000 /* special treatment in vm_mmap.c */ #define D_KQFILTER 0x00200000 /* has kqfilter entry */ /* * Character device switch table */ struct cdevsw { d_open_t *d_open; d_close_t *d_close; d_read_t *d_read; d_write_t *d_write; d_ioctl_t *d_ioctl; d_poll_t *d_poll; d_mmap_t *d_mmap; d_strategy_t *d_strategy; const char *d_name; /* base device name, e.g. 'vn' */ int d_maj; d_dump_t *d_dump; d_psize_t *d_psize; u_int d_flags; /* additions below are not binary compatible with 4.2 and below */ d_kqfilter_t *d_kqfilter; }; /* * Line discipline switch table */ struct linesw { l_open_t *l_open; l_close_t *l_close; l_read_t *l_read; l_write_t *l_write; l_ioctl_t *l_ioctl; l_rint_t *l_rint; l_start_t *l_start; l_modem_t *l_modem; u_char l_hotchar; }; extern struct linesw linesw[]; extern int nlinesw; -int ldisc_register __P((int , struct linesw *)); -void ldisc_deregister __P((int)); +int ldisc_register(int , struct linesw *); +void ldisc_deregister(int); #define LDISC_LOAD -1 /* Loadable line discipline */ #endif /* _KERNEL */ /* * Swap device table */ struct swdevt { udev_t sw_dev; /* For quasibogus swapdev reporting */ int sw_flags; int sw_nblks; int sw_used; struct vnode *sw_vp; dev_t sw_device; }; #define SW_FREED 0x01 #define SW_SEQUENTIAL 0x02 #define sw_freed sw_flags /* XXX compat */ #ifdef _KERNEL d_open_t noopen; d_close_t noclose; d_read_t noread; d_write_t nowrite; d_ioctl_t noioctl; d_mmap_t nommap; d_kqfilter_t nokqfilter; #define nostrategy ((d_strategy_t *)NULL) #define nopoll seltrue d_dump_t nodump; #define NUMCDEVSW 256 /* * nopsize is little used, so not worth having dummy functions for. */ #define nopsize ((d_psize_t *)NULL) d_open_t nullopen; d_close_t nullclose; l_ioctl_t l_nullioctl; l_read_t l_noread; l_write_t l_nowrite; struct module; struct devsw_module_data { int (*chainevh)(struct module *, int, void *); /* next handler */ void *chainarg; /* arg for next event handler */ /* Do not initialize fields hereafter */ }; #define DEV_MODULE(name, evh, arg) \ static moduledata_t name##_mod = { \ #name, \ evh, \ arg \ }; \ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE) -int cdevsw_add __P((struct cdevsw *new)); -int cdevsw_remove __P((struct cdevsw *old)); -int count_dev __P((dev_t dev)); -void destroy_dev __P((dev_t dev)); -void revoke_and_destroy_dev __P((dev_t dev)); -struct cdevsw *devsw __P((dev_t dev)); -const char *devtoname __P((dev_t dev)); -int dev_named __P((dev_t pdev, const char *name)); -void dev_depends __P((dev_t pdev, dev_t cdev)); -void freedev __P((dev_t dev)); -int iszerodev __P((dev_t dev)); -dev_t makebdev __P((int maj, int min)); -dev_t make_dev __P((struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const char *fmt, ...)) __printflike(6, 7); -dev_t make_dev_alias __P((dev_t pdev, const char *fmt, ...)) __printflike(2, 3); -int dev2unit __P((dev_t dev)); -int unit2minor __P((int unit)); -void setconf __P((void)); +int cdevsw_add(struct cdevsw *new); +int cdevsw_remove(struct cdevsw *old); +int count_dev(dev_t dev); +void destroy_dev(dev_t dev); +void revoke_and_destroy_dev(dev_t dev); +struct cdevsw *devsw(dev_t dev); +const char *devtoname(dev_t dev); +int dev_named(dev_t pdev, const char *name); +void dev_depends(dev_t pdev, dev_t cdev); +void freedev(dev_t dev); +int iszerodev(dev_t dev); +dev_t makebdev(int maj, int min); +dev_t make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const char *fmt, ...) __printflike(6, 7); +dev_t make_dev_alias(dev_t pdev, const char *fmt, ...) __printflike(2, 3); +int dev2unit(dev_t dev); +int unit2minor(int unit); +void setconf(void); dev_t getdiskbyname(char *name); /* This is type of the function DEVFS uses to hook into the kernel with */ -typedef void devfs_create_t __P((dev_t dev)); -typedef void devfs_destroy_t __P((dev_t dev)); +typedef void devfs_create_t(dev_t dev); +typedef void devfs_destroy_t(dev_t dev); extern devfs_create_t *devfs_create_hook; extern devfs_destroy_t *devfs_destroy_hook; extern int devfs_present; #define UID_ROOT 0 #define UID_BIN 3 #define UID_UUCP 66 #define GID_WHEEL 0 #define GID_KMEM 2 #define GID_OPERATOR 5 #define GID_BIN 7 #define GID_GAMES 13 #define GID_DIALER 68 -typedef void (*dev_clone_fn) __P((void *arg, char *name, int namelen, dev_t *result)); +typedef void (*dev_clone_fn)(void *arg, char *name, int namelen, dev_t *result); -int dev_stdclone __P((char *name, char **namep, const char *stem, int *unit)); +int dev_stdclone(char *name, char **namep, const char *stem, int *unit); EVENTHANDLER_DECLARE(dev_clone, dev_clone_fn); #endif /* _KERNEL */ #endif /* !_SYS_CONF_H_ */ Index: head/sys/sys/cons.h =================================================================== --- head/sys/sys/cons.h (revision 92718) +++ head/sys/sys/cons.h (revision 92719) @@ -1,102 +1,102 @@ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1991 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer * Science Department. * * 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. * * from: @(#)cons.h 7.2 (Berkeley) 5/9/91 * $FreeBSD$ */ #ifndef _MACHINE_CONS_H_ #define _MACHINE_CONS_H_ struct consdev; -typedef void cn_probe_t __P((struct consdev *)); -typedef void cn_init_t __P((struct consdev *)); -typedef void cn_term_t __P((struct consdev *)); -typedef int cn_getc_t __P((dev_t)); -typedef int cn_checkc_t __P((dev_t)); -typedef void cn_putc_t __P((dev_t, int)); -typedef void cn_dbctl_t __P((dev_t, int)); +typedef void cn_probe_t(struct consdev *); +typedef void cn_init_t(struct consdev *); +typedef void cn_term_t(struct consdev *); +typedef int cn_getc_t(dev_t); +typedef int cn_checkc_t(dev_t); +typedef void cn_putc_t(dev_t, int); +typedef void cn_dbctl_t(dev_t, int); struct consdev { cn_probe_t *cn_probe; /* probe hardware and fill in consdev info */ cn_init_t *cn_init; /* turn on as console */ cn_term_t *cn_term; /* turn off as console */ cn_getc_t *cn_getc; /* kernel getchar interface */ cn_checkc_t *cn_checkc; /* kernel "return char if available" interface */ cn_putc_t *cn_putc; /* kernel putchar interface */ cn_dbctl_t *cn_dbctl; /* debugger control interface */ struct tty *cn_tp; /* tty structure for console device */ dev_t cn_dev; /* major/minor of device */ short cn_pri; /* pecking order; the higher the better */ }; /* values for cn_pri - reflect our policy for console selection */ #define CN_DEAD 0 /* device doesn't exist */ #define CN_NORMAL 1 /* device exists but is nothing special */ #define CN_INTERNAL 2 /* "internal" bit-mapped display */ #define CN_REMOTE 3 /* serial interface with remote bit set */ #ifdef _KERNEL extern int cons_unavail; #define CONS_DRIVER(name, probe, init, term, getc, checkc, putc, dbctl) \ static struct consdev name##_consdev = { \ probe, init, term, getc, checkc, putc, dbctl \ }; \ DATA_SET(cons_set, name##_consdev) /* Other kernel entry points. */ void cninit(void); void cninit_finish(void); int cnadd(struct consdev *); void cnremove(struct consdev *); void cnselect(struct consdev *); int cncheckc(void); int cngetc(void); void cndbctl(int); void cnputc(int); #endif /* _KERNEL */ #endif /* !_MACHINE_CONS_H_ */ Index: head/sys/sys/disk.h =================================================================== --- head/sys/sys/disk.h (revision 92718) +++ head/sys/sys/disk.h (revision 92719) @@ -1,46 +1,46 @@ /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * * $FreeBSD$ * */ #ifndef _SYS_DISK_H_ #define _SYS_DISK_H_ #ifndef _SYS_DISKSLICE_H_ #include #endif /* _SYS_DISKSLICE_H_ */ #ifndef _SYS_DISKLABEL #include #endif /* _SYS_DISKLABEL */ #include struct disk { u_int d_flags; u_int d_dsflags; struct cdevsw *d_devsw; dev_t d_dev; struct diskslices *d_slice; struct disklabel d_label; LIST_ENTRY(disk) d_list; void *d_softc; }; #define DISKFLAG_LOCK 0x1 #define DISKFLAG_WANTED 0x2 -dev_t disk_create __P((int unit, struct disk *disk, int flags, struct cdevsw *cdevsw, struct cdevsw *diskdevsw)); -void disk_destroy __P((dev_t dev)); -int disk_dumpcheck __P((dev_t dev, u_int *count, u_int *blkno, u_int *secsize)); -struct disk *disk_enumerate __P((struct disk *disk)); -void disk_invalidate __P((struct disk *disk)); +dev_t disk_create(int unit, struct disk *disk, int flags, struct cdevsw *cdevsw, struct cdevsw *diskdevsw); +void disk_destroy(dev_t dev); +int disk_dumpcheck(dev_t dev, u_int *count, u_int *blkno, u_int *secsize); +struct disk *disk_enumerate(struct disk *disk); +void disk_invalidate(struct disk *disk); #endif /* _SYS_DISK_H_ */ Index: head/sys/sys/disklabel.h =================================================================== --- head/sys/sys/disklabel.h (revision 92718) +++ head/sys/sys/disklabel.h (revision 92719) @@ -1,489 +1,489 @@ /* * Copyright (c) 1987, 1988, 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. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 * $FreeBSD$ */ #ifndef _SYS_DISKLABEL_H_ #define _SYS_DISKLABEL_H_ #ifndef _KERNEL #include #endif #include /* * Disk description table, see disktab(5) */ #define _PATH_DISKTAB "/etc/disktab" #define DISKTAB "/etc/disktab" /* deprecated */ /* * Each disk has a label which includes information about the hardware * disk geometry, filesystem partitions, and drive specific information. * The label is in block 0 or 1, possibly offset from the beginning * to leave room for a bootstrap, etc. */ /* XXX these should be defined per controller (or drive) elsewhere, not here! */ #ifdef __i386__ #define LABELSECTOR 1 /* sector containing label */ #define LABELOFFSET 0 /* offset of label in sector */ #endif #ifdef __alpha__ #define LABELSECTOR 0 #define LABELOFFSET 64 #endif #ifdef __ia64__ #define LABELSECTOR 1 #define LABELOFFSET 0 #endif #ifdef __sparc64__ #define LABELSECTOR 0 #define LABELOFFSET 128 #endif #ifndef LABELSECTOR #define LABELSECTOR 0 #endif #ifndef LABELOFFSET #define LABELOFFSET 64 #endif #define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */ #ifndef MAXPARTITIONS #define MAXPARTITIONS 8 #endif #define LABEL_PART 2 /* partition containing label */ #define RAW_PART 2 /* partition containing whole disk */ #define SWAP_PART 1 /* partition normally containing swap */ #ifndef LOCORE struct disklabel { u_int32_t d_magic; /* the magic number */ u_int16_t d_type; /* drive type */ u_int16_t d_subtype; /* controller/d_type specific */ char d_typename[16]; /* type name, e.g. "eagle" */ /* * d_packname contains the pack identifier and is returned when * the disklabel is read off the disk or in-core copy. * d_boot0 and d_boot1 are the (optional) names of the * primary (block 0) and secondary (block 1-15) bootstraps * as found in /boot. These are returned when using * getdiskbyname(3) to retrieve the values from /etc/disktab. */ union { char un_d_packname[16]; /* pack identifier */ struct { char *un_d_boot0; /* primary bootstrap name */ char *un_d_boot1; /* secondary bootstrap name */ } un_b; } d_un; #define d_packname d_un.un_d_packname #define d_boot0 d_un.un_b.un_d_boot0 #define d_boot1 d_un.un_b.un_d_boot1 /* disk geometry: */ u_int32_t d_secsize; /* # of bytes per sector */ u_int32_t d_nsectors; /* # of data sectors per track */ u_int32_t d_ntracks; /* # of tracks per cylinder */ u_int32_t d_ncylinders; /* # of data cylinders per unit */ u_int32_t d_secpercyl; /* # of data sectors per cylinder */ u_int32_t d_secperunit; /* # of data sectors per unit */ /* * Spares (bad sector replacements) below are not counted in * d_nsectors or d_secpercyl. Spare sectors are assumed to * be physical sectors which occupy space at the end of each * track and/or cylinder. */ u_int16_t d_sparespertrack; /* # of spare sectors per track */ u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */ /* * Alternate cylinders include maintenance, replacement, configuration * description areas, etc. */ u_int32_t d_acylinders; /* # of alt. cylinders per unit */ /* hardware characteristics: */ /* * d_interleave, d_trackskew and d_cylskew describe perturbations * in the media format used to compensate for a slow controller. * Interleave is physical sector interleave, set up by the * formatter or controller when formatting. When interleaving is * in use, logically adjacent sectors are not physically * contiguous, but instead are separated by some number of * sectors. It is specified as the ratio of physical sectors * traversed per logical sector. Thus an interleave of 1:1 * implies contiguous layout, while 2:1 implies that logical * sector 0 is separated by one sector from logical sector 1. * d_trackskew is the offset of sector 0 on track N relative to * sector 0 on track N-1 on the same cylinder. Finally, d_cylskew * is the offset of sector 0 on cylinder N relative to sector 0 * on cylinder N-1. */ u_int16_t d_rpm; /* rotational speed */ u_int16_t d_interleave; /* hardware sector interleave */ u_int16_t d_trackskew; /* sector 0 skew, per track */ u_int16_t d_cylskew; /* sector 0 skew, per cylinder */ u_int32_t d_headswitch; /* head switch time, usec */ u_int32_t d_trkseek; /* track-to-track seek, usec */ u_int32_t d_flags; /* generic flags */ #define NDDATA 5 u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */ #define NSPARE 5 u_int32_t d_spare[NSPARE]; /* reserved for future use */ u_int32_t d_magic2; /* the magic number (again) */ u_int16_t d_checksum; /* xor of data incl. partitions */ /* filesystem and partition information: */ u_int16_t d_npartitions; /* number of partitions in following */ u_int32_t d_bbsize; /* size of boot area at sn0, bytes */ u_int32_t d_sbsize; /* max size of fs superblock, bytes */ struct partition { /* the partition table */ u_int32_t p_size; /* number of sectors in partition */ u_int32_t p_offset; /* starting sector */ u_int32_t p_fsize; /* filesystem basic fragment size */ u_int8_t p_fstype; /* filesystem type, see below */ u_int8_t p_frag; /* filesystem fragments per block */ u_int16_t p_cpg; /* filesystem cylinders per group */ } d_partitions[MAXPARTITIONS]; /* actually may be more */ }; -static __inline u_int16_t dkcksum __P((struct disklabel *lp)); +static __inline u_int16_t dkcksum(struct disklabel *lp); static __inline u_int16_t dkcksum(lp) struct disklabel *lp; { u_int16_t *start, *end; u_int16_t sum = 0; start = (u_int16_t *)lp; end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions]; while (start < end) sum ^= *start++; return (sum); } #else /* LOCORE */ /* * offsets for asm boot files. */ .set d_secsize,40 .set d_nsectors,44 .set d_ntracks,48 .set d_ncylinders,52 .set d_secpercyl,56 .set d_secperunit,60 .set d_end_,276 /* size of disk label */ #endif /* LOCORE */ /* d_type values: */ #define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */ #define DTYPE_MSCP 2 /* MSCP */ #define DTYPE_DEC 3 /* other DEC (rk, rl) */ #define DTYPE_SCSI 4 /* SCSI */ #define DTYPE_ESDI 5 /* ESDI interface */ #define DTYPE_ST506 6 /* ST506 etc. */ #define DTYPE_HPIB 7 /* CS/80 on HP-IB */ #define DTYPE_HPFL 8 /* HP Fiber-link */ #define DTYPE_FLOPPY 10 /* floppy */ #define DTYPE_CCD 11 /* concatenated disk */ #define DTYPE_VINUM 12 /* vinum volume */ #define DTYPE_DOC2K 13 /* Msys DiskOnChip */ #if defined(PC98) && !defined(PC98_ATCOMPAT) #define DSTYPE_SEC256 0x80 /* physical sector size=256 */ #endif #ifdef DKTYPENAMES static char *dktypenames[] = { "unknown", "SMD", "MSCP", "old DEC", "SCSI", "ESDI", "ST506", "HP-IB", "HP-FL", "type 9", "floppy", "CCD", "Vinum", "DOC2K", NULL }; #define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1) #endif /* * Filesystem type and version. * Used to interpret other filesystem-specific * per-partition information. */ #define FS_UNUSED 0 /* unused */ #define FS_SWAP 1 /* swap */ #define FS_V6 2 /* Sixth Edition */ #define FS_V7 3 /* Seventh Edition */ #define FS_SYSV 4 /* System V */ #define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */ #define FS_V8 6 /* Eighth Edition, 4K blocks */ #define FS_BSDFFS 7 /* 4.2BSD fast file system */ #define FS_MSDOS 8 /* MSDOS file system */ #define FS_BSDLFS 9 /* 4.4BSD log-structured file system */ #define FS_OTHER 10 /* in use, but unknown/unsupported */ #define FS_HPFS 11 /* OS/2 high-performance file system */ #define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */ #define FS_BOOT 13 /* partition contains bootstrap */ #define FS_VINUM 14 /* Vinum drive */ #ifdef DKTYPENAMES static char *fstypenames[] = { "unused", "swap", "Version 6", "Version 7", "System V", "4.1BSD", "Eighth Edition", "4.2BSD", "MSDOS", "4.4LFS", "unknown", "HPFS", "ISO9660", "boot", "vinum", NULL }; #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) #endif /* * flags shared by various drives: */ #define D_REMOVABLE 0x01 /* removable media */ #define D_ECC 0x02 /* supports ECC */ #define D_BADSECT 0x04 /* supports bad sector forw. */ #define D_RAMDISK 0x08 /* disk emulator */ #define D_CHAIN 0x10 /* can do back-back transfers */ /* * Drive data for SMD. */ #define d_smdflags d_drivedata[0] #define D_SSE 0x1 /* supports skip sectoring */ #define d_mindist d_drivedata[1] #define d_maxdist d_drivedata[2] #define d_sdist d_drivedata[3] /* * Drive data for ST506. */ #define d_precompcyl d_drivedata[0] #define d_gap3 d_drivedata[1] /* used only when formatting */ /* * Drive data for SCSI. */ #define d_blind d_drivedata[0] #ifndef LOCORE /* * Structure used to perform a format or other raw operation, returning * data and/or register values. Register identification and format * are device- and driver-dependent. */ struct format_op { char *df_buf; int df_count; /* value-result */ daddr_t df_startblk; int df_reg[8]; /* result */ }; #ifdef _KERNEL /* * Structure used internally to retrieve information about a partition * on a disk. */ struct partinfo { struct disklabel *disklab; struct partition *part; }; #endif /* DOS partition table -- located in boot block */ #if defined(PC98) && !defined(PC98_ATCOMPAT) #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSLABELSECTOR 1 /* 0: 256b/s, 1: 512b/s */ #define DOSPARTOFF 0 #define NDOSPART 16 #define DOSPTYP_386BSD 0x94 /* 386BSD partition type */ #define MBR_PTYPE_FreeBSD 0x94 /* FreeBSD partition type */ struct dos_partition { unsigned char dp_mid; #define DOSMID_386BSD (0x14|0x80) /* 386bsd|bootable */ unsigned char dp_sid; #define DOSSID_386BSD (0x44|0x80) /* 386bsd|active */ unsigned char dp_dum1; unsigned char dp_dum2; unsigned char dp_ipl_sct; unsigned char dp_ipl_head; unsigned short dp_ipl_cyl; unsigned char dp_ssect; /* starting sector */ unsigned char dp_shd; /* starting head */ unsigned short dp_scyl; /* starting cylinder */ unsigned char dp_esect; /* end sector */ unsigned char dp_ehd; /* end head */ unsigned short dp_ecyl; /* end cylinder */ unsigned char dp_name[16]; }; #else /* IBMPC */ #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSPARTOFF 446 #define NDOSPART 4 #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ #define DOSPTYP_EXT 5 /* DOS extended partition */ struct dos_partition { unsigned char dp_flag; /* bootstrap flags */ unsigned char dp_shd; /* starting head */ unsigned char dp_ssect; /* starting sector */ unsigned char dp_scyl; /* starting cylinder */ unsigned char dp_typ; /* partition type */ unsigned char dp_ehd; /* end head */ unsigned char dp_esect; /* end sector */ unsigned char dp_ecyl; /* end cylinder */ u_int32_t dp_start; /* absolute starting sector number */ u_int32_t dp_size; /* partition size in sectors */ }; #endif #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ /* * Disk-specific ioctls. */ /* get and set disklabel; DIOCGPART used internally */ #define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */ #define DIOCSDINFO _IOW('d', 102, struct disklabel)/* set */ #define DIOCWDINFO _IOW('d', 103, struct disklabel)/* set, update disk */ #ifdef _KERNEL #define DIOCGPART _IOW('d', 104, struct partinfo) /* get partition */ #endif #define DIOCGDVIRGIN _IOR('d', 105, struct disklabel)/* get virgin label */ #define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */ #define DIOCGSECTORSIZE _IOR('d', 128, u_int) /* Get sector size in bytes */ #define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ #define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ #define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ #define DIOCGFWCYLINDERS _IOR('d', 132, u_int) /* Get firmware cyl'scount */ #ifdef _KERNEL /* * XXX encoding of disk minor numbers, should be elsewhere. * * See for a possibly better encoding. * * "cpio -H newc" can be used to back up device files with large minor * numbers (but not ones >= 2^31). Old cpio formats and all tar formats * don't have enough bits, and cpio and tar don't notice the lossage. * There are also some sign extension bugs. */ /* 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 _________________________________________________________________ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------------------------------------------- | SPARE |UNIT_2 | SLICE | MAJOR? | UNIT |PART | ----------------------------------------------------------------- */ #define DKMAXUNIT 0x1ff #define dkmakeminor(unit, slice, part) \ (((slice) << 16) | (((unit) & 0x1e0) << 16) | \ (((unit) & 0x1f) << 3) | (part)) #define dkpart(dev) (minor(dev) & 7) #define dkslice(dev) ((minor(dev) >> 16) & 0x1f) #define dksparebits(dev) ((minor(dev) >> 25) & 0x7f) struct bio; struct bio_queue_head; -int bounds_check_with_label __P((struct bio *bp, struct disklabel *lp, - int wlabel)); -void diskerr __P((struct bio *bp, char *what, int blkdone, - struct disklabel *lp)); -dev_t dkmodpart __P((dev_t dev, int part)); -dev_t dkmodslice __P((dev_t dev, int slice)); -u_int dkunit __P((dev_t dev)); -char *readdisklabel __P((dev_t dev, struct disklabel *lp)); -void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp)); -int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp, - u_long openmask)); -int writedisklabel __P((dev_t dev, struct disklabel *lp)); +int bounds_check_with_label(struct bio *bp, struct disklabel *lp, + int wlabel); +void diskerr(struct bio *bp, char *what, int blkdone, + struct disklabel *lp); +dev_t dkmodpart(dev_t dev, int part); +dev_t dkmodslice(dev_t dev, int slice); +u_int dkunit(dev_t dev); +char *readdisklabel(dev_t dev, struct disklabel *lp); +void bioqdisksort(struct bio_queue_head *ap, struct bio *bp); +int setdisklabel(struct disklabel *olp, struct disklabel *nlp, + u_long openmask); +int writedisklabel(dev_t dev, struct disklabel *lp); #ifdef __alpha__ struct buf; -void alpha_fix_srm_checksum __P((struct buf *bp)); +void alpha_fix_srm_checksum(struct buf *bp); #endif #endif /* _KERNEL */ #endif /* LOCORE */ #ifndef _KERNEL __BEGIN_DECLS -struct disklabel *getdiskbyname __P((const char *)); +struct disklabel *getdiskbyname(const char *); __END_DECLS #endif #endif /* !_SYS_DISKLABEL_H_ */ Index: head/sys/sys/diskmbr.h =================================================================== --- head/sys/sys/diskmbr.h (revision 92718) +++ head/sys/sys/diskmbr.h (revision 92719) @@ -1,489 +1,489 @@ /* * Copyright (c) 1987, 1988, 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. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 * $FreeBSD$ */ #ifndef _SYS_DISKLABEL_H_ #define _SYS_DISKLABEL_H_ #ifndef _KERNEL #include #endif #include /* * Disk description table, see disktab(5) */ #define _PATH_DISKTAB "/etc/disktab" #define DISKTAB "/etc/disktab" /* deprecated */ /* * Each disk has a label which includes information about the hardware * disk geometry, filesystem partitions, and drive specific information. * The label is in block 0 or 1, possibly offset from the beginning * to leave room for a bootstrap, etc. */ /* XXX these should be defined per controller (or drive) elsewhere, not here! */ #ifdef __i386__ #define LABELSECTOR 1 /* sector containing label */ #define LABELOFFSET 0 /* offset of label in sector */ #endif #ifdef __alpha__ #define LABELSECTOR 0 #define LABELOFFSET 64 #endif #ifdef __ia64__ #define LABELSECTOR 1 #define LABELOFFSET 0 #endif #ifdef __sparc64__ #define LABELSECTOR 0 #define LABELOFFSET 128 #endif #ifndef LABELSECTOR #define LABELSECTOR 0 #endif #ifndef LABELOFFSET #define LABELOFFSET 64 #endif #define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */ #ifndef MAXPARTITIONS #define MAXPARTITIONS 8 #endif #define LABEL_PART 2 /* partition containing label */ #define RAW_PART 2 /* partition containing whole disk */ #define SWAP_PART 1 /* partition normally containing swap */ #ifndef LOCORE struct disklabel { u_int32_t d_magic; /* the magic number */ u_int16_t d_type; /* drive type */ u_int16_t d_subtype; /* controller/d_type specific */ char d_typename[16]; /* type name, e.g. "eagle" */ /* * d_packname contains the pack identifier and is returned when * the disklabel is read off the disk or in-core copy. * d_boot0 and d_boot1 are the (optional) names of the * primary (block 0) and secondary (block 1-15) bootstraps * as found in /boot. These are returned when using * getdiskbyname(3) to retrieve the values from /etc/disktab. */ union { char un_d_packname[16]; /* pack identifier */ struct { char *un_d_boot0; /* primary bootstrap name */ char *un_d_boot1; /* secondary bootstrap name */ } un_b; } d_un; #define d_packname d_un.un_d_packname #define d_boot0 d_un.un_b.un_d_boot0 #define d_boot1 d_un.un_b.un_d_boot1 /* disk geometry: */ u_int32_t d_secsize; /* # of bytes per sector */ u_int32_t d_nsectors; /* # of data sectors per track */ u_int32_t d_ntracks; /* # of tracks per cylinder */ u_int32_t d_ncylinders; /* # of data cylinders per unit */ u_int32_t d_secpercyl; /* # of data sectors per cylinder */ u_int32_t d_secperunit; /* # of data sectors per unit */ /* * Spares (bad sector replacements) below are not counted in * d_nsectors or d_secpercyl. Spare sectors are assumed to * be physical sectors which occupy space at the end of each * track and/or cylinder. */ u_int16_t d_sparespertrack; /* # of spare sectors per track */ u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */ /* * Alternate cylinders include maintenance, replacement, configuration * description areas, etc. */ u_int32_t d_acylinders; /* # of alt. cylinders per unit */ /* hardware characteristics: */ /* * d_interleave, d_trackskew and d_cylskew describe perturbations * in the media format used to compensate for a slow controller. * Interleave is physical sector interleave, set up by the * formatter or controller when formatting. When interleaving is * in use, logically adjacent sectors are not physically * contiguous, but instead are separated by some number of * sectors. It is specified as the ratio of physical sectors * traversed per logical sector. Thus an interleave of 1:1 * implies contiguous layout, while 2:1 implies that logical * sector 0 is separated by one sector from logical sector 1. * d_trackskew is the offset of sector 0 on track N relative to * sector 0 on track N-1 on the same cylinder. Finally, d_cylskew * is the offset of sector 0 on cylinder N relative to sector 0 * on cylinder N-1. */ u_int16_t d_rpm; /* rotational speed */ u_int16_t d_interleave; /* hardware sector interleave */ u_int16_t d_trackskew; /* sector 0 skew, per track */ u_int16_t d_cylskew; /* sector 0 skew, per cylinder */ u_int32_t d_headswitch; /* head switch time, usec */ u_int32_t d_trkseek; /* track-to-track seek, usec */ u_int32_t d_flags; /* generic flags */ #define NDDATA 5 u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */ #define NSPARE 5 u_int32_t d_spare[NSPARE]; /* reserved for future use */ u_int32_t d_magic2; /* the magic number (again) */ u_int16_t d_checksum; /* xor of data incl. partitions */ /* filesystem and partition information: */ u_int16_t d_npartitions; /* number of partitions in following */ u_int32_t d_bbsize; /* size of boot area at sn0, bytes */ u_int32_t d_sbsize; /* max size of fs superblock, bytes */ struct partition { /* the partition table */ u_int32_t p_size; /* number of sectors in partition */ u_int32_t p_offset; /* starting sector */ u_int32_t p_fsize; /* filesystem basic fragment size */ u_int8_t p_fstype; /* filesystem type, see below */ u_int8_t p_frag; /* filesystem fragments per block */ u_int16_t p_cpg; /* filesystem cylinders per group */ } d_partitions[MAXPARTITIONS]; /* actually may be more */ }; -static __inline u_int16_t dkcksum __P((struct disklabel *lp)); +static __inline u_int16_t dkcksum(struct disklabel *lp); static __inline u_int16_t dkcksum(lp) struct disklabel *lp; { u_int16_t *start, *end; u_int16_t sum = 0; start = (u_int16_t *)lp; end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions]; while (start < end) sum ^= *start++; return (sum); } #else /* LOCORE */ /* * offsets for asm boot files. */ .set d_secsize,40 .set d_nsectors,44 .set d_ntracks,48 .set d_ncylinders,52 .set d_secpercyl,56 .set d_secperunit,60 .set d_end_,276 /* size of disk label */ #endif /* LOCORE */ /* d_type values: */ #define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */ #define DTYPE_MSCP 2 /* MSCP */ #define DTYPE_DEC 3 /* other DEC (rk, rl) */ #define DTYPE_SCSI 4 /* SCSI */ #define DTYPE_ESDI 5 /* ESDI interface */ #define DTYPE_ST506 6 /* ST506 etc. */ #define DTYPE_HPIB 7 /* CS/80 on HP-IB */ #define DTYPE_HPFL 8 /* HP Fiber-link */ #define DTYPE_FLOPPY 10 /* floppy */ #define DTYPE_CCD 11 /* concatenated disk */ #define DTYPE_VINUM 12 /* vinum volume */ #define DTYPE_DOC2K 13 /* Msys DiskOnChip */ #if defined(PC98) && !defined(PC98_ATCOMPAT) #define DSTYPE_SEC256 0x80 /* physical sector size=256 */ #endif #ifdef DKTYPENAMES static char *dktypenames[] = { "unknown", "SMD", "MSCP", "old DEC", "SCSI", "ESDI", "ST506", "HP-IB", "HP-FL", "type 9", "floppy", "CCD", "Vinum", "DOC2K", NULL }; #define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1) #endif /* * Filesystem type and version. * Used to interpret other filesystem-specific * per-partition information. */ #define FS_UNUSED 0 /* unused */ #define FS_SWAP 1 /* swap */ #define FS_V6 2 /* Sixth Edition */ #define FS_V7 3 /* Seventh Edition */ #define FS_SYSV 4 /* System V */ #define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */ #define FS_V8 6 /* Eighth Edition, 4K blocks */ #define FS_BSDFFS 7 /* 4.2BSD fast file system */ #define FS_MSDOS 8 /* MSDOS file system */ #define FS_BSDLFS 9 /* 4.4BSD log-structured file system */ #define FS_OTHER 10 /* in use, but unknown/unsupported */ #define FS_HPFS 11 /* OS/2 high-performance file system */ #define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */ #define FS_BOOT 13 /* partition contains bootstrap */ #define FS_VINUM 14 /* Vinum drive */ #ifdef DKTYPENAMES static char *fstypenames[] = { "unused", "swap", "Version 6", "Version 7", "System V", "4.1BSD", "Eighth Edition", "4.2BSD", "MSDOS", "4.4LFS", "unknown", "HPFS", "ISO9660", "boot", "vinum", NULL }; #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) #endif /* * flags shared by various drives: */ #define D_REMOVABLE 0x01 /* removable media */ #define D_ECC 0x02 /* supports ECC */ #define D_BADSECT 0x04 /* supports bad sector forw. */ #define D_RAMDISK 0x08 /* disk emulator */ #define D_CHAIN 0x10 /* can do back-back transfers */ /* * Drive data for SMD. */ #define d_smdflags d_drivedata[0] #define D_SSE 0x1 /* supports skip sectoring */ #define d_mindist d_drivedata[1] #define d_maxdist d_drivedata[2] #define d_sdist d_drivedata[3] /* * Drive data for ST506. */ #define d_precompcyl d_drivedata[0] #define d_gap3 d_drivedata[1] /* used only when formatting */ /* * Drive data for SCSI. */ #define d_blind d_drivedata[0] #ifndef LOCORE /* * Structure used to perform a format or other raw operation, returning * data and/or register values. Register identification and format * are device- and driver-dependent. */ struct format_op { char *df_buf; int df_count; /* value-result */ daddr_t df_startblk; int df_reg[8]; /* result */ }; #ifdef _KERNEL /* * Structure used internally to retrieve information about a partition * on a disk. */ struct partinfo { struct disklabel *disklab; struct partition *part; }; #endif /* DOS partition table -- located in boot block */ #if defined(PC98) && !defined(PC98_ATCOMPAT) #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSLABELSECTOR 1 /* 0: 256b/s, 1: 512b/s */ #define DOSPARTOFF 0 #define NDOSPART 16 #define DOSPTYP_386BSD 0x94 /* 386BSD partition type */ #define MBR_PTYPE_FreeBSD 0x94 /* FreeBSD partition type */ struct dos_partition { unsigned char dp_mid; #define DOSMID_386BSD (0x14|0x80) /* 386bsd|bootable */ unsigned char dp_sid; #define DOSSID_386BSD (0x44|0x80) /* 386bsd|active */ unsigned char dp_dum1; unsigned char dp_dum2; unsigned char dp_ipl_sct; unsigned char dp_ipl_head; unsigned short dp_ipl_cyl; unsigned char dp_ssect; /* starting sector */ unsigned char dp_shd; /* starting head */ unsigned short dp_scyl; /* starting cylinder */ unsigned char dp_esect; /* end sector */ unsigned char dp_ehd; /* end head */ unsigned short dp_ecyl; /* end cylinder */ unsigned char dp_name[16]; }; #else /* IBMPC */ #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSPARTOFF 446 #define NDOSPART 4 #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ #define DOSPTYP_EXT 5 /* DOS extended partition */ struct dos_partition { unsigned char dp_flag; /* bootstrap flags */ unsigned char dp_shd; /* starting head */ unsigned char dp_ssect; /* starting sector */ unsigned char dp_scyl; /* starting cylinder */ unsigned char dp_typ; /* partition type */ unsigned char dp_ehd; /* end head */ unsigned char dp_esect; /* end sector */ unsigned char dp_ecyl; /* end cylinder */ u_int32_t dp_start; /* absolute starting sector number */ u_int32_t dp_size; /* partition size in sectors */ }; #endif #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ /* * Disk-specific ioctls. */ /* get and set disklabel; DIOCGPART used internally */ #define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */ #define DIOCSDINFO _IOW('d', 102, struct disklabel)/* set */ #define DIOCWDINFO _IOW('d', 103, struct disklabel)/* set, update disk */ #ifdef _KERNEL #define DIOCGPART _IOW('d', 104, struct partinfo) /* get partition */ #endif #define DIOCGDVIRGIN _IOR('d', 105, struct disklabel)/* get virgin label */ #define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */ #define DIOCGSECTORSIZE _IOR('d', 128, u_int) /* Get sector size in bytes */ #define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ #define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ #define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ #define DIOCGFWCYLINDERS _IOR('d', 132, u_int) /* Get firmware cyl'scount */ #ifdef _KERNEL /* * XXX encoding of disk minor numbers, should be elsewhere. * * See for a possibly better encoding. * * "cpio -H newc" can be used to back up device files with large minor * numbers (but not ones >= 2^31). Old cpio formats and all tar formats * don't have enough bits, and cpio and tar don't notice the lossage. * There are also some sign extension bugs. */ /* 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 _________________________________________________________________ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------------------------------------------- | SPARE |UNIT_2 | SLICE | MAJOR? | UNIT |PART | ----------------------------------------------------------------- */ #define DKMAXUNIT 0x1ff #define dkmakeminor(unit, slice, part) \ (((slice) << 16) | (((unit) & 0x1e0) << 16) | \ (((unit) & 0x1f) << 3) | (part)) #define dkpart(dev) (minor(dev) & 7) #define dkslice(dev) ((minor(dev) >> 16) & 0x1f) #define dksparebits(dev) ((minor(dev) >> 25) & 0x7f) struct bio; struct bio_queue_head; -int bounds_check_with_label __P((struct bio *bp, struct disklabel *lp, - int wlabel)); -void diskerr __P((struct bio *bp, char *what, int blkdone, - struct disklabel *lp)); -dev_t dkmodpart __P((dev_t dev, int part)); -dev_t dkmodslice __P((dev_t dev, int slice)); -u_int dkunit __P((dev_t dev)); -char *readdisklabel __P((dev_t dev, struct disklabel *lp)); -void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp)); -int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp, - u_long openmask)); -int writedisklabel __P((dev_t dev, struct disklabel *lp)); +int bounds_check_with_label(struct bio *bp, struct disklabel *lp, + int wlabel); +void diskerr(struct bio *bp, char *what, int blkdone, + struct disklabel *lp); +dev_t dkmodpart(dev_t dev, int part); +dev_t dkmodslice(dev_t dev, int slice); +u_int dkunit(dev_t dev); +char *readdisklabel(dev_t dev, struct disklabel *lp); +void bioqdisksort(struct bio_queue_head *ap, struct bio *bp); +int setdisklabel(struct disklabel *olp, struct disklabel *nlp, + u_long openmask); +int writedisklabel(dev_t dev, struct disklabel *lp); #ifdef __alpha__ struct buf; -void alpha_fix_srm_checksum __P((struct buf *bp)); +void alpha_fix_srm_checksum(struct buf *bp); #endif #endif /* _KERNEL */ #endif /* LOCORE */ #ifndef _KERNEL __BEGIN_DECLS -struct disklabel *getdiskbyname __P((const char *)); +struct disklabel *getdiskbyname(const char *); __END_DECLS #endif #endif /* !_SYS_DISKLABEL_H_ */ Index: head/sys/sys/diskpc98.h =================================================================== --- head/sys/sys/diskpc98.h (revision 92718) +++ head/sys/sys/diskpc98.h (revision 92719) @@ -1,489 +1,489 @@ /* * Copyright (c) 1987, 1988, 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. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 * $FreeBSD$ */ #ifndef _SYS_DISKLABEL_H_ #define _SYS_DISKLABEL_H_ #ifndef _KERNEL #include #endif #include /* * Disk description table, see disktab(5) */ #define _PATH_DISKTAB "/etc/disktab" #define DISKTAB "/etc/disktab" /* deprecated */ /* * Each disk has a label which includes information about the hardware * disk geometry, filesystem partitions, and drive specific information. * The label is in block 0 or 1, possibly offset from the beginning * to leave room for a bootstrap, etc. */ /* XXX these should be defined per controller (or drive) elsewhere, not here! */ #ifdef __i386__ #define LABELSECTOR 1 /* sector containing label */ #define LABELOFFSET 0 /* offset of label in sector */ #endif #ifdef __alpha__ #define LABELSECTOR 0 #define LABELOFFSET 64 #endif #ifdef __ia64__ #define LABELSECTOR 1 #define LABELOFFSET 0 #endif #ifdef __sparc64__ #define LABELSECTOR 0 #define LABELOFFSET 128 #endif #ifndef LABELSECTOR #define LABELSECTOR 0 #endif #ifndef LABELOFFSET #define LABELOFFSET 64 #endif #define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */ #ifndef MAXPARTITIONS #define MAXPARTITIONS 8 #endif #define LABEL_PART 2 /* partition containing label */ #define RAW_PART 2 /* partition containing whole disk */ #define SWAP_PART 1 /* partition normally containing swap */ #ifndef LOCORE struct disklabel { u_int32_t d_magic; /* the magic number */ u_int16_t d_type; /* drive type */ u_int16_t d_subtype; /* controller/d_type specific */ char d_typename[16]; /* type name, e.g. "eagle" */ /* * d_packname contains the pack identifier and is returned when * the disklabel is read off the disk or in-core copy. * d_boot0 and d_boot1 are the (optional) names of the * primary (block 0) and secondary (block 1-15) bootstraps * as found in /boot. These are returned when using * getdiskbyname(3) to retrieve the values from /etc/disktab. */ union { char un_d_packname[16]; /* pack identifier */ struct { char *un_d_boot0; /* primary bootstrap name */ char *un_d_boot1; /* secondary bootstrap name */ } un_b; } d_un; #define d_packname d_un.un_d_packname #define d_boot0 d_un.un_b.un_d_boot0 #define d_boot1 d_un.un_b.un_d_boot1 /* disk geometry: */ u_int32_t d_secsize; /* # of bytes per sector */ u_int32_t d_nsectors; /* # of data sectors per track */ u_int32_t d_ntracks; /* # of tracks per cylinder */ u_int32_t d_ncylinders; /* # of data cylinders per unit */ u_int32_t d_secpercyl; /* # of data sectors per cylinder */ u_int32_t d_secperunit; /* # of data sectors per unit */ /* * Spares (bad sector replacements) below are not counted in * d_nsectors or d_secpercyl. Spare sectors are assumed to * be physical sectors which occupy space at the end of each * track and/or cylinder. */ u_int16_t d_sparespertrack; /* # of spare sectors per track */ u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */ /* * Alternate cylinders include maintenance, replacement, configuration * description areas, etc. */ u_int32_t d_acylinders; /* # of alt. cylinders per unit */ /* hardware characteristics: */ /* * d_interleave, d_trackskew and d_cylskew describe perturbations * in the media format used to compensate for a slow controller. * Interleave is physical sector interleave, set up by the * formatter or controller when formatting. When interleaving is * in use, logically adjacent sectors are not physically * contiguous, but instead are separated by some number of * sectors. It is specified as the ratio of physical sectors * traversed per logical sector. Thus an interleave of 1:1 * implies contiguous layout, while 2:1 implies that logical * sector 0 is separated by one sector from logical sector 1. * d_trackskew is the offset of sector 0 on track N relative to * sector 0 on track N-1 on the same cylinder. Finally, d_cylskew * is the offset of sector 0 on cylinder N relative to sector 0 * on cylinder N-1. */ u_int16_t d_rpm; /* rotational speed */ u_int16_t d_interleave; /* hardware sector interleave */ u_int16_t d_trackskew; /* sector 0 skew, per track */ u_int16_t d_cylskew; /* sector 0 skew, per cylinder */ u_int32_t d_headswitch; /* head switch time, usec */ u_int32_t d_trkseek; /* track-to-track seek, usec */ u_int32_t d_flags; /* generic flags */ #define NDDATA 5 u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */ #define NSPARE 5 u_int32_t d_spare[NSPARE]; /* reserved for future use */ u_int32_t d_magic2; /* the magic number (again) */ u_int16_t d_checksum; /* xor of data incl. partitions */ /* filesystem and partition information: */ u_int16_t d_npartitions; /* number of partitions in following */ u_int32_t d_bbsize; /* size of boot area at sn0, bytes */ u_int32_t d_sbsize; /* max size of fs superblock, bytes */ struct partition { /* the partition table */ u_int32_t p_size; /* number of sectors in partition */ u_int32_t p_offset; /* starting sector */ u_int32_t p_fsize; /* filesystem basic fragment size */ u_int8_t p_fstype; /* filesystem type, see below */ u_int8_t p_frag; /* filesystem fragments per block */ u_int16_t p_cpg; /* filesystem cylinders per group */ } d_partitions[MAXPARTITIONS]; /* actually may be more */ }; -static __inline u_int16_t dkcksum __P((struct disklabel *lp)); +static __inline u_int16_t dkcksum(struct disklabel *lp); static __inline u_int16_t dkcksum(lp) struct disklabel *lp; { u_int16_t *start, *end; u_int16_t sum = 0; start = (u_int16_t *)lp; end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions]; while (start < end) sum ^= *start++; return (sum); } #else /* LOCORE */ /* * offsets for asm boot files. */ .set d_secsize,40 .set d_nsectors,44 .set d_ntracks,48 .set d_ncylinders,52 .set d_secpercyl,56 .set d_secperunit,60 .set d_end_,276 /* size of disk label */ #endif /* LOCORE */ /* d_type values: */ #define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */ #define DTYPE_MSCP 2 /* MSCP */ #define DTYPE_DEC 3 /* other DEC (rk, rl) */ #define DTYPE_SCSI 4 /* SCSI */ #define DTYPE_ESDI 5 /* ESDI interface */ #define DTYPE_ST506 6 /* ST506 etc. */ #define DTYPE_HPIB 7 /* CS/80 on HP-IB */ #define DTYPE_HPFL 8 /* HP Fiber-link */ #define DTYPE_FLOPPY 10 /* floppy */ #define DTYPE_CCD 11 /* concatenated disk */ #define DTYPE_VINUM 12 /* vinum volume */ #define DTYPE_DOC2K 13 /* Msys DiskOnChip */ #if defined(PC98) && !defined(PC98_ATCOMPAT) #define DSTYPE_SEC256 0x80 /* physical sector size=256 */ #endif #ifdef DKTYPENAMES static char *dktypenames[] = { "unknown", "SMD", "MSCP", "old DEC", "SCSI", "ESDI", "ST506", "HP-IB", "HP-FL", "type 9", "floppy", "CCD", "Vinum", "DOC2K", NULL }; #define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1) #endif /* * Filesystem type and version. * Used to interpret other filesystem-specific * per-partition information. */ #define FS_UNUSED 0 /* unused */ #define FS_SWAP 1 /* swap */ #define FS_V6 2 /* Sixth Edition */ #define FS_V7 3 /* Seventh Edition */ #define FS_SYSV 4 /* System V */ #define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */ #define FS_V8 6 /* Eighth Edition, 4K blocks */ #define FS_BSDFFS 7 /* 4.2BSD fast file system */ #define FS_MSDOS 8 /* MSDOS file system */ #define FS_BSDLFS 9 /* 4.4BSD log-structured file system */ #define FS_OTHER 10 /* in use, but unknown/unsupported */ #define FS_HPFS 11 /* OS/2 high-performance file system */ #define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */ #define FS_BOOT 13 /* partition contains bootstrap */ #define FS_VINUM 14 /* Vinum drive */ #ifdef DKTYPENAMES static char *fstypenames[] = { "unused", "swap", "Version 6", "Version 7", "System V", "4.1BSD", "Eighth Edition", "4.2BSD", "MSDOS", "4.4LFS", "unknown", "HPFS", "ISO9660", "boot", "vinum", NULL }; #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) #endif /* * flags shared by various drives: */ #define D_REMOVABLE 0x01 /* removable media */ #define D_ECC 0x02 /* supports ECC */ #define D_BADSECT 0x04 /* supports bad sector forw. */ #define D_RAMDISK 0x08 /* disk emulator */ #define D_CHAIN 0x10 /* can do back-back transfers */ /* * Drive data for SMD. */ #define d_smdflags d_drivedata[0] #define D_SSE 0x1 /* supports skip sectoring */ #define d_mindist d_drivedata[1] #define d_maxdist d_drivedata[2] #define d_sdist d_drivedata[3] /* * Drive data for ST506. */ #define d_precompcyl d_drivedata[0] #define d_gap3 d_drivedata[1] /* used only when formatting */ /* * Drive data for SCSI. */ #define d_blind d_drivedata[0] #ifndef LOCORE /* * Structure used to perform a format or other raw operation, returning * data and/or register values. Register identification and format * are device- and driver-dependent. */ struct format_op { char *df_buf; int df_count; /* value-result */ daddr_t df_startblk; int df_reg[8]; /* result */ }; #ifdef _KERNEL /* * Structure used internally to retrieve information about a partition * on a disk. */ struct partinfo { struct disklabel *disklab; struct partition *part; }; #endif /* DOS partition table -- located in boot block */ #if defined(PC98) && !defined(PC98_ATCOMPAT) #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSLABELSECTOR 1 /* 0: 256b/s, 1: 512b/s */ #define DOSPARTOFF 0 #define NDOSPART 16 #define DOSPTYP_386BSD 0x94 /* 386BSD partition type */ #define MBR_PTYPE_FreeBSD 0x94 /* FreeBSD partition type */ struct dos_partition { unsigned char dp_mid; #define DOSMID_386BSD (0x14|0x80) /* 386bsd|bootable */ unsigned char dp_sid; #define DOSSID_386BSD (0x44|0x80) /* 386bsd|active */ unsigned char dp_dum1; unsigned char dp_dum2; unsigned char dp_ipl_sct; unsigned char dp_ipl_head; unsigned short dp_ipl_cyl; unsigned char dp_ssect; /* starting sector */ unsigned char dp_shd; /* starting head */ unsigned short dp_scyl; /* starting cylinder */ unsigned char dp_esect; /* end sector */ unsigned char dp_ehd; /* end head */ unsigned short dp_ecyl; /* end cylinder */ unsigned char dp_name[16]; }; #else /* IBMPC */ #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSPARTOFF 446 #define NDOSPART 4 #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ #define DOSPTYP_EXT 5 /* DOS extended partition */ struct dos_partition { unsigned char dp_flag; /* bootstrap flags */ unsigned char dp_shd; /* starting head */ unsigned char dp_ssect; /* starting sector */ unsigned char dp_scyl; /* starting cylinder */ unsigned char dp_typ; /* partition type */ unsigned char dp_ehd; /* end head */ unsigned char dp_esect; /* end sector */ unsigned char dp_ecyl; /* end cylinder */ u_int32_t dp_start; /* absolute starting sector number */ u_int32_t dp_size; /* partition size in sectors */ }; #endif #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ /* * Disk-specific ioctls. */ /* get and set disklabel; DIOCGPART used internally */ #define DIOCGDINFO _IOR('d', 101, struct disklabel)/* get */ #define DIOCSDINFO _IOW('d', 102, struct disklabel)/* set */ #define DIOCWDINFO _IOW('d', 103, struct disklabel)/* set, update disk */ #ifdef _KERNEL #define DIOCGPART _IOW('d', 104, struct partinfo) /* get partition */ #endif #define DIOCGDVIRGIN _IOR('d', 105, struct disklabel)/* get virgin label */ #define DIOCWLABEL _IOW('d', 109, int) /* write en/disable label */ #define DIOCGSECTORSIZE _IOR('d', 128, u_int) /* Get sector size in bytes */ #define DIOCGMEDIASIZE _IOR('d', 129, off_t) /* Get media size in bytes */ #define DIOCGFWSECTORS _IOR('d', 130, u_int) /* Get firmware sectorcount */ #define DIOCGFWHEADS _IOR('d', 131, u_int) /* Get firmware headcount */ #define DIOCGFWCYLINDERS _IOR('d', 132, u_int) /* Get firmware cyl'scount */ #ifdef _KERNEL /* * XXX encoding of disk minor numbers, should be elsewhere. * * See for a possibly better encoding. * * "cpio -H newc" can be used to back up device files with large minor * numbers (but not ones >= 2^31). Old cpio formats and all tar formats * don't have enough bits, and cpio and tar don't notice the lossage. * There are also some sign extension bugs. */ /* 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 _________________________________________________________________ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------------------------------------------- | SPARE |UNIT_2 | SLICE | MAJOR? | UNIT |PART | ----------------------------------------------------------------- */ #define DKMAXUNIT 0x1ff #define dkmakeminor(unit, slice, part) \ (((slice) << 16) | (((unit) & 0x1e0) << 16) | \ (((unit) & 0x1f) << 3) | (part)) #define dkpart(dev) (minor(dev) & 7) #define dkslice(dev) ((minor(dev) >> 16) & 0x1f) #define dksparebits(dev) ((minor(dev) >> 25) & 0x7f) struct bio; struct bio_queue_head; -int bounds_check_with_label __P((struct bio *bp, struct disklabel *lp, - int wlabel)); -void diskerr __P((struct bio *bp, char *what, int blkdone, - struct disklabel *lp)); -dev_t dkmodpart __P((dev_t dev, int part)); -dev_t dkmodslice __P((dev_t dev, int slice)); -u_int dkunit __P((dev_t dev)); -char *readdisklabel __P((dev_t dev, struct disklabel *lp)); -void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp)); -int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp, - u_long openmask)); -int writedisklabel __P((dev_t dev, struct disklabel *lp)); +int bounds_check_with_label(struct bio *bp, struct disklabel *lp, + int wlabel); +void diskerr(struct bio *bp, char *what, int blkdone, + struct disklabel *lp); +dev_t dkmodpart(dev_t dev, int part); +dev_t dkmodslice(dev_t dev, int slice); +u_int dkunit(dev_t dev); +char *readdisklabel(dev_t dev, struct disklabel *lp); +void bioqdisksort(struct bio_queue_head *ap, struct bio *bp); +int setdisklabel(struct disklabel *olp, struct disklabel *nlp, + u_long openmask); +int writedisklabel(dev_t dev, struct disklabel *lp); #ifdef __alpha__ struct buf; -void alpha_fix_srm_checksum __P((struct buf *bp)); +void alpha_fix_srm_checksum(struct buf *bp); #endif #endif /* _KERNEL */ #endif /* LOCORE */ #ifndef _KERNEL __BEGIN_DECLS -struct disklabel *getdiskbyname __P((const char *)); +struct disklabel *getdiskbyname(const char *); __END_DECLS #endif #endif /* !_SYS_DISKLABEL_H_ */ Index: head/sys/sys/diskslice.h =================================================================== --- head/sys/sys/diskslice.h (revision 92718) +++ head/sys/sys/diskslice.h (revision 92719) @@ -1,98 +1,98 @@ /*- * Copyright (c) 1994 Bruce D. Evans. * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_DISKSLICE_H_ #define _SYS_DISKSLICE_H_ #ifndef _KERNEL #include #endif #include #define BASE_SLICE 2 #define COMPATIBILITY_SLICE 0 #define DIOCGSLICEINFO _IOR('d', 111, struct diskslices) #define DIOCSYNCSLICEINFO _IOW('d', 112, int) #define MAX_SLICES 32 #define WHOLE_DISK_SLICE 1 struct diskslice { u_long ds_offset; /* starting sector */ u_long ds_size; /* number of sectors */ int ds_type; /* (foreign) slice type */ #ifdef PC98 int ds_subtype; /* sub slice type */ u_char ds_name[16]; /* slice name */ #endif struct disklabel *ds_label; /* BSD label, if any */ u_char ds_openmask; /* devs open */ u_char ds_wlabel; /* nonzero if label is writable */ }; struct diskslices { struct cdevsw *dss_cdevsw; /* for containing device */ int dss_first_bsd_slice; /* COMPATIBILITY_SLICE is mapped here */ u_int dss_nslices; /* actual dimension of dss_slices[] */ u_int dss_oflags; /* copy of flags for "first" open */ int dss_secmult; /* block to sector multiplier */ int dss_secshift; /* block to sector shift (or -1) */ int dss_secsize; /* sector size */ struct diskslice dss_slices[MAX_SLICES]; /* actually usually less */ }; #ifdef _KERNEL /* Flags for dsopen(). */ #define DSO_NOLABELS 1 #define DSO_ONESLICE 2 #define DSO_COMPATLABEL 4 #define dsgetlabel(dev, ssp) (ssp->dss_slices[dkslice(dev)].ds_label) struct bio; struct disklabel; -int dscheck __P((struct bio *bp, struct diskslices *ssp)); -void dsclose __P((dev_t dev, int mode, struct diskslices *ssp)); -void dsgone __P((struct diskslices **sspp)); -int dsinit __P((dev_t dev, struct disklabel *lp, - struct diskslices **sspp)); -int dsioctl __P((dev_t dev, u_long cmd, caddr_t data, - int flags, struct diskslices **sspp)); -int dsisopen __P((struct diskslices *ssp)); -struct diskslices *dsmakeslicestruct __P((int nslices, struct disklabel *lp)); -char *dsname __P((dev_t dev, int unit, int slice, int part, - char *partname)); -int dsopen __P((dev_t dev, int mode, u_int flags, - struct diskslices **sspp, struct disklabel *lp)); -int dssize __P((dev_t dev, struct diskslices **sspp)); +int dscheck(struct bio *bp, struct diskslices *ssp); +void dsclose(dev_t dev, int mode, struct diskslices *ssp); +void dsgone(struct diskslices **sspp); +int dsinit(dev_t dev, struct disklabel *lp, + struct diskslices **sspp); +int dsioctl(dev_t dev, u_long cmd, caddr_t data, + int flags, struct diskslices **sspp); +int dsisopen(struct diskslices *ssp); +struct diskslices *dsmakeslicestruct(int nslices, struct disklabel *lp); +char *dsname(dev_t dev, int unit, int slice, int part, + char *partname); +int dsopen(dev_t dev, int mode, u_int flags, + struct diskslices **sspp, struct disklabel *lp); +int dssize(dev_t dev, struct diskslices **sspp); #endif /* _KERNEL */ #endif /* !_SYS_DISKSLICE_H_ */ Index: head/sys/sys/domain.h =================================================================== --- head/sys/sys/domain.h (revision 92718) +++ head/sys/sys/domain.h (revision 92719) @@ -1,76 +1,76 @@ /* * 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. * * @(#)domain.h 8.1 (Berkeley) 6/2/93 * $FreeBSD$ */ #ifndef _SYS_DOMAIN_H_ #define _SYS_DOMAIN_H_ /* * Structure per communications domain. */ /* * Forward structure declarations for function prototypes [sic]. */ struct mbuf; struct domain { int dom_family; /* AF_xxx */ char *dom_name; void (*dom_init) /* initialize domain data structures */ - __P((void)); + (void); int (*dom_externalize) /* externalize access rights */ - __P((struct mbuf *, struct mbuf **)); + (struct mbuf *, struct mbuf **); void (*dom_dispose) /* dispose of internalized rights */ - __P((struct mbuf *)); + (struct mbuf *); struct protosw *dom_protosw, *dom_protoswNPROTOSW; struct domain *dom_next; int (*dom_rtattach) /* initialize routing table */ - __P((void **, int)); + (void **, int); int dom_rtoffset; /* an arg to rtattach, in bits */ int dom_maxrtkey; /* for routing layer */ }; #ifdef _KERNEL extern struct domain *domains; extern struct domain localdomain; extern void net_add_domain(void *); #define DOMAIN_SET(name) \ SYSINIT(domain_ ## name, SI_SUB_PROTO_DOMAIN, SI_ORDER_SECOND, net_add_domain, & name ## domain) #endif #endif Index: head/sys/sys/errno.h =================================================================== --- head/sys/sys/errno.h (revision 92718) +++ head/sys/sys/errno.h (revision 92719) @@ -1,182 +1,182 @@ /* * Copyright (c) 1982, 1986, 1989, 1993 * 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. * * @(#)errno.h 8.5 (Berkeley) 1/21/94 * $FreeBSD$ */ #ifndef _SYS_ERRNO_H_ #define _SYS_ERRNO_H_ #ifndef _KERNEL #include __BEGIN_DECLS -int * __error __P((void)); +int * __error(void); __END_DECLS #define errno (* __error()) #endif #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* Input/output error */ #define ENXIO 6 /* Device not configured */ #define E2BIG 7 /* Argument list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file descriptor */ #define ECHILD 10 /* No child processes */ #define EDEADLK 11 /* Resource deadlock avoided */ /* 11 was EAGAIN */ #define ENOMEM 12 /* Cannot allocate memory */ #define EACCES 13 /* Permission denied */ #define EFAULT 14 /* Bad address */ #ifndef _POSIX_SOURCE #define ENOTBLK 15 /* Block device required */ #endif #define EBUSY 16 /* Device busy */ #define EEXIST 17 /* File exists */ #define EXDEV 18 /* Cross-device link */ #define ENODEV 19 /* Operation not supported by device */ #define ENOTDIR 20 /* Not a directory */ #define EISDIR 21 /* Is a directory */ #define EINVAL 22 /* Invalid argument */ #define ENFILE 23 /* Too many open files in system */ #define EMFILE 24 /* Too many open files */ #define ENOTTY 25 /* Inappropriate ioctl for device */ #ifndef _POSIX_SOURCE #define ETXTBSY 26 /* Text file busy */ #endif #define EFBIG 27 /* File too large */ #define ENOSPC 28 /* No space left on device */ #define ESPIPE 29 /* Illegal seek */ #define EROFS 30 /* Read-only file system */ #define EMLINK 31 /* Too many links */ #define EPIPE 32 /* Broken pipe */ /* math software */ #define EDOM 33 /* Numerical argument out of domain */ #define ERANGE 34 /* Result too large */ /* non-blocking and interrupt i/o */ #define EAGAIN 35 /* Resource temporarily unavailable */ #ifndef _POSIX_SOURCE #define EWOULDBLOCK EAGAIN /* Operation would block */ #define EINPROGRESS 36 /* Operation now in progress */ #define EALREADY 37 /* Operation already in progress */ /* ipc/network software -- argument errors */ #define ENOTSOCK 38 /* Socket operation on non-socket */ #define EDESTADDRREQ 39 /* Destination address required */ #define EMSGSIZE 40 /* Message too long */ #define EPROTOTYPE 41 /* Protocol wrong type for socket */ #define ENOPROTOOPT 42 /* Protocol not available */ #define EPROTONOSUPPORT 43 /* Protocol not supported */ #define ESOCKTNOSUPPORT 44 /* Socket type not supported */ #define EOPNOTSUPP 45 /* Operation not supported */ #define ENOTSUP EOPNOTSUPP /* Operation not supported */ #define EPFNOSUPPORT 46 /* Protocol family not supported */ #define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ #define EADDRINUSE 48 /* Address already in use */ #define EADDRNOTAVAIL 49 /* Can't assign requested address */ /* ipc/network software -- operational errors */ #define ENETDOWN 50 /* Network is down */ #define ENETUNREACH 51 /* Network is unreachable */ #define ENETRESET 52 /* Network dropped connection on reset */ #define ECONNABORTED 53 /* Software caused connection abort */ #define ECONNRESET 54 /* Connection reset by peer */ #define ENOBUFS 55 /* No buffer space available */ #define EISCONN 56 /* Socket is already connected */ #define ENOTCONN 57 /* Socket is not connected */ #define ESHUTDOWN 58 /* Can't send after socket shutdown */ #define ETOOMANYREFS 59 /* Too many references: can't splice */ #define ETIMEDOUT 60 /* Operation timed out */ #define ECONNREFUSED 61 /* Connection refused */ #define ELOOP 62 /* Too many levels of symbolic links */ #endif /* _POSIX_SOURCE */ #define ENAMETOOLONG 63 /* File name too long */ /* should be rearranged */ #ifndef _POSIX_SOURCE #define EHOSTDOWN 64 /* Host is down */ #define EHOSTUNREACH 65 /* No route to host */ #endif /* _POSIX_SOURCE */ #define ENOTEMPTY 66 /* Directory not empty */ /* quotas & mush */ #ifndef _POSIX_SOURCE #define EPROCLIM 67 /* Too many processes */ #define EUSERS 68 /* Too many users */ #define EDQUOT 69 /* Disc quota exceeded */ /* Network File System */ #define ESTALE 70 /* Stale NFS file handle */ #define EREMOTE 71 /* Too many levels of remote in path */ #define EBADRPC 72 /* RPC struct is bad */ #define ERPCMISMATCH 73 /* RPC version wrong */ #define EPROGUNAVAIL 74 /* RPC prog. not avail */ #define EPROGMISMATCH 75 /* Program version wrong */ #define EPROCUNAVAIL 76 /* Bad procedure for program */ #endif /* _POSIX_SOURCE */ #define ENOLCK 77 /* No locks available */ #define ENOSYS 78 /* Function not implemented */ #ifndef _POSIX_SOURCE #define EFTYPE 79 /* Inappropriate file type or format */ #define EAUTH 80 /* Authentication error */ #define ENEEDAUTH 81 /* Need authenticator */ #define EIDRM 82 /* Identifier removed */ #define ENOMSG 83 /* No message of desired type */ #define EOVERFLOW 84 /* Value too large to be stored in data type */ #define ECANCELED 85 /* Operation canceled */ #define EILSEQ 86 /* Illegal byte sequence */ #define ENOATTR 87 /* Attribute not found */ #define ELAST 87 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL /* pseudo-errors returned inside kernel to modify return to process */ #define ERESTART (-1) /* restart syscall */ #define EJUSTRETURN (-2) /* don't modify regs, just return */ #define ENOIOCTL (-3) /* ioctl not handled by this layer */ #endif #endif Index: head/sys/sys/event.h =================================================================== --- head/sys/sys/event.h (revision 92718) +++ head/sys/sys/event.h (revision 92719) @@ -1,197 +1,197 @@ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_EVENT_H_ #define _SYS_EVENT_H_ #define EVFILT_READ (-1) #define EVFILT_WRITE (-2) #define EVFILT_AIO (-3) /* attached to aio requests */ #define EVFILT_VNODE (-4) /* attached to vnodes */ #define EVFILT_PROC (-5) /* attached to struct proc */ #define EVFILT_SIGNAL (-6) /* attached to struct proc */ #define EVFILT_TIMER (-7) /* timers */ #define EVFILT_NETDEV (-8) /* network devices */ #define EVFILT_SYSCOUNT 8 #define EV_SET(kevp, a, b, c, d, e, f) do { \ (kevp)->ident = (a); \ (kevp)->filter = (b); \ (kevp)->flags = (c); \ (kevp)->fflags = (d); \ (kevp)->data = (e); \ (kevp)->udata = (f); \ } while(0) struct kevent { uintptr_t ident; /* identifier for this event */ short filter; /* filter for event */ u_short flags; u_int fflags; intptr_t data; void *udata; /* opaque user data identifier */ }; /* actions */ #define EV_ADD 0x0001 /* add event to kq (implies enable) */ #define EV_DELETE 0x0002 /* delete event from kq */ #define EV_ENABLE 0x0004 /* enable event */ #define EV_DISABLE 0x0008 /* disable event (not reported) */ /* flags */ #define EV_ONESHOT 0x0010 /* only report one occurrence */ #define EV_CLEAR 0x0020 /* clear event state after reporting */ #define EV_SYSFLAGS 0xF000 /* reserved by system */ #define EV_FLAG1 0x2000 /* filter-specific flag */ /* returned values */ #define EV_EOF 0x8000 /* EOF detected */ #define EV_ERROR 0x4000 /* error, data contains errno */ /* * data/hint flags for EVFILT_{READ|WRITE}, shared with userspace */ #define NOTE_LOWAT 0x0001 /* low water mark */ /* * data/hint flags for EVFILT_VNODE, shared with userspace */ #define NOTE_DELETE 0x0001 /* vnode was removed */ #define NOTE_WRITE 0x0002 /* data contents changed */ #define NOTE_EXTEND 0x0004 /* size increased */ #define NOTE_ATTRIB 0x0008 /* attributes changed */ #define NOTE_LINK 0x0010 /* link count changed */ #define NOTE_RENAME 0x0020 /* vnode was renamed */ #define NOTE_REVOKE 0x0040 /* vnode access was revoked */ /* * data/hint flags for EVFILT_PROC, shared with userspace */ #define NOTE_EXIT 0x80000000 /* process exited */ #define NOTE_FORK 0x40000000 /* process forked */ #define NOTE_EXEC 0x20000000 /* process exec'd */ #define NOTE_PCTRLMASK 0xf0000000 /* mask for hint bits */ #define NOTE_PDATAMASK 0x000fffff /* mask for pid */ /* additional flags for EVFILT_PROC */ #define NOTE_TRACK 0x00000001 /* follow across forks */ #define NOTE_TRACKERR 0x00000002 /* could not track child */ #define NOTE_CHILD 0x00000004 /* am a child process */ /* * data/hint flags for EVFILT_NETDEV, shared with userspace */ #define NOTE_LINKUP 0x0001 /* link is up */ #define NOTE_LINKDOWN 0x0002 /* link is down */ #define NOTE_LINKINV 0x0004 /* link state is invalid */ /* * This is currently visible to userland to work around broken * programs which pull in or . */ #include struct knote; SLIST_HEAD(klist, knote); #ifdef _KERNEL #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_KQUEUE); #endif #define KNOTE(list, hint) if ((list) != NULL) knote(list, hint) /* * Flag indicating hint is a signal. Used by EVFILT_SIGNAL, and also * shared by EVFILT_PROC (all knotes attached to p->p_klist) */ #define NOTE_SIGNAL 0x08000000 struct filterops { int f_isfd; /* true if ident == filedescriptor */ - int (*f_attach) __P((struct knote *kn)); - void (*f_detach) __P((struct knote *kn)); - int (*f_event) __P((struct knote *kn, long hint)); + int (*f_attach) (struct knote *kn); + void (*f_detach) (struct knote *kn); + int (*f_event) (struct knote *kn, long hint); }; struct knote { SLIST_ENTRY(knote) kn_link; /* for fd */ SLIST_ENTRY(knote) kn_selnext; /* for struct selinfo */ TAILQ_ENTRY(knote) kn_tqe; struct kqueue *kn_kq; /* which queue we are on */ struct kevent kn_kevent; int kn_status; int kn_sfflags; /* saved filter flags */ intptr_t kn_sdata; /* saved data field */ union { struct file *p_fp; /* file data pointer */ struct proc *p_proc; /* proc pointer */ } kn_ptr; struct filterops *kn_fop; caddr_t kn_hook; #define KN_ACTIVE 0x01 /* event has been triggered */ #define KN_QUEUED 0x02 /* event is on queue */ #define KN_DISABLED 0x04 /* event is disabled */ #define KN_DETACHED 0x08 /* knote is detached */ #define kn_id kn_kevent.ident #define kn_filter kn_kevent.filter #define kn_flags kn_kevent.flags #define kn_fflags kn_kevent.fflags #define kn_data kn_kevent.data #define kn_fp kn_ptr.p_fp }; struct thread; struct proc; extern void knote(struct klist *list, long hint); extern void knote_remove(struct thread *p, struct klist *list); extern void knote_fdclose(struct thread *p, int fd); extern int kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *p); extern int kqueue_add_filteropts(int filt, struct filterops *filtops); extern int kqueue_del_filteropts(int filt); #else /* !_KERNEL */ #include struct timespec; __BEGIN_DECLS -int kqueue __P((void)); -int kevent __P((int kq, const struct kevent *changelist, int nchanges, +int kqueue(void); +int kevent(int kq, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, - const struct timespec *timeout)); + const struct timespec *timeout); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_EVENT_H_ */ Index: head/sys/sys/eventhandler.h =================================================================== --- head/sys/sys/eventhandler.h (revision 92718) +++ head/sys/sys/eventhandler.h (revision 92719) @@ -1,186 +1,186 @@ /*- * Copyright (c) 1999 Michael Smith * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef SYS_EVENTHANDLER_H #define SYS_EVENTHANDLER_H /* * XXX - compatability until lockmgr() goes away or all the #includes are * updated. */ #include #include #include #include struct eventhandler_entry { TAILQ_ENTRY(eventhandler_entry) ee_link; int ee_priority; void *ee_arg; }; struct eventhandler_list { char *el_name; int el_flags; #define EHE_INITTED (1<<0) struct lock el_lock; TAILQ_ENTRY(eventhandler_list) el_link; TAILQ_HEAD(,eventhandler_entry) el_entries; }; typedef struct eventhandler_entry *eventhandler_tag; /* * Fast handler lists require the eventhandler list be present * at link time. They don't allow addition of entries to * unknown eventhandler lists, ie. each list must have an * "owner". * * Fast handler lists must be defined once by the owner * of the eventhandler list, and the declaration must be in * scope at any point the list is manipulated. */ #define EVENTHANDLER_FAST_DECLARE(name, type) \ extern struct eventhandler_list Xeventhandler_list_ ## name ; \ struct eventhandler_entry_ ## name \ { \ struct eventhandler_entry ee; \ type eh_func; \ }; \ struct __hack #define EVENTHANDLER_FAST_DEFINE(name, type) \ struct eventhandler_list Xeventhandler_list_ ## name = { #name }; \ struct __hack #define EVENTHANDLER_FAST_INVOKE(name, args...) \ do { \ struct eventhandler_list *_el = &Xeventhandler_list_ ## name ; \ struct eventhandler_entry *_ep, *_en; \ \ if (_el->el_flags & EHE_INITTED) { \ lockmgr(&_el->el_lock, LK_EXCLUSIVE, NULL, curthread); \ _ep = TAILQ_FIRST(&(_el->el_entries)); \ while (_ep != NULL) { \ _en = TAILQ_NEXT(_ep, ee_link); \ ((struct eventhandler_entry_ ## name *)_ep)->eh_func(_ep->ee_arg , \ ## args); \ _ep = _en; \ } \ lockmgr(&_el->el_lock, LK_RELEASE, NULL, curthread); \ } \ } while (0) #define EVENTHANDLER_FAST_REGISTER(name, func, arg, priority) \ eventhandler_register(&Xeventhandler_list_ ## name, #name, func, arg, priority) #define EVENTHANDLER_FAST_DEREGISTER(name, tag) \ eventhandler_deregister(&Xeventhandler_list_ ## name, tag) /* * Slow handlers are entirely dynamic; lists are created * when entries are added to them, and thus have no concept of "owner", * * Slow handlers need to be declared, but do not need to be defined. The * declaration must be in scope wherever the handler is to be invoked. */ #define EVENTHANDLER_DECLARE(name, type) \ struct eventhandler_entry_ ## name \ { \ struct eventhandler_entry ee; \ type eh_func; \ }; \ struct __hack #define EVENTHANDLER_INVOKE(name, args...) \ do { \ struct eventhandler_list *_el; \ struct eventhandler_entry *_ep, *_en; \ \ if (((_el = eventhandler_find_list(#name)) != NULL) && \ (_el->el_flags & EHE_INITTED)) { \ lockmgr(&_el->el_lock, LK_EXCLUSIVE, NULL, curthread); \ _ep = TAILQ_FIRST(&(_el->el_entries)); \ while (_ep != NULL) { \ _en = TAILQ_NEXT(_ep, ee_link); \ ((struct eventhandler_entry_ ## name *)_ep)->eh_func(_ep->ee_arg , \ ## args); \ _ep = _en; \ } \ lockmgr(&_el->el_lock, LK_RELEASE, NULL, curthread); \ } \ } while (0) #define EVENTHANDLER_REGISTER(name, func, arg, priority) \ eventhandler_register(NULL, #name, func, arg, priority) #define EVENTHANDLER_DEREGISTER(name, tag) \ do { \ struct eventhandler_list *_el; \ \ if ((_el = eventhandler_find_list(#name)) != NULL) \ eventhandler_deregister(_el, tag); \ } while(0) extern eventhandler_tag eventhandler_register(struct eventhandler_list *list, char *name, void *func, void *arg, int priority); extern void eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag); extern struct eventhandler_list *eventhandler_find_list(char *name); /* * Standard system event queues. */ /* Shutdown events */ -typedef void (*shutdown_fn) __P((void *, int)); +typedef void (*shutdown_fn)(void *, int); #define SHUTDOWN_PRI_FIRST 0 #define SHUTDOWN_PRI_DEFAULT 10000 #define SHUTDOWN_PRI_LAST 20000 EVENTHANDLER_DECLARE(shutdown_pre_sync, shutdown_fn); /* before fs sync */ EVENTHANDLER_DECLARE(shutdown_post_sync, shutdown_fn); /* after fs sync */ EVENTHANDLER_DECLARE(shutdown_final, shutdown_fn); /* Idle process event */ -typedef void (*idle_eventhandler_t) __P((void *, int)); +typedef void (*idle_eventhandler_t)(void *, int); #define IDLE_PRI_FIRST 10000 #define IDLE_PRI_LAST 20000 EVENTHANDLER_FAST_DECLARE(idle_event, idle_eventhandler_t); #endif /* SYS_EVENTHANDLER_H */ Index: head/sys/sys/exec.h =================================================================== --- head/sys/sys/exec.h (revision 92718) +++ head/sys/sys/exec.h (revision 92719) @@ -1,123 +1,123 @@ /*- * Copyright (c) 1992, 1993 * 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. * * @(#)exec.h 8.3 (Berkeley) 1/21/94 * $FreeBSD$ */ #ifndef _SYS_EXEC_H_ #define _SYS_EXEC_H_ /* * The following structure is found at the top of the user stack of each * user process. The ps program uses it to locate argv and environment * strings. Programs that wish ps to display other information may modify * it; normally ps_argvstr points to the argv vector, and ps_nargvstr * is the same as the program's argc. The fields ps_envstr and ps_nenvstr * are the equivalent for the environment. */ struct ps_strings { char **ps_argvstr; /* first of 0 or more argument strings */ int ps_nargvstr; /* the number of argument strings */ char **ps_envstr; /* first of 0 or more environment strings */ int ps_nenvstr; /* the number of environment strings */ }; /* * Address of ps_strings structure (in user space). */ #define PS_STRINGS (USRSTACK - sizeof(struct ps_strings)) #define SPARE_USRSPACE 256 struct image_params; struct execsw { - int (*ex_imgact) __P((struct image_params *)); + int (*ex_imgact)(struct image_params *); const char *ex_name; }; #include #ifdef _KERNEL #include -int exec_map_first_page __P((struct image_params *)); -void exec_unmap_first_page __P((struct image_params *)); +int exec_map_first_page(struct image_params *); +void exec_unmap_first_page(struct image_params *); -int exec_register __P((const struct execsw *)); -int exec_unregister __P((const struct execsw *)); +int exec_register(const struct execsw *); +int exec_unregister(const struct execsw *); /* * note: name##_mod cannot be const storage because the * linker_file_sysinit() function modifies _file in the * moduledata_t. */ #include #define EXEC_SET(name, execsw_arg) \ static int name ## _modevent(module_t mod, int type, void *data) \ { \ struct execsw *exec = (struct execsw *)data; \ int error = 0; \ switch (type) { \ case MOD_LOAD: \ /* printf(#name " module loaded\n"); */ \ error = exec_register(exec); \ if (error) \ printf(#name "register failed\n"); \ break; \ case MOD_UNLOAD: \ /* printf(#name " module unloaded\n"); */ \ error = exec_unregister(exec); \ if (error) \ printf(#name " unregister failed\n"); \ break; \ default: \ break; \ } \ return error; \ } \ static moduledata_t name ## _mod = { \ #name, \ name ## _modevent, \ (void *)& execsw_arg \ }; \ DECLARE_MODULE(name, name ## _mod, SI_SUB_EXEC, SI_ORDER_ANY) #endif #endif Index: head/sys/sys/fcntl.h =================================================================== --- head/sys/sys/fcntl.h (revision 92718) +++ head/sys/sys/fcntl.h (revision 92719) @@ -1,212 +1,212 @@ /*- * Copyright (c) 1983, 1990, 1993 * 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. * * @(#)fcntl.h 8.3 (Berkeley) 1/21/94 * $FreeBSD$ */ #ifndef _SYS_FCNTL_H_ #define _SYS_FCNTL_H_ /* * This file includes the definitions for open and fcntl * described by POSIX for ; it also includes * related kernel definitions. */ #ifndef _KERNEL #include #endif /* * File status flags: these are used by open(2), fcntl(2). * They are also used (indirectly) in the kernel file structure f_flags, * which is a superset of the open/fcntl flags. Open flags and f_flags * are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags). * Open/fcntl flags begin with O_; kernel-internal flags begin with F. */ /* open-only flags */ #define O_RDONLY 0x0000 /* open for reading only */ #define O_WRONLY 0x0001 /* open for writing only */ #define O_RDWR 0x0002 /* open for reading and writing */ #define O_ACCMODE 0x0003 /* mask for above modes */ /* * Kernel encoding of open mode; separate read and write bits that are * independently testable: 1 greater than the above. * * XXX * FREAD and FWRITE are excluded from the #ifdef _KERNEL so that TIOCFLUSH, * which was documented to use FREAD/FWRITE, continues to work. */ #ifndef _POSIX_SOURCE #define FREAD 0x0001 #define FWRITE 0x0002 #endif #define O_NONBLOCK 0x0004 /* no delay */ #define O_APPEND 0x0008 /* set append mode */ #ifndef _POSIX_SOURCE #define O_SHLOCK 0x0010 /* open with shared file lock */ #define O_EXLOCK 0x0020 /* open with exclusive file lock */ #define O_ASYNC 0x0040 /* signal pgrp when data ready */ #define O_FSYNC 0x0080 /* synchronous writes */ #define O_NOFOLLOW 0x0100 /* don't follow symlinks */ #endif #define O_CREAT 0x0200 /* create if nonexistent */ #define O_TRUNC 0x0400 /* truncate to zero length */ #define O_EXCL 0x0800 /* error if already exists */ #ifdef _KERNEL /* FMARK/FDEFER kept in f_gcflags */ #define FMARK 0x1 /* mark during gc() */ #define FDEFER 0x2 /* defer for next gc pass */ #define FHASLOCK 0x4000 /* descriptor holds advisory lock */ #endif /* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */ #define O_NOCTTY 0x8000 /* don't assign controlling terminal */ /* Attempt to bypass buffer cache */ #define O_DIRECT 0x00010000 #ifdef _KERNEL /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ #define FFLAGS(oflags) ((oflags) + 1) #define OFLAGS(fflags) ((fflags) - 1) /* bits to save after open */ #define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT) /* bits settable by fcntl(F_SETFL, ...) */ #define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|O_DIRECT) #endif /* * The O_* flags used to have only F* names, which were used in the kernel * and by fcntl. We retain the F* names for the kernel f_flag field * and for backward compatibility for fcntl. */ #ifndef _POSIX_SOURCE #define FAPPEND O_APPEND /* kernel/compat */ #define FASYNC O_ASYNC /* kernel/compat */ #define FFSYNC O_FSYNC /* kernel */ #define FNONBLOCK O_NONBLOCK /* kernel */ #define FNDELAY O_NONBLOCK /* compat */ #define O_NDELAY O_NONBLOCK /* compat */ #endif /* * We are out of bits in f_flag (which is a short). However, * the flag bits not set in FMASK are only meaningful in the * initial open syscall. Those bits can thus be given a * different meaning for fcntl(2). */ #ifndef _POSIX_SOURCE /* * Set by shm_open(3) to get automatic MAP_ASYNC behavior * for POSIX shared memory objects (which are otherwise * implemented as plain files). */ #define FPOSIXSHM O_NOFOLLOW #endif /* * Constants used for fcntl(2) */ /* command values */ #define F_DUPFD 0 /* duplicate file descriptor */ #define F_GETFD 1 /* get file descriptor flags */ #define F_SETFD 2 /* set file descriptor flags */ #define F_GETFL 3 /* get file status flags */ #define F_SETFL 4 /* set file status flags */ #ifndef _POSIX_SOURCE #define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */ #define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ #endif #define F_GETLK 7 /* get record locking information */ #define F_SETLK 8 /* set record locking information */ #define F_SETLKW 9 /* F_SETLK; wait if blocked */ /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ /* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */ #define F_RDLCK 1 /* shared or read lock */ #define F_UNLCK 2 /* unlock */ #define F_WRLCK 3 /* exclusive or write lock */ #ifdef _KERNEL #define F_WAIT 0x010 /* Wait until lock is granted */ #define F_FLOCK 0x020 /* Use flock(2) semantics for lock */ #define F_POSIX 0x040 /* Use POSIX semantics for lock */ #endif /* * Advisory file segment locking data type - * information passed to system by user */ struct flock { off_t l_start; /* starting offset */ off_t l_len; /* len = 0 means until end of file */ pid_t l_pid; /* lock owner */ short l_type; /* lock type: read/write, etc. */ short l_whence; /* type of l_start */ }; #ifndef _POSIX_SOURCE /* lock operations for flock(2) */ #define LOCK_SH 0x01 /* shared file lock */ #define LOCK_EX 0x02 /* exclusive file lock */ #define LOCK_NB 0x04 /* don't block when locking */ #define LOCK_UN 0x08 /* unlock file */ #endif #ifndef _KERNEL #include __BEGIN_DECLS -int open __P((const char *, int, ...)); -int creat __P((const char *, mode_t)); -int fcntl __P((int, int, ...)); +int open(const char *, int, ...); +int creat(const char *, mode_t); +int fcntl(int, int, ...); #ifndef _POSIX_SOURCE -int flock __P((int, int)); +int flock(int, int); #endif /* !_POSIX_SOURCE */ __END_DECLS #endif #endif /* !_SYS_FCNTL_H_ */ Index: head/sys/sys/file.h =================================================================== --- head/sys/sys/file.h (revision 92718) +++ head/sys/sys/file.h (revision 92719) @@ -1,244 +1,244 @@ /* * Copyright (c) 1982, 1986, 1989, 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. * * @(#)file.h 8.3 (Berkeley) 1/9/95 * $FreeBSD$ */ #ifndef _SYS_FILE_H_ #define _SYS_FILE_H_ #ifndef _KERNEL #include #include #endif #ifdef _KERNEL #include #include #include #include #include struct stat; struct thread; struct uio; struct knote; struct vnode; struct socket; /* * Kernel descriptor table. * One entry for each open kernel vnode and socket. * * Below is the list of locks that protects members in struct file. * * (fl) filelist_lock * (f) f_mtx in struct file * none not locked */ struct file { LIST_ENTRY(file) f_list;/* (fl) list of active files */ short f_gcflag; /* used by thread doing fd garbage collection */ #define DTYPE_VNODE 1 /* file */ #define DTYPE_SOCKET 2 /* communications endpoint */ #define DTYPE_PIPE 3 /* pipe */ #define DTYPE_FIFO 4 /* fifo (named pipe) */ #define DTYPE_KQUEUE 5 /* event queue */ short f_type; /* descriptor type */ int f_count; /* (f) reference count */ int f_msgcount; /* (f) references from message queue */ struct ucred *f_cred; /* credentials associated with descriptor */ struct fileops { - int (*fo_read) __P((struct file *fp, struct uio *uio, + int (*fo_read) (struct file *fp, struct uio *uio, struct ucred *cred, int flags, - struct thread *td)); - int (*fo_write) __P((struct file *fp, struct uio *uio, + struct thread *td); + int (*fo_write) (struct file *fp, struct uio *uio, struct ucred *cred, int flags, - struct thread *td)); + struct thread *td); #define FOF_OFFSET 1 - int (*fo_ioctl) __P((struct file *fp, u_long com, - caddr_t data, struct thread *td)); - int (*fo_poll) __P((struct file *fp, int events, - struct ucred *cred, struct thread *td)); - int (*fo_kqfilter) __P((struct file *fp, - struct knote *kn)); - int (*fo_stat) __P((struct file *fp, struct stat *sb, - struct thread *td)); - int (*fo_close) __P((struct file *fp, struct thread *td)); + int (*fo_ioctl) (struct file *fp, u_long com, + caddr_t data, struct thread *td); + int (*fo_poll) (struct file *fp, int events, + struct ucred *cred, + struct thread *td); + int (*fo_kqfilter) (struct file *fp, struct knote *kn); + int (*fo_stat) (struct file *fp, struct stat *sb, + struct thread *td); + int (*fo_close) (struct file *fp, struct thread *td); } *f_ops; int f_seqcount; /* * count of sequential accesses -- cleared * by most seek operations. */ off_t f_nextoff; /* * offset of next expected read or write */ off_t f_offset; caddr_t f_data; /* vnode or socket */ u_int f_flag; /* see fcntl.h */ struct mtx *f_mtxp; /* mutex to protect data */ }; #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_FILE); #endif LIST_HEAD(filelist, file); extern struct filelist filehead; /* (fl) head of list of open files */ extern struct fileops vnops; extern struct fileops badfileops; extern int maxfiles; /* kernel limit on number of open files */ extern int maxfilesperproc; /* per process limit on number of open files */ extern int nfiles; /* (fl) actual number of open files */ extern struct sx filelist_lock; /* sx to protect filelist and nfiles */ -int fget __P((struct thread *td, int fd, struct file **fpp)); -int fget_read __P((struct thread *td, int fd, struct file **fpp)); -int fget_write __P((struct thread *td, int fd, struct file **fpp)); -int fdrop __P((struct file *fp, struct thread *td)); -int fdrop_locked __P((struct file *fp, struct thread *td)); +int fget(struct thread *td, int fd, struct file **fpp); +int fget_read(struct thread *td, int fd, struct file **fpp); +int fget_write(struct thread *td, int fd, struct file **fpp); +int fdrop(struct file *fp, struct thread *td); +int fdrop_locked(struct file *fp, struct thread *td); /* Lock a file. */ #define FILE_LOCK(f) mtx_lock((f)->f_mtxp) #define FILE_UNLOCK(f) mtx_unlock((f)->f_mtxp) #define FILE_LOCKED(f) mtx_owned((f)->f_mtxp) #define FILE_LOCK_ASSERT(f, type) mtx_assert((f)->f_mtxp, (type)) -int fgetvp __P((struct thread *td, int fd, struct vnode **vpp)); -int fgetvp_read __P((struct thread *td, int fd, struct vnode **vpp)); -int fgetvp_write __P((struct thread *td, int fd, struct vnode **vpp)); +int fgetvp(struct thread *td, int fd, struct vnode **vpp); +int fgetvp_read(struct thread *td, int fd, struct vnode **vpp); +int fgetvp_write(struct thread *td, int fd, struct vnode **vpp); -int fgetsock __P((struct thread *td, int fd, struct socket **spp, u_int *fflagp)); -void fputsock __P((struct socket *sp)); +int fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp); +void fputsock(struct socket *sp); #define fhold_locked(fp) \ do { \ FILE_LOCK_ASSERT(fp, MA_OWNED); \ (fp)->f_count++; \ } while (0) #define fhold(fp) \ do { \ FILE_LOCK(fp); \ fhold_locked(fp); \ FILE_UNLOCK(fp); \ } while (0) -static __inline int fo_read __P((struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td)); -static __inline int fo_write __P((struct file *fp, struct uio *uio, - struct ucred *cred, int flags, struct thread *td)); -static __inline int fo_ioctl __P((struct file *fp, u_long com, caddr_t data, - struct thread *td)); -static __inline int fo_poll __P((struct file *fp, int events, - struct ucred *cred, struct thread *td)); -static __inline int fo_stat __P((struct file *fp, struct stat *sb, - struct thread *td)); -static __inline int fo_close __P((struct file *fp, struct thread *td)); -static __inline int fo_kqfilter __P((struct file *fp, struct knote *kn)); +static __inline int fo_read(struct file *fp, struct uio *uio, + struct ucred *cred, int flags, struct thread *td); +static __inline int fo_write(struct file *fp, struct uio *uio, + struct ucred *cred, int flags, struct thread *td); +static __inline int fo_ioctl(struct file *fp, u_long com, caddr_t data, + struct thread *td); +static __inline int fo_poll(struct file *fp, int events, + struct ucred *cred, struct thread *td); +static __inline int fo_stat(struct file *fp, struct stat *sb, + struct thread *td); +static __inline int fo_close(struct file *fp, struct thread *td); +static __inline int fo_kqfilter(struct file *fp, struct knote *kn); struct proc; static __inline int fo_read(fp, uio, cred, flags, td) struct file *fp; struct uio *uio; struct ucred *cred; struct thread *td; int flags; { return ((*fp->f_ops->fo_read)(fp, uio, cred, flags, td)); } static __inline int fo_write(fp, uio, cred, flags, td) struct file *fp; struct uio *uio; struct ucred *cred; struct thread *td; int flags; { return ((*fp->f_ops->fo_write)(fp, uio, cred, flags, td)); } static __inline int fo_ioctl(fp, com, data, td) struct file *fp; u_long com; caddr_t data; struct thread *td; { return ((*fp->f_ops->fo_ioctl)(fp, com, data, td)); } static __inline int fo_poll(fp, events, cred, td) struct file *fp; int events; struct ucred *cred; struct thread *td; { /* select(2) and poll(2) hold file descriptors. */ return ((*fp->f_ops->fo_poll)(fp, events, cred, td)); } static __inline int fo_stat(fp, sb, td) struct file *fp; struct stat *sb; struct thread *td; { return ((*fp->f_ops->fo_stat)(fp, sb, td)); } static __inline int fo_close(fp, td) struct file *fp; struct thread *td; { return ((*fp->f_ops->fo_close)(fp, td)); } static __inline int fo_kqfilter(fp, kn) struct file *fp; struct knote *kn; { return ((*fp->f_ops->fo_kqfilter)(fp, kn)); } #endif /* _KERNEL */ #endif /* !SYS_FILE_H */ Index: head/sys/sys/filedesc.h =================================================================== --- head/sys/sys/filedesc.h (revision 92718) +++ head/sys/sys/filedesc.h (revision 92719) @@ -1,173 +1,173 @@ /* * Copyright (c) 1990, 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. * * @(#)filedesc.h 8.1 (Berkeley) 6/2/93 * $FreeBSD$ */ #ifndef _SYS_FILEDESC_H_ #define _SYS_FILEDESC_H_ #include #include #include /* * This structure is used for the management of descriptors. It may be * shared by multiple processes. * * A process is initially started out with NDFILE descriptors stored within * this structure, selected to be enough for typical applications based on * the historical limit of 20 open files (and the usage of descriptors by * shells). If these descriptors are exhausted, a larger descriptor table * may be allocated, up to a process' resource limit; the internal arrays * are then unused. The initial expansion is set to NDEXTENT; each time * it runs out, it is doubled until the resource limit is reached. NDEXTENT * should be selected to be the biggest multiple of OFILESIZE (see below) * that will fit in a power-of-two sized piece of memory. */ #define NDFILE 20 #define NDEXTENT 50 /* 250 bytes in 256-byte alloc. */ struct filedesc { struct file **fd_ofiles; /* file structures for open files */ char *fd_ofileflags; /* per-process open file flags */ struct vnode *fd_cdir; /* current directory */ struct vnode *fd_rdir; /* root directory */ struct vnode *fd_jdir; /* jail root directory */ int fd_nfiles; /* number of open files allocated */ int fd_lastfile; /* high-water mark of fd_ofiles */ int fd_freefile; /* approx. next free file */ u_short fd_cmask; /* mask for file creation */ u_short fd_refcnt; /* reference count */ int fd_knlistsize; /* size of knlist */ struct klist *fd_knlist; /* list of attached knotes */ u_long fd_knhashmask; /* size of knhash */ struct klist *fd_knhash; /* hash table for attached knotes */ struct mtx fd_mtx; /* mtx to protect the members of struct filedesc */ }; /* * Basic allocation of descriptors: * one of the above, plus arrays for NDFILE descriptors. */ struct filedesc0 { struct filedesc fd_fd; /* * These arrays are used when the number of open files is * <= NDFILE, and are then pointed to by the pointers above. */ struct file *fd_dfiles[NDFILE]; char fd_dfileflags[NDFILE]; }; /* * Per-process open flags. */ #define UF_EXCLOSE 0x01 /* auto-close on exec */ #if 0 #define UF_MAPPED 0x02 /* mapped from device */ #endif /* * Storage required per open file descriptor. */ #define OFILESIZE (sizeof(struct file *) + sizeof(char)) /* * This structure holds the information needed to send a SIGIO or * a SIGURG signal to a process or process group when new data arrives * on a device or socket. The structure is placed on an SLIST belonging * to the proc or pgrp so that the entire list may be revoked when the * process exits or the process group disappears. * * (c) const * (pg) locked by either the process or process group lock */ struct sigio { union { struct proc *siu_proc; /* (c) process to receive SIGIO/SIGURG */ struct pgrp *siu_pgrp; /* (c) process group to receive ... */ } sio_u; SLIST_ENTRY(sigio) sio_pgsigio; /* (pg) sigio's for process or group */ struct sigio **sio_myref; /* (c) location of the pointer that holds * the reference to this structure */ struct ucred *sio_ucred; /* (c) current credentials */ pid_t sio_pgid; /* (c) pgid for signals */ }; #define sio_proc sio_u.siu_proc #define sio_pgrp sio_u.siu_pgrp SLIST_HEAD(sigiolst, sigio); #ifdef _KERNEL /* Lock a file descriptor table. */ #define FILEDESC_LOCK(fd) mtx_lock(&(fd)->fd_mtx) #define FILEDESC_UNLOCK(fd) mtx_unlock(&(fd)->fd_mtx) #define FILEDESC_LOCKED(fd) mtx_owned(&(fd)->fd_mtx) #define FILEDESC_LOCK_ASSERT(fd, type) mtx_assert(&(fd)->fd_mtx, (type)) -int closef __P((struct file *fp, struct thread *p)); -int dupfdopen __P((struct thread *td, struct filedesc *fdp, int indx, int dfd, int mode, - int error)); -int falloc __P((struct thread *p, struct file **resultfp, int *resultfd)); -int fdalloc __P((struct thread *p, int want, int *result)); -int fdavail __P((struct thread *td, int n)); -void fdcloseexec __P((struct thread *td)); -struct filedesc *fdcopy __P((struct thread *td)); -void fdfree __P((struct thread *td)); -struct filedesc *fdinit __P((struct thread *td)); -struct filedesc *fdshare __P((struct proc *p)); -void ffree __P((struct file *fp)); -static __inline struct file * fget_locked __P((struct filedesc *fdp, int fd)); -pid_t fgetown __P((struct sigio *sigio)); -int fsetown __P((pid_t pgid, struct sigio **sigiop)); -void funsetown __P((struct sigio *sigio)); -void funsetownlst __P((struct sigiolst *sigiolst)); -int getvnode __P((struct filedesc *fdp, int fd, struct file **fpp)); -void setugidsafety __P((struct thread *td)); +int closef(struct file *fp, struct thread *p); +int dupfdopen(struct thread *td, struct filedesc *fdp, int indx, + int dfd, int mode, int error); +int falloc(struct thread *p, struct file **resultfp, int *resultfd); +int fdalloc(struct thread *p, int want, int *result); +int fdavail(struct thread *td, int n); +void fdcloseexec(struct thread *td); +struct filedesc *fdcopy(struct thread *td); +void fdfree(struct thread *td); +struct filedesc *fdinit(struct thread *td); +struct filedesc *fdshare(struct proc *p); +void ffree(struct file *fp); +static __inline struct file * fget_locked(struct filedesc *fdp, int fd); +pid_t fgetown(struct sigio *sigio); +int fsetown(pid_t pgid, struct sigio **sigiop); +void funsetown(struct sigio *sigio); +void funsetownlst(struct sigiolst *sigiolst); +int getvnode(struct filedesc *fdp, int fd, struct file **fpp); +void setugidsafety(struct thread *td); static __inline struct file * fget_locked(fdp, fd) struct filedesc *fdp; int fd; { /* u_int cast checks for negative descriptors. */ return ((u_int)fd >= fdp->fd_nfiles ? NULL : fdp->fd_ofiles[fd]); } #endif /* _KERNEL */ #endif /* !_SYS_FILEDESC_H_ */ Index: head/sys/sys/imgact.h =================================================================== --- head/sys/sys/imgact.h (revision 92718) +++ head/sys/sys/imgact.h (revision 92719) @@ -1,71 +1,71 @@ /*- * Copyright (c) 1993, David Greenman * 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_IMGACT_H_ #define _SYS_IMGACT_H_ #define MAXSHELLCMDLEN 128 struct image_params { struct proc *proc; /* our process struct */ struct execve_args *uap; /* syscall arguments */ struct vnode *vp; /* pointer to vnode of file to exec */ struct vattr *attr; /* attributes of file */ const char *image_header; /* head of file to exec */ char *stringbase; /* base address of tmp string storage */ char *stringp; /* current 'end' pointer of tmp strings */ char *endargs; /* end of argv vector */ int stringspace; /* space left in tmp string storage area */ int argc, envc; /* count of argument and environment strings */ char *argv0; /* Replacement for argv[0] when interpreting */ unsigned long entry_addr; /* entry address of target executable */ char vmspace_destroyed; /* flag - we've blown away original vm space */ char interpreted; /* flag - this executable is interpreted */ char interpreter_name[MAXSHELLCMDLEN]; /* name of the interpreter */ void *auxargs; /* ELF Auxinfo structure pointer */ struct vm_page *firstpage; /* first page that we mapped */ char *fname; /* pointer to filename of executable (user space) */ unsigned long ps_strings; /* PS_STRINGS for BSD/OS binaries */ size_t auxarg_size; }; #ifdef _KERNEL -int exec_check_permissions __P((struct image_params *)); -int exec_extract_strings __P((struct image_params *)); -int exec_new_vmspace __P((struct image_params *)); -int exec_shell_imgact __P((struct image_params *)); +int exec_check_permissions(struct image_params *); +int exec_extract_strings(struct image_params *); +int exec_new_vmspace(struct image_params *); +int exec_shell_imgact(struct image_params *); #endif #endif /* !_SYS_IMGACT_H_ */ Index: head/sys/sys/imgact_aout.h =================================================================== --- head/sys/sys/imgact_aout.h (revision 92718) +++ head/sys/sys/imgact_aout.h (revision 92719) @@ -1,156 +1,156 @@ /*- * Copyright (c) 1992, 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. * * from: @(#)exec.h 8.1 (Berkeley) 6/11/93 * $FreeBSD$ */ #ifndef _IMGACT_AOUT_H_ #define _IMGACT_AOUT_H_ #define N_GETMAGIC(ex) \ ( (ex).a_midmag & 0xffff ) #define N_GETMID(ex) \ ( (N_GETMAGIC_NET(ex) == ZMAGIC) ? N_GETMID_NET(ex) : \ ((ex).a_midmag >> 16) & 0x03ff ) #define N_GETFLAG(ex) \ ( (N_GETMAGIC_NET(ex) == ZMAGIC) ? N_GETFLAG_NET(ex) : \ ((ex).a_midmag >> 26) & 0x3f ) #define N_SETMAGIC(ex,mag,mid,flag) \ ( (ex).a_midmag = (((flag) & 0x3f) <<26) | (((mid) & 0x03ff) << 16) | \ ((mag) & 0xffff) ) #define N_GETMAGIC_NET(ex) \ (ntohl((ex).a_midmag) & 0xffff) #define N_GETMID_NET(ex) \ ((ntohl((ex).a_midmag) >> 16) & 0x03ff) #define N_GETFLAG_NET(ex) \ ((ntohl((ex).a_midmag) >> 26) & 0x3f) #define N_SETMAGIC_NET(ex,mag,mid,flag) \ ( (ex).a_midmag = htonl( (((flag)&0x3f)<<26) | (((mid)&0x03ff)<<16) \ | (((mag)&0xffff)) ) ) #define N_ALIGN(ex,x) \ (N_GETMAGIC(ex) == ZMAGIC || N_GETMAGIC(ex) == QMAGIC || \ N_GETMAGIC_NET(ex) == ZMAGIC || N_GETMAGIC_NET(ex) == QMAGIC ? \ ((x) + __LDPGSZ - 1) & ~(unsigned long)(__LDPGSZ - 1) : (x)) /* Valid magic number check. */ #define N_BADMAG(ex) \ (N_GETMAGIC(ex) != OMAGIC && N_GETMAGIC(ex) != NMAGIC && \ N_GETMAGIC(ex) != ZMAGIC && N_GETMAGIC(ex) != QMAGIC && \ N_GETMAGIC_NET(ex) != OMAGIC && N_GETMAGIC_NET(ex) != NMAGIC && \ N_GETMAGIC_NET(ex) != ZMAGIC && N_GETMAGIC_NET(ex) != QMAGIC) /* Address of the bottom of the text segment. */ /* * This can not be done right. Abuse a_entry in some cases to handle kernels. */ #define N_TXTADDR(ex) \ ((N_GETMAGIC(ex) == OMAGIC || N_GETMAGIC(ex) == NMAGIC || \ N_GETMAGIC(ex) == ZMAGIC) ? \ ((ex).a_entry < (ex).a_text ? 0 : (ex).a_entry & ~__LDPGSZ) : __LDPGSZ) /* Address of the bottom of the data segment. */ #define N_DATADDR(ex) \ N_ALIGN(ex, N_TXTADDR(ex) + (ex).a_text) /* Text segment offset. */ #define N_TXTOFF(ex) \ (N_GETMAGIC(ex) == ZMAGIC ? __LDPGSZ : (N_GETMAGIC(ex) == QMAGIC || \ N_GETMAGIC_NET(ex) == ZMAGIC) ? 0 : sizeof(struct exec)) /* Data segment offset. */ #define N_DATOFF(ex) \ N_ALIGN(ex, N_TXTOFF(ex) + (ex).a_text) /* Relocation table offset. */ #define N_RELOFF(ex) \ N_ALIGN(ex, N_DATOFF(ex) + (ex).a_data) /* Symbol table offset. */ #define N_SYMOFF(ex) \ (N_RELOFF(ex) + (ex).a_trsize + (ex).a_drsize) /* String table offset. */ #define N_STROFF(ex) (N_SYMOFF(ex) + (ex).a_syms) /* * Header prepended to each a.out file. * only manipulate the a_midmag field via the * N_SETMAGIC/N_GET{MAGIC,MID,FLAG} macros in a.out.h */ struct exec { unsigned long a_midmag; /* flags<<26 | mid<<16 | magic */ unsigned long a_text; /* text segment size */ unsigned long a_data; /* initialized data size */ unsigned long a_bss; /* uninitialized data size */ unsigned long a_syms; /* symbol table size */ unsigned long a_entry; /* entry point */ unsigned long a_trsize; /* text relocation size */ unsigned long a_drsize; /* data relocation size */ }; #define a_magic a_midmag /* XXX Hack to work with current kern_execve.c */ /* a_magic */ #define OMAGIC 0407 /* old impure format */ #define NMAGIC 0410 /* read-only text */ #define ZMAGIC 0413 /* demand load format */ #define QMAGIC 0314 /* "compact" demand load format */ /* a_mid */ #define MID_ZERO 0 /* unknown - implementation dependent */ #define MID_SUN010 1 /* sun 68010/68020 binary */ #define MID_SUN020 2 /* sun 68020-only binary */ #define MID_I386 134 /* i386 BSD binary */ #define MID_SPARC 138 /* sparc */ #define MID_HP200 200 /* hp200 (68010) BSD binary */ #define MID_HP300 300 /* hp300 (68020+68881) BSD binary */ #define MID_HPUX 0x20C /* hp200/300 HP-UX binary */ #define MID_HPUX800 0x20B /* hp800 HP-UX binary */ /* * a_flags */ #define EX_PIC 0x10 /* contains position independent code */ #define EX_DYNAMIC 0x20 /* contains run-time link-edit info */ #define EX_DPMASK 0x30 /* mask for the above */ #ifdef _KERNEL struct thread; -int aout_coredump __P((struct thread *td, struct vnode *vp, off_t limit)); +int aout_coredump(struct thread *td, struct vnode *vp, off_t limit); #endif #endif /* !_IMGACT_AOUT_H_ */ Index: head/sys/sys/imgact_elf.h =================================================================== --- head/sys/sys/imgact_elf.h (revision 92718) +++ head/sys/sys/imgact_elf.h (revision 92719) @@ -1,112 +1,112 @@ /*- * Copyright (c) 1995-1996 Søren Schmidt * 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 * in this position and unchanged. * 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. The name of the author may not be used to endorse or promote products * derived from this software withough specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_IMGACT_ELF_H_ #define _SYS_IMGACT_ELF_H_ #include #ifdef _KERNEL #define AUXARGS_ENTRY(pos, id, val) {suword(pos++, id); suword(pos++, val);} #if ELF_TARG_CLASS == ELFCLASS32 /* * Structure used to pass infomation from the loader to the * stack fixup routine. */ typedef struct { Elf32_Sword execfd; Elf32_Word phdr; Elf32_Word phent; Elf32_Word phnum; Elf32_Word pagesz; Elf32_Word base; Elf32_Word flags; Elf32_Word entry; Elf32_Word trace; } Elf32_Auxargs; typedef struct { int brand; const char *compat_3_brand; /* pre Binutils 2.10 method (FBSD 3) */ const char *emul_path; const char *interp_path; struct sysentvec *sysvec; } Elf32_Brandinfo; #define MAX_BRANDS 8 -int elf_brand_inuse __P((Elf32_Brandinfo *entry)); -int elf_insert_brand_entry __P((Elf32_Brandinfo *entry)); -int elf_remove_brand_entry __P((Elf32_Brandinfo *entry)); +int elf_brand_inuse(Elf32_Brandinfo *entry); +int elf_insert_brand_entry(Elf32_Brandinfo *entry); +int elf_remove_brand_entry(Elf32_Brandinfo *entry); #else /* !(ELF_TARG_CLASS == ELFCLASS32) */ /* * Structure used to pass infomation from the loader to the * stack fixup routine. */ typedef struct { Elf64_Sword execfd; Elf64_Addr phdr; Elf64_Word phent; Elf64_Word phnum; Elf64_Word pagesz; Elf64_Addr base; Elf64_Word flags; Elf64_Addr entry; Elf64_Word trace; } Elf64_Auxargs; typedef struct { int brand; const char *compat_3_brand; /* pre Binutils 2.10 method (FBSD 3) */ const char *emul_path; const char *interp_path; struct sysentvec *sysvec; } Elf64_Brandinfo; #define MAX_BRANDS 8 -int elf_brand_inuse __P((Elf64_Brandinfo *entry)); -int elf_insert_brand_entry __P((Elf64_Brandinfo *entry)); -int elf_remove_brand_entry __P((Elf64_Brandinfo *entry)); +int elf_brand_inuse(Elf64_Brandinfo *entry); +int elf_insert_brand_entry(Elf64_Brandinfo *entry); +int elf_remove_brand_entry(Elf64_Brandinfo *entry); #endif /* ELF_TARG_CLASS == ELFCLASS32 */ struct thread; -int elf_coredump __P((struct thread *, struct vnode *, off_t)); +int elf_coredump(struct thread *, struct vnode *, off_t); #endif /* _KERNEL */ #endif /* !_SYS_IMGACT_ELF_H_ */ Index: head/sys/sys/inflate.h =================================================================== --- head/sys/sys/inflate.h (revision 92718) +++ head/sys/sys/inflate.h (revision 92719) @@ -1,53 +1,53 @@ /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * * $FreeBSD$ * */ #ifndef _SYS_INFLATE_H_ #define _SYS_INFLATE_H_ #if defined(_KERNEL) || defined(KZIP) #define GZ_EOF -1 #define GZ_WSIZE 0x8000 /* * Global variables used by inflate and friends. * This structure is used in order to make inflate() reentrant. */ struct inflate { /* Public part */ /* This pointer is passed along to the two functions below */ void *gz_private; /* Fetch next character to be uncompressed */ - int (*gz_input) __P((void *)); + int (*gz_input)(void *); /* Dispose of uncompressed characters */ - int (*gz_output) __P((void *, u_char *, u_long)); + int (*gz_output)(void *, u_char *, u_long); /* Private part */ u_long gz_bb; /* bit buffer */ unsigned gz_bk; /* bits in bit buffer */ unsigned gz_hufts; /* track memory usage */ struct huft *gz_fixed_tl; /* must init to NULL !! */ struct huft *gz_fixed_td; int gz_fixed_bl; int gz_fixed_bd; u_char *gz_slide; unsigned gz_wp; }; -int inflate __P((struct inflate *)); +int inflate(struct inflate *); #endif /* _KERNEL || KZIP */ #endif /* ! _SYS_INFLATE_H_ */ Index: head/sys/sys/interrupt.h =================================================================== --- head/sys/sys/interrupt.h (revision 92718) +++ head/sys/sys/interrupt.h (revision 92719) @@ -1,127 +1,127 @@ /* * Copyright (c) 1997, Stefan Esser * 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 unmodified, 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_INTERRUPT_H_ #define _SYS_INTERRUPT_H_ #include #include /* * Describe a hardware interrupt handler. * * Multiple interrupt handlers for a specific vector can be chained * together. */ struct intrhand { driver_intr_t *ih_handler; /* Handler function. */ void *ih_argument; /* Argument to pass to handler. */ int ih_flags; const char *ih_name; /* Name of handler. */ struct ithd *ih_ithread; /* Ithread we are connected to. */ int ih_need; /* Needs service. */ TAILQ_ENTRY(intrhand) ih_next; /* Next handler for this vector. */ u_char ih_pri; /* Priority of this handler. */ }; /* Interrupt handle flags kept in ih_flags */ #define IH_FAST 0x00000001 /* Fast interrupt. */ #define IH_EXCLUSIVE 0x00000002 /* Exclusive interrupt. */ #define IH_ENTROPY 0x00000004 /* Device is a good entropy source. */ #define IH_DEAD 0x00000008 /* Handler should be removed. */ #define IH_MPSAFE 0x80000000 /* Handler does not need Giant. */ /* * Describe an interrupt thread. There is one of these per interrupt vector. * Note that this actually describes an interrupt source. There may or may * not be an actual kernel thread attached to a given source. */ struct ithd { struct mtx it_lock; struct thread *it_td; /* Interrupt process. */ LIST_ENTRY(ithd) it_list; /* All interrupt threads. */ TAILQ_HEAD(, intrhand) it_handlers; /* Interrupt handlers. */ struct ithd *it_interrupted; /* Who we interrupted. */ void (*it_disable)(int); /* Enable interrupt source. */ void (*it_enable)(int); /* Disable interrupt source. */ void *it_md; /* Hook for MD interrupt code. */ int it_flags; /* Interrupt-specific flags. */ int it_need; /* Needs service. */ int it_vector; char it_name[MAXCOMLEN + 1]; }; /* Interrupt thread flags kept in it_flags */ #define IT_SOFT 0x000001 /* Software interrupt. */ #define IT_ENTROPY 0x000002 /* Interrupt is an entropy source. */ #define IT_DEAD 0x000004 /* Thread is waiting to exit. */ /* Flags to pass to sched_swi. */ #define SWI_DELAY 0x2 /* * Software interrupt bit numbers in priority order. The priority only * determines which swi will be dispatched next; a higher priority swi * may be dispatched when a nested h/w interrupt handler returns. */ #define SWI_TTY 0 #define SWI_NET 1 #define SWI_CAMNET 2 #define SWI_CAMBIO 3 #define SWI_VM 4 #define SWI_TQ 5 #define SWI_CLOCK 6 extern struct ithd *tty_ithd; extern struct ithd *clk_ithd; extern void *net_ih; extern void *softclock_ih; extern void *vm_ih; /* Counts and names for statistics (defined in MD code). */ extern u_long eintrcnt[]; /* end of intrcnt[] */ extern char eintrnames[]; /* end of intrnames[] */ extern u_long intrcnt[]; /* counts for for each device and stray */ extern char intrnames[]; /* string table containing device names */ -int ithread_create __P((struct ithd **ithread, int vector, int flags, - void (*disable)(int), void (*enable)(int), const char *fmt, ...)) +int ithread_create(struct ithd **ithread, int vector, int flags, + void (*disable)(int), void (*enable)(int), const char *fmt, ...) __printflike(6, 7); -int ithread_destroy __P((struct ithd *ithread)); -u_char ithread_priority __P((enum intr_type flags)); -int ithread_add_handler __P((struct ithd *ithread, const char *name, +int ithread_destroy(struct ithd *ithread); +u_char ithread_priority(enum intr_type flags); +int ithread_add_handler(struct ithd *ithread, const char *name, driver_intr_t handler, void *arg, u_char pri, enum intr_type flags, - void **cookiep)); -int ithread_remove_handler __P((void *cookie)); -int ithread_schedule __P((struct ithd *ithread, int do_switch)); -int swi_add __P((struct ithd **ithdp, const char *name, + void **cookiep); +int ithread_remove_handler(void *cookie); +int ithread_schedule(struct ithd *ithread, int do_switch); +int swi_add(struct ithd **ithdp, const char *name, driver_intr_t handler, void *arg, int pri, enum intr_type flags, - void **cookiep)); -void swi_sched __P((void *cookie, int flags)); + void **cookiep); +void swi_sched(void *cookie, int flags); #endif Index: head/sys/sys/ioccom.h =================================================================== --- head/sys/sys/ioccom.h (revision 92718) +++ head/sys/sys/ioccom.h (revision 92719) @@ -1,75 +1,75 @@ /*- * Copyright (c) 1982, 1986, 1990, 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. * * @(#)ioccom.h 8.2 (Berkeley) 3/28/94 * $FreeBSD$ */ #ifndef _SYS_IOCCOM_H_ #define _SYS_IOCCOM_H_ /* * Ioctl's have the command encoded in the lower word, and the size of * any in or out parameters in the upper word. The high 3 bits of the * upper word are used to encode the in/out status of the parameter. */ #define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */ #define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) #define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16)) #define IOCGROUP(x) (((x) >> 8) & 0xff) #define IOCPARM_MAX PAGE_SIZE /* max size of ioctl, mult. of PAGE_SIZE */ #define IOC_VOID 0x20000000 /* no parameters */ #define IOC_OUT 0x40000000 /* copy out parameters */ #define IOC_IN 0x80000000 /* copy in parameters */ #define IOC_INOUT (IOC_IN|IOC_OUT) #define IOC_DIRMASK 0xe0000000 /* mask for IN/OUT/VOID */ #define _IOC(inout,group,num,len) \ ((unsigned long)(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))) #define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) #define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) /* this should be _IORW, but stdio got there first */ #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) #ifndef _KERNEL #include __BEGIN_DECLS -int ioctl __P((int, unsigned long, ...)); +int ioctl(int, unsigned long, ...); __END_DECLS #endif #endif /* !_SYS_IOCCOM_H_ */ Index: head/sys/sys/ipc.h =================================================================== --- head/sys/sys/ipc.h (revision 92718) +++ head/sys/sys/ipc.h (revision 92719) @@ -1,105 +1,105 @@ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1990, 1993 * 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. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer * Science Department. * * 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. * * @(#)ipc.h 8.4 (Berkeley) 2/19/95 * $FreeBSD$ */ /* * SVID compatible ipc.h file */ #ifndef _SYS_IPC_H_ #define _SYS_IPC_H_ struct ipc_perm { ushort cuid; /* creator user id */ ushort cgid; /* creator group id */ ushort uid; /* user id */ ushort gid; /* group id */ ushort mode; /* r/w permission */ ushort seq; /* sequence # (to generate unique msg/sem/shm id) */ key_t key; /* user specified msg/sem/shm key */ }; /* common mode bits */ #define IPC_R 000400 /* read permission */ #define IPC_W 000200 /* write/alter permission */ #define IPC_M 010000 /* permission to change control info */ /* SVID required constants (same values as system 5) */ #define IPC_CREAT 001000 /* create entry if key does not exist */ #define IPC_EXCL 002000 /* fail if key exists */ #define IPC_NOWAIT 004000 /* error if request must wait */ #define IPC_PRIVATE (key_t)0 /* private key */ #define IPC_RMID 0 /* remove identifier */ #define IPC_SET 1 /* set options */ #define IPC_STAT 2 /* get options */ #define IPC_INFO 3 /* get info */ #ifdef _KERNEL /* Macros to convert between ipc ids and array indices or sequence ids */ #define IPCID_TO_IX(id) ((id) & 0xffff) #define IPCID_TO_SEQ(id) (((id) >> 16) & 0xffff) #define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff)) struct thread; struct proc; -int ipcperm __P((struct thread *, struct ipc_perm *, int)); +int ipcperm(struct thread *, struct ipc_perm *, int); extern void (*shmfork_hook)(struct proc *, struct proc *); extern void (*shmexit_hook)(struct proc *); #else /* ! _KERNEL */ /* XXX doesn't really belong here, but has been historical practice in SysV. */ #include __BEGIN_DECLS -key_t ftok __P((const char *, int)); +key_t ftok(const char *, int); __END_DECLS #endif /* _KERNEL */ #endif /* !_SYS_IPC_H_ */ Index: head/sys/sys/jail.h =================================================================== --- head/sys/sys/jail.h (revision 92718) +++ head/sys/sys/jail.h (revision 92719) @@ -1,81 +1,81 @@ /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * * $FreeBSD$ * */ #ifndef _SYS_JAIL_H_ #define _SYS_JAIL_H_ struct jail { u_int32_t version; char *path; char *hostname; u_int32_t ip_number; }; #ifndef _KERNEL -int jail __P((struct jail *)); +int jail(struct jail *); #else /* _KERNEL */ #include #include #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_PRISON); #endif /* * This structure describes a prison. It is pointed to by all struct * ucreds's of the inmates. pr_ref keeps track of them and is used to * delete the struture when the last inmate is dead. * * Lock key: * (p) locked by pr_mutex * (c) set only during creation before the structure is shared, no mutex * required to read */ struct mtx; struct prison { int pr_ref; /* (p) refcount */ char pr_host[MAXHOSTNAMELEN]; /* (p) jail hostname */ u_int32_t pr_ip; /* (c) ip addr host */ void *pr_linux; /* (p) linux abi */ int pr_securelevel; /* (p) securelevel */ struct mtx pr_mtx; }; /* * Sysctl-set variables that determine global jail policy * * XXX MIB entries will need to be protected by a mutex. */ extern int jail_set_hostname_allowed; extern int jail_socket_unixiproute_only; extern int jail_sysvipc_allowed; /* * Kernel support functions for jail(). */ struct ucred; struct sockaddr; -int jailed __P((struct ucred *cred)); -void getcredhostname __P((struct ucred *cred, char *, size_t)); -int prison_check __P((struct ucred *cred1, struct ucred *cred2)); -void prison_free __P((struct prison *pr)); -u_int32_t prison_getip __P((struct ucred *cred)); -void prison_hold __P((struct prison *pr)); -int prison_if __P((struct ucred *cred, struct sockaddr *sa)); -int prison_ip __P((struct ucred *cred, int flag, u_int32_t *ip)); -void prison_remote_ip __P((struct ucred *cred, int flags, u_int32_t *ip)); +int jailed(struct ucred *cred); +void getcredhostname(struct ucred *cred, char *, size_t); +int prison_check(struct ucred *cred1, struct ucred *cred2); +void prison_free(struct prison *pr); +u_int32_t prison_getip(struct ucred *cred); +void prison_hold(struct prison *pr); +int prison_if(struct ucred *cred, struct sockaddr *sa); +int prison_ip(struct ucred *cred, int flag, u_int32_t *ip); +void prison_remote_ip(struct ucred *cred, int flags, u_int32_t *ip); #endif /* !_KERNEL */ #endif /* !_SYS_JAIL_H_ */ Index: head/sys/sys/kernel.h =================================================================== --- head/sys/sys/kernel.h (revision 92718) +++ head/sys/sys/kernel.h (revision 92719) @@ -1,338 +1,338 @@ /*- * Copyright (c) 1995 Terrence R. Lambert * All rights reserved. * * Copyright (c) 1990, 1993 * 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. * * @(#)kernel.h 8.3 (Berkeley) 1/21/94 * $FreeBSD$ */ #ifndef _SYS_KERNEL_H_ #define _SYS_KERNEL_H_ #include #ifdef _KERNEL /* for intrhook below */ #include /* THIS MUST DIE! */ #include /* Global variables for the kernel. */ /* 1.1 */ extern unsigned long hostid; extern char hostname[MAXHOSTNAMELEN]; extern int hostnamelen; extern char domainname[MAXHOSTNAMELEN]; extern int domainnamelen; extern char kernelname[MAXPATHLEN]; /* 1.2 */ extern struct timeval boottime; extern struct timezone tz; /* XXX */ extern int tick; /* usec per tick (1000000 / hz) */ extern int tickadj; /* "standard" clock skew, us./tick */ extern int hz; /* system clock's frequency */ extern int psratio; /* ratio: prof / stat */ extern int stathz; /* statistics clock's frequency */ extern int profhz; /* profiling clock's frequency */ extern int ticks; extern int lbolt; /* once a second sleep address */ extern int tickdelta; extern long timedelta; #endif /* _KERNEL */ /* * Enumerated types for known system startup interfaces. * * Startup occurs in ascending numeric order; the list entries are * sorted prior to attempting startup to guarantee order. Items * of the same level are arbitrated for order based on the 'order' * element. * * These numbers are arbitrary and are chosen ONLY for ordering; the * enumeration values are explicit rather than implicit to provide * for binary compatibility with inserted elements. * * The SI_SUB_RUN_SCHEDULER value must have the highest lexical value. * * The SI_SUB_CONSOLE and SI_SUB_SWAP values represent values used by * the BSD 4.4Lite but not by FreeBSD; they are maintained in dependent * order to support porting. * * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of * initializations to take place at splimp(). This is a historical * wart that should be removed -- probably running everything at * splimp() until the first init that doesn't want it is the correct * fix. They are currently present to ensure historical behavior. */ enum sysinit_sub_id { SI_SUB_DUMMY = 0x0000000, /* not executed; for linker*/ SI_SUB_DONE = 0x0000001, /* processed*/ SI_SUB_TUNABLES = 0x0700000, /* establish tunable values */ SI_SUB_CONSOLE = 0x0800000, /* console*/ SI_SUB_COPYRIGHT = 0x0800001, /* first use of console*/ SI_SUB_MTX_POOL = 0x0900000, /* mutex pool */ SI_SUB_VM = 0x1000000, /* virtual memory system init*/ SI_SUB_KMEM = 0x1800000, /* kernel memory*/ SI_SUB_KVM_RSRC = 0x1A00000, /* kvm operational limits*/ SI_SUB_WITNESS = 0x1A80000, /* witness initialization */ SI_SUB_LOCK = 0x1B00000, /* lockmgr locks */ SI_SUB_EVENTHANDLER = 0x1C00000, /* eventhandler init */ SI_SUB_KLD = 0x2000000, /* KLD and module setup */ SI_SUB_CPU = 0x2100000, /* CPU resource(s)*/ SI_SUB_MAC = 0x2180000, /* TrustedBSD MAC subsystem */ SI_SUB_MAC_POLICY = 0x21C0000, /* TrustedBSD MAC policies */ SI_SUB_INTRINSIC = 0x2200000, /* proc 0*/ SI_SUB_VM_CONF = 0x2300000, /* config VM, set limits*/ SI_SUB_RUN_QUEUE = 0x2400000, /* set up run queue*/ SI_SUB_CREATE_INIT = 0x2500000, /* create init process*/ SI_SUB_SCHED_IDLE = 0x2600000, /* required idle procs */ SI_SUB_MBUF = 0x2700000, /* mbuf subsystem */ SI_SUB_INTR = 0x2800000, /* interrupt threads */ SI_SUB_SOFTINTR = 0x2800001, /* start soft interrupt thread */ SI_SUB_DEVFS = 0x2F00000, /* devfs ready for devices */ SI_SUB_INIT_IF = 0x3000000, /* prep for net interfaces */ SI_SUB_DRIVERS = 0x3100000, /* Let Drivers initialize */ SI_SUB_CONFIGURE = 0x3800000, /* Configure devices */ SI_SUB_VFS = 0x4000000, /* virtual file system*/ SI_SUB_CLOCKS = 0x4800000, /* real time and stat clocks*/ SI_SUB_CLIST = 0x5800000, /* clists*/ SI_SUB_SYSV_SHM = 0x6400000, /* System V shared memory*/ SI_SUB_SYSV_SEM = 0x6800000, /* System V semaphores*/ SI_SUB_SYSV_MSG = 0x6C00000, /* System V message queues*/ SI_SUB_P1003_1B = 0x6E00000, /* P1003.1B realtime */ SI_SUB_PSEUDO = 0x7000000, /* pseudo devices*/ SI_SUB_EXEC = 0x7400000, /* execve() handlers */ SI_SUB_PROTO_BEGIN = 0x8000000, /* XXX: set splimp (kludge)*/ SI_SUB_PROTO_IF = 0x8400000, /* interfaces*/ SI_SUB_PROTO_DOMAIN = 0x8800000, /* domains (address families?)*/ SI_SUB_PROTO_END = 0x8ffffff, /* XXX: set splx (kludge)*/ SI_SUB_KPROF = 0x9000000, /* kernel profiling*/ SI_SUB_KICK_SCHEDULER = 0xa000000, /* start the timeout events*/ SI_SUB_INT_CONFIG_HOOKS = 0xa800000, /* Interrupts enabled config */ SI_SUB_ROOT_CONF = 0xb000000, /* Find root devices */ SI_SUB_DUMP_CONF = 0xb200000, /* Find dump devices */ SI_SUB_VINUM = 0xb300000, /* Configure vinum */ SI_SUB_MOUNT_ROOT = 0xb400000, /* root mount*/ SI_SUB_SWAP = 0xc000000, /* swap*/ SI_SUB_INTRINSIC_POST = 0xd000000, /* proc 0 cleanup*/ SI_SUB_KTHREAD_INIT = 0xe000000, /* init process*/ SI_SUB_KTHREAD_PAGE = 0xe400000, /* pageout daemon*/ SI_SUB_KTHREAD_VM = 0xe800000, /* vm daemon*/ SI_SUB_KTHREAD_BUF = 0xea00000, /* buffer daemon*/ SI_SUB_KTHREAD_UPDATE = 0xec00000, /* update daemon*/ SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ SI_SUB_SMP = 0xf000000, /* start the APs*/ SI_SUB_RUN_SCHEDULER = 0xfffffff /* scheduler*/ }; /* * Some enumerated orders; "ANY" sorts last. */ enum sysinit_elem_order { SI_ORDER_FIRST = 0x0000000, /* first*/ SI_ORDER_SECOND = 0x0000001, /* second*/ SI_ORDER_THIRD = 0x0000002, /* third*/ SI_ORDER_MIDDLE = 0x1000000, /* somewhere in the middle */ SI_ORDER_ANY = 0xfffffff /* last*/ }; /* * A system initialization call instance * * At the moment there is one instance of sysinit. We probably do not * want two which is why this code is if'd out, but we definitely want * to discern SYSINIT's which take non-constant data pointers and * SYSINIT's which take constant data pointers, * * The C_* macros take functions expecting const void * arguments * while the non-C_* macros take functions expecting just void * arguments. * * With -Wcast-qual on, the compiler issues warnings: * - if we pass non-const data or functions taking non-const data * to a C_* macro. * * - if we pass const data to the normal macros * * However, no warning is issued if we pass a function taking const data * through a normal non-const macro. This is ok because the function is * saying it won't modify the data so we don't care whether the data is * modifiable or not. */ -typedef void (*sysinit_nfunc_t) __P((void *)); -typedef void (*sysinit_cfunc_t) __P((const void *)); +typedef void (*sysinit_nfunc_t)(void *); +typedef void (*sysinit_cfunc_t)(const void *); struct sysinit { enum sysinit_sub_id subsystem; /* subsystem identifier*/ enum sysinit_elem_order order; /* init order within subsystem*/ sysinit_cfunc_t func; /* function */ const void *udata; /* multiplexer/argument */ }; /* * Default: no special processing * * The C_ version of SYSINIT is for data pointers to const * data ( and functions taking data pointers to const data ). * At the moment it is no different from SYSINIT and thus * still results in warnings. * * The casts are necessary to have the compiler produce the * correct warnings when -Wcast-qual is used. * */ #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \ static struct sysinit uniquifier ## _sys_init = { \ subsystem, \ order, \ func, \ ident \ }; \ DATA_SET(sysinit_set,uniquifier ## _sys_init); #define SYSINIT(uniquifier, subsystem, order, func, ident) \ C_SYSINIT(uniquifier, subsystem, order, \ (sysinit_cfunc_t)(sysinit_nfunc_t)func, (void *)ident) /* * Called on module unload: no special processing */ #define C_SYSUNINIT(uniquifier, subsystem, order, func, ident) \ static struct sysinit uniquifier ## _sys_uninit = { \ subsystem, \ order, \ func, \ ident \ }; \ DATA_SET(sysuninit_set,uniquifier ## _sys_uninit) #define SYSUNINIT(uniquifier, subsystem, order, func, ident) \ C_SYSUNINIT(uniquifier, subsystem, order, \ (sysinit_cfunc_t)(sysinit_nfunc_t)func, (void *)ident) -void sysinit_add __P((struct sysinit **set, struct sysinit **set_end)); +void sysinit_add(struct sysinit **set, struct sysinit **set_end); /* * Infrastructure for tunable 'constants'. Value may be specified at compile * time or kernel load time. Rules relating tunables together can be placed * in a SYSINIT function at SI_SUB_TUNABLES with SI_ORDER_LAST. */ extern void tunable_int_init(void *); struct tunable_int { const char *path; int *var; }; #define TUNABLE_INT(path, var) \ _TUNABLE_INT((path), (var), __LINE__) #define _TUNABLE_INT(path, var, line) \ __TUNABLE_INT((path), (var), line) #define __TUNABLE_INT(path, var, line) \ static struct tunable_int __tunable_int_ ## line = { \ path, \ var, \ }; \ SYSINIT(__Tunable_init_ ## line, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, \ tunable_int_init, &__tunable_int_ ## line) #define TUNABLE_INT_FETCH(path, var) getenv_int((path), (var)) extern void tunable_quad_init(void *); struct tunable_quad { const char *path; quad_t *var; }; #define TUNABLE_QUAD(path, var) \ _TUNABLE_QUAD((path), (var), __LINE__) #define _TUNABLE_QUAD(path, var, line) \ __TUNABLE_QUAD((path), (var), line) #define __TUNABLE_QUAD(path, var, line) \ static struct tunable_quad __tunable_quad_ ## line = { \ path, \ var, \ }; \ SYSINIT(__Tunable_init_ ## line, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, \ tunable_quad_init, &__tunable_quad_ ## line) #define TUNABLE_QUAD_FETCH(path, var) getenv_quad((path), (var)) extern void tunable_str_init(void *); struct tunable_str { const char *path; char *var; int size; }; #define TUNABLE_STR(path, var, size) \ _TUNABLE_STR((path), (var), (size), __LINE__) #define _TUNABLE_STR(path, var, size, line) \ __TUNABLE_STR((path), (var), (size), line) #define __TUNABLE_STR(path, var, size, line) \ static struct tunable_str __tunable_str_ ## line = { \ path, \ var, \ size, \ }; \ SYSINIT(__Tunable_init_ ## line, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, \ tunable_str_init, &__tunable_str_ ## line) #define TUNABLE_STR_FETCH(path, var, size) \ getenv_string((path), (var), (size)) struct intr_config_hook { TAILQ_ENTRY(intr_config_hook) ich_links; - void (*ich_func) __P((void *arg)); + void (*ich_func)(void *arg); void *ich_arg; }; -int config_intrhook_establish __P((struct intr_config_hook *hook)); -void config_intrhook_disestablish __P((struct intr_config_hook *hook)); +int config_intrhook_establish(struct intr_config_hook *hook); +void config_intrhook_disestablish(struct intr_config_hook *hook); #endif /* !_SYS_KERNEL_H_*/ Index: head/sys/sys/kthread.h =================================================================== --- head/sys/sys/kthread.h (revision 92718) +++ head/sys/sys/kthread.h (revision 92719) @@ -1,54 +1,54 @@ /*- * Copyright (c) 1999 Peter Wemm * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_KTHREAD_H_ #define _SYS_KTHREAD_H_ #include /*- * A kernel process descriptor; used to start "internal" daemons. * * Note: global_procpp may be NULL for no global save area. */ struct kproc_desc { char *arg0; /* arg 0 (for 'ps' listing) */ - void (*func) __P((void)); /* "main" for kernel process */ + void (*func)(void); /* "main" for kernel process */ struct proc **global_procpp; /* ptr to proc ptr save area */ }; -void kproc_shutdown __P((void *, int)); -void kproc_start __P((const void *)); -int kthread_create __P((void (*)(void *), void *, struct proc **, - int flags, const char *, ...)) __printflike(5, 6); -void kthread_exit __P((int)) __dead2; -int kthread_resume __P((struct proc *)); /* XXXKSE */ -int kthread_suspend __P((struct proc *, int)); /* XXXKSE */ -void kthread_suspend_check __P((struct proc *)); /* XXXKSE */ +void kproc_shutdown(void *, int); +void kproc_start(const void *); +int kthread_create(void (*)(void *), void *, struct proc **, + int flags, const char *, ...) __printflike(5, 6); +void kthread_exit(int) __dead2; +int kthread_resume(struct proc *); /* XXXKSE */ +int kthread_suspend(struct proc *, int); /* XXXKSE */ +void kthread_suspend_check(struct proc *); /* XXXKSE */ #endif /* !_SYS_KTHREAD_H_ */ Index: head/sys/sys/ktrace.h =================================================================== --- head/sys/sys/ktrace.h (revision 92718) +++ head/sys/sys/ktrace.h (revision 92719) @@ -1,179 +1,179 @@ /* * Copyright (c) 1988, 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. * * @(#)ktrace.h 8.1 (Berkeley) 6/2/93 * $FreeBSD$ */ #ifndef _SYS_KTRACE_H_ #define _SYS_KTRACE_H_ /* * operations to ktrace system call (KTROP(op)) */ #define KTROP_SET 0 /* set trace points */ #define KTROP_CLEAR 1 /* clear trace points */ #define KTROP_CLEARFILE 2 /* stop all tracing to file */ #define KTROP(o) ((o)&3) /* macro to extract operation */ /* * flags (ORed in with operation) */ #define KTRFLAG_DESCEND 4 /* perform op on all children too */ /* * ktrace record header */ struct ktr_header { int ktr_len; /* length of buf */ short ktr_type; /* trace record type */ pid_t ktr_pid; /* process id */ char ktr_comm[MAXCOMLEN+1]; /* command name */ struct timeval ktr_time; /* timestamp */ caddr_t ktr_buffer; }; /* * Test for kernel trace point (MP SAFE) */ #define KTRPOINT(p, type) \ (((p)->p_traceflag & ((1<<(type))|KTRFAC_ACTIVE)) == (1<<(type))) /* * ktrace record types */ /* * KTR_SYSCALL - system call record */ #define KTR_SYSCALL 1 struct ktr_syscall { short ktr_code; /* syscall number */ short ktr_narg; /* number of arguments */ /* * followed by ktr_narg register_t */ register_t ktr_args[1]; }; /* * KTR_SYSRET - return from system call record */ #define KTR_SYSRET 2 struct ktr_sysret { short ktr_code; short ktr_eosys; int ktr_error; register_t ktr_retval; }; /* * KTR_NAMEI - namei record */ #define KTR_NAMEI 3 /* record contains pathname */ /* * KTR_GENIO - trace generic process i/o */ #define KTR_GENIO 4 struct ktr_genio { int ktr_fd; enum uio_rw ktr_rw; /* * followed by data successfully read/written */ }; /* * KTR_PSIG - trace processed signal */ #define KTR_PSIG 5 struct ktr_psig { int signo; sig_t action; int code; sigset_t mask; }; /* * KTR_CSW - trace context switches */ #define KTR_CSW 6 struct ktr_csw { int out; /* 1 if switch out, 0 if switch in */ int user; /* 1 if usermode (ivcsw), 0 if kernel (vcsw) */ }; /* * KTR_USER - data comming from userland */ #define KTR_USER_MAXLEN 2048 /* maximum length of passed data */ #define KTR_USER 7 /* * kernel trace points (in p_traceflag) */ #define KTRFAC_MASK 0x00ffffff #define KTRFAC_SYSCALL (1< __BEGIN_DECLS -int ktrace __P((const char *, int, int, pid_t)); -int utrace __P((const void *, size_t)); +int ktrace(const char *, int, int, pid_t); +int utrace(const void *, size_t); __END_DECLS #endif #endif Index: head/sys/sys/libkern.h =================================================================== --- head/sys/sys/libkern.h (revision 92718) +++ head/sys/sys/libkern.h (revision 92719) @@ -1,114 +1,114 @@ /*- * Copyright (c) 1992, 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. * * @(#)libkern.h 8.1 (Berkeley) 6/10/93 * $FreeBSD$ */ #ifndef _SYS_LIBKERN_H_ #define _SYS_LIBKERN_H_ #include #include #ifdef _KERNEL #include #endif /* BCD conversions. */ extern u_char const bcd2bin_data[]; extern u_char const bin2bcd_data[]; extern char const hex2ascii_data[]; #define bcd2bin(bcd) (bcd2bin_data[bcd]) #define bin2bcd(bin) (bin2bcd_data[bin]) #define hex2ascii(hex) (hex2ascii_data[hex]) static __inline int imax(int a, int b) { return (a > b ? a : b); } static __inline int imin(int a, int b) { return (a < b ? a : b); } static __inline long lmax(long a, long b) { return (a > b ? a : b); } static __inline long lmin(long a, long b) { return (a < b ? a : b); } static __inline u_int max(u_int a, u_int b) { return (a > b ? a : b); } static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); } static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); } static __inline quad_t qmin(quad_t a, quad_t b) { return (a < b ? a : b); } static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); } static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); } /* Prototypes for non-quad routines. */ -u_int32_t arc4random __P((void)); -int bcmp __P((const void *, const void *, size_t)); -void *bsearch __P((const void *, const void *, size_t, - size_t, int (*)(const void *, const void *))); +u_int32_t arc4random(void); +int bcmp(const void *, const void *, size_t); +void *bsearch(const void *, const void *, size_t, + size_t, int (*)(const void *, const void *)); #ifndef HAVE_INLINE_FFS -int ffs __P((int)); +int ffs(int); #endif #ifndef HAVE_INLINE_FLS -int fls __P((int)); +int fls(int); #endif -int locc __P((int, char *, u_int)); -void qsort __P((void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *))); -u_long random __P((void)); -char *index __P((const char *, int)); -char *rindex __P((const char *, int)); -int scanc __P((u_int, const u_char *, const u_char *, int)); -int skpc __P((int, int, char *)); -void srandom __P((u_long)); -char *strcat __P((char *, const char *)); -int strcmp __P((const char *, const char *)); -char *strcpy __P((char *, const char *)); -size_t strlen __P((const char *)); -int strncmp __P((const char *, const char *, size_t)); -char *strncpy __P((char *, const char *, size_t)); -int strvalid __P((const char *, size_t)); +int locc(int, char *, u_int); +void qsort(void *base, size_t nmemb, size_t size, + int (*compar)(const void *, const void *)); +u_long random(void); +char *index(const char *, int); +char *rindex(const char *, int); +int scanc(u_int, const u_char *, const u_char *, int); +int skpc(int, int, char *); +void srandom(u_long); +char *strcat(char *, const char *); +int strcmp(const char *, const char *); +char *strcpy(char *, const char *); +size_t strlen(const char *); +int strncmp(const char *, const char *, size_t); +char *strncpy(char *, const char *, size_t); +int strvalid(const char *, size_t); static __inline int memcmp(const void *b1, const void *b2, size_t len) { return (bcmp(b1, b2, len)); } static __inline void * memset(void *b, int c, size_t len) { char *bb; if (c == 0) bzero(b, len); else for (bb = (char *)b; len--; ) *bb++ = c; return (b); } #endif /* !_SYS_LIBKERN_H_ */ Index: head/sys/sys/linedisc.h =================================================================== --- head/sys/sys/linedisc.h (revision 92718) +++ head/sys/sys/linedisc.h (revision 92719) @@ -1,360 +1,358 @@ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 2000 * Poul-Henning Kamp. 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. * * @(#)conf.h 8.5 (Berkeley) 1/9/95 * $FreeBSD$ */ #ifndef _SYS_CONF_H_ #define _SYS_CONF_H_ #ifdef _KERNEL #include struct tty; struct disk; struct vnode; struct buf; TAILQ_HEAD(snaphead, inode); struct specinfo { u_int si_flags; #define SI_STASHED 0x0001 /* created in stashed storage */ #define SI_ALIAS 0x0002 /* carrier of alias name */ #define SI_NAMED 0x0004 /* make_dev{_alias} has been called */ #define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */ #define SI_CHILD 0x0010 /* child of another dev_t */ #define SI_DEVOPEN 0x0020 /* opened by device */ #define SI_CONSOPEN 0x0040 /* opened by console */ struct timespec si_atime; struct timespec si_ctime; struct timespec si_mtime; udev_t si_udev; LIST_ENTRY(specinfo) si_hash; SLIST_HEAD(, vnode) si_hlist; LIST_HEAD(, specinfo) si_children; LIST_ENTRY(specinfo) si_siblings; dev_t si_parent; struct snaphead si_snapshots; int (*si_copyonwrite)(struct vnode *, struct buf *); u_int si_inode; char si_name[SPECNAMELEN + 1]; void *si_drv1, *si_drv2; struct cdevsw *si_devsw; int si_iosize_max; /* maximum I/O size (for physio &al) */ uid_t si_uid; gid_t si_gid; mode_t si_mode; union { struct { struct tty *__sit_tty; } __si_tty; struct { struct disk *__sid_disk; struct mount *__sid_mountpoint; int __sid_bsize_phys; /* min physical block size */ int __sid_bsize_best; /* optimal block size */ } __si_disk; } __si_u; }; #define si_tty __si_u.__si_tty.__sit_tty #define si_disk __si_u.__si_disk.__sid_disk #define si_mountpoint __si_u.__si_disk.__sid_mountpoint #define si_bsize_phys __si_u.__si_disk.__sid_bsize_phys #define si_bsize_best __si_u.__si_disk.__sid_bsize_best /* * Special device management */ #define SPECHSZ 64 #define SPECHASH(rdev) (((unsigned)(minor(rdev)))%SPECHSZ) /* * Definitions of device driver entry switches */ struct bio; struct buf; struct thread; struct uio; struct knote; /* * Note: d_thread_t is provided as a transition aid for those drivers * that treat struct proc/struct thread as an opaque data type and * exist in substantially the same form in both 4.x and 5.x. Writers * of drivers that dips into the d_thread_t structure should use * struct thread or struct proc as appropriate for the version of the * OS they are using. It is provided in lieu of each device driver * inventing its own way of doing this. While it does violate style(9) * in a number of ways, this violation is deemed to be less * important than the benefits that a uniform API between releases * gives. * * Users of struct thread/struct proc that aren't device drivers should * not use d_thread_t. */ typedef struct thread d_thread_t; -typedef int d_open_t __P((dev_t dev, int oflags, int devtype, - struct thread *td)); -typedef int d_close_t __P((dev_t dev, int fflag, int devtype, - struct thread *td)); -typedef void d_strategy_t __P((struct bio *bp)); -typedef int d_ioctl_t __P((dev_t dev, u_long cmd, caddr_t data, - int fflag, struct thread *td)); -typedef int d_dump_t __P((dev_t dev)); -typedef int d_psize_t __P((dev_t dev)); +typedef int d_open_t(dev_t dev, int oflags, int devtype, struct thread *td); +typedef int d_close_t(dev_t dev, int fflag, int devtype, struct thread *td); +typedef void d_strategy_t(struct bio *bp); +typedef int d_ioctl_t(dev_t dev, u_long cmd, caddr_t data, + int fflag, struct thread *td); +typedef int d_dump_t(dev_t dev); +typedef int d_psize_t(dev_t dev); -typedef int d_read_t __P((dev_t dev, struct uio *uio, int ioflag)); -typedef int d_write_t __P((dev_t dev, struct uio *uio, int ioflag)); -typedef int d_poll_t __P((dev_t dev, int events, struct thread *td)); -typedef int d_kqfilter_t __P((dev_t dev, struct knote *kn)); -typedef int d_mmap_t __P((dev_t dev, vm_offset_t offset, int nprot)); +typedef int d_read_t(dev_t dev, struct uio *uio, int ioflag); +typedef int d_write_t(dev_t dev, struct uio *uio, int ioflag); +typedef int d_poll_t(dev_t dev, int events, struct thread *td); +typedef int d_kqfilter_t(dev_t dev, struct knote *kn); +typedef int d_mmap_t(dev_t dev, vm_offset_t offset, int nprot); -typedef int l_open_t __P((dev_t dev, struct tty *tp)); -typedef int l_close_t __P((struct tty *tp, int flag)); -typedef int l_read_t __P((struct tty *tp, struct uio *uio, int flag)); -typedef int l_write_t __P((struct tty *tp, struct uio *uio, int flag)); -typedef int l_ioctl_t __P((struct tty *tp, u_long cmd, caddr_t data, - int flag, struct thread*td)); -typedef int l_rint_t __P((int c, struct tty *tp)); -typedef int l_start_t __P((struct tty *tp)); -typedef int l_modem_t __P((struct tty *tp, int flag)); +typedef int l_open_t(dev_t dev, struct tty *tp); +typedef int l_close_t(struct tty *tp, int flag); +typedef int l_read_t(struct tty *tp, struct uio *uio, int flag); +typedef int l_write_t(struct tty *tp, struct uio *uio, int flag); +typedef int l_ioctl_t(struct tty *tp, u_long cmd, caddr_t data, + int flag, struct thread *td); +typedef int l_rint_t(int c, struct tty *tp); +typedef int l_start_t(struct tty *tp); +typedef int l_modem_t(struct tty *tp, int flag); /* * XXX: The dummy argument can be used to do what strategy1() never * did anywhere: Create a per device flag to lock the device during * label/slice surgery, all calls with a dummy == 0 gets stalled on * a queue somewhere, whereas dummy == 1 are let through. Once out * of surgery, reset the flag and restart all the stuff on the stall * queue. */ #define BIO_STRATEGY(bp, dummy) \ do { \ if ((!(bp)->bio_cmd) || ((bp)->bio_cmd & ((bp)->bio_cmd - 1))) \ Debugger("bio_cmd botch"); \ (*devsw((bp)->bio_dev)->d_strategy)(bp); \ } while (0) #define DEV_STRATEGY(bp, dummy) \ do { \ if ((bp)->b_flags & B_PHYS) \ (bp)->b_io.bio_offset = (bp)->b_offset; \ else \ (bp)->b_io.bio_offset = dbtob((bp)->b_blkno); \ (bp)->b_io.bio_done = bufdonebio; \ (bp)->b_io.bio_caller2 = (bp); \ BIO_STRATEGY(&(bp)->b_io, dummy); \ } while (0) #endif /* _KERNEL */ /* * Types for d_flags. */ #define D_TAPE 0x0001 #define D_DISK 0x0002 #define D_TTY 0x0004 #define D_MEM 0x0008 #ifdef _KERNEL #define D_TYPEMASK 0xffff /* * Flags for d_flags. */ #define D_MEMDISK 0x00010000 /* memory type disk */ #define D_NAGGED 0x00020000 /* nagged about missing make_dev() */ #define D_CANFREE 0x00040000 /* can free blocks */ #define D_TRACKCLOSE 0x00080000 /* track all closes */ #define D_MMAP_ANON 0x00100000 /* special treatment in vm_mmap.c */ #define D_KQFILTER 0x00200000 /* has kqfilter entry */ /* * Character device switch table */ struct cdevsw { d_open_t *d_open; d_close_t *d_close; d_read_t *d_read; d_write_t *d_write; d_ioctl_t *d_ioctl; d_poll_t *d_poll; d_mmap_t *d_mmap; d_strategy_t *d_strategy; const char *d_name; /* base device name, e.g. 'vn' */ int d_maj; d_dump_t *d_dump; d_psize_t *d_psize; u_int d_flags; /* additions below are not binary compatible with 4.2 and below */ d_kqfilter_t *d_kqfilter; }; /* * Line discipline switch table */ struct linesw { l_open_t *l_open; l_close_t *l_close; l_read_t *l_read; l_write_t *l_write; l_ioctl_t *l_ioctl; l_rint_t *l_rint; l_start_t *l_start; l_modem_t *l_modem; u_char l_hotchar; }; extern struct linesw linesw[]; extern int nlinesw; -int ldisc_register __P((int , struct linesw *)); -void ldisc_deregister __P((int)); +int ldisc_register(int , struct linesw *); +void ldisc_deregister(int); #define LDISC_LOAD -1 /* Loadable line discipline */ #endif /* _KERNEL */ /* * Swap device table */ struct swdevt { udev_t sw_dev; /* For quasibogus swapdev reporting */ int sw_flags; int sw_nblks; int sw_used; struct vnode *sw_vp; dev_t sw_device; }; #define SW_FREED 0x01 #define SW_SEQUENTIAL 0x02 #define sw_freed sw_flags /* XXX compat */ #ifdef _KERNEL d_open_t noopen; d_close_t noclose; d_read_t noread; d_write_t nowrite; d_ioctl_t noioctl; d_mmap_t nommap; d_kqfilter_t nokqfilter; #define nostrategy ((d_strategy_t *)NULL) #define nopoll seltrue d_dump_t nodump; #define NUMCDEVSW 256 /* * nopsize is little used, so not worth having dummy functions for. */ #define nopsize ((d_psize_t *)NULL) d_open_t nullopen; d_close_t nullclose; l_ioctl_t l_nullioctl; l_read_t l_noread; l_write_t l_nowrite; struct module; struct devsw_module_data { int (*chainevh)(struct module *, int, void *); /* next handler */ void *chainarg; /* arg for next event handler */ /* Do not initialize fields hereafter */ }; #define DEV_MODULE(name, evh, arg) \ static moduledata_t name##_mod = { \ #name, \ evh, \ arg \ }; \ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE) -int cdevsw_add __P((struct cdevsw *new)); -int cdevsw_remove __P((struct cdevsw *old)); -int count_dev __P((dev_t dev)); -void destroy_dev __P((dev_t dev)); -void revoke_and_destroy_dev __P((dev_t dev)); -struct cdevsw *devsw __P((dev_t dev)); -const char *devtoname __P((dev_t dev)); -int dev_named __P((dev_t pdev, const char *name)); -void dev_depends __P((dev_t pdev, dev_t cdev)); -void freedev __P((dev_t dev)); -int iszerodev __P((dev_t dev)); -dev_t makebdev __P((int maj, int min)); -dev_t make_dev __P((struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const char *fmt, ...)) __printflike(6, 7); -dev_t make_dev_alias __P((dev_t pdev, const char *fmt, ...)) __printflike(2, 3); -int dev2unit __P((dev_t dev)); -int unit2minor __P((int unit)); -void setconf __P((void)); +int cdevsw_add(struct cdevsw *new); +int cdevsw_remove(struct cdevsw *old); +int count_dev(dev_t dev); +void destroy_dev(dev_t dev); +void revoke_and_destroy_dev(dev_t dev); +struct cdevsw *devsw(dev_t dev); +const char *devtoname(dev_t dev); +int dev_named(dev_t pdev, const char *name); +void dev_depends(dev_t pdev, dev_t cdev); +void freedev(dev_t dev); +int iszerodev(dev_t dev); +dev_t makebdev(int maj, int min); +dev_t make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const char *fmt, ...) __printflike(6, 7); +dev_t make_dev_alias(dev_t pdev, const char *fmt, ...) __printflike(2, 3); +int dev2unit(dev_t dev); +int unit2minor(int unit); +void setconf(void); dev_t getdiskbyname(char *name); /* This is type of the function DEVFS uses to hook into the kernel with */ -typedef void devfs_create_t __P((dev_t dev)); -typedef void devfs_destroy_t __P((dev_t dev)); +typedef void devfs_create_t(dev_t dev); +typedef void devfs_destroy_t(dev_t dev); extern devfs_create_t *devfs_create_hook; extern devfs_destroy_t *devfs_destroy_hook; extern int devfs_present; #define UID_ROOT 0 #define UID_BIN 3 #define UID_UUCP 66 #define GID_WHEEL 0 #define GID_KMEM 2 #define GID_OPERATOR 5 #define GID_BIN 7 #define GID_GAMES 13 #define GID_DIALER 68 -typedef void (*dev_clone_fn) __P((void *arg, char *name, int namelen, dev_t *result)); +typedef void (*dev_clone_fn)(void *arg, char *name, int namelen, dev_t *result); -int dev_stdclone __P((char *name, char **namep, const char *stem, int *unit)); +int dev_stdclone(char *name, char **namep, const char *stem, int *unit); EVENTHANDLER_DECLARE(dev_clone, dev_clone_fn); #endif /* _KERNEL */ #endif /* !_SYS_CONF_H_ */ Index: head/sys/sys/lockf.h =================================================================== --- head/sys/sys/lockf.h (revision 92718) +++ head/sys/sys/lockf.h (revision 92719) @@ -1,82 +1,82 @@ /* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Scooter Morris at Genentech 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. * * @(#)lockf.h 8.1 (Berkeley) 6/11/93 * $FreeBSD$ */ #ifndef _SYS_LOCKF_H_ #define _SYS_LOCKF_H_ #include struct vop_advlock_args; #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_LOCKF); #endif /* * The lockf structure is a kernel structure which contains the information * associated with a byte range lock. The lockf structures are linked into * the inode structure. Locks are sorted by the starting byte of the lock for * efficiency. */ TAILQ_HEAD(locklist, lockf); struct lockf { short lf_flags; /* Semantics: F_POSIX, F_FLOCK, F_WAIT */ short lf_type; /* Lock type: F_RDLCK, F_WRLCK */ off_t lf_start; /* Byte # of the start of the lock */ off_t lf_end; /* Byte # of the end of the lock (-1=EOF) */ caddr_t lf_id; /* Id of the resource holding the lock */ struct lockf **lf_head; /* Back pointer to the head of the locf list */ struct inode *lf_inode; /* Back pointer to the inode */ struct lockf *lf_next; /* Pointer to the next lock on this inode */ struct locklist lf_blkhd; /* List of requests blocked on this lock */ TAILQ_ENTRY(lockf) lf_block;/* A request waiting for a lock */ }; /* Maximum length of sleep chains to traverse to try and detect deadlock. */ #define MAXDEPTH 50 -int lf_advlock __P((struct vop_advlock_args *, struct lockf **, u_quad_t)); +int lf_advlock(struct vop_advlock_args *, struct lockf **, u_quad_t); #ifdef LOCKF_DEBUG -void lf_print __P((char *, struct lockf *)); -void lf_printlist __P((char *, struct lockf *)); +void lf_print(char *, struct lockf *); +void lf_printlist(char *, struct lockf *); #endif #endif /* !_SYS_LOCKF_H_ */ Index: head/sys/sys/lockmgr.h =================================================================== --- head/sys/sys/lockmgr.h (revision 92718) +++ head/sys/sys/lockmgr.h (revision 92719) @@ -1,223 +1,223 @@ /* * Copyright (c) 1995 * The Regents of the University of California. All rights reserved. * * This code contains ideas from software contributed to Berkeley by * Avadis Tevanian, Jr., Michael Wayne Young, and the Mach Operating * System project at Carnegie-Mellon University. * * 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. * * @(#)lock.h 8.12 (Berkeley) 5/19/95 * $FreeBSD$ */ #ifndef _SYS_LOCKMGR_H_ #define _SYS_LOCKMGR_H_ struct mtx; /* * The general lock structure. Provides for multiple shared locks, * upgrading from shared to exclusive, and sleeping until the lock * can be gained. */ struct lock { struct mtx *lk_interlock; /* lock on remaining fields */ u_int lk_flags; /* see below */ int lk_sharecount; /* # of accepted shared locks */ int lk_waitcount; /* # of processes sleeping for lock */ short lk_exclusivecount; /* # of recursive exclusive locks */ short lk_prio; /* priority at which to sleep */ const char *lk_wmesg; /* resource sleeping (for tsleep) */ int lk_timo; /* maximum sleep time (for tsleep) */ pid_t lk_lockholder; /* pid of exclusive lock holder */ #ifdef DEBUG_LOCKS const char *lk_filename; const char *lk_lockername; int lk_lineno; #endif }; /* * Lock request types: * LK_SHARED - get one of many possible shared locks. If a process * holding an exclusive lock requests a shared lock, the exclusive * lock(s) will be downgraded to shared locks. * LK_EXCLUSIVE - stop further shared locks, when they are cleared, * grant a pending upgrade if it exists, then grant an exclusive * lock. Only one exclusive lock may exist at a time, except that * a process holding an exclusive lock may get additional exclusive * locks if it explicitly sets the LK_CANRECURSE flag in the lock * request, or if the LK_CANRECUSE flag was set when the lock was * initialized. * LK_UPGRADE - the process must hold a shared lock that it wants to * have upgraded to an exclusive lock. Other processes may get * exclusive access to the resource between the time that the upgrade * is requested and the time that it is granted. * LK_EXCLUPGRADE - the process must hold a shared lock that it wants to * have upgraded to an exclusive lock. If the request succeeds, no * other processes will have gotten exclusive access to the resource * between the time that the upgrade is requested and the time that * it is granted. However, if another process has already requested * an upgrade, the request will fail (see error returns below). * LK_DOWNGRADE - the process must hold an exclusive lock that it wants * to have downgraded to a shared lock. If the process holds multiple * (recursive) exclusive locks, they will all be downgraded to shared * locks. * LK_RELEASE - release one instance of a lock. * LK_DRAIN - wait for all activity on the lock to end, then mark it * decommissioned. This feature is used before freeing a lock that * is part of a piece of memory that is about to be freed. * LK_EXCLOTHER - return for lockstatus(). Used when another process * holds the lock exclusively. * * These are flags that are passed to the lockmgr routine. */ #define LK_TYPE_MASK 0x0000000f /* type of lock sought */ #define LK_SHARED 0x00000001 /* shared lock */ #define LK_EXCLUSIVE 0x00000002 /* exclusive lock */ #define LK_UPGRADE 0x00000003 /* shared-to-exclusive upgrade */ #define LK_EXCLUPGRADE 0x00000004 /* first shared-to-exclusive upgrade */ #define LK_DOWNGRADE 0x00000005 /* exclusive-to-shared downgrade */ #define LK_RELEASE 0x00000006 /* release any type of lock */ #define LK_DRAIN 0x00000007 /* wait for all lock activity to end */ #define LK_EXCLOTHER 0x00000008 /* other process holds lock */ /* * External lock flags. * * The first three flags may be set in lock_init to set their mode permanently, * or passed in as arguments to the lock manager. The LK_REENABLE flag may be * set only at the release of a lock obtained by drain. */ #define LK_EXTFLG_MASK 0x03000070 /* mask of external flags */ #define LK_NOWAIT 0x00000010 /* do not sleep to await lock */ #define LK_SLEEPFAIL 0x00000020 /* sleep, then return failure */ #define LK_CANRECURSE 0x00000040 /* allow recursive exclusive lock */ #define LK_REENABLE 0x00000080 /* lock is be reenabled after drain */ #define LK_NOPAUSE 0x01000000 /* no spinloop */ #define LK_TIMELOCK 0x02000000 /* use lk_timo, else no timeout */ /* * Internal lock flags. * * These flags are used internally to the lock manager. */ #define LK_WANT_UPGRADE 0x00000100 /* waiting for share-to-excl upgrade */ #define LK_WANT_EXCL 0x00000200 /* exclusive lock sought */ #define LK_HAVE_EXCL 0x00000400 /* exclusive lock obtained */ #define LK_WAITDRAIN 0x00000800 /* process waiting for lock to drain */ #define LK_DRAINING 0x00004000 /* lock is being drained */ /* * Control flags * * Non-persistent external flags. */ #define LK_INTERLOCK 0x00010000 /* * unlock passed mutex after getting * lk_interlock */ #define LK_RETRY 0x00020000 /* vn_lock: retry until locked */ #define LK_NOOBJ 0x00040000 /* vget: don't create object */ #define LK_THISLAYER 0x00080000 /* vn_lock: lock/unlock only current layer */ /* * Internal state flags corresponding to lk_sharecount, and lk_waitcount */ #define LK_SHARE_NONZERO 0x00100000 #define LK_WAIT_NONZERO 0x00200000 /* * Lock return status. * * Successfully obtained locks return 0. Locks will always succeed * unless one of the following is true: * LK_FORCEUPGRADE is requested and some other process has already * requested a lock upgrade (returns EBUSY). * LK_WAIT is set and a sleep would be required (returns EBUSY). * LK_SLEEPFAIL is set and a sleep was done (returns ENOLCK). * PCATCH is set in lock priority and a signal arrives (returns * either EINTR or ERESTART if system calls is to be restarted). * Non-null lock timeout and timeout expires (returns EWOULDBLOCK). * A failed lock attempt always returns a non-zero error value. No lock * is held after an error return (in particular, a failed LK_UPGRADE * or LK_FORCEUPGRADE will have released its shared access lock). */ /* * Indicator that no process holds exclusive lock */ #define LK_KERNPROC ((pid_t) -2) #define LK_NOPROC ((pid_t) -1) #ifdef INVARIANTS #define LOCKMGR_ASSERT(lkp, what, p) do { \ switch ((what)) { \ case LK_SHARED: \ if (lockstatus((lkp), (p)) == LK_SHARED) \ break; \ /* fall into exclusive */ \ case LK_EXCLUSIVE: \ if (lockstatus((lkp), (p)) != LK_EXCLUSIVE) \ panic("lock %s %s not held at %s:%d", \ (lkp)->lk_wmesg, #what, __FILE__, \ __LINE__); \ break; \ default: \ panic("unknown LOCKMGR_ASSERT at %s:%d", __FILE__, \ __LINE__); \ } \ } while (0) #else /* INVARIANTS */ #define LOCKMGR_ASSERT(lkp, p, what) #endif /* INVARIANTS */ void dumplockinfo(struct lock *lkp); struct thread; -void lockinit __P((struct lock *, int prio, const char *wmesg, - int timo, int flags)); -void lockdestroy __P((struct lock *)); +void lockinit(struct lock *, int prio, const char *wmesg, + int timo, int flags); +void lockdestroy(struct lock *); #ifdef DEBUG_LOCKS -int debuglockmgr __P((struct lock *, u_int flags, +int debuglockmgr(struct lock *, u_int flags, struct mtx *, struct thread *p, const char *, const char *, - int)); + int); #define lockmgr(lockp, flags, slockp, proc) \ debuglockmgr((lockp), (flags), (slockp), (proc), \ "lockmgr", __FILE__, __LINE__) #else -int lockmgr __P((struct lock *, u_int flags, - struct mtx *, struct thread *p)); +int lockmgr(struct lock *, u_int flags, + struct mtx *, struct thread *p); #endif -void lockmgr_printinfo __P((struct lock *)); -int lockstatus __P((struct lock *, struct thread *)); -int lockcount __P((struct lock *)); +void lockmgr_printinfo(struct lock *); +int lockstatus(struct lock *, struct thread *); +int lockcount(struct lock *); #endif /* !_SYS_LOCKMGR_H_ */ Index: head/sys/sys/malloc.h =================================================================== --- head/sys/sys/malloc.h (revision 92718) +++ head/sys/sys/malloc.h (revision 92719) @@ -1,118 +1,118 @@ /* * Copyright (c) 1987, 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. * * @(#)malloc.h 8.5 (Berkeley) 5/3/95 * $FreeBSD$ */ #ifndef _SYS_MALLOC_H_ #define _SYS_MALLOC_H_ #include #define splmem splhigh #define MINALLOCSIZE UMA_SMALLEST_UNIT /* * flags to malloc. */ #define M_WAITOK 0x0000 #define M_NOWAIT 0x0001 /* do not block */ #define M_USE_RESERVE 0x0002 /* can alloc out of reserve memory */ #define M_ZERO 0x0004 /* bzero the allocation */ #define M_MAGIC 877983977 /* time when first defined :-) */ struct malloc_type { struct malloc_type *ks_next; /* next in list */ long ks_memuse; /* total memory held in bytes */ long ks_limit; /* most that are allowed to exist */ long ks_size; /* sizes of this thing that are allocated */ long ks_inuse; /* # of packets of this type currently in use */ int64_t ks_calls; /* total packets of this type ever allocated */ long ks_maxused; /* maximum number ever used */ u_long ks_magic; /* if it's not magic, don't touch it */ const char *ks_shortdesc; /* short description */ u_short ks_limblocks; /* number of times blocked for hitting limit */ u_short ks_mapblocks; /* number of times blocked for kernel map */ }; #ifdef _KERNEL #define MALLOC_DEFINE(type, shortdesc, longdesc) \ struct malloc_type type[1] = { \ { NULL, 0, 0, 0, 0, 0, 0, M_MAGIC, shortdesc, 0, 0 } \ }; \ SYSINIT(type##_init, SI_SUB_KMEM, SI_ORDER_SECOND, malloc_init, type); \ SYSUNINIT(type##_uninit, SI_SUB_KMEM, SI_ORDER_ANY, malloc_uninit, type) #define MALLOC_DECLARE(type) \ extern struct malloc_type type[1] MALLOC_DECLARE(M_CACHE); MALLOC_DECLARE(M_DEVBUF); MALLOC_DECLARE(M_TEMP); MALLOC_DECLARE(M_IP6OPT); /* for INET6 */ MALLOC_DECLARE(M_IP6NDP); /* for INET6 */ /* * Deprecated macro versions of not-quite-malloc() and free(). */ #define MALLOC(space, cast, size, type, flags) \ (space) = (cast)malloc((u_long)(size), (type), (flags)) #define FREE(addr, type) free((addr), (type)) /* * XXX this should be declared in , but that tends to fail * because is included in a header before the source file * has a chance to include to get MALLOC_DECLARE() defined. */ MALLOC_DECLARE(M_IOV); /* XXX struct malloc_type is unused for contig*(). */ -void contigfree __P((void *addr, unsigned long size, - struct malloc_type *type)); -void *contigmalloc __P((unsigned long size, struct malloc_type *type, +void contigfree(void *addr, unsigned long size, + struct malloc_type *type); +void *contigmalloc(unsigned long size, struct malloc_type *type, int flags, unsigned long low, unsigned long high, - unsigned long alignment, unsigned long boundary)); -void free __P((void *addr, struct malloc_type *type)); -void *malloc __P((unsigned long size, struct malloc_type *type, int flags)); -void malloc_init __P((void *)); -void malloc_uninit __P((void *)); -void *realloc __P((void *addr, unsigned long size, - struct malloc_type *type, int flags)); -void *reallocf __P((void *addr, unsigned long size, - struct malloc_type *type, int flags)); + unsigned long alignment, unsigned long boundary); +void free(void *addr, struct malloc_type *type); +void *malloc(unsigned long size, struct malloc_type *type, int flags); +void malloc_init(void *); +void malloc_uninit(void *); +void *realloc(void *addr, unsigned long size, + struct malloc_type *type, int flags); +void *reallocf(void *addr, unsigned long size, + struct malloc_type *type, int flags); #endif /* _KERNEL */ #endif /* !_SYS_MALLOC_H_ */ Index: head/sys/sys/md5.h =================================================================== --- head/sys/sys/md5.h (revision 92718) +++ head/sys/sys/md5.h (revision 92719) @@ -1,51 +1,51 @@ /* MD5.H - header file for MD5C.C * $FreeBSD$ */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #ifndef _SYS_MD5_H_ #define _SYS_MD5_H_ /* MD5 context. */ typedef struct MD5Context { u_int32_t state[4]; /* state (ABCD) */ u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } MD5_CTX; #include __BEGIN_DECLS void MD5Init (MD5_CTX *); void MD5Update (MD5_CTX *, const unsigned char *, unsigned int); void MD5Pad (MD5_CTX *); void MD5Final (unsigned char [16], MD5_CTX *); char * MD5End(MD5_CTX *, char *); char * MD5File(const char *, char *); char * MD5FileChunk(const char *, char *, off_t, off_t); char * MD5Data(const unsigned char *, unsigned int, char *); #ifdef _KERNEL -void MD5Transform __P((u_int32_t [4], const unsigned char [64])); +void MD5Transform(u_int32_t [4], const unsigned char [64]); #endif __END_DECLS #endif /* _SYS_MD5_H_ */ Index: head/sys/sys/mman.h =================================================================== --- head/sys/sys/mman.h (revision 92718) +++ head/sys/sys/mman.h (revision 92719) @@ -1,162 +1,162 @@ /*- * 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 * $FreeBSD$ */ #ifndef _SYS_MMAN_H_ #define _SYS_MMAN_H_ #include /* * Inheritance for minherit() */ #define INHERIT_SHARE 0 #define INHERIT_COPY 1 #define INHERIT_NONE 2 /* * 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_RESERVED0080 0x0080 /* previously misimplemented MAP_INHERIT */ #define MAP_RESERVED0100 0x0100 /* previously unimplemented MAP_NOEXTEND */ #define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ #define MAP_STACK 0x0400 /* region grows down, like a stack */ #define MAP_NOSYNC 0x0800 /* page to but do not sync underlying file */ /* * Extended flags */ #define MAP_NOCORE 0x00020000 /* dont include these pages in a coredump */ #ifdef _P1003_1B_VISIBLE /* * Process memory locking */ #define MCL_CURRENT 0x0001 /* Lock only current memory */ #define MCL_FUTURE 0x0002 /* Lock all future memory as well */ #endif /* _P1003_1B_VISIBLE */ /* * Error return from mmap() */ #define MAP_FAILED ((void *)-1) /* * msync() flags */ #define MS_SYNC 0x0000 /* msync synchronously */ #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 */ #define MADV_NOSYNC 6 /* try to avoid flushes to physical media */ #define MADV_AUTOSYNC 7 /* revert to default flushing strategy */ #define MADV_NOCORE 8 /* do not include these pages in a core file */ #define MADV_CORE 9 /* revert to including pages in a core file */ /* * 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 #ifdef _P1003_1B_VISIBLE -int mlockall __P((int)); -int munlockall __P((void)); -int shm_open __P((const char *, int, mode_t)); -int shm_unlink __P((const char *)); +int mlockall(int); +int munlockall(void); +int shm_open(const char *, int, mode_t); +int shm_unlink(const char *); #endif /* _P1003_1B_VISIBLE */ -int mlock __P((const void *, size_t)); +int mlock(const void *, size_t); #ifndef _MMAP_DECLARED #define _MMAP_DECLARED -void * mmap __P((void *, size_t, int, int, int, off_t)); +void * mmap(void *, size_t, int, int, int, off_t); #endif -int mprotect __P((const void *, size_t, int)); -int msync __P((void *, size_t, int)); -int munlock __P((const void *, size_t)); -int munmap __P((void *, size_t)); +int mprotect(const void *, size_t, int); +int msync(void *, size_t, int); +int munlock(const void *, size_t); +int munmap(void *, size_t); #ifndef _POSIX_SOURCE -int madvise __P((void *, size_t, int)); -int mincore __P((const void *, size_t, char *)); -int minherit __P((void *, size_t, int)); +int madvise(void *, size_t, int); +int mincore(const void *, size_t, char *); +int minherit(void *, size_t, int); #endif __END_DECLS #endif /* !_KERNEL */ #endif Index: head/sys/sys/mount.h =================================================================== --- head/sys/sys/mount.h (revision 92718) +++ head/sys/sys/mount.h (revision 92719) @@ -1,506 +1,506 @@ /* * Copyright (c) 1989, 1991, 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. * * @(#)mount.h 8.21 (Berkeley) 5/20/95 * $FreeBSD$ */ #ifndef _SYS_MOUNT_H_ #define _SYS_MOUNT_H_ /* * XXX - compatability until lockmgr() goes away or all the #includes are * updated. */ #include #include #include #ifdef _KERNEL #include #include #endif struct netcred; struct netexport; typedef struct fsid { int32_t val[2]; } fsid_t; /* file system id type */ /* * File identifier. * These are unique per filesystem on a single machine. */ #define MAXFIDSZ 16 struct fid { u_short fid_len; /* length of data in bytes */ u_short fid_reserved; /* force longword alignment */ char fid_data[MAXFIDSZ]; /* data (variable length) */ }; /* * file system statistics */ #define MFSNAMELEN 16 /* length of fs type name, including null */ #if defined(__i386__) || defined(__powerpc__) #define MNAMELEN 80 /* length of buffer for returned name */ #endif #if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) #define MNAMELEN 72 /* length of buffer for returned name */ #endif struct statfs { long f_spare2; /* placeholder */ long f_bsize; /* fundamental file system block size */ long f_iosize; /* optimal transfer block size */ long f_blocks; /* total data blocks in file system */ long f_bfree; /* free blocks in fs */ long f_bavail; /* free blocks avail to non-superuser */ long f_files; /* total file nodes in file system */ long f_ffree; /* free file nodes in fs */ fsid_t f_fsid; /* file system id */ uid_t f_owner; /* user that mounted the filesystem */ int f_type; /* type of filesystem */ int f_flags; /* copy of mount exported flags */ long f_syncwrites; /* count of sync writes since mount */ long f_asyncwrites; /* count of async writes since mount */ char f_fstypename[MFSNAMELEN]; /* fs type name */ char f_mntonname[MNAMELEN]; /* directory on which mounted */ long f_syncreads; /* count of sync reads since mount */ long f_asyncreads; /* count of async reads since mount */ short f_spares1; /* unused spare */ char f_mntfromname[MNAMELEN];/* mounted filesystem */ short f_spares2; /* unused spare */ long f_spare[2]; /* unused spare */ }; #ifdef _KERNEL /* * Structure per mounted file system. Each mounted file system has an * array of operations and an instance record. The file systems are * put on a doubly linked list. * * NOTE: mnt_nvnodelist and mnt_reservedvnlist. At the moment vnodes * are linked into mnt_nvnodelist. At some point in the near future the * vnode list will be split into a 'dirty' and 'clean' list. mnt_nvnodelist * will become the dirty list and mnt_reservedvnlist will become the 'clean' * list. Filesystem kld's syncing code should remain compatible since * they only need to scan the dirty vnode list (nvnodelist -> dirtyvnodelist). */ TAILQ_HEAD(vnodelst, vnode); struct mount { TAILQ_ENTRY(mount) mnt_list; /* mount list */ struct vfsops *mnt_op; /* operations on fs */ struct vfsconf *mnt_vfc; /* configuration info */ struct vnode *mnt_vnodecovered; /* vnode we mounted on */ struct vnode *mnt_syncer; /* syncer vnode */ struct vnodelst mnt_nvnodelist; /* list of vnodes this mount */ struct vnodelst mnt_reservedvnlist; /* (future) dirty vnode list */ struct lock mnt_lock; /* mount structure lock */ int mnt_writeopcount; /* write syscalls in progress */ int mnt_flag; /* flags shared with user */ int mnt_kern_flag; /* kernel only flags */ int mnt_maxsymlinklen; /* max size of short symlink */ struct statfs mnt_stat; /* cache of filesystem stats */ qaddr_t mnt_data; /* private data */ time_t mnt_time; /* last time written*/ u_int mnt_iosize_max; /* max IO request size */ struct netexport *mnt_export; /* export list */ }; #endif /* _KERNEL */ /* * User specifiable flags. */ #define MNT_RDONLY 0x00000001 /* read only filesystem */ #define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */ #define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */ #define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */ #define MNT_NODEV 0x00000010 /* don't interpret special files */ #define MNT_UNION 0x00000020 /* union with underlying filesystem */ #define MNT_ASYNC 0x00000040 /* file system written asynchronously */ #define MNT_SUIDDIR 0x00100000 /* special handling of SUID on dirs */ #define MNT_SOFTDEP 0x00200000 /* soft updates being done */ #define MNT_NOSYMFOLLOW 0x00400000 /* do not follow symlinks */ #define MNT_JAILDEVFS 0x02000000 /* Jail friendly DEVFS behaviour */ #define MNT_MULTILABEL 0x04000000 /* MAC support for individual objects */ #define MNT_NOATIME 0x10000000 /* disable update of file access time */ #define MNT_NOCLUSTERR 0x40000000 /* disable cluster read */ #define MNT_NOCLUSTERW 0x80000000 /* disable cluster write */ /* * NFS export related mount flags. */ #define MNT_EXRDONLY 0x00000080 /* exported read only */ #define MNT_EXPORTED 0x00000100 /* file system is exported */ #define MNT_DEFEXPORTED 0x00000200 /* exported to the world */ #define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */ #define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */ #define MNT_EXPUBLIC 0x20000000 /* public export (WebNFS) */ /* * Flags set by internal operations, * but visible to the user. * XXX some of these are not quite right.. (I've never seen the root flag set) */ #define MNT_LOCAL 0x00001000 /* filesystem is stored locally */ #define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */ #define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */ #define MNT_USER 0x00008000 /* mounted by a user */ #define MNT_IGNORE 0x00800000 /* do not show entry in df */ /* * Mask of flags that are visible to statfs() * XXX I think that this could now become (~(MNT_CMDFLAGS)) * but the 'mount' program may need changing to handle this. */ #define MNT_VISFLAGMASK (MNT_RDONLY | MNT_SYNCHRONOUS | MNT_NOEXEC | \ MNT_NOSUID | MNT_NODEV | MNT_UNION | \ MNT_ASYNC | MNT_EXRDONLY | MNT_EXPORTED | \ MNT_DEFEXPORTED | MNT_EXPORTANON| MNT_EXKERB | \ MNT_LOCAL | MNT_USER | MNT_QUOTA | \ MNT_ROOTFS | MNT_NOATIME | MNT_NOCLUSTERR| \ MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP | \ MNT_IGNORE | MNT_EXPUBLIC | MNT_NOSYMFOLLOW | \ MNT_JAILDEVFS | MNT_MULTILABEL) /* Mask of flags that can be updated */ #define MNT_UPDATEMASK (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV | \ MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | \ MNT_NOATIME | \ MNT_NOSYMFOLLOW | MNT_IGNORE | MNT_JAILDEVFS | \ MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR | \ MNT_MULTILABEL) /* * External filesystem command modifier flags. * Unmount can use the MNT_FORCE flag. * XXX These are not STATES and really should be somewhere else. */ #define MNT_UPDATE 0x00010000 /* not a real mount, just an update */ #define MNT_DELEXPORT 0x00020000 /* delete export host lists */ #define MNT_RELOAD 0x00040000 /* reload filesystem data */ #define MNT_FORCE 0x00080000 /* force unmount or readonly change */ #define MNT_SNAPSHOT 0x01000000 /* snapshot the filesystem */ #define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \ MNT_FORCE | MNT_SNAPSHOT) /* * Still available */ #define MNT_SPARE3 0x08000000 /* * Internal filesystem control flags stored in mnt_kern_flag. * * MNTK_UNMOUNT locks the mount entry so that name lookup cannot proceed * past the mount point. This keeps the subtree stable during mounts * and unmounts. */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_WANTRDWR 0x04000000 /* upgrade to read/write requested */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ #define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */ /* * Sysctl CTL_VFS definitions. * * Second level identifier specifies which filesystem. Second level * identifier VFS_VFSCONF returns information about all filesystems. * Second level identifier VFS_GENERIC is non-terminal. */ #define VFS_VFSCONF 0 /* get configured filesystems */ #define VFS_GENERIC 0 /* generic filesystem information */ /* * Third level identifiers for VFS_GENERIC are given below; third * level identifiers for specific filesystems are given in their * mount specific header files. */ #define VFS_MAXTYPENUM 1 /* int: highest defined filesystem type */ #define VFS_CONF 2 /* struct: vfsconf for filesystem given as next argument */ /* * Flags for various system call interfaces. * * waitfor flags to vfs_sync() and getfsstat() */ #define MNT_WAIT 1 /* synchronously wait for I/O to complete */ #define MNT_NOWAIT 2 /* start all I/O, but do not wait for it */ #define MNT_LAZY 3 /* push data not written by filesystem syncer */ /* * Generic file handle */ struct fhandle { fsid_t fh_fsid; /* File system id of mount point */ struct fid fh_fid; /* File sys specific id */ }; typedef struct fhandle fhandle_t; /* * Export arguments for local filesystem mount calls. */ struct export_args { int ex_flags; /* export related flags */ uid_t ex_root; /* mapping for root uid */ struct xucred ex_anon; /* mapping for anonymous user */ struct sockaddr *ex_addr; /* net address to which exported */ u_char ex_addrlen; /* and the net address length */ struct sockaddr *ex_mask; /* mask of valid bits in saddr */ u_char ex_masklen; /* and the smask length */ char *ex_indexfile; /* index file for WebNFS URLs */ }; /* * Structure holding information for a publicly exported filesystem * (WebNFS). Currently the specs allow just for one such filesystem. */ struct nfs_public { int np_valid; /* Do we hold valid information */ fhandle_t np_handle; /* Filehandle for pub fs (internal) */ struct mount *np_mount; /* Mountpoint of exported fs */ char *np_index; /* Index file */ }; /* * Filesystem configuration information. One of these exists for each * type of filesystem supported by the kernel. These are searched at * mount time to identify the requested filesystem. */ struct vfsconf { struct vfsops *vfc_vfsops; /* filesystem operations vector */ char vfc_name[MFSNAMELEN]; /* filesystem type name */ int vfc_typenum; /* historic filesystem type number */ int vfc_refcount; /* number mounted of this type */ int vfc_flags; /* permanent flags */ struct vfsconf *vfc_next; /* next in list */ }; struct ovfsconf { void *vfc_vfsops; char vfc_name[32]; int vfc_index; int vfc_refcount; int vfc_flags; }; /* * NB: these flags refer to IMPLEMENTATION properties, not properties of * any actual mounts; i.e., it does not make sense to change the flags. */ #define VFCF_STATIC 0x00010000 /* statically compiled into kernel */ #define VFCF_NETWORK 0x00020000 /* may get data over the network */ #define VFCF_READONLY 0x00040000 /* writes are not implemented */ #define VFCF_SYNTHETIC 0x00080000 /* data does not represent real files */ #define VFCF_LOOPBACK 0x00100000 /* aliases some other mounted FS */ #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode*/ #ifdef _KERNEL #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_MOUNT); #endif extern int maxvfsconf; /* highest defined filesystem type */ extern int nfs_mount_type; /* vfc_typenum for nfs, or -1 */ extern struct vfsconf *vfsconf; /* head of list of filesystem types */ /* * Operations supported on mounted file system. */ #ifdef __STDC__ struct nameidata; struct mbuf; struct mount_args; #endif struct vfsops { - int (*vfs_mount) __P((struct mount *mp, char *path, caddr_t data, - struct nameidata *ndp, struct thread *td)); - int (*vfs_start) __P((struct mount *mp, int flags, - struct thread *td)); - int (*vfs_unmount) __P((struct mount *mp, int mntflags, - struct thread *td)); - int (*vfs_root) __P((struct mount *mp, struct vnode **vpp)); - int (*vfs_quotactl) __P((struct mount *mp, int cmds, uid_t uid, - caddr_t arg, struct thread *td)); - int (*vfs_statfs) __P((struct mount *mp, struct statfs *sbp, - struct thread *td)); - int (*vfs_sync) __P((struct mount *mp, int waitfor, - struct ucred *cred, struct thread *td)); - int (*vfs_vget) __P((struct mount *mp, ino_t ino, int flags, - struct vnode **vpp)); - int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp, - struct vnode **vpp)); - int (*vfs_checkexp) __P((struct mount *mp, struct sockaddr *nam, - int *extflagsp, struct ucred **credanonp)); - int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp)); - int (*vfs_init) __P((struct vfsconf *)); - int (*vfs_uninit) __P((struct vfsconf *)); - int (*vfs_extattrctl) __P((struct mount *mp, int cmd, + int (*vfs_mount) (struct mount *mp, char *path, caddr_t data, + struct nameidata *ndp, struct thread *td); + int (*vfs_start) (struct mount *mp, int flags, + struct thread *td); + int (*vfs_unmount) (struct mount *mp, int mntflags, + struct thread *td); + int (*vfs_root) (struct mount *mp, struct vnode **vpp); + int (*vfs_quotactl) (struct mount *mp, int cmds, uid_t uid, + caddr_t arg, struct thread *td); + int (*vfs_statfs) (struct mount *mp, struct statfs *sbp, + struct thread *td); + int (*vfs_sync) (struct mount *mp, int waitfor, + struct ucred *cred, struct thread *td); + int (*vfs_vget) (struct mount *mp, ino_t ino, int flags, + struct vnode **vpp); + int (*vfs_fhtovp) (struct mount *mp, struct fid *fhp, + struct vnode **vpp); + int (*vfs_checkexp)(struct mount *mp, struct sockaddr *nam, + int *extflagsp, struct ucred **credanonp); + int (*vfs_vptofh) (struct vnode *vp, struct fid *fhp); + int (*vfs_init) (struct vfsconf *); + int (*vfs_uninit) (struct vfsconf *); + int (*vfs_extattrctl)(struct mount *mp, int cmd, struct vnode *filename_vp, int attrnamespace, const char *attrname, - struct thread *td)); + struct thread *td); }; #define VFS_MOUNT(MP, PATH, DATA, NDP, P) \ (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P) #define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P) #define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P) #define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP) #define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P) #define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P) #define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P) #define VFS_VGET(MP, INO, FLAGS, VPP) \ (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) #define VFS_FHTOVP(MP, FIDP, VPP) \ (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP) #define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP) #define VFS_CHECKEXP(MP, NAM, EXFLG, CRED) \ (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED) #define VFS_EXTATTRCTL(MP, C, FN, NS, N, P) \ (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N, P) #include #define VFS_SET(vfsops, fsname, flags) \ static struct vfsconf fsname ## _vfsconf = { \ &vfsops, \ #fsname, \ -1, \ 0, \ flags \ }; \ static moduledata_t fsname ## _mod = { \ #fsname, \ vfs_modevent, \ & fsname ## _vfsconf \ }; \ DECLARE_MODULE(fsname, fsname ## _mod, SI_SUB_VFS, SI_ORDER_MIDDLE) extern char *mountrootfsname; /* * exported vnode operations */ -int dounmount __P((struct mount *, int, struct thread *td)); -int vfs_mount __P((struct thread *td, const char *type, char *path, - int flags, void *data)); +int dounmount(struct mount *, int, struct thread *td); +int vfs_mount (struct thread *td, const char *type, char *path, + int flags, void *data); int vfs_setpublicfs /* set publicly exported fs */ - __P((struct mount *, struct netexport *, struct export_args *)); -int vfs_lock __P((struct mount *)); /* lock a vfs */ -void vfs_msync __P((struct mount *, int)); -void vfs_unlock __P((struct mount *)); /* unlock a vfs */ -int vfs_busy __P((struct mount *, int, struct mtx *, struct thread *td)); + (struct mount *, struct netexport *, struct export_args *); +int vfs_lock(struct mount *); /* lock a vfs */ +void vfs_msync(struct mount *, int); +void vfs_unlock(struct mount *); /* unlock a vfs */ +int vfs_busy(struct mount *, int, struct mtx *, struct thread *td); int vfs_export /* process mount export info */ - __P((struct mount *, struct export_args *)); + (struct mount *, struct export_args *); struct netcred *vfs_export_lookup /* lookup host in fs export list */ - __P((struct mount *, struct sockaddr *)); -int vfs_allocate_syncvnode __P((struct mount *)); -void vfs_getnewfsid __P((struct mount *)); -dev_t vfs_getrootfsid __P((struct mount *)); -struct mount *vfs_getvfs __P((fsid_t *)); /* return vfs given fsid */ -int vfs_modevent __P((module_t, int, void *)); -int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */ -void vfs_mountroot __P((void *)); /* mount our root filesystem */ -int vfs_rootmountalloc __P((char *, char *, struct mount **)); -void vfs_unbusy __P((struct mount *, struct thread *td)); -void vfs_unmountall __P((void)); -int vfs_register __P((struct vfsconf *)); -int vfs_unregister __P((struct vfsconf *)); + (struct mount *, struct sockaddr *); +int vfs_allocate_syncvnode(struct mount *); +void vfs_getnewfsid(struct mount *); +dev_t vfs_getrootfsid(struct mount *); +struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */ +int vfs_modevent(module_t, int, void *); +int vfs_mountedon(struct vnode *); /* is a vfs mounted on vp */ +void vfs_mountroot(void *); /* mount our root filesystem */ +int vfs_rootmountalloc(char *, char *, struct mount **); +void vfs_unbusy(struct mount *, struct thread *td); +void vfs_unmountall(void); +int vfs_register(struct vfsconf *); +int vfs_unregister(struct vfsconf *); extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ extern struct mtx mountlist_mtx; extern struct nfs_public nfs_pub; /* * Declarations for these vfs default operations are located in * kern/vfs_default.c, they should be used instead of making "dummy" * functions or casting entries in the VFS op table to "enopnotsupp()". */ -int vfs_stdmount __P((struct mount *mp, char *path, caddr_t data, - struct nameidata *ndp, struct thread *td)); -int vfs_stdstart __P((struct mount *mp, int flags, struct thread *td)); -int vfs_stdunmount __P((struct mount *mp, int mntflags, struct thread *td)); -int vfs_stdroot __P((struct mount *mp, struct vnode **vpp)); -int vfs_stdquotactl __P((struct mount *mp, int cmds, uid_t uid, - caddr_t arg, struct thread *td)); -int vfs_stdstatfs __P((struct mount *mp, struct statfs *sbp, struct thread *td)); -int vfs_stdsync __P((struct mount *mp, int waitfor, struct ucred *cred, - struct thread *td)); -int vfs_stdvget __P((struct mount *mp, ino_t ino, int, struct vnode **vpp)); -int vfs_stdfhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp)); -int vfs_stdcheckexp __P((struct mount *mp, struct sockaddr *nam, - int *extflagsp, struct ucred **credanonp)); -int vfs_stdvptofh __P((struct vnode *vp, struct fid *fhp)); -int vfs_stdinit __P((struct vfsconf *)); -int vfs_stduninit __P((struct vfsconf *)); -int vfs_stdextattrctl __P((struct mount *mp, int cmd, +int vfs_stdmount(struct mount *mp, char *path, caddr_t data, + struct nameidata *ndp, struct thread *td); +int vfs_stdstart(struct mount *mp, int flags, struct thread *td); +int vfs_stdunmount(struct mount *mp, int mntflags, struct thread *td); +int vfs_stdroot(struct mount *mp, struct vnode **vpp); +int vfs_stdquotactl(struct mount *mp, int cmds, uid_t uid, + caddr_t arg, struct thread *td); +int vfs_stdstatfs(struct mount *mp, struct statfs *sbp, struct thread *td); +int vfs_stdsync(struct mount *mp, int waitfor, struct ucred *cred, + struct thread *td); +int vfs_stdvget(struct mount *mp, ino_t ino, int, struct vnode **vpp); +int vfs_stdfhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp); +int vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, + int *extflagsp, struct ucred **credanonp); +int vfs_stdvptofh(struct vnode *vp, struct fid *fhp); +int vfs_stdinit(struct vfsconf *); +int vfs_stduninit(struct vfsconf *); +int vfs_stdextattrctl(struct mount *mp, int cmd, struct vnode *filename_vp, int attrnamespace, const char *attrname, - struct thread *td)); + struct thread *td); /* XXX - these should be indirect functions!!! */ -int softdep_process_worklist __P((struct mount *)); -int softdep_fsync __P((struct vnode *)); +int softdep_process_worklist(struct mount *); +int softdep_fsync(struct vnode *); #else /* !_KERNEL */ #include struct stat; __BEGIN_DECLS -int fhopen __P((const struct fhandle *, int)); -int fhstat __P((const struct fhandle *, struct stat *)); -int fhstatfs __P((const struct fhandle *, struct statfs *)); -int fstatfs __P((int, struct statfs *)); -int getfh __P((const char *, fhandle_t *)); -int getfsstat __P((struct statfs *, long, int)); -int getmntinfo __P((struct statfs **, int)); -int mount __P((const char *, const char *, int, void *)); -int statfs __P((const char *, struct statfs *)); -int unmount __P((const char *, int)); +int fhopen(const struct fhandle *, int); +int fhstat(const struct fhandle *, struct stat *); +int fhstatfs(const struct fhandle *, struct statfs *); +int fstatfs(int, struct statfs *); +int getfh(const char *, fhandle_t *); +int getfsstat(struct statfs *, long, int); +int getmntinfo(struct statfs **, int); +int mount(const char *, const char *, int, void *); +int statfs(const char *, struct statfs *); +int unmount(const char *, int); /* C library stuff */ -void endvfsent __P((void)); -struct ovfsconf *getvfsbyname __P((const char *)); -struct ovfsconf *getvfsbytype __P((int)); -struct ovfsconf *getvfsent __P((void)); +void endvfsent(void); +struct ovfsconf *getvfsbyname(const char *); +struct ovfsconf *getvfsbytype(int); +struct ovfsconf *getvfsent(void); #define getvfsbyname new_getvfsbyname -int new_getvfsbyname __P((const char *, struct vfsconf *)); -void setvfsent __P((int)); -int vfsisloadable __P((const char *)); -int vfsload __P((const char *)); +int new_getvfsbyname(const char *, struct vfsconf *); +void setvfsent(int); +int vfsisloadable(const char *); +int vfsload(const char *); __END_DECLS #endif /* _KERNEL */ #endif /* !_SYS_MOUNT_H_ */ Index: head/sys/sys/msg.h =================================================================== --- head/sys/sys/msg.h (revision 92718) +++ head/sys/sys/msg.h (revision 92719) @@ -1,106 +1,106 @@ /* $FreeBSD$ */ /* $NetBSD: msg.h,v 1.4 1994/06/29 06:44:43 cgd Exp $ */ /* * SVID compatible msg.h file * * Author: Daniel Boulet * * Copyright 1993 Daniel Boulet and RTMX Inc. * * This system call was implemented by Daniel Boulet under contract from RTMX. * * Redistribution and use in source forms, with and without modification, * are permitted provided that this entire comment appears intact. * * Redistribution in binary form may occur without any restrictions. * Obviously, it would be nice if you gave credit where credit is due * but requiring it would be too onerous. * * This software is provided ``AS IS'' without any warranties of any kind. */ #ifndef _SYS_MSG_H_ #define _SYS_MSG_H_ #include /* * The MSG_NOERROR identifier value, the msqid_ds struct and the msg struct * are as defined by the SV API Intel 386 Processor Supplement. */ #define MSG_NOERROR 010000 /* don't complain about too long msgs */ struct msg; struct msqid_ds { struct ipc_perm msg_perm; /* msg queue permission bits */ struct msg *msg_first; /* first message in the queue */ struct msg *msg_last; /* last message in the queue */ u_long msg_cbytes; /* number of bytes in use on the queue */ u_long msg_qnum; /* number of msgs in the queue */ u_long msg_qbytes; /* max # of bytes on the queue */ pid_t msg_lspid; /* pid of last msgsnd() */ pid_t msg_lrpid; /* pid of last msgrcv() */ time_t msg_stime; /* time of last msgsnd() */ long msg_pad1; time_t msg_rtime; /* time of last msgrcv() */ long msg_pad2; time_t msg_ctime; /* time of last msgctl() */ long msg_pad3; long msg_pad4[4]; }; /* * Structure describing a message. The SVID doesn't suggest any * particular name for this structure. There is a reference in the * msgop man page that reads "The structure mymsg is an example of what * this user defined buffer might look like, and includes the following * members:". This sentence is followed by two lines equivalent * to the mtype and mtext field declarations below. It isn't clear * if "mymsg" refers to the naem of the structure type or the name of an * instance of the structure... */ struct mymsg { long mtype; /* message type (+ve integer) */ char mtext[1]; /* message body */ }; #ifdef _KERNEL /* * Based on the configuration parameters described in an SVR2 (yes, two) * config(1m) man page. * * Each message is broken up and stored in segments that are msgssz bytes * long. For efficiency reasons, this should be a power of two. Also, * it doesn't make sense if it is less than 8 or greater than about 256. * Consequently, msginit in kern/sysv_msg.c checks that msgssz is a power of * two between 8 and 1024 inclusive (and panic's if it isn't). */ struct msginfo { int msgmax, /* max chars in a message */ msgmni, /* max message queue identifiers */ msgmnb, /* max chars in a queue */ msgtql, /* max messages in system */ msgssz, /* size of a message segment (see notes above) */ msgseg; /* number of message segments */ }; extern struct msginfo msginfo; #endif #ifndef _KERNEL #include __BEGIN_DECLS -int msgsys __P((int, ...)); -int msgctl __P((int, int, struct msqid_ds *)); -int msgget __P((key_t, int)); -int msgsnd __P((int, void *, size_t, int)); -int msgrcv __P((int, void*, size_t, long, int)); +int msgsys(int, ...); +int msgctl(int, int, struct msqid_ds *); +int msgget(key_t, int); +int msgsnd(int, void *, size_t, int); +int msgrcv(int, void*, size_t, long, int); __END_DECLS #endif #endif /* !_SYS_MSG_H_ */ Index: head/sys/sys/msgbuf.h =================================================================== --- head/sys/sys/msgbuf.h (revision 92718) +++ head/sys/sys/msgbuf.h (revision 92719) @@ -1,60 +1,60 @@ /* * Copyright (c) 1981, 1984, 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. * * @(#)msgbuf.h 8.1 (Berkeley) 6/2/93 * $FreeBSD$ */ #ifndef _SYS_MSGBUF_H_ #define _SYS_MSGBUF_H_ struct msgbuf { #define MSG_MAGIC 0x063062 unsigned int msg_magic; unsigned int msg_size; /* size of buffer area */ unsigned int msg_bufx; /* write pointer */ unsigned int msg_bufr; /* read pointer */ char * msg_ptr; /* pointer to buffer */ }; #ifdef _KERNEL extern int msgbuftrigger; extern struct msgbuf *msgbufp; -void msgbufinit __P((void *ptr, size_t size)); +void msgbufinit (void *ptr, size_t size); #if !defined(MSGBUF_SIZE) #define MSGBUF_SIZE 32768 #endif #endif #endif Index: head/sys/sys/namei.h =================================================================== --- head/sys/sys/namei.h (revision 92718) +++ head/sys/sys/namei.h (revision 92719) @@ -1,211 +1,211 @@ /* * Copyright (c) 1985, 1989, 1991, 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. * * @(#)namei.h 8.5 (Berkeley) 1/9/95 * $FreeBSD$ */ #ifndef _SYS_NAMEI_H_ #define _SYS_NAMEI_H_ #include #include struct componentname { /* * Arguments to lookup. */ u_long cn_nameiop; /* namei operation */ u_long cn_flags; /* flags to namei */ struct thread *cn_thread;/* thread requesting lookup */ struct ucred *cn_cred; /* credentials */ /* * Shared between lookup and commit routines. */ char *cn_pnbuf; /* pathname buffer */ char *cn_nameptr; /* pointer to looked up name */ long cn_namelen; /* length of looked up component */ long cn_consume; /* chars to consume in lookup() */ }; /* * Encapsulation of namei parameters. */ struct nameidata { /* * Arguments to namei/lookup. */ const char *ni_dirp; /* pathname pointer */ enum uio_seg ni_segflg; /* location of pathname */ /* u_long ni_nameiop; namei operation */ /* u_long ni_flags; flags to namei */ /* struct proc *ni_proc; process requesting lookup */ /* * Arguments to lookup. */ /* struct ucred *ni_cred; credentials */ struct vnode *ni_startdir; /* starting directory */ struct vnode *ni_rootdir; /* logical root directory */ struct vnode *ni_topdir; /* logical top directory */ /* * Results: returned from/manipulated by lookup */ struct vnode *ni_vp; /* vnode of result */ struct vnode *ni_dvp; /* vnode of intermediate directory */ /* * Shared between namei and lookup/commit routines. */ size_t ni_pathlen; /* remaining chars in path */ char *ni_next; /* next location in pathname */ u_long ni_loopcnt; /* count of symlinks encountered */ /* * Lookup parameters: this structure describes the subset of * information from the nameidata structure that is passed * through the VOP interface. */ struct componentname ni_cnd; }; #ifdef _KERNEL /* * namei operations */ #define LOOKUP 0 /* perform name lookup only */ #define CREATE 1 /* setup for file creation */ #define DELETE 2 /* setup for file deletion */ #define RENAME 3 /* setup for file renaming */ #define OPMASK 3 /* mask for operation */ /* * namei operational modifier flags, stored in ni_cnd.flags */ #define LOCKLEAF 0x0004 /* lock inode on return */ #define LOCKPARENT 0x0008 /* want parent vnode returned locked */ #define WANTPARENT 0x0010 /* want parent vnode returned unlocked */ #define NOCACHE 0x0020 /* name must not be left in cache */ #define FOLLOW 0x0040 /* follow symbolic links */ #define NOOBJ 0x0080 /* don't create object */ #define LOCKSHARED 0x0100 /* Shared lock leaf */ #define NOFOLLOW 0x0000 /* do not follow symbolic links (pseudo) */ #define MODMASK 0x01fc /* mask of operational modifiers */ /* * Namei parameter descriptors. * * SAVENAME may be set by either the callers of namei or by VOP_LOOKUP. * If the caller of namei sets the flag (for example execve wants to * know the name of the program that is being executed), then it must * free the buffer. If VOP_LOOKUP sets the flag, then the buffer must * be freed by either the commit routine or the VOP_ABORT routine. * SAVESTART is set only by the callers of namei. It implies SAVENAME * plus the addition of saving the parent directory that contains the * name in ni_startdir. It allows repeated calls to lookup for the * name being sought. The caller is responsible for releasing the * buffer and for vrele'ing ni_startdir. */ #define RDONLY 0x000200 /* lookup with read-only semantics */ #define HASBUF 0x000400 /* has allocated pathname buffer */ #define SAVENAME 0x000800 /* save pathname buffer */ #define SAVESTART 0x001000 /* save starting directory */ #define ISDOTDOT 0x002000 /* current component name is .. */ #define MAKEENTRY 0x004000 /* entry is to be added to name cache */ #define ISLASTCN 0x008000 /* this is last component of pathname */ #define ISSYMLINK 0x010000 /* symlink needs interpretation */ #define ISWHITEOUT 0x020000 /* found whiteout */ #define DOWHITEOUT 0x040000 /* do whiteouts */ #define WILLBEDIR 0x080000 /* new files will be dirs; allow trailing / */ #define ISUNICODE 0x100000 /* current component name is unicode*/ #define PDIRUNLOCK 0x200000 /* file system lookup() unlocked parent dir */ #define NOCROSSMOUNT 0x400000 /* do not cross mount points */ #define PARAMASK 0x3ffe00 /* mask of parameter descriptors */ /* * Initialization of an nameidata structure. */ -static void NDINIT __P((struct nameidata *, u_long, u_long, enum uio_seg, - const char *, struct thread *)); +static void NDINIT(struct nameidata *, u_long, u_long, enum uio_seg, + const char *, struct thread *); static __inline void #if defined(__STDC__) || defined(__cplusplus) NDINIT(struct nameidata *ndp, u_long op, u_long flags, enum uio_seg segflg, const char *namep, struct thread *td) #else NDINIT(ndp, op, flags, segflg, namep, td) struct nameidata *ndp; u_long op, flags; enum uio_seg segflg; const char *namep; struct thread *td; #endif { ndp->ni_cnd.cn_nameiop = op; ndp->ni_cnd.cn_flags = flags; ndp->ni_segflg = segflg; ndp->ni_dirp = namep; ndp->ni_cnd.cn_thread = td; } #define NDF_NO_DVP_RELE 0x00000001 #define NDF_NO_DVP_UNLOCK 0x00000002 #define NDF_NO_DVP_PUT 0x00000003 #define NDF_NO_VP_RELE 0x00000004 #define NDF_NO_VP_UNLOCK 0x00000008 #define NDF_NO_VP_PUT 0x0000000c #define NDF_NO_STARTDIR_RELE 0x00000010 #define NDF_NO_FREE_PNBUF 0x00000020 #define NDF_ONLY_PNBUF (~NDF_NO_FREE_PNBUF) -void NDFREE __P((struct nameidata *, const uint)); +void NDFREE(struct nameidata *, const uint); -int namei __P((struct nameidata *ndp)); -int lookup __P((struct nameidata *ndp)); -int relookup __P((struct vnode *dvp, struct vnode **vpp, - struct componentname *cnp)); +int namei(struct nameidata *ndp); +int lookup(struct nameidata *ndp); +int relookup(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp); #endif /* * Stats on usefulness of namei caches. */ struct nchstats { long ncs_goodhits; /* hits that we can really use */ long ncs_neghits; /* negative hits that we can use */ long ncs_badhits; /* hits we must drop */ long ncs_falsehits; /* hits with id mismatch */ long ncs_miss; /* misses */ long ncs_long; /* long names that ignore cache */ long ncs_pass2; /* names found with passes == 2 */ long ncs_2passes; /* number of times we attempt it */ }; extern struct nchstats nchstats; #endif /* !_SYS_NAMEI_H_ */ Index: head/sys/sys/param.h =================================================================== --- head/sys/sys/param.h (revision 92718) +++ head/sys/sys/param.h (revision 92719) @@ -1,294 +1,294 @@ /*- * Copyright (c) 1982, 1986, 1989, 1993 * 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. * * @(#)param.h 8.3 (Berkeley) 4/4/95 * $FreeBSD$ */ #ifndef _SYS_PARAM_H_ #define _SYS_PARAM_H_ #define BSD 199506 /* System version (year & month). */ #define BSD4_3 1 #define BSD4_4 1 /* * __FreeBSD_version numbers are documented in the Porter's Handbook. * If you bump the version for any reason, you should update the documentation * there. */ #undef __FreeBSD_version #define __FreeBSD_version 500032 /* Master, propagated to newvers */ #ifndef NULL #define NULL 0 #endif #ifndef LOCORE #include #endif /* * Machine-independent constants (some used in following include files). * Redefined constants are from POSIX 1003.1 limits file. * * MAXCOMLEN should be >= sizeof(ac_comm) (see ) * MAXLOGNAME should be == UT_NAMESIZE+1 (see ) */ #include #define MAXCOMLEN 19 /* max command name remembered */ #define MAXINTERP 32 /* max interpreter file name length */ #define MAXLOGNAME 17 /* max login name length (incl. NUL) */ #define MAXUPRC CHILD_MAX /* max simultaneous processes */ #define NCARGS ARG_MAX /* max bytes for an exec function */ #define NGROUPS NGROUPS_MAX /* max number groups */ #define NOFILE OPEN_MAX /* max open files per process */ #define NOGROUP 65535 /* marker for empty group set member */ #define MAXHOSTNAMELEN 256 /* max hostname size */ #define SPECNAMELEN 15 /* max length of devicename */ /* More types and definitions used throughout the kernel. */ #ifdef _KERNEL #include #include #include #include #define FALSE 0 #define TRUE 1 #endif #ifndef _KERNEL /* Signals. */ #include #endif /* Machine type dependent parameters. */ #include #ifndef _KERNEL #include #endif #define PRIMASK 0x0ff #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ #define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */ #define NZERO 0 /* default "nice" */ #define NBPW sizeof(int) /* number of bytes per word (integer) */ #define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ #ifdef _KERNEL #define NODEV (dev_t)(-1) /* non-existent device */ #define NOUDEV (udev_t)(-1) /* non-existent device */ #define NOMAJ 256 /* non-existent device */ #else #define NODEV (dev_t)(-1) /* non-existent device */ #endif #define CBLOCK 128 /* Clist block size, must be a power of 2. */ #define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */ /* Data chars/clist. */ #define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE) #define CROUND (CBLOCK - 1) /* Clist rounding. */ /* * File system parameters and macros. * * MAXBSIZE - Filesystems are made out of blocks of at most MAXBSIZE bytes * per block. MAXBSIZE may be made larger without effecting * any existing filesystems as long as it does not exceed MAXPHYS, * and may be made smaller at the risk of not being able to use * filesystems which require a block size exceeding MAXBSIZE. * * BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the * minimum KVM memory reservation the kernel is willing to make. * Filesystems can of course request smaller chunks. Actual * backing memory uses a chunk size of a page (PAGE_SIZE). * * If you make BKVASIZE too small you risk seriously fragmenting * the buffer KVM map which may slow things down a bit. If you * make it too big the kernel will not be able to optimally use * the KVM memory reserved for the buffer cache and will wind * up with too-few buffers. * * The default is 16384, roughly 2x the block size used by a * normal UFS filesystem. */ #define MAXBSIZE 65536 /* must be power of 2 */ #define BKVASIZE 16384 /* must be power of 2 */ #define BKVAMASK (BKVASIZE-1) #define MAXFRAG 8 /* * MAXPATHLEN defines the longest permissible path length after expanding * symbolic links. It is used to allocate a temporary buffer from the buffer * pool in which to do the name expansion, hence should be a power of two, * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the * maximum number of symbolic links that may be expanded in a path name. * It should be set high enough to allow all legitimate uses, but halt * infinite loops reasonably quickly. */ #define MAXPATHLEN PATH_MAX #define MAXSYMLINKS 32 /* 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 rounddown(x, y) (((x)/(y))*(y)) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ #define powerof2(x) ((((x)-1)&(x))==0) /* Macros for min/max. */ #ifndef _KERNEL #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* * Basic byte order function prototypes for non-inline functions. * * XXX temporarily exposed to userland for bogus software. */ #ifndef _BYTEORDER_PROTOTYPED #define _BYTEORDER_PROTOTYPED __BEGIN_DECLS -__uint32_t htonl __P((__uint32_t)); -__uint16_t htons __P((__uint16_t)); -__uint32_t ntohl __P((__uint32_t)); -__uint16_t ntohs __P((__uint16_t)); +__uint32_t htonl(__uint32_t); +__uint16_t htons(__uint16_t); +__uint32_t ntohl(__uint32_t); +__uint16_t ntohs(__uint16_t); __END_DECLS #endif /* XXX temporarily exposed to userland for bogus software. */ #ifndef _BYTEORDER_FUNC_DEFINED #define _BYTEORDER_FUNC_DEFINED #define htonl(x) __htonl(x) #define htons(x) __htons(x) #define ntohl(x) __ntohl(x) #define ntohs(x) __ntohs(x) #endif /* !_BYTEORDER_FUNC_DEFINED */ #ifdef _KERNEL #define bswap16(x) __bswap16(x) #define bswap32(x) __bswap32(x) #define bswap64(x) __bswap64(x) #if BYTE_ORDER == LITTLE_ENDIAN #define htobe16(x) bswap16((x)) #define htobe32(x) bswap32((x)) #define htobe64(x) bswap64((x)) #define htole16(x) ((__uint16_t)(x)) #define htole32(x) ((__uint32_t)(x)) #define htole64(x) ((__uint64_t)(x)) #define be16toh(x) bswap16((x)) #define be32toh(x) bswap32((x)) #define be64toh(x) bswap64((x)) #define le16toh(x) ((__uint16_t)(x)) #define le32toh(x) ((__uint32_t)(x)) #define le64toh(x) ((__uint64_t)(x)) #else /* BYTE_ORDER != LITTLE_ENDIAN */ #define htobe16(x) ((__uint16_t)(x)) #define htobe32(x) ((__uint32_t)(x)) #define htobe64(x) ((__uint64_t)(x)) #define htole16(x) bswap16((x)) #define htole32(x) bswap32((x)) #define htole64(x) bswap64((x)) #define be16toh(x) ((__uint16_t)(x)) #define be32toh(x) ((__uint32_t)(x)) #define be64toh(x) ((__uint64_t)(x)) #define le16toh(x) bswap16((x)) #define le32toh(x) bswap32((x)) #define le64toh(x) bswap64((x)) #endif /* BYTE_ORDER */ #endif /* _KERNEL */ /* * Constants for setting the parameters of the kernel memory allocator. * * 2 ** MINBUCKET is the smallest unit of memory that will be * allocated. It must be at least large enough to hold a pointer. * * Units of memory less or equal to MAXALLOCSAVE will permanently * allocate physical memory; requests for these size pieces of * memory are quite fast. Allocations greater than MAXALLOCSAVE must * always allocate and free physical memory; requests for these * size allocations should be done infrequently as they will be slow. * * Constraints: PAGE_SIZE <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and * MAXALLOCSIZE must be a power of two. */ #if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) #define MINBUCKET 5 /* 5 => min allocation of 32 bytes */ #else #define MINBUCKET 4 /* 4 => min allocation of 16 bytes */ #endif #define MAXALLOCSAVE (2 * PAGE_SIZE) /* * Scale factor for scaled integers used to count %cpu time and load avgs. * * The number of CPU `tick's that map to a unique `%age' can be expressed * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that * can be calculated (assuming 32 bits) can be closely approximated using * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). * * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. */ #define FSHIFT 11 /* bits to right of fixed binary point */ #define FSCALE (1<> (PAGE_SHIFT - DEV_BSHIFT)) #define ctodb(db) /* calculates pages to devblks */ \ ((db) << (PAGE_SHIFT - DEV_BSHIFT)) #endif /* _SYS_PARAM_H_ */ Index: head/sys/sys/poll.h =================================================================== --- head/sys/sys/poll.h (revision 92718) +++ head/sys/sys/poll.h (revision 92719) @@ -1,111 +1,111 @@ /*- * Copyright (c) 1997 Peter Wemm * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_POLL_H_ #define _SYS_POLL_H_ /* * This file is intended to be compatible with the traditional poll.h. */ /* * This structure is passed as an array to poll(2). */ struct pollfd { int fd; /* which file descriptor to poll */ short events; /* events we are interested in */ short revents; /* events found on return */ }; /* * Requestable events. If poll(2) finds any of these set, they are * copied to revents on return. * XXX Note that FreeBSD doesn't make much distinction between POLLPRI * and POLLRDBAND since none of the file types have distinct priority * bands - and only some have an urgent "mode". * XXX Note POLLIN isn't really supported in true SVSV terms. Under SYSV * POLLIN includes all of normal, band and urgent data. Most poll handlers * on FreeBSD only treat it as "normal" data. */ #define POLLIN 0x0001 /* any readable data available */ #define POLLPRI 0x0002 /* OOB/Urgent readable data */ #define POLLOUT 0x0004 /* file descriptor is writeable */ #define POLLRDNORM 0x0040 /* non-OOB/URG data available */ #define POLLWRNORM POLLOUT /* no write type differentiation */ #define POLLRDBAND 0x0080 /* OOB/Urgent readable data */ #define POLLWRBAND 0x0100 /* OOB/Urgent data can be written */ /* * File extensions: * polling on a regular file might return one * of these events (currently only supported on UFS). */ #define POLLEXTEND 0x0200 /* file may have been extended */ #define POLLATTRIB 0x0400 /* file attributes may have changed */ #define POLLNLINK 0x0800 /* (un)link/rename may have happened */ #define POLLWRITE 0x1000 /* file's contents may have changed */ /* General FreeBSD extensions (currently only supported for sockets): */ #define POLLINIGNEOF 0x2000 /* POLLIN, except ignore EOF */ /* * These events are set if they occur regardless of whether they were * requested. */ #define POLLERR 0x0008 /* some poll error occurred */ #define POLLHUP 0x0010 /* file descriptor was "hung up" */ #define POLLNVAL 0x0020 /* requested events "invalid" */ #define POLLSTANDARD (POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\ POLLWRBAND|POLLERR|POLLHUP|POLLNVAL) /* * Request that poll() wait forever. * XXX in SYSV, this is defined in stropts.h, which is not included * by poll.h. */ #define INFTIM (-1) #ifndef _KERNEL #include __BEGIN_DECLS /* * XXX logically, poll() should be declared in , but SVR4 at * least has it here in . * XXX poll() has "unsigned long" nfds on SVR4, not unsigned as on the * other BSDs. */ -int poll __P((struct pollfd *_pfd, unsigned int _nfds, int _timeout)); +int poll(struct pollfd *_pfd, unsigned int _nfds, int _timeout); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_POLL_H_ */ Index: head/sys/sys/proc.h =================================================================== --- head/sys/sys/proc.h (revision 92718) +++ head/sys/sys/proc.h (revision 92719) @@ -1,777 +1,777 @@ /*- * Copyright (c) 1986, 1989, 1991, 1993 * 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. * * @(#)proc.h 8.15 (Berkeley) 5/19/95 * $FreeBSD$ */ #ifndef _SYS_PROC_H_ #define _SYS_PROC_H_ #include /* For struct callout. */ #include /* For struct klist. */ #include #include #include #include /* XXX */ #include #include #ifndef _KERNEL #include /* For structs itimerval, timeval. */ #else #include #endif #include #include /* Machine-dependent proc substruct. */ #include /* * One structure allocated per session. * * List of locks * (m) locked by s_mtx mtx * (ps) locked by pgrpsess_lock sx * (c) const until freeing */ struct session { int s_count; /* (m) Ref cnt; pgrps in session. */ struct proc *s_leader; /* (m, ps) Session leader. */ struct vnode *s_ttyvp; /* (m) Vnode of controlling terminal. */ struct tty *s_ttyp; /* (m) Controlling terminal. */ pid_t s_sid; /* (c) Session ID. */ /* (m) Setlogin() name: */ char s_login[roundup(MAXLOGNAME, sizeof(long))]; struct mtx s_mtx; /* Mutex to protect members */ }; /* * One structure allocated per process group. * * List of locks * (m) locked by pg_mtx mtx * (ps) locked by pgrpsess_lock sx * (c) const until freeing */ struct pgrp { LIST_ENTRY(pgrp) pg_hash; /* (ps) Hash chain. */ LIST_HEAD(, proc) pg_members; /* (m, ps) Pointer to pgrp members. */ struct session *pg_session; /* (c) Pointer to session. */ struct sigiolst pg_sigiolst; /* (m) List of sigio sources. */ pid_t pg_id; /* (c) Pgrp id. */ int pg_jobc; /* (m) # procs qualifying pgrp for job control */ struct mtx pg_mtx; /* Mutex to protect members */ }; struct procsig { sigset_t ps_sigignore; /* Signals being ignored. */ sigset_t ps_sigcatch; /* Signals being caught by user. */ int ps_flag; struct sigacts *ps_sigacts; /* Signal actions, state. */ int ps_refcnt; }; #define PS_NOCLDWAIT 0x0001 /* No zombies if child dies */ #define PS_NOCLDSTOP 0x0002 /* No SIGCHLD when children stop. */ /* * pargs, used to hold a copy of the command line, if it had a sane length. */ struct pargs { u_int ar_ref; /* Reference count. */ u_int ar_length; /* Length. */ u_char ar_args[0]; /* Arguments. */ }; /*- * Description of a process. * * This structure contains the information needed to manage a thread of * control, known in UN*X as a process; it has references to substructures * containing descriptions of things that the process uses, but may share * with related processes. The process structure and the substructures * are always addressable except for those marked "(CPU)" below, * which might be addressable only on a processor on which the process * is running. * * Below is a key of locks used to protect each member of struct proc. The * lock is indicated by a reference to a specific character in parens in the * associated comment. * * - not yet protected * a - only touched by curproc or parent during fork/wait * b - created at fork, never changes * (exception aiods switch vmspaces, but they are also * marked 'P_SYSTEM' so hopefully it will be left alone) * c - locked by proc mtx * d - locked by allproc_lock lock * e - locked by proctree_lock lock * f - session mtx * g - process group mtx * h - callout_lock mtx * i - by curproc or the master session mtx * j - locked by sched_lock mtx * k - only accessed by curthread * l - the attaching proc or attaching proc parent * m - Giant * n - not locked, lazy * o - locked by pgrpsess_lock sx * p - select lock (sellock) * * If the locking key specifies two identifiers (for example, p_pptr) then * either lock is sufficient for read access, but both locks must be held * for write access. */ struct ithd; struct nlminfo; struct trapframe; /* * Here we define the four structures used for process information. * * The first is the thread. It might be though of as a "Kernel * Schedulable Entity Context". * This structure contains all the information as to where a thread of * execution is now, or was when it was suspended, why it was suspended, * and anything else that will be needed to restart it when it is * rescheduled. Always associated with a KSE when running, but can be * reassigned to an equivalent KSE when being restarted for * load balancing. Each of these is associated with a kernel stack * and a pcb. * * It is important to remember that a particular thread structure only * exists as long as the system call or kernel entrance (e.g. by pagefault) * which it is currently executing. It should threfore NEVER be referenced * by pointers in long lived structures that live longer than a single * request. If several threads complete their work at the same time, * they will all rewind their stacks to the uer boundary, report their * completion state, and all but one will be freed. That last one will * be kept to provide a kernel stack and pcb for the NEXT syscall or kernel * entrance. (basically to save freeing and then re-allocating it) A process * might keep a cache of threads available to allow it to quickly * get one when it needs a new one. There would probably also be a system * cache of free threads. */ struct thread; /* * The second structure is the Kernel Schedulable Entity. (KSE) * As long as this is scheduled, it will continue to run any threads that * are assigned to it or the KSEGRP (see later) until either it runs out * of runnable threads or CPU. * It runs on one CPU and is assigned a quantum of time. When a thread is * blocked, The KSE continues to run and will search for another thread * in a runnable state amongst those it has. It May decide to return to user * mode with a new 'empty' thread if there are no runnable threads. * threads are associated with a KSE for cache reasons, but a sheduled KSE with * no runnable thread will try take a thread from a sibling KSE before * surrendering its quantum. In some schemes it gets it's quantum from the KSEG * and contributes to draining that quantum, along withthe other KSEs in * the group. (undecided) */ struct kse; /* * The KSEGRP is allocated resources across a number of CPUs. * (Including a number of CPUxQUANTA. It parcels these QUANTA up among * Its KSEs, each of which should be running in a different CPU. * Priority and total available sheduled quanta are properties of a KSEGRP. * Multiple KSEGRPs in a single process compete against each other * for total quanta in the same way that a forked child competes against * it's parent process. */ struct ksegrp; /* * A process is the owner of all system resources allocated to a task * except CPU quanta. * All KSEGs under one process see, and have the same access to, these * resources (e.g. files, memory, sockets, permissions kqueues). * A process may compete for CPU cycles on the same basis as a * forked process cluster by spawning several KSEGRPs. */ struct proc; /*************** * In pictures: With a single run queue used by all processors: RUNQ: --->KSE---KSE--... SLEEPQ:[]---THREAD---THREAD---THREAD | / []---THREAD KSEG---THREAD--THREAD--THREAD [] []---THREAD---THREAD (processors run THREADs from the KSEG until they are exhausted or the KSEG exhausts its quantum) With PER-CPU run queues: KSEs on the separate run queues directly They would be given priorities calculated from the KSEG. * *****************/ /* * Kernel runnable context (thread). * This is what is put to sleep and reactivated. * The first KSE available in the correct group will run this thread. * If several are available, use the one on the same CPU as last time. */ struct thread { struct proc *td_proc; /* Associated process. */ struct ksegrp *td_ksegrp; /* Associated KSEG. */ struct kse *td_last_kse; /* Where it wants to be if possible. */ struct kse *td_kse; /* Current KSE if running. */ TAILQ_ENTRY(thread) td_plist; /* All threads in this proc */ TAILQ_ENTRY(thread) td_kglist; /* All threads in this ksegrp */ /* The two queues below should someday be merged */ TAILQ_ENTRY(thread) td_slpq; /* (j) Sleep queue. XXXKSE */ TAILQ_ENTRY(thread) td_blkq; /* (j) Mutex queue. XXXKSE */ TAILQ_ENTRY(thread) td_runq; /* (j) Run queue(s). XXXKSE */ TAILQ_HEAD(, selinfo) td_selq; /* (p) List of selinfos. */ #define td_startzero td_flags int td_flags; /* (j) TDF_* flags. */ int td_dupfd; /* (k) Ret value from fdopen. XXX */ void *td_wchan; /* (j) Sleep address. */ const char *td_wmesg; /* (j) Reason for sleep. */ u_char td_lastcpu; /* (j) Last cpu we were on. */ u_char td_inktr; /* (k) Currently handling a KTR. */ short td_locks; /* (k) DEBUG: lockmgr count of locks */ struct mtx *td_blocked; /* (j) Mutex process is blocked on. */ struct ithd *td_ithd; /* (b) For interrupt threads only. */ const char *td_mtxname; /* (j) Name of mutex blocked on. */ LIST_HEAD(, mtx) td_contested; /* (j) Contested locks. */ struct lock_list_entry *td_sleeplocks; /* (k) Held sleep locks. */ int td_intr_nesting_level; /* (k) Interrupt recursion. */ #define td_endzero td_md #define td_startcopy td_endzero /* XXXKSE p_md is in the "on your own" section in old struct proc */ struct mdthread td_md; /* (k) Any machine-dependent fields. */ register_t td_retval[2]; /* (k) Syscall aux returns. */ u_char td_base_pri; /* (j) Thread base kernel priority. */ u_char td_priority; /* (j) Thread active priority. */ #define td_endcopy td_pcb struct ucred *td_ucred; /* (k) Reference to credentials. */ #ifdef DIAGNOSTIC /* see the comment in ast() */ struct ucred *td_ucred_cache; /* (k) hide cred here for DIAGNOSTIC */ #else void *td_dontuse; /* keep the size the same if not DIAG */ #endif struct pcb *td_pcb; /* (k) Kernel VA of pcb and kstack. */ struct callout td_slpcallout; /* (h) Callout for sleep. */ struct trapframe *td_frame; /* (k) */ struct vm_object *td_kstack_obj;/* (a) Kstack object. */ vm_offset_t td_kstack; /* Kernel VA of kstack. */ u_int td_critnest; /* (k) Critical section nest level. */ critical_t td_savecrit; /* (k) Saved critical section state. */ }; /* * The schedulable entity that can be given a context to run. * A process may have several of these. Probably one per processor * but posibly a few more. In this universe they are grouped * with a KSEG that contains the priority and niceness * for the group. */ struct kse { struct proc *ke_proc; /* Associated process. */ struct ksegrp *ke_ksegrp; /* Associated KSEG. */ struct thread *ke_thread; /* Associated thread, if running. */ TAILQ_ENTRY(kse) ke_kglist; /* Queue of all KSEs in ke_ksegrp. */ TAILQ_ENTRY(kse) ke_kgrlist; /* Queue of all KSEs in this state. */ TAILQ_ENTRY(kse) ke_procq; /* (j) Run queue. */ TAILQ_HEAD(, thread) ke_runq; /* (td_runq) RUNNABLE bound to KSE. */ #define ke_startzero ke_flags int ke_flags; /* (j) KEF_* flags. */ /*u_int ke_estcpu; */ /* (j) Time averaged val of cpticks. */ int ke_cpticks; /* (j) Ticks of cpu time. */ fixpt_t ke_pctcpu; /* (j) %cpu during p_swtime. */ u_int64_t ke_uu; /* (j) Previous user time in usec. */ u_int64_t ke_su; /* (j) Previous system time in usec. */ u_int64_t ke_iu; /* (j) Previous intr time in usec. */ u_int64_t ke_uticks; /* (j) Statclock hits in user mode. */ u_int64_t ke_sticks; /* (j) Statclock hits in system mode. */ u_int64_t ke_iticks; /* (j) Statclock hits in intr. */ u_char ke_oncpu; /* (j) Which cpu we are on. */ u_int ke_slptime; /* (j) Time since last idle. */ char ke_rqindex; /* (j) Run queue index. */ #define ke_endzero ke_priority #define ke_startcopy ke_endzero u_char ke_priority; /* (j) Process priority. */ u_char ke_usrpri; /* (j) User pri from cpu & nice. */ #define ke_endcopy ke_end int ke_end; /* dummy entry */ }; /* * Kernel-scheduled entity group (KSEG). The scheduler considers each KSEG to * be an indivisible unit from a time-sharing perspective, though each KSEG may * contain multiple KSEs. */ struct ksegrp { struct proc *kg_proc; /* Process that contains this KSEG. */ TAILQ_ENTRY(ksegrp) kg_ksegrp; /* Queue of KSEGs in kg_proc. */ TAILQ_HEAD(, kse) kg_kseq; /* (ke_kglist) All KSEs. */ TAILQ_HEAD(, kse) kg_rq; /* (ke_kgrlist) Runnable KSEs. */ TAILQ_HEAD(, kse) kg_iq; /* (ke_kgrlist) Idle KSEs. */ TAILQ_HEAD(, thread) kg_threads;/* (td_kglist) All threads. */ TAILQ_HEAD(, thread) kg_runq; /* (td_runq) Unbound RUNNABLE threads */ TAILQ_HEAD(, thread) kg_slpq; /* (td_runq) NONRUNNABLE threads. */ #define kg_startzero kg_estcpu u_int kg_estcpu; /* Sum of the same field in KSEs. */ u_int kg_slptime; /* (j) How long completely blocked. */ #define kg_endzero kg_pri_class #define kg_startcopy kg_endzero u_char kg_pri_class; /* (j) Scheduling class. */ u_char kg_user_pri; /* (j) User pri from estcpu and nice. */ char kg_nice; /* (j?/k?) Process "nice" value. */ struct rtprio kg_rtprio; /* (j) Realtime priority. */ #define kg_endcopy kg_runnable int kg_runnable; /* Num runnable threads on queue. */ int kg_runq_kses; /* Num KSEs on runq. */ int kg_kses; /* Num KSEs in group. */ }; /* * The old fashionned process. May have multiple threads, KSEGRPs * and KSEs. Starts off with a single embedded KSEGRP, KSE and THREAD. */ struct proc { LIST_ENTRY(proc) p_list; /* (d) List of all processes. */ TAILQ_HEAD(, ksegrp) p_ksegrps; /* (kg_ksegrp) All KSEGs. */ TAILQ_HEAD(, thread) p_threads; /* (td_plist) Threads. (shortcut) */ struct ucred *p_ucred; /* (c) Process owner's identity. */ struct filedesc *p_fd; /* (b) Ptr to open files structure. */ /* Accumulated stats for all KSEs? */ struct pstats *p_stats; /* (b) Accounting/statistics (CPU). */ struct plimit *p_limit; /* (m) Process limits. */ struct vm_object *p_upages_obj; /* (a) Upages object. */ struct procsig *p_procsig; /* (c) Signal actions, state (CPU). */ struct ksegrp p_ksegrp; struct kse p_kse; struct thread p_xxthread; /* * The following don't make too much sense.. * See the td_ or ke_ versions of the same flags */ int p_flag; /* (c) P_* flags. */ int p_sflag; /* (j) PS_* flags. */ int p_stat; /* (j) S* process status. */ pid_t p_pid; /* (b) Process identifier. */ LIST_ENTRY(proc) p_hash; /* (d) Hash chain. */ LIST_ENTRY(proc) p_pglist; /* (g + o) List of processes in pgrp. */ struct proc *p_pptr; /* (c + e) Pointer to parent process. */ LIST_ENTRY(proc) p_sibling; /* (e) List of sibling processes. */ LIST_HEAD(, proc) p_children; /* (e) Pointer to list of children. */ struct mtx p_mtx; /* (k) Lock for this struct. */ /* The following fields are all zeroed upon creation in fork. */ #define p_startzero p_oppid pid_t p_oppid; /* (c + e) Save ppid in ptrace. XXX */ struct vmspace *p_vmspace; /* (b) Address space. */ u_int p_swtime; /* (j) Time swapped in or out. */ struct itimerval p_realtimer; /* (h?/k?) Alarm timer. */ struct bintime p_runtime; /* (j) Real time. */ int p_traceflag; /* (j?) Kernel trace points. */ struct vnode *p_tracep; /* (j?) Trace to vnode. */ sigset_t p_siglist; /* (c) Sigs arrived, not delivered. */ struct vnode *p_textvp; /* (b) Vnode of executable. */ char p_lock; /* (c) Proclock (prevent swap) count. */ struct klist p_klist; /* (c) Knotes attached to this proc. */ struct sigiolst p_sigiolst; /* (c) List of sigio sources. */ int p_sigparent; /* (c) Signal to parent on exit. */ sigset_t p_oldsigmask; /* (c) Saved mask from pre sigpause. */ int p_sig; /* (n) For core dump/debugger XXX. */ u_long p_code; /* (n) For core dump/debugger XXX. */ u_int p_stops; /* (c) Stop event bitmask. */ u_int p_stype; /* (c) Stop event type. */ char p_step; /* (c) Process is stopped. */ u_char p_pfsflags; /* (c) Procfs flags. */ struct nlminfo *p_nlminfo; /* (?) Only used by/for lockd. */ void *p_aioinfo; /* (c) ASYNC I/O info. */ /* End area that is zeroed on creation. */ #define p_startcopy p_sigmask /* The following fields are all copied upon creation in fork. */ #define p_endzero p_startcopy sigset_t p_sigmask; /* (c) Current signal mask. */ stack_t p_sigstk; /* (c) Stack ptr and on-stack flag. */ int p_magic; /* (b) Magic number. */ char p_comm[MAXCOMLEN + 1]; /* (b) Process name. */ struct pgrp *p_pgrp; /* (c + o) Pointer to process group. */ struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */ struct pargs *p_args; /* (c) Process arguments. */ /* End area that is copied on creation. */ #define p_endcopy p_xstat u_short p_xstat; /* (c) Exit status; also stop sig. */ struct mdproc p_md; /* (c) Any machine-dependent fields. */ struct callout p_itcallout; /* (h) Interval timer callout. */ struct user *p_uarea; /* (k) Kernel VA of u-area (CPU) */ u_short p_acflag; /* (c) Accounting flags. */ struct rusage *p_ru; /* (a) Exit information. XXX */ struct proc *p_peers; /* (c) */ struct proc *p_leader; /* (c) */ void *p_emuldata; /* (c) Emulator state data. */ }; #define p_rlimit p_limit->pl_rlimit #define p_sigacts p_procsig->ps_sigacts #define p_sigignore p_procsig->ps_sigignore #define p_sigcatch p_procsig->ps_sigcatch #define p_session p_pgrp->pg_session #define p_pgid p_pgrp->pg_id #define NOCPU 0xff /* For p_oncpu when we aren't on a CPU. */ /* Status values (p_stat). */ #define SIDL 1 /* Process being created by fork. */ #define SRUN 2 /* Currently runnable. */ #define SSLEEP 3 /* Sleeping on an address. */ #define SSTOP 4 /* Process debugging or suspension. */ #define SZOMB 5 /* Awaiting collection by parent. */ #define SWAIT 6 /* Waiting for interrupt. */ #define SMTX 7 /* Blocked on a mutex. */ /* These flags are kept in p_flag. */ #define P_ADVLOCK 0x00001 /* Process may hold a POSIX advisory lock. */ #define P_CONTROLT 0x00002 /* Has a controlling terminal. */ #define P_KTHREAD 0x00004 /* Kernel thread. (*)*/ #define P_NOLOAD 0x00008 /* Ignore during load avg calculations. */ #define P_PPWAIT 0x00010 /* Parent is waiting for child to exec/exit. */ #define P_SUGID 0x00100 /* Had set id privileges since last exec. */ #define P_SYSTEM 0x00200 /* System proc: no sigs, stats or swapping. */ #define P_TRACED 0x00800 /* Debugged process being traced. */ #define P_WAITED 0x01000 /* Debugging process has waited for child. */ #define P_WEXIT 0x02000 /* Working on exiting. */ #define P_EXEC 0x04000 /* Process called exec. */ #define P_KSES 0x08000 /* Process is using KSEs. */ /* Should be moved to machine-dependent areas. */ #define P_UNUSED100000 0x100000 #define P_COWINPROGRESS 0x400000 /* Snapshot copy-on-write in progress. */ #define P_JAILED 0x1000000 /* Process is in jail. */ #define P_OLDMASK 0x2000000 /* Need to restore mask after suspend. */ #define P_ALTSTACK 0x4000000 /* Have alternate signal stack. */ #define P_INEXEC 0x8000000 /* Process is in execve(). */ /* These flags are kept in p_sflag and are protected with sched_lock. */ #define PS_INMEM 0x00001 /* Loaded into memory. */ #define PS_PROFIL 0x00004 /* Has started profiling. */ #define PS_ALRMPEND 0x00020 /* Pending SIGVTALRM needs to be posted. */ #define PS_PROFPEND 0x00040 /* Pending SIGPROF needs to be posted. */ #define PS_SWAPINREQ 0x00100 /* Swapin request due to wakeup. */ #define PS_SWAPPING 0x00200 /* Process is being swapped. */ /* flags kept in td_flags */ #define TDF_ONRUNQ 0x00001 /* This KE is on a run queue */ #define TDF_SINTR 0x00008 /* Sleep is interruptible. */ #define TDF_TIMEOUT 0x00010 /* Timing out during sleep. */ #define TDF_SELECT 0x00040 /* Selecting; wakeup/waiting danger. */ #define TDF_CVWAITQ 0x00080 /* Thread is on a cv_waitq (not slpq). */ #define TDF_TIMOFAIL 0x01000 /* Timeout from sleep after we were awake. */ #define TDF_DEADLKTREAT 0x800000 /* Lock aquisition - deadlock treatment. */ /* flags kept in ke_flags */ #define KEF_ONRUNQ 0x00001 /* This KE is on a run queue */ #define KEF_OWEUPC 0x00002 /* Owe process an addupc() call at next ast. */ #define KEF_ASTPENDING 0x00400 /* KSE has a pending ast. */ #define KEF_NEEDRESCHED 0x00800 /* Process needs to yield. */ #define P_MAGIC 0xbeefface #ifdef _KERNEL #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_PARGS); MALLOC_DECLARE(M_PGRP); MALLOC_DECLARE(M_SESSION); MALLOC_DECLARE(M_SUBPROC); MALLOC_DECLARE(M_ZOMBIE); #endif #define FOREACH_PROC_IN_SYSTEM(p) \ LIST_FOREACH((p), &allproc, p_list) #define FOREACH_KSEGRP_IN_PROC(p, kg) \ TAILQ_FOREACH((kg), &(p)->p_ksegrps, kg_ksegrp) #define FOREACH_THREAD_IN_GROUP(kg, td) \ TAILQ_FOREACH((td), &(kg)->kg_threads, td_kglist) #define FOREACH_KSE_IN_GROUP(kg, ke) \ TAILQ_FOREACH((ke), &(kg)->kg_kseq, ke_kglist) #define FOREACH_THREAD_IN_PROC(p, td) \ TAILQ_FOREACH((td), &(p)->p_threads, td_plist) /* XXXKSE the lines below should probably only be used in 1:1 code */ #define FIRST_THREAD_IN_PROC(p) TAILQ_FIRST(&p->p_threads) #define FIRST_KSEGRP_IN_PROC(p) TAILQ_FIRST(&p->p_ksegrps) #define FIRST_KSE_IN_KSEGRP(kg) TAILQ_FIRST(&kg->kg_kseq) #define FIRST_KSE_IN_PROC(p) FIRST_KSE_IN_KSEGRP(FIRST_KSEGRP_IN_PROC(p)) static __inline int sigonstack(size_t sp) { register struct thread *td = curthread; struct proc *p = td->td_proc; return ((p->p_flag & P_ALTSTACK) ? #if defined(COMPAT_43) || defined(COMPAT_SUNOS) ((p->p_sigstk.ss_size == 0) ? (p->p_sigstk.ss_flags & SS_ONSTACK) : ((sp - (size_t)p->p_sigstk.ss_sp) < p->p_sigstk.ss_size)) #else ((sp - (size_t)p->p_sigstk.ss_sp) < p->p_sigstk.ss_size) #endif : 0); } /* * Notify the current process (p) that it has a signal pending, * process as soon as possible. */ #define signotify(ke) do { \ mtx_assert(&sched_lock, MA_OWNED); \ (ke)->ke_flags |= KEF_ASTPENDING; \ } while (0) /* Handy macro to determine if p1 can mangle p2. */ #define PRISON_CHECK(p1, p2) \ ((p1)->p_prison == NULL || (p1)->p_prison == (p2)->p_prison) /* * We use process IDs <= PID_MAX; PID_MAX + 1 must also fit in a pid_t, * as it is used to represent "no process group". */ #define PID_MAX 99999 #define NO_PID 100000 #define SESS_LEADER(p) ((p)->p_session->s_leader == (p)) #define SESSHOLD(s) ((s)->s_count++) #define SESSRELE(s) { \ if (--(s)->s_count == 0) \ FREE(s, M_SESSION); \ } #define STOPEVENT(p, e, v) do { \ PROC_LOCK(p); \ _STOPEVENT((p), (e), (v)); \ PROC_UNLOCK(p); \ } while (0) #define _STOPEVENT(p, e, v) do { \ PROC_LOCK_ASSERT(p, MA_OWNED); \ if ((p)->p_stops & (e)) { \ stopevent((p), (e), (v)); \ } \ } while (0) /* Lock and unlock a process. */ #define PROC_LOCK(p) mtx_lock(&(p)->p_mtx) #define PROC_TRYLOCK(p) mtx_trylock(&(p)->p_mtx) #define PROC_UNLOCK(p) mtx_unlock(&(p)->p_mtx) #define PROC_LOCKED(p) mtx_owned(&(p)->p_mtx) #define PROC_LOCK_ASSERT(p, type) mtx_assert(&(p)->p_mtx, (type)) #define PGRPSESS_SLOCK() sx_slock(&pgrpsess_lock) #define PGRPSESS_XLOCK() sx_xlock(&pgrpsess_lock) #define PGRPSESS_SUNLOCK() sx_sunlock(&pgrpsess_lock) #define PGRPSESS_XUNLOCK() sx_xunlock(&pgrpsess_lock) #define PGRPSESS_LOCK_ASSERT(type) sx_assert(&pgrpsess_lock, (type)) /* Lock and unlock a process group. */ #define PGRP_LOCK(pg) mtx_lock(&(pg)->pg_mtx) #define PGRP_UNLOCK(pg) mtx_unlock(&(pg)->pg_mtx) #define PGRP_UNLOCK_NOSWITCH(pg) \ mtx_unlock_flags(&(pg)->pg_mtx, MTX_NOSWITCH) #define PGRP_LOCKED(pg) mtx_owned(&(pg)->pg_mtx) #define PGRP_LOCK_ASSERT(pg, type) mtx_assert(&(pg)->pg_mtx, (type)) #define PGRP_LOCK_PGSIGNAL(pg) \ do { \ if ((pg) != NULL) \ PGRP_LOCK(pg); \ } while (0); #define PGRP_UNLOCK_PGSIGNAL(pg) \ do { \ if ((pg) != NULL) \ PGRP_UNLOCK(pg); \ } while (0); /* Lock and unlock a session. */ #define SESS_LOCK(s) mtx_lock(&(s)->s_mtx) #define SESS_UNLOCK(s) mtx_unlock(&(s)->s_mtx) #define SESS_UNLOCK_NOSWITCH(s) \ mtx_unlock_flags(&(s)->s_mtx, MTX_NOSWITCH) #define SESS_LOCKED(s) mtx_owned(&(s)->s_mtx) #define SESS_LOCK_ASSERT(s, type) mtx_assert(&(s)->s_mtx, (type)) /* Hold process U-area in memory, normally for ptrace/procfs work. */ #define PHOLD(p) do { \ PROC_LOCK(p); \ _PHOLD(p); \ PROC_UNLOCK(p); \ } while (0) #define _PHOLD(p) do { \ PROC_LOCK_ASSERT((p), MA_OWNED); \ if ((p)->p_lock++ == 0) \ faultin((p)); \ } while (0) #define PRELE(p) do { \ PROC_LOCK((p)); \ _PRELE((p)); \ PROC_UNLOCK((p)); \ } while (0) #define _PRELE(p) do { \ PROC_LOCK_ASSERT((p), MA_OWNED); \ (--(p)->p_lock); \ } while (0) #define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) extern LIST_HEAD(pidhashhead, proc) *pidhashtbl; extern u_long pidhash; #define PGRPHASH(pgid) (&pgrphashtbl[(pgid) & pgrphash]) extern LIST_HEAD(pgrphashhead, pgrp) *pgrphashtbl; extern u_long pgrphash; extern struct sx allproc_lock; extern struct sx proctree_lock; extern struct sx pgrpsess_lock; extern struct proc proc0; /* Process slot for swapper. */ extern struct thread thread0; /* Primary thread in proc0 */ extern int hogticks; /* Limit on kernel cpu hogs. */ extern int nprocs, maxproc; /* Current and max number of procs. */ extern int maxprocperuid; /* Max procs per uid. */ extern u_long ps_arg_cache_limit; extern int ps_argsopen; extern int ps_showallprocs; extern int sched_quantum; /* Scheduling quantum in ticks. */ LIST_HEAD(proclist, proc); TAILQ_HEAD(procqueue, proc); TAILQ_HEAD(threadqueue, thread); extern struct proclist allproc; /* List of all processes. */ extern struct proclist zombproc; /* List of zombie processes. */ extern struct proc *initproc, *pageproc; /* Process slots for init, pager. */ extern struct proc *updateproc; /* Process slot for syncer (sic). */ extern vm_zone_t proc_zone; extern int lastpid; /* * XXX macros for scheduler. Shouldn't be here, but currently needed for * bounding the dubious p_estcpu inheritance in wait1(). * INVERSE_ESTCPU_WEIGHT is only suitable for statclock() frequencies in * the range 100-256 Hz (approximately). */ #define ESTCPULIM(e) \ min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) - \ RQ_PPQ) + INVERSE_ESTCPU_WEIGHT - 1) #define INVERSE_ESTCPU_WEIGHT 8 /* 1 / (priorities per estcpu level). */ #define NICE_WEIGHT 1 /* Priorities per nice level. */ struct proc *pfind(pid_t); /* Find process by id. */ struct pgrp *pgfind(pid_t); /* Find process group by id. */ struct proc *zpfind(pid_t); /* Find zombie process by id. */ void ast(struct trapframe *framep); struct thread *choosethread(void); int cr_cansignal(struct ucred *cred, struct proc *proc, int signum); -int enterpgrp __P((struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess)); -int enterthispgrp __P((struct proc *p, struct pgrp *pgrp)); +int enterpgrp(struct proc *p, pid_t pgid, struct pgrp *pgrp, struct session *sess); +int enterthispgrp(struct proc *p, struct pgrp *pgrp); void faultin(struct proc *p); void fixjobc(struct proc *p, struct pgrp *pgrp, int entering); int fork1(struct thread *, int, struct proc **); void fork_exit(void (*)(void *, struct trapframe *), void *, struct trapframe *); void fork_return(struct thread *, struct trapframe *); int inferior(struct proc *p); int leavepgrp(struct proc *p); void mi_switch(void); int p_candebug(struct proc *p1, struct proc *p2); int p_cansee(struct proc *p1, struct proc *p2); int p_cansched(struct proc *p1, struct proc *p2); int p_cansignal(struct proc *p1, struct proc *p2, int signum); void procinit(void); void proc_linkup(struct proc *p, struct ksegrp *kg, struct kse *ke, struct thread *td); void proc_reparent(struct proc *child, struct proc *newparent); int procrunnable(void); void remrunqueue(struct thread *); void resetpriority(struct ksegrp *); int roundrobin_interval(void); void schedclock(struct thread *); int securelevel_ge(struct ucred *cr, int level); int securelevel_gt(struct ucred *cr, int level); void setrunnable(struct thread *); void setrunqueue(struct thread *); void setsugid(struct proc *p); void sleepinit(void); void stopevent(struct proc *, u_int, u_int); void cpu_idle(void); void cpu_switch(void); void cpu_throw(void) __dead2; void unsleep(struct thread *); void updatepri(struct thread *); void userret(struct thread *, struct trapframe *, u_int); void maybe_resched(struct thread *); void cpu_exit(struct thread *); void exit1(struct thread *, int) __dead2; void cpu_fork(struct thread *, struct proc *, struct thread *, int); void cpu_set_fork_handler(struct thread *, void (*)(void *), void *); int trace_req(struct proc *); void cpu_wait(struct proc *); int cpu_coredump(struct thread *, struct vnode *, struct ucred *); struct thread *thread_get(struct proc *); #endif /* _KERNEL */ #endif /* !_SYS_PROC_H_ */ Index: head/sys/sys/protosw.h =================================================================== --- head/sys/sys/protosw.h (revision 92718) +++ head/sys/sys/protosw.h (revision 92719) @@ -1,338 +1,334 @@ /*- * 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. * * @(#)protosw.h 8.1 (Berkeley) 6/2/93 * $FreeBSD$ */ #ifndef _SYS_PROTOSW_H_ #define _SYS_PROTOSW_H_ /* * For pfil_head structure. */ #include /* Forward declare these structures referenced from prototypes below. */ struct mbuf; struct thread; struct sockaddr; struct socket; struct sockopt; /*#ifdef _KERNEL*/ /* * Protocol switch table. * * Each protocol has a handle initializing one of these structures, * which is used for protocol-protocol and system-protocol communication. * * A protocol is called through the pr_init entry before any other. * Thereafter it is called every 200ms through the pr_fasttimo entry and * every 500ms through the pr_slowtimo for timer based actions. * The system will call the pr_drain entry if it is low on space and * this should throw away any non-critical data. * * Protocols pass data between themselves as chains of mbufs using * the pr_input and pr_output hooks. Pr_input passes data up (towards * the users) and pr_output passes it down (towards the interfaces); control * information passes up and down on pr_ctlinput and pr_ctloutput. * The protocol is responsible for the space occupied by any the * arguments to these entries and must dispose it. * * In retrospect, it would be a lot nicer to use an interface * similar to the vnode VOP interface. */ /* USE THESE FOR YOUR PROTOTYPES ! */ typedef void pr_input_t (struct mbuf *, int); typedef int pr_input6_t (struct mbuf **, int*, int); /* XXX FIX THIS */ typedef void pr_in_input_t (struct mbuf *, int, int); /* XXX FIX THIS */ typedef int pr_output_t (struct mbuf *, struct socket *); typedef int pr_in_output_t (struct mbuf *, struct socket *, struct sockaddr *); typedef void pr_ctlinput_t (int, struct sockaddr *, void *); typedef int pr_ctloutput_t (struct socket *, struct sockopt *); typedef void pr_init_t (void); typedef void pr_fasttimo_t (void); typedef void pr_slowtimo_t (void); typedef void pr_drain_t (void); typedef int pr_usrreq_t(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct thread *); struct protosw { short pr_type; /* socket type used for */ struct domain *pr_domain; /* domain protocol a member of */ short pr_protocol; /* protocol number */ short pr_flags; /* see below */ /* protocol-protocol hooks */ pr_input_t *pr_input; /* input to protocol (from below) */ pr_output_t *pr_output; /* output to protocol (from above) */ pr_ctlinput_t *pr_ctlinput; /* control input (from below) */ pr_ctloutput_t *pr_ctloutput; /* control output (from above) */ /* user-protocol hook */ pr_usrreq_t *pr_ousrreq; /* utility hooks */ pr_init_t *pr_init; pr_fasttimo_t *pr_fasttimo; /* fast timeout (200ms) */ pr_slowtimo_t *pr_slowtimo; /* slow timeout (500ms) */ pr_drain_t *pr_drain; /* flush any excess space possible */ struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */ struct pfil_head pr_pfh; }; /*#endif*/ #define PR_SLOWHZ 2 /* 2 slow timeouts per second */ #define PR_FASTHZ 5 /* 5 fast timeouts per second */ /* * Values for pr_flags. * PR_ADDR requires PR_ATOMIC; * PR_ADDR and PR_CONNREQUIRED are mutually exclusive. * PR_IMPLOPCL means that the protocol allows sendto without prior connect, * and the protocol understands the MSG_EOF flag. The first property is * is only relevant if PR_CONNREQUIRED is set (otherwise sendto is allowed * anyhow). */ #define PR_ATOMIC 0x01 /* exchange atomic messages only */ #define PR_ADDR 0x02 /* addresses given with messages */ #define PR_CONNREQUIRED 0x04 /* connection required by protocol */ #define PR_WANTRCVD 0x08 /* want PRU_RCVD calls */ #define PR_RIGHTS 0x10 /* passes capabilities */ #define PR_IMPLOPCL 0x20 /* implied open/close */ #define PR_LASTHDR 0x40 /* enforce ipsec policy; last header */ /* * The arguments to usrreq are: * (*protosw[].pr_usrreq)(up, req, m, nam, opt); * where up is a (struct socket *), req is one of these requests, * m is a optional mbuf chain containing a message, * nam is an optional mbuf chain containing an address, * and opt is a pointer to a socketopt structure or nil. * The protocol is responsible for disposal of the mbuf chain m, * the caller is responsible for any space held by nam and opt. * A non-zero return from usrreq gives an * UNIX error number which should be passed to higher level software. */ #define PRU_ATTACH 0 /* attach protocol to up */ #define PRU_DETACH 1 /* detach protocol from up */ #define PRU_BIND 2 /* bind socket to address */ #define PRU_LISTEN 3 /* listen for connection */ #define PRU_CONNECT 4 /* establish connection to peer */ #define PRU_ACCEPT 5 /* accept connection from peer */ #define PRU_DISCONNECT 6 /* disconnect from peer */ #define PRU_SHUTDOWN 7 /* won't send any more data */ #define PRU_RCVD 8 /* have taken data; more room now */ #define PRU_SEND 9 /* send this data */ #define PRU_ABORT 10 /* abort (fast DISCONNECT, DETATCH) */ #define PRU_CONTROL 11 /* control operations on protocol */ #define PRU_SENSE 12 /* return status into m */ #define PRU_RCVOOB 13 /* retrieve out of band data */ #define PRU_SENDOOB 14 /* send out of band data */ #define PRU_SOCKADDR 15 /* fetch socket's address */ #define PRU_PEERADDR 16 /* fetch peer's address */ #define PRU_CONNECT2 17 /* connect two sockets */ /* begin for protocols internal use */ #define PRU_FASTTIMO 18 /* 200ms timeout */ #define PRU_SLOWTIMO 19 /* 500ms timeout */ #define PRU_PROTORCV 20 /* receive from below */ #define PRU_PROTOSEND 21 /* send to below */ /* end for protocol's internal use */ #define PRU_SEND_EOF 22 /* send and close */ #define PRU_NREQ 22 #ifdef PRUREQUESTS char *prurequests[] = { "ATTACH", "DETACH", "BIND", "LISTEN", "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN", "RCVD", "SEND", "ABORT", "CONTROL", "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR", "PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO", "PROTORCV", "PROTOSEND", "SEND_EOF", }; #endif #ifdef _KERNEL /* users shouldn't see this decl */ struct ifnet; struct stat; struct ucred; struct uio; /* * If the ordering here looks odd, that's because it's alphabetical. * Having this structure separated out from the main protoswitch is allegedly * a big (12 cycles per call) lose on high-end CPUs. We will eventually * migrate this stuff back into the main structure. */ struct pr_usrreqs { - int (*pru_abort) __P((struct socket *so)); - int (*pru_accept) __P((struct socket *so, struct sockaddr **nam)); - int (*pru_attach) __P((struct socket *so, int proto, - struct thread *td)); - int (*pru_bind) __P((struct socket *so, struct sockaddr *nam, - struct thread *td)); - int (*pru_connect) __P((struct socket *so, struct sockaddr *nam, - struct thread *td)); - int (*pru_connect2) __P((struct socket *so1, struct socket *so2)); - int (*pru_control) __P((struct socket *so, u_long cmd, caddr_t data, - struct ifnet *ifp, struct thread *td)); - int (*pru_detach) __P((struct socket *so)); - int (*pru_disconnect) __P((struct socket *so)); - int (*pru_listen) __P((struct socket *so, struct thread *td)); - int (*pru_peeraddr) __P((struct socket *so, - struct sockaddr **nam)); - int (*pru_rcvd) __P((struct socket *so, int flags)); - int (*pru_rcvoob) __P((struct socket *so, struct mbuf *m, - int flags)); - int (*pru_send) __P((struct socket *so, int flags, struct mbuf *m, + int (*pru_abort)(struct socket *so); + int (*pru_accept)(struct socket *so, struct sockaddr **nam); + int (*pru_attach)(struct socket *so, int proto, struct thread *td); + int (*pru_bind)(struct socket *so, struct sockaddr *nam, + struct thread *td); + int (*pru_connect)(struct socket *so, struct sockaddr *nam, + struct thread *td); + int (*pru_connect2)(struct socket *so1, struct socket *so2); + int (*pru_control)(struct socket *so, u_long cmd, caddr_t data, + struct ifnet *ifp, struct thread *td); + int (*pru_detach)(struct socket *so); + int (*pru_disconnect)(struct socket *so); + int (*pru_listen)(struct socket *so, struct thread *td); + int (*pru_peeraddr)(struct socket *so, struct sockaddr **nam); + int (*pru_rcvd)(struct socket *so, int flags); + int (*pru_rcvoob)(struct socket *so, struct mbuf *m, int flags); + int (*pru_send)(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, - struct thread *td)); + struct thread *td); #define PRUS_OOB 0x1 #define PRUS_EOF 0x2 #define PRUS_MORETOCOME 0x4 - int (*pru_sense) __P((struct socket *so, struct stat *sb)); - int (*pru_shutdown) __P((struct socket *so)); - int (*pru_sockaddr) __P((struct socket *so, - struct sockaddr **nam)); + int (*pru_sense)(struct socket *so, struct stat *sb); + int (*pru_shutdown)(struct socket *so); + int (*pru_sockaddr)(struct socket *so, struct sockaddr **nam); /* * These three added later, so they are out of order. They are used * for shortcutting (fast path input/output) in some protocols. * XXX - that's a lie, they are not implemented yet * Rather than calling sosend() etc. directly, calls are made * through these entry points. For protocols which still use * the generic code, these just point to those routines. */ - int (*pru_sosend) __P((struct socket *so, struct sockaddr *addr, + int (*pru_sosend)(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, - struct thread *td)); - int (*pru_soreceive) __P((struct socket *so, + struct thread *td); + int (*pru_soreceive)(struct socket *so, struct sockaddr **paddr, struct uio *uio, struct mbuf **mp0, - struct mbuf **controlp, int *flagsp)); - int (*pru_sopoll) __P((struct socket *so, int events, - struct ucred *cred, struct thread *td)); + struct mbuf **controlp, int *flagsp); + int (*pru_sopoll)(struct socket *so, int events, + struct ucred *cred, struct thread *td); }; -int pru_accept_notsupp __P((struct socket *so, struct sockaddr **nam)); -int pru_connect_notsupp __P((struct socket *so, struct sockaddr *nam, - struct thread *td)); -int pru_connect2_notsupp __P((struct socket *so1, struct socket *so2)); -int pru_control_notsupp __P((struct socket *so, u_long cmd, caddr_t data, - struct ifnet *ifp, struct thread *td)); -int pru_listen_notsupp __P((struct socket *so, struct thread *td)); -int pru_rcvd_notsupp __P((struct socket *so, int flags)); -int pru_rcvoob_notsupp __P((struct socket *so, struct mbuf *m, int flags)); -int pru_sense_null __P((struct socket *so, struct stat *sb)); +int pru_accept_notsupp(struct socket *so, struct sockaddr **nam); +int pru_connect_notsupp(struct socket *so, struct sockaddr *nam, + struct thread *td); +int pru_connect2_notsupp(struct socket *so1, struct socket *so2); +int pru_control_notsupp(struct socket *so, u_long cmd, caddr_t data, + struct ifnet *ifp, struct thread *td); +int pru_listen_notsupp(struct socket *so, struct thread *td); +int pru_rcvd_notsupp(struct socket *so, int flags); +int pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, int flags); +int pru_sense_null(struct socket *so, struct stat *sb); #endif /* _KERNEL */ /* * The arguments to the ctlinput routine are * (*protosw[].pr_ctlinput)(cmd, sa, arg); * where cmd is one of the commands below, sa is a pointer to a sockaddr, * and arg is a `void *' argument used within a protocol family. */ #define PRC_IFDOWN 0 /* interface transition */ #define PRC_ROUTEDEAD 1 /* select new route if possible ??? */ #define PRC_IFUP 2 /* interface has come back up */ #define PRC_QUENCH2 3 /* DEC congestion bit says slow down */ #define PRC_QUENCH 4 /* some one said to slow down */ #define PRC_MSGSIZE 5 /* message size forced drop */ #define PRC_HOSTDEAD 6 /* host appears to be down */ #define PRC_HOSTUNREACH 7 /* deprecated (use PRC_UNREACH_HOST) */ #define PRC_UNREACH_NET 8 /* no route to network */ #define PRC_UNREACH_HOST 9 /* no route to host */ #define PRC_UNREACH_PROTOCOL 10 /* dst says bad protocol */ #define PRC_UNREACH_PORT 11 /* bad port # */ /* was PRC_UNREACH_NEEDFRAG 12 (use PRC_MSGSIZE) */ #define PRC_UNREACH_SRCFAIL 13 /* source route failed */ #define PRC_REDIRECT_NET 14 /* net routing redirect */ #define PRC_REDIRECT_HOST 15 /* host routing redirect */ #define PRC_REDIRECT_TOSNET 16 /* redirect for type of service & net */ #define PRC_REDIRECT_TOSHOST 17 /* redirect for tos & host */ #define PRC_TIMXCEED_INTRANS 18 /* packet lifetime expired in transit */ #define PRC_TIMXCEED_REASS 19 /* lifetime expired on reass q */ #define PRC_PARAMPROB 20 /* header incorrect */ #define PRC_UNREACH_ADMIN_PROHIB 21 /* packet administrativly prohibited */ #define PRC_NCMDS 22 #define PRC_IS_REDIRECT(cmd) \ ((cmd) >= PRC_REDIRECT_NET && (cmd) <= PRC_REDIRECT_TOSHOST) #ifdef PRCREQUESTS char *prcrequests[] = { "IFDOWN", "ROUTEDEAD", "IFUP", "DEC-BIT-QUENCH2", "QUENCH", "MSGSIZE", "HOSTDEAD", "#7", "NET-UNREACH", "HOST-UNREACH", "PROTO-UNREACH", "PORT-UNREACH", "#12", "SRCFAIL-UNREACH", "NET-REDIRECT", "HOST-REDIRECT", "TOSNET-REDIRECT", "TOSHOST-REDIRECT", "TX-INTRANS", "TX-REASS", "PARAMPROB", "ADMIN-UNREACH" }; #endif /* * The arguments to ctloutput are: * (*protosw[].pr_ctloutput)(req, so, level, optname, optval, p); * req is one of the actions listed below, so is a (struct socket *), * level is an indication of which protocol layer the option is intended. * optname is a protocol dependent socket option request, * optval is a pointer to a mbuf-chain pointer, for value-return results. * The protocol is responsible for disposal of the mbuf chain *optval * if supplied, * the caller is responsible for any space held by *optval, when returned. * A non-zero return from usrreq gives an * UNIX error number which should be passed to higher level software. */ #define PRCO_GETOPT 0 #define PRCO_SETOPT 1 #define PRCO_NCMDS 2 #ifdef PRCOREQUESTS char *prcorequests[] = { "GETOPT", "SETOPT", }; #endif #ifdef _KERNEL -void pfctlinput __P((int, struct sockaddr *)); -void pfctlinput2 __P((int, struct sockaddr *, void *)); -struct protosw *pffindproto __P((int family, int protocol, int type)); -struct protosw *pffindtype __P((int family, int type)); +void pfctlinput(int, struct sockaddr *); +void pfctlinput2(int, struct sockaddr *, void *); +struct protosw *pffindproto(int family, int protocol, int type); +struct protosw *pffindtype(int family, int type); #endif #endif Index: head/sys/sys/queue.h =================================================================== --- head/sys/sys/queue.h (revision 92718) +++ head/sys/sys/queue.h (revision 92719) @@ -1,453 +1,453 @@ /* * Copyright (c) 1991, 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. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 * $FreeBSD$ */ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ #include /* for __offsetof */ /* * This file defines four types of data structures: singly-linked lists, * singly-linked tail queues, lists and tail queues. * * A singly-linked list is headed by a single forward pointer. The elements * are singly linked for minimum space and pointer manipulation overhead at * the expense of O(n) removal for arbitrary elements. New elements can be * added to the list after an existing element or at the head of the list. * Elements being removed from the head of the list should use the explicit * macro for this purpose for optimum efficiency. A singly-linked list may * only be traversed in the forward direction. Singly-linked lists are ideal * for applications with large datasets and few or no removals or for * implementing a LIFO queue. * * A singly-linked tail queue is headed by a pair of pointers, one to the * head of the list and the other to the tail of the list. The elements are * singly linked for minimum space and pointer manipulation overhead at the * expense of O(n) removal for arbitrary elements. New elements can be added * to the list after an existing element, at the head of the list, or at the * end of the list. Elements being removed from the head of the tail queue * should use the explicit macro for this purpose for optimum efficiency. * A singly-linked tail queue may only be traversed in the forward direction. * Singly-linked tail queues are ideal for applications with large datasets * and few or no removals or for implementing a FIFO queue. * * A list is headed by a single forward pointer (or an array of forward * pointers for a hash table header). The elements are doubly linked * so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before * or after an existing element or at the head of the list. A list * may only be traversed in the forward direction. * * A tail queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or * after an existing element, at the head of the list, or at the end of * the list. A tail queue may be traversed in either direction. * * For details on the use of these macros, see the queue(3) manual page. * * * SLIST LIST STAILQ TAILQ * _HEAD + + + + * _HEAD_INITIALIZER + + + + * _ENTRY + + + + * _INIT + + + + * _EMPTY + + + + * _FIRST + + + + * _NEXT + + + + * _PREV - - - + * _LAST - - + + * _FOREACH + + + + * _FOREACH_REVERSE - - - + * _INSERT_HEAD + + + + * _INSERT_BEFORE - + - + * _INSERT_AFTER + + + + * _INSERT_TAIL - - + + * _REMOVE_HEAD + - + - * _REMOVE + + + + * */ /* * Singly-linked List declarations. */ #define SLIST_HEAD(name, type) \ struct name { \ struct type *slh_first; /* first element */ \ } #define SLIST_HEAD_INITIALIZER(head) \ { NULL } #define SLIST_ENTRY(type) \ struct { \ struct type *sle_next; /* next element */ \ } /* * Singly-linked List functions. */ #define SLIST_EMPTY(head) ((head)->slh_first == NULL) #define SLIST_FIRST(head) ((head)->slh_first) #define SLIST_FOREACH(var, head, field) \ for ((var) = SLIST_FIRST((head)); \ (var); \ (var) = SLIST_NEXT((var), field)) #define SLIST_INIT(head) do { \ SLIST_FIRST((head)) = NULL; \ } while (0) #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ SLIST_NEXT((slistelm), field) = (elm); \ } while (0) #define SLIST_INSERT_HEAD(head, elm, field) do { \ SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ SLIST_FIRST((head)) = (elm); \ } while (0) #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) #define SLIST_REMOVE(head, elm, type, field) do { \ if (SLIST_FIRST((head)) == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ struct type *curelm = SLIST_FIRST((head)); \ while (SLIST_NEXT(curelm, field) != (elm)) \ curelm = SLIST_NEXT(curelm, field); \ SLIST_NEXT(curelm, field) = \ SLIST_NEXT(SLIST_NEXT(curelm, field), field); \ } \ } while (0) #define SLIST_REMOVE_HEAD(head, field) do { \ SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ } while (0) /* * Singly-linked Tail queue declarations. */ #define STAILQ_HEAD(name, type) \ struct name { \ struct type *stqh_first;/* first element */ \ struct type **stqh_last;/* addr of last next element */ \ } #define STAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).stqh_first } #define STAILQ_ENTRY(type) \ struct { \ struct type *stqe_next; /* next element */ \ } /* * Singly-linked Tail queue functions. */ #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) #define STAILQ_FIRST(head) ((head)->stqh_first) #define STAILQ_FOREACH(var, head, field) \ for((var) = STAILQ_FIRST((head)); \ (var); \ (var) = STAILQ_NEXT((var), field)) #define STAILQ_INIT(head) do { \ STAILQ_FIRST((head)) = NULL; \ (head)->stqh_last = &STAILQ_FIRST((head)); \ } while (0) #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ STAILQ_NEXT((tqelm), field) = (elm); \ } while (0) #define STAILQ_INSERT_HEAD(head, elm, field) do { \ if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ STAILQ_FIRST((head)) = (elm); \ } while (0) #define STAILQ_INSERT_TAIL(head, elm, field) do { \ STAILQ_NEXT((elm), field) = NULL; \ *(head)->stqh_last = (elm); \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ } while (0) #define STAILQ_LAST(head, type, field) \ (STAILQ_EMPTY(head) ? \ NULL : \ ((struct type *) \ ((char *)((head)->stqh_last) - __offsetof(struct type, field)))) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) #define STAILQ_REMOVE(head, elm, type, field) do { \ if (STAILQ_FIRST((head)) == (elm)) { \ STAILQ_REMOVE_HEAD(head, field); \ } \ else { \ struct type *curelm = STAILQ_FIRST((head)); \ while (STAILQ_NEXT(curelm, field) != (elm)) \ curelm = STAILQ_NEXT(curelm, field); \ if ((STAILQ_NEXT(curelm, field) = \ STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\ (head)->stqh_last = &STAILQ_NEXT((curelm), field);\ } \ } while (0) #define STAILQ_REMOVE_HEAD(head, field) do { \ if ((STAILQ_FIRST((head)) = \ STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ (head)->stqh_last = &STAILQ_FIRST((head)); \ } while (0) #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \ (head)->stqh_last = &STAILQ_FIRST((head)); \ } while (0) /* * List declarations. */ #define LIST_HEAD(name, type) \ struct name { \ struct type *lh_first; /* first element */ \ } #define LIST_HEAD_INITIALIZER(head) \ { NULL } #define LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } /* * List functions. */ #define LIST_EMPTY(head) ((head)->lh_first == NULL) #define LIST_FIRST(head) ((head)->lh_first) #define LIST_FOREACH(var, head, field) \ for ((var) = LIST_FIRST((head)); \ (var); \ (var) = LIST_NEXT((var), field)) #define LIST_INIT(head) do { \ LIST_FIRST((head)) = NULL; \ } while (0) #define LIST_INSERT_AFTER(listelm, elm, field) do { \ if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ LIST_NEXT((listelm), field)->field.le_prev = \ &LIST_NEXT((elm), field); \ LIST_NEXT((listelm), field) = (elm); \ (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ } while (0) #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.le_prev = (listelm)->field.le_prev; \ LIST_NEXT((elm), field) = (listelm); \ *(listelm)->field.le_prev = (elm); \ (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ } while (0) #define LIST_INSERT_HEAD(head, elm, field) do { \ if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ LIST_FIRST((head)) = (elm); \ (elm)->field.le_prev = &LIST_FIRST((head)); \ } while (0) #define LIST_NEXT(elm, field) ((elm)->field.le_next) #define LIST_REMOVE(elm, field) do { \ if (LIST_NEXT((elm), field) != NULL) \ LIST_NEXT((elm), field)->field.le_prev = \ (elm)->field.le_prev; \ *(elm)->field.le_prev = LIST_NEXT((elm), field); \ } while (0) /* * Tail queue declarations. */ #define TAILQ_HEAD(name, type) \ struct name { \ struct type *tqh_first; /* first element */ \ struct type **tqh_last; /* addr of last next element */ \ } #define TAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).tqh_first } #define TAILQ_ENTRY(type) \ struct { \ struct type *tqe_next; /* next element */ \ struct type **tqe_prev; /* address of previous next element */ \ } /* * Tail queue functions. */ #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_FOREACH(var, head, field) \ for ((var) = TAILQ_FIRST((head)); \ (var); \ (var) = TAILQ_NEXT((var), field)) #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ for ((var) = TAILQ_LAST((head), headname); \ (var); \ (var) = TAILQ_PREV((var), headname, field)) #define TAILQ_INIT(head) do { \ TAILQ_FIRST((head)) = NULL; \ (head)->tqh_last = &TAILQ_FIRST((head)); \ } while (0) #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ TAILQ_NEXT((elm), field)->field.tqe_prev = \ &TAILQ_NEXT((elm), field); \ else \ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ TAILQ_NEXT((listelm), field) = (elm); \ (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ } while (0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ TAILQ_NEXT((elm), field) = (listelm); \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ } while (0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ TAILQ_FIRST((head))->field.tqe_prev = \ &TAILQ_NEXT((elm), field); \ else \ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ TAILQ_FIRST((head)) = (elm); \ (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ } while (0) #define TAILQ_INSERT_TAIL(head, elm, field) do { \ TAILQ_NEXT((elm), field) = NULL; \ (elm)->field.tqe_prev = (head)->tqh_last; \ *(head)->tqh_last = (elm); \ (head)->tqh_last = &TAILQ_NEXT((elm), field); \ } while (0) #define TAILQ_LAST(head, headname) \ (*(((struct headname *)((head)->tqh_last))->tqh_last)) #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_PREV(elm, headname, field) \ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) #define TAILQ_REMOVE(head, elm, field) do { \ if ((TAILQ_NEXT((elm), field)) != NULL) \ TAILQ_NEXT((elm), field)->field.tqe_prev = \ (elm)->field.tqe_prev; \ else \ (head)->tqh_last = (elm)->field.tqe_prev; \ *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ } while (0) #ifdef _KERNEL /* * XXX insque() and remque() are an old way of handling certain queues. * They bogusly assumes that all queue heads look alike. */ struct quehead { struct quehead *qh_link; struct quehead *qh_rlink; }; #ifdef __GNUC__ static __inline void insque(void *a, void *b) { struct quehead *element = (struct quehead *)a, *head = (struct quehead *)b; element->qh_link = head->qh_link; element->qh_rlink = head; head->qh_link = element; element->qh_link->qh_rlink = element; } static __inline void remque(void *a) { struct quehead *element = (struct quehead *)a; element->qh_link->qh_rlink = element->qh_rlink; element->qh_rlink->qh_link = element->qh_link; element->qh_rlink = 0; } #else /* !__GNUC__ */ -void insque __P((void *a, void *b)); -void remque __P((void *a)); +void insque(void *a, void *b); +void remque(void *a); #endif /* __GNUC__ */ #endif /* _KERNEL */ #endif /* !_SYS_QUEUE_H_ */ Index: head/sys/sys/regression.h =================================================================== --- head/sys/sys/regression.h (revision 92718) +++ head/sys/sys/regression.h (revision 92719) @@ -1,38 +1,38 @@ /*- * Copyright (c) 2001 Robert N. M. Watson * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_REGRESSION_H #define _SYS_REGRESSION_H #ifndef _KERNEL /* * System calls associated with regression testing functions in kernel. */ -int __setugid __P ((int _flag)); +int __setugid(int _flag); #endif /* !_KERNEL */ #endif /* !_SYS_REGRESSION_H */ Index: head/sys/sys/resource.h =================================================================== --- head/sys/sys/resource.h (revision 92718) +++ head/sys/sys/resource.h (revision 92719) @@ -1,152 +1,152 @@ /* * 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. * * @(#)resource.h 8.4 (Berkeley) 1/9/95 * $FreeBSD$ */ #ifndef _SYS_RESOURCE_H_ #define _SYS_RESOURCE_H_ /* * Process priority specifications to get/setpriority. */ #define PRIO_MIN -20 #define PRIO_MAX 20 #ifdef _KERNEL #define PRIO_TOTAL (PRIO_MAX - PRIO_MIN) #endif /* _KERNEL */ #define PRIO_PROCESS 0 #define PRIO_PGRP 1 #define PRIO_USER 2 /* * Resource utilization information. */ #define RUSAGE_SELF 0 #define RUSAGE_CHILDREN -1 struct rusage { struct timeval ru_utime; /* user time used */ struct timeval ru_stime; /* system time used */ long ru_maxrss; /* max resident set size */ #define ru_first ru_ixrss long ru_ixrss; /* integral shared memory size */ long ru_idrss; /* integral unshared data " */ long ru_isrss; /* integral unshared stack " */ 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 ru_last ru_nivcsw }; /* * Resource limits */ #define RLIMIT_CPU 0 /* cpu time in milliseconds */ #define RLIMIT_FSIZE 1 /* maximum file size */ #define RLIMIT_DATA 2 /* data size */ #define RLIMIT_STACK 3 /* stack size */ #define RLIMIT_CORE 4 /* core file size */ #define RLIMIT_RSS 5 /* resident set size */ #define RLIMIT_MEMLOCK 6 /* locked-in-memory address space */ #define RLIMIT_NPROC 7 /* number of processes */ #define RLIMIT_NOFILE 8 /* number of open files */ #define RLIMIT_SBSIZE 9 /* maximum size of all socket buffers */ #define RLIM_NLIMITS 10 /* number of resource limits */ #define RLIM_INFINITY ((rlim_t)(((u_quad_t)1 << 63) - 1)) /* * Resource limit string identifiers */ #ifdef _RLIMIT_IDENT static char *rlimit_ident[] = { "cpu", "fsize", "data", "stack", "core", "rss", "memlock", "nproc", "nofile", "sbsize", }; #endif struct orlimit { int32_t rlim_cur; /* current (soft) limit */ int32_t rlim_max; /* maximum value for rlim_cur */ }; struct rlimit { rlim_t rlim_cur; /* current (soft) limit */ rlim_t rlim_max; /* maximum value for rlim_cur */ }; /* Load average structure. */ struct loadavg { fixpt_t ldavg[3]; long fscale; }; #ifdef _KERNEL extern struct loadavg averunnable; -int dosetrlimit __P((struct thread *, u_int, struct rlimit *)); +int dosetrlimit(struct thread *, u_int, struct rlimit *); #else #include __BEGIN_DECLS -int getpriority __P((int, int)); -int getrlimit __P((int, struct rlimit *)); -int getrusage __P((int, struct rusage *)); -int setpriority __P((int, int, int)); -int setrlimit __P((int, const struct rlimit *)); +int getpriority(int, int); +int getrlimit(int, struct rlimit *); +int getrusage(int, struct rusage *); +int setpriority(int, int, int); +int setrlimit(int, const struct rlimit *); __END_DECLS #endif /* _KERNEL */ #endif /* !_SYS_RESOURCE_H_ */ Index: head/sys/sys/resourcevar.h =================================================================== --- head/sys/sys/resourcevar.h (revision 92718) +++ head/sys/sys/resourcevar.h (revision 92719) @@ -1,128 +1,128 @@ /* * Copyright (c) 1991, 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. * * @(#)resourcevar.h 8.4 (Berkeley) 1/9/95 * $FreeBSD$ */ #ifndef _SYS_RESOURCEVAR_H_ #define _SYS_RESOURCEVAR_H_ #include #include #ifdef _KERNEL #include #include #endif /* * Kernel per-process accounting / statistics * (not necessarily resident except when running). */ struct pstats { #define pstat_startzero p_ru struct rusage p_ru; /* stats for this proc */ struct rusage p_cru; /* sum of stats for reaped children */ #define pstat_endzero pstat_startcopy #define pstat_startcopy p_timer struct itimerval p_timer[3]; /* virtual-time timers */ struct uprof { /* profile arguments */ caddr_t pr_base; /* buffer base */ u_long pr_size; /* buffer size */ u_long pr_off; /* pc offset */ u_long pr_scale; /* pc scaling */ u_long pr_addr; /* temp storage for addr until AST */ u_int pr_ticks; /* temp storage for ticks until AST */ } p_prof; #define pstat_endcopy p_start struct timeval p_start; /* starting time */ }; /* * Kernel shareable process resource limits. Because this structure * is moderately large but changes infrequently, it is normally * shared copy-on-write after forks. If a group of processes * ("threads") share modifications, the PL_SHAREMOD flag is set, * and a copy must be made for the child of a new fork that isn't * sharing modifications to the limits. */ struct plimit { struct rlimit pl_rlimit[RLIM_NLIMITS]; #define PL_SHAREMOD 0x01 /* modifications are shared */ int p_lflags; int p_refcnt; /* number of references */ rlim_t p_cpulimit; /* current cpu limit in usec */ }; #ifdef _KERNEL /* * Per uid resource consumption */ struct uidinfo { LIST_ENTRY(uidinfo) ui_hash; rlim_t ui_sbsize; /* socket buffer space consumed */ long ui_proccnt; /* number of processes */ uid_t ui_uid; /* uid */ u_short ui_ref; /* reference count */ struct mtx *ui_mtxp; /* protect all counts/limits */ }; #define UIDINFO_LOCK(ui) mtx_lock((ui)->ui_mtxp) #define UIDINFO_UNLOCK(ui) mtx_unlock((ui)->ui_mtxp) struct thread; struct kse; struct proc; -void addupc_intr __P((struct kse *ke, uintptr_t pc, u_int ticks)); -void addupc_task __P((struct kse *ke, uintptr_t pc, u_int ticks)); -void calcru __P((struct proc *p, struct timeval *up, struct timeval *sp, - struct timeval *ip)); -int chgproccnt __P((struct uidinfo *uip, int diff, int max)); -int chgsbsize __P((struct uidinfo *uip, u_long *hiwat, u_long to, - rlim_t max)); -int fuswintr __P((void *base)); +void addupc_intr(struct kse *ke, uintptr_t pc, u_int ticks); +void addupc_task(struct kse *ke, uintptr_t pc, u_int ticks); +void calcru(struct proc *p, struct timeval *up, struct timeval *sp, + struct timeval *ip); +int chgproccnt(struct uidinfo *uip, int diff, int max); +int chgsbsize(struct uidinfo *uip, u_long *hiwat, u_long to, + rlim_t max); +int fuswintr(void *base); struct plimit - *limcopy __P((struct plimit *lim)); -void ruadd __P((struct rusage *ru, struct rusage *ru2)); -int suswintr __P((void *base, int word)); + *limcopy(struct plimit *lim); +void ruadd(struct rusage *ru, struct rusage *ru2); +int suswintr(void *base, int word); struct uidinfo - *uifind __P((uid_t uid)); -void uihold __P((struct uidinfo *uip)); -void uifree __P((struct uidinfo *uip)); -void uihashinit __P((void)); + *uifind(uid_t uid); +void uihold(struct uidinfo *uip); +void uifree(struct uidinfo *uip); +void uihashinit(void); #endif #endif /* !_SYS_RESOURCEVAR_H_ */ Index: head/sys/sys/rtprio.h =================================================================== --- head/sys/sys/rtprio.h (revision 92718) +++ head/sys/sys/rtprio.h (revision 92719) @@ -1,91 +1,91 @@ /* * Copyright (c) 1994, Henrik Vestergaard Draboel * 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 (name). * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD$ */ #ifndef _SYS_RTPRIO_H_ #define _SYS_RTPRIO_H_ #include /* * Process realtime-priority specifications to rtprio. */ /* priority types. Start at 1 to catch uninitialized fields. */ #define RTP_PRIO_REALTIME PRI_REALTIME /* real time process */ #define RTP_PRIO_NORMAL PRI_TIMESHARE /* time sharing process */ #define RTP_PRIO_IDLE PRI_IDLE /* idle process */ /* RTP_PRIO_FIFO is POSIX.1B SCHED_FIFO. */ #define RTP_PRIO_FIFO_BIT PRI_FIFO_BIT #define RTP_PRIO_FIFO PRI_FIFO #define RTP_PRIO_BASE(P) PRI_BASE(P) #define RTP_PRIO_IS_REALTIME(P) PRI_IS_REALTIME(P) #define RTP_PRIO_NEED_RR(P) PRI_NEED_RR(P) /* priority range */ #define RTP_PRIO_MIN 0 /* Highest priority */ #define RTP_PRIO_MAX 31 /* Lowest priority */ /* * rtprio() syscall functions */ #define RTP_LOOKUP 0 #define RTP_SET 1 #ifndef LOCORE /* * Scheduling class information. */ struct rtprio { u_short type; /* scheduling class */ u_short prio; }; #ifdef _KERNEL struct ksegrp; int rtp_to_pri(struct rtprio *, struct ksegrp *); void pri_to_rtp(struct ksegrp *, struct rtprio *); #endif #endif #ifndef _KERNEL #include __BEGIN_DECLS -int rtprio __P((int, pid_t, struct rtprio *)); +int rtprio(int, pid_t, struct rtprio *); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_RTPRIO_H_ */ Index: head/sys/sys/selinfo.h =================================================================== --- head/sys/sys/selinfo.h (revision 92718) +++ head/sys/sys/selinfo.h (revision 92719) @@ -1,63 +1,63 @@ /*- * Copyright (c) 1992, 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. * * @(#)select.h 8.2 (Berkeley) 1/4/94 * $FreeBSD$ */ #ifndef _SYS_SELINFO_H_ #define _SYS_SELINFO_H_ #include /* for struct klist */ /* * Used to maintain information about processes that wish to be * notified when I/O becomes possible. */ struct selinfo { TAILQ_ENTRY(selinfo) si_thrlist; /* list hung off of thread */ struct thread *si_thread; /* thread waiting */ struct klist si_note; /* kernel note list */ short si_flags; /* see below */ }; #define SI_COLL 0x0001 /* collision occurred */ #define SEL_WAITING(si) \ ((si)->si_thread != NULL || ((si)->si_flags & SI_COLL) != 0) #ifdef _KERNEL void clear_selinfo_list(struct thread *td); -void selrecord __P((struct thread *selector, struct selinfo *sip)); -void selwakeup __P((struct selinfo *sip)); +void selrecord(struct thread *selector, struct selinfo *sip); +void selwakeup(struct selinfo *sip); #endif #endif /* !_SYS_SELINFO_H_ */ Index: head/sys/sys/sem.h =================================================================== --- head/sys/sys/sem.h (revision 92718) +++ head/sys/sys/sem.h (revision 92719) @@ -1,108 +1,108 @@ /* $FreeBSD$ */ /* $NetBSD: sem.h,v 1.5 1994/06/29 06:45:15 cgd Exp $ */ /* * SVID compatible sem.h file * * Author: Daniel Boulet */ #ifndef _SYS_SEM_H_ #define _SYS_SEM_H_ #include struct sem; struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ struct sem *sem_base; /* pointer to first semaphore in set */ u_short sem_nsems; /* number of sems in set */ time_t sem_otime; /* last operation time */ long sem_pad1; /* SVABI/386 says I need this here */ time_t sem_ctime; /* last change time */ /* Times measured in secs since */ /* 00:00:00 GMT, Jan. 1, 1970 */ long sem_pad2; /* SVABI/386 says I need this here */ long sem_pad3[4]; /* SVABI/386 says I need this here */ }; /* * semop's sops parameter structure */ struct sembuf { u_short sem_num; /* semaphore # */ short sem_op; /* semaphore operation */ short sem_flg; /* operation flags */ }; #define SEM_UNDO 010000 /* * semctl's arg parameter structure */ union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ u_short *array; /* array for GETALL & SETALL */ }; /* * commands for semctl */ #define GETNCNT 3 /* Return the value of semncnt {READ} */ #define GETPID 4 /* Return the value of sempid {READ} */ #define GETVAL 5 /* Return the value of semval {READ} */ #define GETALL 6 /* Return semvals into arg.array {READ} */ #define GETZCNT 7 /* Return the value of semzcnt {READ} */ #define SETVAL 8 /* Set the value of semval to arg.val {ALTER} */ #define SETALL 9 /* Set semvals from arg.array {ALTER} */ #define SEM_STAT 10 /* Like IPC_STAT but treats semid as sema-index */ #define SEM_INFO 11 /* Like IPC_INFO but treats semid as sema-index */ /* * Permissions */ #define SEM_A IPC_W /* alter permission */ #define SEM_R IPC_R /* read permission */ #ifdef _KERNEL /* * semaphore info struct */ struct seminfo { int semmap, /* # of entries in semaphore map */ semmni, /* # of semaphore identifiers */ semmns, /* # of semaphores in system */ semmnu, /* # of undo structures in system */ semmsl, /* max # of semaphores per id */ semopm, /* max # of operations per semop call */ semume, /* max # of undo entries per process */ semusz, /* size in bytes of undo structure */ semvmx, /* semaphore maximum value */ semaem; /* adjust on exit max value */ }; extern struct seminfo seminfo; /* internal "mode" bits */ #define SEM_ALLOC 01000 /* semaphore is allocated */ #define SEM_DEST 02000 /* semaphore will be destroyed on last detach */ /* * Process sem_undo vectors at proc exit. */ -void semexit __P((struct proc *p)); +void semexit(struct proc *p); #endif /* _KERNEL */ #ifndef _KERNEL #include __BEGIN_DECLS -int semsys __P((int, ...)); -int semctl __P((int, int, int, ...)); -int semget __P((key_t, int, int)); -int semop __P((int, struct sembuf *,unsigned)); +int semsys(int, ...); +int semctl(int, int, int, ...); +int semget(key_t, int, int); +int semop(int, struct sembuf *,unsigned); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SEM_H_ */ Index: head/sys/sys/shm.h =================================================================== --- head/sys/sys/shm.h (revision 92718) +++ head/sys/sys/shm.h (revision 92719) @@ -1,117 +1,117 @@ /* $FreeBSD$ */ /* $NetBSD: shm.h,v 1.15 1994/06/29 06:45:17 cgd Exp $ */ /* * Copyright (c) 1994 Adam Glass * 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 Adam Glass. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ /* * As defined+described in "X/Open System Interfaces and Headers" * Issue 4, p. XXX */ #ifndef _SYS_SHM_H_ #define _SYS_SHM_H_ #include #define SHM_RDONLY 010000 /* Attach read-only (else read-write) */ #define SHM_RND 020000 /* Round attach address to SHMLBA */ #define SHMLBA PAGE_SIZE /* Segment low boundary address multiple */ /* "official" access mode definitions; somewhat braindead since you have to specify (SHM_* >> 3) for group and (SHM_* >> 6) for world permissions */ #define SHM_R (IPC_R) #define SHM_W (IPC_W) /* predefine tbd *LOCK shmctl commands */ #define SHM_LOCK 11 #define SHM_UNLOCK 12 /* ipcs shmctl commands */ #define SHM_STAT 13 #define SHM_INFO 14 struct shmid_ds { struct ipc_perm shm_perm; /* operation permission structure */ int shm_segsz; /* size of segment in bytes */ pid_t shm_lpid; /* process ID of last shared memory op */ pid_t shm_cpid; /* process ID of creator */ short shm_nattch; /* number of current attaches */ time_t shm_atime; /* time of last shmat() */ time_t shm_dtime; /* time of last shmdt() */ time_t shm_ctime; /* time of last change by shmctl() */ void *shm_internal; /* sysv stupidity */ }; #ifdef _KERNEL /* * System 5 style catch-all structure for shared memory constants that * might be of interest to user programs. Do we really want/need this? */ struct shminfo { int shmmax, /* max shared memory segment size (bytes) */ shmmin, /* min shared memory segment size (bytes) */ shmmni, /* max number of shared memory identifiers */ shmseg, /* max shared memory segments per process */ shmall; /* max amount of shared memory (pages) */ }; extern struct shminfo shminfo; extern struct shmid_ds *shmsegs; struct shm_info { int used_ids; unsigned long shm_tot; unsigned long shm_rss; unsigned long shm_swp; unsigned long swap_attempts; unsigned long swap_successes; }; struct thread; struct proc; -void shmexit __P((struct proc *)); -void shmfork __P((struct proc *, struct proc *)); +void shmexit(struct proc *); +void shmfork(struct proc *, struct proc *); #else /* !_KERNEL */ #include __BEGIN_DECLS -int shmsys __P((int, ...)); -void *shmat __P((int, void *, int)); -int shmget __P((key_t, int, int)); -int shmctl __P((int, int, struct shmid_ds *)); -int shmdt __P((void *)); +int shmsys(int, ...); +void *shmat(int, void *, int); +int shmget(key_t, int, int); +int shmctl(int, int, struct shmid_ds *); +int shmdt(void *); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_SHM_H_ */ Index: head/sys/sys/signal.h =================================================================== --- head/sys/sys/signal.h (revision 92718) +++ head/sys/sys/signal.h (revision 92719) @@ -1,309 +1,308 @@ /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 * 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. * * @(#)signal.h 8.4 (Berkeley) 5/4/95 * $FreeBSD$ */ #ifndef _SYS_SIGNAL_H_ #define _SYS_SIGNAL_H_ #include #include /* * sigset_t macros. */ #define _SIG_WORDS 4 #define _SIG_MAXSIG 128 #define _SIG_IDX(sig) ((sig) - 1) #define _SIG_WORD(sig) (_SIG_IDX(sig) >> 5) #define _SIG_BIT(sig) (1 << (_SIG_IDX(sig) & 31)) #define _SIG_VALID(sig) ((sig) <= _SIG_MAXSIG && (sig) > 0) /* * System defined signals. */ #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt */ #define SIGQUIT 3 /* quit */ #define SIGILL 4 /* illegal instr. (not reset when caught) */ #ifndef _POSIX_SOURCE #define SIGTRAP 5 /* trace trap (not reset when caught) */ #endif #define SIGABRT 6 /* abort() */ #ifndef _POSIX_SOURCE #define SIGIOT SIGABRT /* compatibility */ #define SIGEMT 7 /* EMT instruction */ #endif #define SIGFPE 8 /* floating point exception */ #define SIGKILL 9 /* kill (cannot be caught or ignored) */ #ifndef _POSIX_SOURCE #define SIGBUS 10 /* bus error */ #endif #define SIGSEGV 11 /* segmentation violation */ #ifndef _POSIX_SOURCE #define SIGSYS 12 /* non-existent system call invoked */ #endif #define SIGPIPE 13 /* write on a pipe with no one to read it */ #define SIGALRM 14 /* alarm clock */ #define SIGTERM 15 /* software termination signal from kill */ #ifndef _POSIX_SOURCE #define SIGURG 16 /* urgent condition on IO channel */ #endif #define SIGSTOP 17 /* sendable stop signal not from tty */ #define SIGTSTP 18 /* stop signal from tty */ #define SIGCONT 19 /* continue a stopped process */ #define SIGCHLD 20 /* to parent on child stop or exit */ #define SIGTTIN 21 /* to readers pgrp upon background tty read */ #define SIGTTOU 22 /* like TTIN if (tp->t_local<OSTOP) */ #ifndef _POSIX_SOURCE #define SIGIO 23 /* input/output possible signal */ #define SIGXCPU 24 /* exceeded CPU time limit */ #define SIGXFSZ 25 /* exceeded file size limit */ #define SIGVTALRM 26 /* virtual time alarm */ #define SIGPROF 27 /* profiling time alarm */ #define SIGWINCH 28 /* window size changes */ #define SIGINFO 29 /* information request */ #endif #define SIGUSR1 30 /* user defined signal 1 */ #define SIGUSR2 31 /* user defined signal 2 */ /*- * Type of a signal handling function. * * Language spec sez signal handlers take exactly one arg, even though we * actually supply three. Ugh! * * We don't try to hide the difference by leaving out the args because * that would cause warnings about conformant programs. Nonconformant * programs can avoid the warnings by casting to (__sighandler_t *) or * sig_t before calling signal() or assigning to sa_handler or sv_handler. * * The kernel should reverse the cast before calling the function. It * has no way to do this, but on most machines 1-arg and 3-arg functions * have the same calling protocol so there is no problem in practice. * A bit in sa_flags could be used to specify the number of args. */ -typedef void __sighandler_t __P((int)); +typedef void __sighandler_t(int); #define SIG_DFL ((__sighandler_t *)0) #define SIG_IGN ((__sighandler_t *)1) #define SIG_ERR ((__sighandler_t *)-1) #if defined(_P1003_1B_VISIBLE) || defined(_KERNEL) union sigval { /* Members as suggested by Annex C of POSIX 1003.1b. */ int sigval_int; void *sigval_ptr; }; struct sigevent { int sigev_notify; /* Notification type */ union { int __sigev_signo; /* Signal number */ int __sigev_notify_kqueue; } __sigev_u; union sigval sigev_value; /* Signal value */ }; #define sigev_signo __sigev_u.__sigev_signo #define sigev_notify_kqueue __sigev_u.__sigev_notify_kqueue #define SIGEV_NONE 0 /* No async notification */ #define SIGEV_SIGNAL 1 /* Generate a queued signal */ #define SIGEV_KEVENT 3 /* Generate a kevent */ typedef struct __siginfo { int si_signo; /* signal number */ int si_errno; /* errno association */ /* * Cause of signal, one of the SI_ macros or signal-specific * values, i.e. one of the FPE_... values for SIGFPE. This * value is equivalent to the second argument to an old-style * FreeBSD signal handler. */ int si_code; /* signal code */ int si_pid; /* sending process */ unsigned int si_uid; /* sender's ruid */ int si_status; /* exit value */ void *si_addr; /* faulting instruction */ union sigval si_value; /* signal value */ long si_band; /* band event for SIGPOLL */ int __spare__[7]; /* gimme some slack */ } siginfo_t; #endif /* _P1003_1B_VISIBLE */ typedef struct __sigset { unsigned int __bits[_SIG_WORDS]; } sigset_t; /* * XXX - there are some nasty dependencies on include file order. Now that * sigset_t has been defined we can include the MD header. */ #include /* sig_atomic_t; trap codes; sigcontext */ #if !defined(_ANSI_SOURCE) struct __siginfo; /* * Signal vector "template" used in sigaction call. */ struct sigaction { union { - void (*__sa_handler) __P((int)); - void (*__sa_sigaction) __P((int, struct __siginfo *, - void *)); + void (*__sa_handler)(int); + void (*__sa_sigaction)(int, struct __siginfo *, void *); } __sigaction_u; /* signal handler */ int sa_flags; /* see signal options below */ sigset_t sa_mask; /* signal mask to apply */ }; /* if SA_SIGINFO is set, sa_sigaction is to be used instead of sa_handler. */ #define sa_handler __sigaction_u.__sa_handler #define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ #if !defined(_POSIX_SOURCE) #define sa_sigaction __sigaction_u.__sa_sigaction #define SA_ONSTACK 0x0001 /* take signal on signal stack */ #define SA_RESTART 0x0002 /* restart system call on signal return */ #define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ #define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ #define SA_NOCLDWAIT 0x0020 /* don't keep zombies around */ #define SA_SIGINFO 0x0040 /* signal handler with SA_SIGINFO args */ #ifdef COMPAT_SUNOS #define SA_USERTRAMP 0x0100 /* do not bounce off kernel's sigtramp */ #endif #define NSIG 32 /* number of old signals (counting 0) */ /* POSIX 1003.1b required values. */ #define SI_USER 0x10001 #define SI_QUEUE 0x10002 #define SI_TIMER 0x10003 #define SI_ASYNCIO 0x10004 #define SI_MESGQ 0x10005 /* Additional FreeBSD values. */ #define SI_UNDEFINED 0 -typedef void __siginfohandler_t __P((int, struct __siginfo *, void *)); +typedef void __siginfohandler_t(int, struct __siginfo *, void *); typedef __sighandler_t *sig_t; /* type of pointer to a signal function */ #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ #endif /* * Structure used in sigaltstack call. */ typedef struct sigaltstack { char *ss_sp; /* signal stack base */ size_t ss_size; /* signal stack length */ int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ } stack_t; #define SS_ONSTACK 0x0001 /* take signal on alternate stack */ #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ /* * Forward declaration for __ucontext so that sigreturn can use it * without having to include . */ struct __ucontext; /* * 4.3 compatibility: * Signal vector "template" used in sigvec call. */ struct sigvec { __sighandler_t *sv_handler; /* signal handler */ int sv_mask; /* signal mask to apply */ int sv_flags; /* see signal options below */ }; #define SV_ONSTACK SA_ONSTACK #define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */ #define SV_RESETHAND SA_RESETHAND #define SV_NODEFER SA_NODEFER #define SV_NOCLDSTOP SA_NOCLDSTOP #define SV_SIGINFO SA_SIGINFO #define sv_onstack sv_flags /* isn't compatibility wonderful! */ /* * Structure used in sigstack call. */ struct sigstack { char *ss_sp; /* signal stack pointer */ int ss_onstack; /* current status */ }; /* * Macro for converting signal number to a mask suitable for * sigblock(). */ #define sigmask(m) (1 << ((m)-1)) #define BADSIG SIG_ERR #endif /* !_POSIX_SOURCE */ /* * Flags for sigprocmask: */ #define SIG_BLOCK 1 /* block specified signal set */ #define SIG_UNBLOCK 2 /* unblock specified signal set */ #define SIG_SETMASK 3 /* set specified signal set */ #endif /* !_ANSI_SOURCE */ /* * For historical reasons; programs expect signal's return value to be * defined by . */ __BEGIN_DECLS -__sighandler_t *signal __P((int, __sighandler_t *)); +__sighandler_t *signal(int, __sighandler_t *); __END_DECLS #endif /* !_SYS_SIGNAL_H_ */ Index: head/sys/sys/signalvar.h =================================================================== --- head/sys/sys/signalvar.h (revision 92718) +++ head/sys/sys/signalvar.h (revision 92719) @@ -1,222 +1,222 @@ /* * Copyright (c) 1991, 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. * * @(#)signalvar.h 8.6 (Berkeley) 2/19/95 * $FreeBSD$ */ #ifndef _SYS_SIGNALVAR_H_ #define _SYS_SIGNALVAR_H_ #include /* * Kernel signal definitions and data structures, * not exported to user programs. */ /* * Process signal actions and state, needed only within the process * (not necessarily resident). */ struct sigacts { sig_t ps_sigact[_SIG_MAXSIG]; /* disposition of signals */ sigset_t ps_catchmask[_SIG_MAXSIG]; /* signals to be blocked */ sigset_t ps_sigonstack; /* signals to take on sigstack */ sigset_t ps_sigintr; /* signals that interrupt syscalls */ sigset_t ps_sigreset; /* signals that reset when caught */ sigset_t ps_signodefer; /* signals not masked while handled */ sigset_t ps_siginfo; /* signals that want SA_SIGINFO args */ sigset_t ps_osigset; /* signals that use osigset_t */ sigset_t ps_usertramp; /* SunOS compat; libc sigtramp XXX */ }; #ifdef _KERNEL /* * Compatibility. */ typedef struct { struct osigcontext si_sc; int si_signo; int si_code; union sigval si_value; } osiginfo_t; struct osigaction { union { - void (*__sa_handler) __P((int)); - void (*__sa_sigaction) __P((int, osiginfo_t *, void *)); + void (*__sa_handler)(int); + void (*__sa_sigaction)(int, osiginfo_t *, void *); } __sigaction_u; /* signal handler */ osigset_t sa_mask; /* signal mask to apply */ int sa_flags; /* see signal options below */ }; -typedef void __osiginfohandler_t __P((int, osiginfo_t *, void *)); +typedef void __osiginfohandler_t(int, osiginfo_t *, void *); #endif /* _KERNEL */ /* additional signal action values, used only temporarily/internally */ #define SIG_CATCH ((__sighandler_t *)2) #define SIG_HOLD ((__sighandler_t *)3) /* * get signal action for process and signal; currently only for current process */ #define SIGACTION(p, sig) (p->p_sigacts->ps_sigact[_SIG_IDX(sig)]) /* * sigset_t manipulation macros */ #define SIGADDSET(set, signo) \ (set).__bits[_SIG_WORD(signo)] |= _SIG_BIT(signo) #define SIGDELSET(set, signo) \ (set).__bits[_SIG_WORD(signo)] &= ~_SIG_BIT(signo) #define SIGEMPTYSET(set) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set).__bits[__i] = 0; \ } while (0) #define SIGFILLSET(set) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set).__bits[__i] = ~0U; \ } while (0) #define SIGISMEMBER(set, signo) \ ((set).__bits[_SIG_WORD(signo)] & _SIG_BIT(signo)) #define SIGISEMPTY(set) __sigisempty(&(set)) #define SIGNOTEMPTY(set) (!__sigisempty(&(set))) #define SIGSETEQ(set1, set2) __sigseteq(&(set1), &(set2)) #define SIGSETNEQ(set1, set2) (!__sigseteq(&(set1), &(set2))) #define SIGSETOR(set1, set2) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set1).__bits[__i] |= (set2).__bits[__i]; \ } while (0) #define SIGSETAND(set1, set2) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set1).__bits[__i] &= (set2).__bits[__i]; \ } while (0) #define SIGSETNAND(set1, set2) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set1).__bits[__i] &= ~(set2).__bits[__i]; \ } while (0) #define SIGSETLO(set1, set2) ((set1).__bits[0] = (set2).__bits[0]) #define SIGSETOLD(set, oset) ((set).__bits[0] = (oset)) #define SIG_CANTMASK(set) \ SIGDELSET(set, SIGKILL), SIGDELSET(set, SIGSTOP) #define SIG_STOPSIGMASK(set) \ SIGDELSET(set, SIGSTOP), SIGDELSET(set, SIGTSTP), \ SIGDELSET(set, SIGTTIN), SIGDELSET(set, SIGTTOU) #define SIG_CONTSIGMASK(set) \ SIGDELSET(set, SIGCONT) #define sigcantmask (sigmask(SIGKILL) | sigmask(SIGSTOP)) #define SIG2OSIG(sig, osig) osig = (sig).__bits[0] #define OSIG2SIG(osig, sig) SIGEMPTYSET(sig); (sig).__bits[0] = osig static __inline int __sigisempty(sigset_t *set) { int i; for (i = 0; i < _SIG_WORDS; i++) { if (set->__bits[i]) return (0); } return (1); } static __inline int __sigseteq(sigset_t *set1, sigset_t *set2) { int i; for (i = 0; i < _SIG_WORDS; i++) { if (set1->__bits[i] != set2->__bits[i]) return (0); } return (1); } #ifdef _KERNEL struct pgrp; struct thread; struct proc; struct sigio; extern int sugid_coredump; /* Sysctl variable kern.sugid_coredump */ /* * Machine-independent functions: */ int CURSIG(struct proc *p); -void execsigs __P((struct proc *p)); -void gsignal __P((int pgid, int sig)); -int issignal __P((struct proc *p)); -void killproc __P((struct proc *p, char *why)); -void pgsigio __P((struct sigio *, int signum, int checkctty)); -void pgsignal __P((struct pgrp *pgrp, int sig, int checkctty)); -void postsig __P((int sig)); -void psignal __P((struct proc *p, int sig)); -void sigexit __P((struct thread *td, int signum)) __dead2; -void siginit __P((struct proc *p)); -void trapsignal __P((struct proc *p, int sig, u_long code)); +void execsigs(struct proc *p); +void gsignal(int pgid, int sig); +int issignal(struct proc *p); +void killproc(struct proc *p, char *why); +void pgsigio(struct sigio *, int signum, int checkctty); +void pgsignal(struct pgrp *pgrp, int sig, int checkctty); +void postsig(int sig); +void psignal(struct proc *p, int sig); +void sigexit(struct thread *td, int signum) __dead2; +void siginit(struct proc *p); +void trapsignal(struct proc *p, int sig, u_long code); /* * Machine-dependent functions: */ -void sendsig __P((sig_t action, int sig, sigset_t *retmask, u_long code)); +void sendsig(sig_t action, int sig, sigset_t *retmask, u_long code); #endif /* _KERNEL */ #endif /* !_SYS_SIGNALVAR_H_ */ Index: head/sys/sys/socket.h =================================================================== --- head/sys/sys/socket.h (revision 92718) +++ head/sys/sys/socket.h (revision 92719) @@ -1,467 +1,467 @@ /* * Copyright (c) 1982, 1985, 1986, 1988, 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. * * @(#)socket.h 8.4 (Berkeley) 2/21/94 * $FreeBSD$ */ #ifndef _SYS_SOCKET_H_ #define _SYS_SOCKET_H_ #include #define _NO_NAMESPACE_POLLUTION #include #undef _NO_NAMESPACE_POLLUTION /* * Definitions related to sockets: types, address families, options. */ /* * Data types. */ typedef u_char sa_family_t; #ifdef _BSD_SOCKLEN_T_ typedef _BSD_SOCKLEN_T_ socklen_t; #undef _BSD_SOCKLEN_T_ #endif /* * Types */ #define SOCK_STREAM 1 /* stream socket */ #define SOCK_DGRAM 2 /* datagram socket */ #define SOCK_RAW 3 /* raw-protocol interface */ #define SOCK_RDM 4 /* reliably-delivered message */ #define SOCK_SEQPACKET 5 /* sequenced packet stream */ /* * Option flags per-socket. */ #define SO_DEBUG 0x0001 /* turn on debugging info recording */ #define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ #define SO_REUSEADDR 0x0004 /* allow local address reuse */ #define SO_KEEPALIVE 0x0008 /* keep connections alive */ #define SO_DONTROUTE 0x0010 /* just use interface addresses */ #define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ #define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ #define SO_LINGER 0x0080 /* linger on close if data present */ #define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ #define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ #define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ #define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */ /* * Additional options, not kept in so_options. */ #define SO_SNDBUF 0x1001 /* send buffer size */ #define SO_RCVBUF 0x1002 /* receive buffer size */ #define SO_SNDLOWAT 0x1003 /* send low-water mark */ #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ #define SO_SNDTIMEO 0x1005 /* send timeout */ #define SO_RCVTIMEO 0x1006 /* receive timeout */ #define SO_ERROR 0x1007 /* get error status and clear */ #define SO_TYPE 0x1008 /* get socket type */ /*efine SO_PRIVSTATE 0x1009 get/deny privileged state */ /* * Structure used for manipulating linger option. */ struct linger { int l_onoff; /* option on/off */ int l_linger; /* linger time */ }; struct accept_filter_arg { char af_name[16]; char af_arg[256-16]; }; /* * Level number for (get/set)sockopt() to apply to socket itself. */ #define SOL_SOCKET 0xffff /* options for socket level */ /* * Address families. */ #define AF_UNSPEC 0 /* unspecified */ #define AF_LOCAL 1 /* local to host (pipes, portals) */ #define AF_UNIX AF_LOCAL /* backward compatibility */ #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ #define AF_IMPLINK 3 /* arpanet imp addresses */ #define AF_PUP 4 /* pup protocols: e.g. BSP */ #define AF_CHAOS 5 /* mit CHAOS protocols */ #define AF_NS 6 /* XEROX NS protocols */ #define AF_ISO 7 /* ISO protocols */ #define AF_OSI AF_ISO #define AF_ECMA 8 /* European computer manufacturers */ #define AF_DATAKIT 9 /* datakit protocols */ #define AF_CCITT 10 /* CCITT protocols, X.25 etc */ #define AF_SNA 11 /* IBM SNA */ #define AF_DECnet 12 /* DECnet */ #define AF_DLI 13 /* DEC Direct data link interface */ #define AF_LAT 14 /* LAT */ #define AF_HYLINK 15 /* NSC Hyperchannel */ #define AF_APPLETALK 16 /* Apple Talk */ #define AF_ROUTE 17 /* Internal Routing Protocol */ #define AF_LINK 18 /* Link layer interface */ #define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ #define AF_COIP 20 /* connection-oriented IP, aka ST II */ #define AF_CNT 21 /* Computer Network Technology */ #define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ #define AF_IPX 23 /* Novell Internet Protocol */ #define AF_SIP 24 /* Simple Internet Protocol */ #define pseudo_AF_PIP 25 /* Help Identify PIP packets */ #define AF_ISDN 26 /* Integrated Services Digital Network*/ #define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ #define pseudo_AF_KEY 27 /* Internal key-management function */ #define AF_INET6 28 /* IPv6 */ #define AF_NATM 29 /* native ATM access */ #define AF_ATM 30 /* ATM */ #define pseudo_AF_HDRCMPLT 31 /* Used by BPF to not rewrite headers * in interface output routine */ #define AF_NETGRAPH 32 /* Netgraph sockets */ #define AF_SLOW 33 /* 802.3ad slow protocol */ #define AF_SCLUSTER 34 /* Sitara cluster protocol */ #define AF_MAX 35 /* * Structure used by kernel to store most * addresses. */ struct sockaddr { u_char sa_len; /* total length */ sa_family_t sa_family; /* address family */ char sa_data[14]; /* actually longer; address value */ }; #define SOCK_MAXADDRLEN 255 /* longest possible addresses */ /* * Structure used by kernel to pass protocol * information in raw sockets. */ struct sockproto { u_short sp_family; /* address family */ u_short sp_protocol; /* protocol */ }; /* * RFC 2553: protocol-independent placeholder for socket addresses */ #define _SS_MAXSIZE 128U #define _SS_ALIGNSIZE (sizeof(int64_t)) #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) - sizeof(sa_family_t)) #define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) - sizeof(sa_family_t) - \ _SS_PAD1SIZE - _SS_ALIGNSIZE) struct sockaddr_storage { u_char ss_len; /* address length */ sa_family_t ss_family; /* address family */ char __ss_pad1[_SS_PAD1SIZE]; int64_t __ss_align; /* force desired structure storage alignment */ char __ss_pad2[_SS_PAD2SIZE]; }; /* * Protocol families, same as address families for now. */ #define PF_UNSPEC AF_UNSPEC #define PF_LOCAL AF_LOCAL #define PF_UNIX PF_LOCAL /* backward compatibility */ #define PF_INET AF_INET #define PF_IMPLINK AF_IMPLINK #define PF_PUP AF_PUP #define PF_CHAOS AF_CHAOS #define PF_NS AF_NS #define PF_ISO AF_ISO #define PF_OSI AF_ISO #define PF_ECMA AF_ECMA #define PF_DATAKIT AF_DATAKIT #define PF_CCITT AF_CCITT #define PF_SNA AF_SNA #define PF_DECnet AF_DECnet #define PF_DLI AF_DLI #define PF_LAT AF_LAT #define PF_HYLINK AF_HYLINK #define PF_APPLETALK AF_APPLETALK #define PF_ROUTE AF_ROUTE #define PF_LINK AF_LINK #define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ #define PF_COIP AF_COIP #define PF_CNT AF_CNT #define PF_SIP AF_SIP #define PF_IPX AF_IPX /* same format as AF_NS */ #define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */ #define PF_PIP pseudo_AF_PIP #define PF_ISDN AF_ISDN #define PF_KEY pseudo_AF_KEY #define PF_INET6 AF_INET6 #define PF_NATM AF_NATM #define PF_ATM AF_ATM #define PF_NETGRAPH AF_NETGRAPH #define PF_SLOW AF_SLOW #define PF_SCLUSTER AF_SCLUSTER #define PF_MAX AF_MAX /* * Definitions for network related sysctl, CTL_NET. * * Second level is protocol family. * Third level is protocol number. * * Further levels are defined by the individual families below. */ #define NET_MAXID AF_MAX #define CTL_NET_NAMES { \ { 0, 0 }, \ { "unix", CTLTYPE_NODE }, \ { "inet", CTLTYPE_NODE }, \ { "implink", CTLTYPE_NODE }, \ { "pup", CTLTYPE_NODE }, \ { "chaos", CTLTYPE_NODE }, \ { "xerox_ns", CTLTYPE_NODE }, \ { "iso", CTLTYPE_NODE }, \ { "emca", CTLTYPE_NODE }, \ { "datakit", CTLTYPE_NODE }, \ { "ccitt", CTLTYPE_NODE }, \ { "ibm_sna", CTLTYPE_NODE }, \ { "decnet", CTLTYPE_NODE }, \ { "dec_dli", CTLTYPE_NODE }, \ { "lat", CTLTYPE_NODE }, \ { "hylink", CTLTYPE_NODE }, \ { "appletalk", CTLTYPE_NODE }, \ { "route", CTLTYPE_NODE }, \ { "link_layer", CTLTYPE_NODE }, \ { "xtp", CTLTYPE_NODE }, \ { "coip", CTLTYPE_NODE }, \ { "cnt", CTLTYPE_NODE }, \ { "rtip", CTLTYPE_NODE }, \ { "ipx", CTLTYPE_NODE }, \ { "sip", CTLTYPE_NODE }, \ { "pip", CTLTYPE_NODE }, \ { "isdn", CTLTYPE_NODE }, \ { "key", CTLTYPE_NODE }, \ { "inet6", CTLTYPE_NODE }, \ { "natm", CTLTYPE_NODE }, \ { "atm", CTLTYPE_NODE }, \ { "hdrcomplete", CTLTYPE_NODE }, \ { "netgraph", CTLTYPE_NODE }, \ { "snp", CTLTYPE_NODE }, \ { "scp", CTLTYPE_NODE }, \ } /* * PF_ROUTE - Routing table * * Three additional levels are defined: * Fourth: address family, 0 is wildcard * Fifth: type of info, defined below * Sixth: flag(s) to mask with for NET_RT_FLAGS */ #define NET_RT_DUMP 1 /* dump; may limit to a.f. */ #define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ #define NET_RT_IFLIST 3 /* survey interface list */ #define NET_RT_MAXID 4 #define CTL_NET_RT_NAMES { \ { 0, 0 }, \ { "dump", CTLTYPE_STRUCT }, \ { "flags", CTLTYPE_STRUCT }, \ { "iflist", CTLTYPE_STRUCT }, \ } /* * Maximum queue length specifiable by listen. */ #ifndef SOMAXCONN #define SOMAXCONN 128 #endif /* * Message header for recvmsg and sendmsg calls. * Used value-result for recvmsg, value only for sendmsg. */ struct msghdr { void *msg_name; /* optional address */ socklen_t msg_namelen; /* size of address */ struct iovec *msg_iov; /* scatter/gather array */ int msg_iovlen; /* # elements in msg_iov */ void *msg_control; /* ancillary data, see below */ socklen_t msg_controllen; /* ancillary data buffer len */ int msg_flags; /* flags on received message */ }; #define MSG_OOB 0x1 /* process out-of-band data */ #define MSG_PEEK 0x2 /* peek at incoming message */ #define MSG_DONTROUTE 0x4 /* send without using routing tables */ #define MSG_EOR 0x8 /* data completes record */ #define MSG_TRUNC 0x10 /* data discarded before delivery */ #define MSG_CTRUNC 0x20 /* control data lost before delivery */ #define MSG_WAITALL 0x40 /* wait for full request or error */ #define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ #define MSG_EOF 0x100 /* data completes connection */ #define MSG_COMPAT 0x8000 /* used in sendit() */ /* * Header for ancillary data objects in msg_control buffer. * Used for additional information with/about a datagram * not expressible by flags. The format is a sequence * of message elements headed by cmsghdr structures. */ struct cmsghdr { socklen_t cmsg_len; /* data byte count, including hdr */ int cmsg_level; /* originating protocol */ int cmsg_type; /* protocol-specific type */ /* followed by u_char cmsg_data[]; */ }; /* * While we may have more groups than this, the cmsgcred struct must * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow * this. */ #define CMGROUP_MAX 16 /* * Credentials structure, used to verify the identity of a peer * process that has sent us a message. This is allocated by the * peer process but filled in by the kernel. This prevents the * peer from lying about its identity. (Note that cmcred_groups[0] * is the effective GID.) */ struct cmsgcred { pid_t cmcred_pid; /* PID of sending process */ uid_t cmcred_uid; /* real UID of sending process */ uid_t cmcred_euid; /* effective UID of sending process */ gid_t cmcred_gid; /* real GID of sending process */ short cmcred_ngroups; /* number or groups */ gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ }; /* given pointer to struct cmsghdr, return pointer to data */ #define CMSG_DATA(cmsg) ((u_char *)(cmsg) + \ _ALIGN(sizeof(struct cmsghdr))) /* given pointer to struct cmsghdr, return pointer to next cmsghdr */ #define CMSG_NXTHDR(mhdr, cmsg) \ (((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len) + \ _ALIGN(sizeof(struct cmsghdr)) > \ (caddr_t)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \ (struct cmsghdr *)NULL : \ (struct cmsghdr *)((caddr_t)(cmsg) + _ALIGN((cmsg)->cmsg_len))) #define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control) /* RFC 2292 additions */ #define CMSG_SPACE(l) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l)) #define CMSG_LEN(l) (_ALIGN(sizeof(struct cmsghdr)) + (l)) #ifdef _KERNEL #define CMSG_ALIGN(n) _ALIGN(n) #endif /* "Socket"-level control message types: */ #define SCM_RIGHTS 0x01 /* access rights (array of int) */ #define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ #define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */ /* * 4.3 compat sockaddr, move to compat file later */ struct osockaddr { u_short sa_family; /* address family */ char sa_data[14]; /* up to 14 bytes of direct address */ }; /* * 4.3-compat message header (move to compat file later). */ struct omsghdr { caddr_t msg_name; /* optional address */ int msg_namelen; /* size of address */ struct iovec *msg_iov; /* scatter/gather array */ int msg_iovlen; /* # elements in msg_iov */ caddr_t msg_accrights; /* access rights sent/received */ int msg_accrightslen; }; /* * howto arguments for shutdown(2), specified by Posix.1g. */ #define SHUT_RD 0 /* shut down the reading side */ #define SHUT_WR 1 /* shut down the writing side */ #define SHUT_RDWR 2 /* shut down both sides */ /* * sendfile(2) header/trailer struct */ struct sf_hdtr { struct iovec *headers; /* pointer to an array of header struct iovec's */ int hdr_cnt; /* number of header iovec's */ struct iovec *trailers; /* pointer to an array of trailer struct iovec's */ int trl_cnt; /* number of trailer iovec's */ }; #ifndef _KERNEL #include __BEGIN_DECLS -int accept __P((int, struct sockaddr *, socklen_t *)); -int bind __P((int, const struct sockaddr *, socklen_t)); -int connect __P((int, const struct sockaddr *, socklen_t)); -int getpeername __P((int, struct sockaddr *, socklen_t *)); -int getsockname __P((int, struct sockaddr *, socklen_t *)); -int getsockopt __P((int, int, int, void *, socklen_t *)); -int listen __P((int, int)); -ssize_t recv __P((int, void *, size_t, int)); -ssize_t recvfrom __P((int, void *, size_t, int, struct sockaddr *, socklen_t *)); -ssize_t recvmsg __P((int, struct msghdr *, int)); -ssize_t send __P((int, const void *, size_t, int)); -ssize_t sendto __P((int, const void *, - size_t, int, const struct sockaddr *, socklen_t)); -ssize_t sendmsg __P((int, const struct msghdr *, int)); -int sendfile __P((int, int, off_t, size_t, struct sf_hdtr *, off_t *, int)); -int setsockopt __P((int, int, int, const void *, socklen_t)); -int shutdown __P((int, int)); -int socket __P((int, int, int)); -int socketpair __P((int, int, int, int *)); +int accept(int, struct sockaddr *, socklen_t *); +int bind(int, const struct sockaddr *, socklen_t); +int connect(int, const struct sockaddr *, socklen_t); +int getpeername(int, struct sockaddr *, socklen_t *); +int getsockname(int, struct sockaddr *, socklen_t *); +int getsockopt(int, int, int, void *, socklen_t *); +int listen(int, int); +ssize_t recv(int, void *, size_t, int); +ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); +ssize_t recvmsg(int, struct msghdr *, int); +ssize_t send(int, const void *, size_t, int); +ssize_t sendto(int, const void *, + size_t, int, const struct sockaddr *, socklen_t); +ssize_t sendmsg(int, const struct msghdr *, int); +int sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int); +int setsockopt(int, int, int, const void *, socklen_t); +int shutdown(int, int); +int socket(int, int, int); +int socketpair(int, int, int, int *); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_SOCKET_H_ */ Index: head/sys/sys/socketvar.h =================================================================== --- head/sys/sys/socketvar.h (revision 92718) +++ head/sys/sys/socketvar.h (revision 92719) @@ -1,438 +1,438 @@ /*- * Copyright (c) 1982, 1986, 1990, 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. * * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 * $FreeBSD$ */ #ifndef _SYS_SOCKETVAR_H_ #define _SYS_SOCKETVAR_H_ #include /* for TAILQ macros */ #include /* SX locks */ #include /* for struct selinfo */ #include /* * Kernel structure per socket. * Contains send and receive buffer queues, * handle on protocol and pointer to protocol * private data and error information. */ typedef u_quad_t so_gen_t; struct accept_filter; struct socket { vm_zone_t so_zone; /* zone we were allocated from */ int so_count; /* reference count */ short so_type; /* generic type, see socket.h */ short so_options; /* from socket call, see socket.h */ short so_linger; /* time to linger while closing */ short so_state; /* internal state flags SS_*, below */ caddr_t so_pcb; /* protocol control block */ struct protosw *so_proto; /* protocol handle */ /* * Variables for connection queuing. * Socket where accepts occur is so_head in all subsidiary sockets. * If so_head is 0, socket is not related to an accept. * For head socket so_incomp queues partially completed connections, * while so_comp is a queue of connections ready to be accepted. * If a connection is aborted and it has so_head set, then * it has to be pulled out of either so_incomp or so_comp. * We allow connections to queue up based on current queue lengths * and limit on number of queued connections for this socket. */ struct socket *so_head; /* back pointer to accept socket */ TAILQ_HEAD(, socket) so_incomp; /* queue of partial unaccepted connections */ TAILQ_HEAD(, socket) so_comp; /* queue of complete unaccepted connections */ TAILQ_ENTRY(socket) so_list; /* list of unaccepted connections */ short so_qlen; /* number of unaccepted connections */ short so_incqlen; /* number of unaccepted incomplete connections */ short so_qlimit; /* max number queued connections */ short so_timeo; /* connection timeout */ u_short so_error; /* error affecting connection */ struct sigio *so_sigio; /* information for async I/O or out of band data (SIGURG) */ u_long so_oobmark; /* chars to oob mark */ TAILQ_HEAD(, aiocblist) so_aiojobq; /* AIO ops waiting on socket */ /* * Variables for socket buffering. */ struct sockbuf { u_long sb_cc; /* actual chars in buffer */ u_long sb_hiwat; /* max actual char count */ u_long sb_mbcnt; /* chars of mbufs used */ u_long sb_mbmax; /* max chars of mbufs to use */ long sb_lowat; /* low water mark */ struct mbuf *sb_mb; /* the mbuf chain */ struct selinfo sb_sel; /* process selecting read/write */ short sb_flags; /* flags, see below */ short sb_timeo; /* timeout for read/write */ } so_rcv, so_snd; #define SB_MAX (256*1024) /* default for max chars in sockbuf */ #define SB_LOCK 0x01 /* lock on data queue */ #define SB_WANT 0x02 /* someone is waiting to lock */ #define SB_WAIT 0x04 /* someone is waiting for data/space */ #define SB_SEL 0x08 /* someone is selecting */ #define SB_ASYNC 0x10 /* ASYNC I/O, need signals */ #define SB_UPCALL 0x20 /* someone wants an upcall */ #define SB_NOINTR 0x40 /* operations not interruptible */ #define SB_AIO 0x80 /* AIO operations queued */ #define SB_KNOTE 0x100 /* kernel note attached */ - void (*so_upcall) __P((struct socket *, void *, int)); + void (*so_upcall)(struct socket *, void *, int); void *so_upcallarg; struct ucred *so_cred; /* user credentials */ /* NB: generation count must not be first; easiest to make it last. */ so_gen_t so_gencnt; /* generation count */ void *so_emuldata; /* private data for emulators */ struct so_accf { struct accept_filter *so_accept_filter; void *so_accept_filter_arg; /* saved filter args */ char *so_accept_filter_str; /* saved user args */ } *so_accf; }; /* * Socket state bits. */ #define SS_NOFDREF 0x0001 /* no file table ref any more */ #define SS_ISCONNECTED 0x0002 /* socket connected to a peer */ #define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */ #define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */ #define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */ #define SS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ #define SS_RCVATMARK 0x0040 /* at mark on input */ #define SS_NBIO 0x0100 /* non-blocking ops */ #define SS_ASYNC 0x0200 /* async i/o notify */ #define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */ #define SS_INCOMP 0x0800 /* unaccepted, incomplete connection */ #define SS_COMP 0x1000 /* unaccepted, complete connection */ #define SS_ISDISCONNECTED 0x2000 /* socket disconnected from peer */ /* * Externalized form of struct socket used by the sysctl(3) interface. */ struct xsocket { size_t xso_len; /* length of this structure */ struct socket *xso_so; /* makes a convenient handle sometimes */ short so_type; short so_options; short so_linger; short so_state; caddr_t so_pcb; /* another convenient handle */ int xso_protocol; int xso_family; short so_qlen; short so_incqlen; short so_qlimit; short so_timeo; u_short so_error; pid_t so_pgid; u_long so_oobmark; struct xsockbuf { u_long sb_cc; u_long sb_hiwat; u_long sb_mbcnt; u_long sb_mbmax; long sb_lowat; short sb_flags; short sb_timeo; } so_rcv, so_snd; uid_t so_uid; /* XXX */ }; /* * Macros for sockets and socket buffering. */ /* * Do we need to notify the other side when I/O is possible? */ #define sb_notify(sb) (((sb)->sb_flags & (SB_WAIT | SB_SEL | SB_ASYNC | \ SB_UPCALL | SB_AIO | SB_KNOTE)) != 0) /* * How much space is there in a socket buffer (so->so_snd or so->so_rcv)? * This is problematical if the fields are unsigned, as the space might * still be negative (cc > hiwat or mbcnt > mbmax). Should detect * overflow and return 0. Should use "lmin" but it doesn't exist now. */ #define sbspace(sb) \ ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \ (int)((sb)->sb_mbmax - (sb)->sb_mbcnt))) /* do we have to send all at once on a socket? */ #define sosendallatonce(so) \ ((so)->so_proto->pr_flags & PR_ATOMIC) /* can we read something from so? */ #define soreadable(so) \ ((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \ ((so)->so_state & SS_CANTRCVMORE) || \ !TAILQ_EMPTY(&(so)->so_comp) || (so)->so_error) /* can we write something to so? */ #define sowriteable(so) \ ((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \ (((so)->so_state&SS_ISCONNECTED) || \ ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \ ((so)->so_state & SS_CANTSENDMORE) || \ (so)->so_error) /* adjust counters in sb reflecting allocation of m */ #define sballoc(sb, m) { \ (sb)->sb_cc += (m)->m_len; \ (sb)->sb_mbcnt += MSIZE; \ if ((m)->m_flags & M_EXT) \ (sb)->sb_mbcnt += (m)->m_ext.ext_size; \ } /* adjust counters in sb reflecting freeing of m */ #define sbfree(sb, m) { \ (sb)->sb_cc -= (m)->m_len; \ (sb)->sb_mbcnt -= MSIZE; \ if ((m)->m_flags & M_EXT) \ (sb)->sb_mbcnt -= (m)->m_ext.ext_size; \ } /* * Set lock on sockbuf sb; sleep if lock is already held. * Unless SB_NOINTR is set on sockbuf, sleep is interruptible. * Returns error without lock if sleep is interrupted. */ #define sblock(sb, wf) ((sb)->sb_flags & SB_LOCK ? \ (((wf) == M_WAITOK) ? sb_lock(sb) : EWOULDBLOCK) : \ ((sb)->sb_flags |= SB_LOCK), 0) /* release lock on sockbuf sb */ #define sbunlock(sb) { \ (sb)->sb_flags &= ~SB_LOCK; \ if ((sb)->sb_flags & SB_WANT) { \ (sb)->sb_flags &= ~SB_WANT; \ wakeup((caddr_t)&(sb)->sb_flags); \ } \ } /* * soref()/sorele() ref-count the socket structure. Note that you must * still explicitly close the socket, but the last ref count will free * the structure. */ #define soref(so) do { \ ++(so)->so_count; \ } while (0) #define sorele(so) do { \ if ((so)->so_count <= 0) \ panic("sorele");\ if (--(so)->so_count == 0)\ sofree(so); \ } while (0) #define sotryfree(so) do { \ if ((so)->so_count == 0) \ sofree(so); \ } while(0) #define sorwakeup(so) do { \ if (sb_notify(&(so)->so_rcv)) \ sowakeup((so), &(so)->so_rcv); \ } while (0) #define sowwakeup(so) do { \ if (sb_notify(&(so)->so_snd)) \ sowakeup((so), &(so)->so_snd); \ } while (0) #ifdef _KERNEL /* * Argument structure for sosetopt et seq. This is in the KERNEL * section because it will never be visible to user code. */ enum sopt_dir { SOPT_GET, SOPT_SET }; struct sockopt { enum sopt_dir sopt_dir; /* is this a get or a set? */ int sopt_level; /* second arg of [gs]etsockopt */ int sopt_name; /* third arg of [gs]etsockopt */ void *sopt_val; /* fourth arg of [gs]etsockopt */ size_t sopt_valsize; /* (almost) fifth arg of [gs]etsockopt */ struct thread *sopt_td; /* calling thread or null if kernel */ }; struct sf_buf { SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ struct vm_page *m; /* currently mapped page */ vm_offset_t kva; /* va of mapping */ }; struct accept_filter { char accf_name[16]; void (*accf_callback) - __P((struct socket *so, void *arg, int waitflag)); + (struct socket *so, void *arg, int waitflag); void * (*accf_create) - __P((struct socket *so, char *arg)); + (struct socket *so, char *arg); void (*accf_destroy) - __P((struct socket *so)); + (struct socket *so); SLIST_ENTRY(accept_filter) accf_next; /* next on the list */ }; #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_PCB); MALLOC_DECLARE(M_SONAME); MALLOC_DECLARE(M_ACCF); #endif extern int maxsockets; extern u_long sb_max; extern vm_zone_t socket_zone; extern so_gen_t so_gencnt; struct file; struct filedesc; struct mbuf; struct sockaddr; struct stat; struct ucred; struct uio; struct knote; /* * File operations on sockets. */ -int soo_read __P((struct file *fp, struct uio *uio, struct ucred *cred, - int flags, struct thread *td)); -int soo_write __P((struct file *fp, struct uio *uio, struct ucred *cred, - int flags, struct thread *td)); -int soo_close __P((struct file *fp, struct thread *td)); -int soo_ioctl __P((struct file *fp, u_long cmd, caddr_t data, - struct thread *td)); -int soo_poll __P((struct file *fp, int events, struct ucred *cred, - struct thread *td)); -int soo_stat __P((struct file *fp, struct stat *ub, struct thread *td)); -int sokqfilter __P((struct file *fp, struct knote *kn)); +int soo_read(struct file *fp, struct uio *uio, struct ucred *cred, + int flags, struct thread *td); +int soo_write(struct file *fp, struct uio *uio, struct ucred *cred, + int flags, struct thread *td); +int soo_close(struct file *fp, struct thread *td); +int soo_ioctl(struct file *fp, u_long cmd, caddr_t data, + struct thread *td); +int soo_poll(struct file *fp, int events, struct ucred *cred, + struct thread *td); +int soo_stat(struct file *fp, struct stat *ub, struct thread *td); +int sokqfilter(struct file *fp, struct knote *kn); /* * From uipc_socket and friends */ -struct sockaddr *dup_sockaddr __P((struct sockaddr *sa, int canwait)); -int sockargs __P((struct mbuf **mp, caddr_t buf, int buflen, int type)); -int getsockaddr __P((struct sockaddr **namp, caddr_t uaddr, size_t len)); -void sbappend __P((struct sockbuf *sb, struct mbuf *m)); -int sbappendaddr __P((struct sockbuf *sb, struct sockaddr *asa, - struct mbuf *m0, struct mbuf *control)); -int sbappendcontrol __P((struct sockbuf *sb, struct mbuf *m0, - struct mbuf *control)); -void sbappendrecord __P((struct sockbuf *sb, struct mbuf *m0)); -void sbcheck __P((struct sockbuf *sb)); -void sbcompress __P((struct sockbuf *sb, struct mbuf *m, struct mbuf *n)); +struct sockaddr *dup_sockaddr(struct sockaddr *sa, int canwait); +int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type); +int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len); +void sbappend(struct sockbuf *sb, struct mbuf *m); +int sbappendaddr(struct sockbuf *sb, struct sockaddr *asa, + struct mbuf *m0, struct mbuf *control); +int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, + struct mbuf *control); +void sbappendrecord(struct sockbuf *sb, struct mbuf *m0); +void sbcheck(struct sockbuf *sb); +void sbcompress(struct sockbuf *sb, struct mbuf *m, struct mbuf *n); struct mbuf * - sbcreatecontrol __P((caddr_t p, int size, int type, int level)); -void sbdrop __P((struct sockbuf *sb, int len)); -void sbdroprecord __P((struct sockbuf *sb)); -void sbflush __P((struct sockbuf *sb)); -void sbinsertoob __P((struct sockbuf *sb, struct mbuf *m0)); -void sbrelease __P((struct sockbuf *sb, struct socket *so)); -int sbreserve __P((struct sockbuf *sb, u_long cc, struct socket *so, - struct thread *td)); -void sbtoxsockbuf __P((struct sockbuf *sb, struct xsockbuf *xsb)); -int sbwait __P((struct sockbuf *sb)); -int sb_lock __P((struct sockbuf *sb)); -int soabort __P((struct socket *so)); -int soaccept __P((struct socket *so, struct sockaddr **nam)); -struct socket *soalloc __P((int waitok)); -int sobind __P((struct socket *so, struct sockaddr *nam, struct thread *td)); -void socantrcvmore __P((struct socket *so)); -void socantsendmore __P((struct socket *so)); -int soclose __P((struct socket *so)); -int soconnect __P((struct socket *so, struct sockaddr *nam, struct thread *td)); -int soconnect2 __P((struct socket *so1, struct socket *so2)); -int socreate __P((int dom, struct socket **aso, int type, int proto, - struct ucred *cred, struct thread *td)); -int sodisconnect __P((struct socket *so)); -void sofree __P((struct socket *so)); -int sogetopt __P((struct socket *so, struct sockopt *sopt)); -void sohasoutofband __P((struct socket *so)); -void soisconnected __P((struct socket *so)); -void soisconnecting __P((struct socket *so)); -void soisdisconnected __P((struct socket *so)); -void soisdisconnecting __P((struct socket *so)); -int solisten __P((struct socket *so, int backlog, struct thread *td)); + sbcreatecontrol(caddr_t p, int size, int type, int level); +void sbdrop(struct sockbuf *sb, int len); +void sbdroprecord(struct sockbuf *sb); +void sbflush(struct sockbuf *sb); +void sbinsertoob(struct sockbuf *sb, struct mbuf *m0); +void sbrelease(struct sockbuf *sb, struct socket *so); +int sbreserve(struct sockbuf *sb, u_long cc, struct socket *so, + struct thread *td); +void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); +int sbwait(struct sockbuf *sb); +int sb_lock(struct sockbuf *sb); +int soabort(struct socket *so); +int soaccept(struct socket *so, struct sockaddr **nam); +struct socket *soalloc(int waitok); +int sobind(struct socket *so, struct sockaddr *nam, struct thread *td); +void socantrcvmore(struct socket *so); +void socantsendmore(struct socket *so); +int soclose(struct socket *so); +int soconnect(struct socket *so, struct sockaddr *nam, struct thread *td); +int soconnect2(struct socket *so1, struct socket *so2); +int socreate(int dom, struct socket **aso, int type, int proto, + struct ucred *cred, struct thread *td); +int sodisconnect(struct socket *so); +void sofree(struct socket *so); +int sogetopt(struct socket *so, struct sockopt *sopt); +void sohasoutofband(struct socket *so); +void soisconnected(struct socket *so); +void soisconnecting(struct socket *so); +void soisdisconnected(struct socket *so); +void soisdisconnecting(struct socket *so); +int solisten(struct socket *so, int backlog, struct thread *td); struct socket * - sodropablereq __P((struct socket *head)); + sodropablereq(struct socket *head); struct socket * - sonewconn __P((struct socket *head, int connstatus)); -int sooptcopyin __P((struct sockopt *sopt, void *buf, size_t len, - size_t minlen)); -int sooptcopyout __P((struct sockopt *sopt, void *buf, size_t len)); + sonewconn(struct socket *head, int connstatus); +int sooptcopyin(struct sockopt *sopt, void *buf, size_t len, + size_t minlen); +int sooptcopyout(struct sockopt *sopt, void *buf, size_t len); /* XXX; prepare mbuf for (__FreeBSD__ < 3) routines. */ -int soopt_getm __P((struct sockopt *sopt, struct mbuf **mp)); -int soopt_mcopyin __P((struct sockopt *sopt, struct mbuf *m)); -int soopt_mcopyout __P((struct sockopt *sopt, struct mbuf *m)); +int soopt_getm(struct sockopt *sopt, struct mbuf **mp); +int soopt_mcopyin(struct sockopt *sopt, struct mbuf *m); +int soopt_mcopyout(struct sockopt *sopt, struct mbuf *m); -int sopoll __P((struct socket *so, int events, struct ucred *cred, - struct thread *td)); -int soreceive __P((struct socket *so, struct sockaddr **paddr, +int sopoll(struct socket *so, int events, struct ucred *cred, + struct thread *td); +int soreceive(struct socket *so, struct sockaddr **paddr, struct uio *uio, struct mbuf **mp0, - struct mbuf **controlp, int *flagsp)); -int soreserve __P((struct socket *so, u_long sndcc, u_long rcvcc)); -void sorflush __P((struct socket *so)); -int sosend __P((struct socket *so, struct sockaddr *addr, struct uio *uio, + struct mbuf **controlp, int *flagsp); +int soreserve(struct socket *so, u_long sndcc, u_long rcvcc); +void sorflush(struct socket *so); +int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, - struct thread *td)); -int sosetopt __P((struct socket *so, struct sockopt *sopt)); -int soshutdown __P((struct socket *so, int how)); -void sotoxsocket __P((struct socket *so, struct xsocket *xso)); -void sowakeup __P((struct socket *so, struct sockbuf *sb)); + struct thread *td); +int sosetopt(struct socket *so, struct sockopt *sopt); +int soshutdown(struct socket *so, int how); +void sotoxsocket(struct socket *so, struct xsocket *xso); +void sowakeup(struct socket *so, struct sockbuf *sb); /* accept filter functions */ -int accept_filt_add __P((struct accept_filter *filt)); -int accept_filt_del __P((char *name)); -struct accept_filter * accept_filt_get __P((char *name)); +int accept_filt_add(struct accept_filter *filt); +int accept_filt_del(char *name); +struct accept_filter * accept_filt_get(char *name); #ifdef ACCEPT_FILTER_MOD -int accept_filt_generic_mod_event __P((module_t mod, int event, void *data)); +int accept_filt_generic_mod_event(module_t mod, int event, void *data); SYSCTL_DECL(_net_inet_accf); #endif /* ACCEPT_FILTER_MOD */ -int socheckuid __P((struct socket *so, uid_t uid)); -int socheckproc __P((struct socket *so, struct proc *p)); +int socheckuid(struct socket *so, uid_t uid); +int socheckproc(struct socket *so, struct proc *p); #endif /* _KERNEL */ #endif /* !_SYS_SOCKETVAR_H_ */ Index: head/sys/sys/soundcard.h =================================================================== --- head/sys/sys/soundcard.h (revision 92718) +++ head/sys/sys/soundcard.h (revision 92719) @@ -1,1398 +1,1398 @@ /* * soundcard.h * * Copyright by Hannu Savolainen 1993 * Modified for the new FreeBSD sound driver by Luigi Rizzo, 1997 * * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR * 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. * * $FreeBSD$ */ #ifndef _SYS_SOUNDCARD_H_ #define _SYS_SOUNDCARD_H_ /* * If you make modifications to this file, please contact me before * distributing the modified version. There is already enough * diversity in the world. * * Regards, * Hannu Savolainen * hannu@voxware.pp.fi * ********************************************************************** * PS. The Hacker's Guide to VoxWare available from * nic.funet.fi:pub/Linux/ALPHA/sound. The file is * snd-sdk-doc-0.1.ps.gz (gzipped postscript). It contains * some useful information about programming with VoxWare. * (NOTE! The pub/Linux/ALPHA/ directories are hidden. You have * to cd inside them before the files are accessible.) ********************************************************************** */ /* * SOUND_VERSION is only used by the voxware driver. Hopefully apps * should not depend on it, but rather look at the capabilities * of the driver in the kernel! */ #define SOUND_VERSION 301 #define VOXWARE /* does this have any use ? */ /* * Supported card ID numbers (Should be somewhere else? We keep * them here just for compativility with the old driver, but these * constants are of little or no use). */ #define SNDCARD_ADLIB 1 #define SNDCARD_SB 2 #define SNDCARD_PAS 3 #define SNDCARD_GUS 4 #define SNDCARD_MPU401 5 #define SNDCARD_SB16 6 #define SNDCARD_SB16MIDI 7 #define SNDCARD_UART6850 8 #define SNDCARD_GUS16 9 #define SNDCARD_MSS 10 #define SNDCARD_PSS 11 #define SNDCARD_SSCAPE 12 #define SNDCARD_PSS_MPU 13 #define SNDCARD_PSS_MSS 14 #define SNDCARD_SSCAPE_MSS 15 #define SNDCARD_TRXPRO 16 #define SNDCARD_TRXPRO_SB 17 #define SNDCARD_TRXPRO_MPU 18 #define SNDCARD_MAD16 19 #define SNDCARD_MAD16_MPU 20 #define SNDCARD_CS4232 21 #define SNDCARD_CS4232_MPU 22 #define SNDCARD_MAUI 23 #define SNDCARD_PSEUDO_MSS 24 #define SNDCARD_AWE32 25 #define SNDCARD_NSS 26 #define SNDCARD_UART16550 27 #define SNDCARD_OPL 28 #include #ifndef _IOWR #include #endif /* !_IOWR */ /* * The first part of this file contains the new FreeBSD sound ioctl * interface. Tries to minimize the number of different ioctls, and * to be reasonably general. * * 970821: some of the new calls have not been implemented yet. */ /* * the following three calls extend the generic file descriptor * interface. AIONWRITE is the dual of FIONREAD, i.e. returns the max * number of bytes for a write operation to be non-blocking. * * AIOGSIZE/AIOSSIZE are used to change the behaviour of the device, * from a character device (default) to a block device. In block mode, * (not to be confused with blocking mode) the main difference for the * application is that select() will return only when a complete * block can be read/written to the device, whereas in character mode * select will return true when one byte can be exchanged. For audio * devices, character mode makes select almost useless since one byte * will always be ready by the next sample time (which is often only a * handful of microseconds away). * Use a size of 0 or 1 to return to character mode. */ #define AIONWRITE _IOR('A', 10, int) /* get # bytes to write */ struct snd_size { int play_size; int rec_size; }; #define AIOGSIZE _IOR('A', 11, struct snd_size)/* read current blocksize */ #define AIOSSIZE _IOWR('A', 11, struct snd_size) /* sets blocksize */ /* * The following constants define supported audio formats. The * encoding follows voxware conventions, i.e. 1 bit for each supported * format. We extend it by using bit 31 (RO) to indicate full-duplex * capability, and bit 29 (RO) to indicate that the card supports/ * needs different formats on capture & playback channels. * Bit 29 (RW) is used to indicate/ask stereo. * * The number of bits required to store the sample is: * o 4 bits for the IDA ADPCM format, * o 8 bits for 8-bit formats, mu-law and A-law, * o 16 bits for the 16-bit formats, and * o 32 bits for the 24/32-bit formats. * o undefined for the MPEG audio format. */ #define AFMT_QUERY 0x00000000 /* Return current format */ #define AFMT_MU_LAW 0x00000001 /* Logarithmic mu-law */ #define AFMT_A_LAW 0x00000002 /* Logarithmic A-law */ #define AFMT_IMA_ADPCM 0x00000004 /* A 4:1 compressed format where 16-bit * squence represented using the * the average 4 bits per sample */ #define AFMT_U8 0x00000008 /* Unsigned 8-bit */ #define AFMT_S16_LE 0x00000010 /* Little endian signed 16-bit */ #define AFMT_S16_BE 0x00000020 /* Big endian signed 16-bit */ #define AFMT_S8 0x00000040 /* Signed 8-bit */ #define AFMT_U16_LE 0x00000080 /* Little endian unsigned 16-bit */ #define AFMT_U16_BE 0x00000100 /* Big endian unsigned 16-bit */ #define AFMT_MPEG 0x00000200 /* MPEG MP2/MP3 audio */ #define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */ /* * 32-bit formats below used for 24-bit audio data where the data is stored * in the 24 most significant bits and the least significant bits are not used * (should be set to 0). */ #define AFMT_S32_LE 0x00001000 /* Little endian signed 32-bit */ #define AFMT_S32_BE 0x00002000 /* Big endian signed 32-bit */ #define AFMT_U32_LE 0x00004000 /* Little endian unsigned 32-bit */ #define AFMT_U32_BE 0x00008000 /* Big endian unsigned 32-bit */ #define AFMT_STEREO 0x10000000 /* can do/want stereo */ /* * the following are really capabilities */ #define AFMT_WEIRD 0x20000000 /* weird hardware... */ /* * AFMT_WEIRD reports that the hardware might need to operate * with different formats in the playback and capture * channels when operating in full duplex. * As an example, SoundBlaster16 cards only support U8 in one * direction and S16 in the other one, and applications should * be aware of this limitation. */ #define AFMT_FULLDUPLEX 0x80000000 /* can do full duplex */ /* * The following structure is used to get/set format and sampling rate. * While it would be better to have things such as stereo, bits per * sample, endiannes, etc split in different variables, it turns out * that formats are not that many, and not all combinations are possible. * So we followed the Voxware approach of associating one bit to each * format. */ typedef struct _snd_chan_param { u_long play_rate; /* sampling rate */ u_long rec_rate; /* sampling rate */ u_long play_format; /* everything describing the format */ u_long rec_format; /* everything describing the format */ } snd_chan_param; #define AIOGFMT _IOR('f', 12, snd_chan_param) /* get format */ #define AIOSFMT _IOWR('f', 12, snd_chan_param) /* sets format */ /* * The following structure is used to get/set the mixer setting. * Up to 32 mixers are supported, each one with up to 32 channels. */ typedef struct _snd_mix_param { u_char subdev; /* which output */ u_char line; /* which input */ u_char left,right; /* volumes, 0..255, 0 = mute */ } snd_mix_param ; /* XXX AIOGMIX, AIOSMIX not implemented yet */ #define AIOGMIX _IOWR('A', 13, snd_mix_param) /* return mixer status */ #define AIOSMIX _IOWR('A', 14, snd_mix_param) /* sets mixer status */ /* * channel specifiers used in AIOSTOP and AIOSYNC */ #define AIOSYNC_PLAY 0x1 /* play chan */ #define AIOSYNC_CAPTURE 0x2 /* capture chan */ /* AIOSTOP stop & flush a channel, returns the residual count */ #define AIOSTOP _IOWR ('A', 15, int) /* alternate method used to notify the sync condition */ #define AIOSYNC_SIGNAL 0x100 #define AIOSYNC_SELECT 0x200 /* what the 'pos' field refers to */ #define AIOSYNC_READY 0x400 #define AIOSYNC_FREE 0x800 typedef struct _snd_sync_parm { long chan ; /* play or capture channel, plus modifier */ long pos; } snd_sync_parm; #define AIOSYNC _IOWR ('A', 15, snd_sync_parm) /* misc. synchronization */ /* * The following is used to return device capabilities. If the structure * passed to the ioctl is zeroed, default values are returned for rate * and formats, a bitmap of available mixers is returned, and values * (inputs, different levels) for the first one are returned. * * If formats, mixers, inputs are instantiated, then detailed info * are returned depending on the call. */ typedef struct _snd_capabilities { u_long rate_min, rate_max; /* min-max sampling rate */ u_long formats; u_long bufsize; /* DMA buffer size */ u_long mixers; /* bitmap of available mixers */ u_long inputs; /* bitmap of available inputs (per mixer) */ u_short left, right; /* how many levels are supported */ } snd_capabilities; #define AIOGCAP _IOWR('A', 15, snd_capabilities) /* get capabilities */ /* * here is the old (Voxware) ioctl interface */ /* * IOCTL Commands for /dev/sequencer */ #define SNDCTL_SEQ_RESET _IO ('Q', 0) #define SNDCTL_SEQ_SYNC _IO ('Q', 1) #define SNDCTL_SYNTH_INFO _IOWR('Q', 2, struct synth_info) #define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) /* Set/get timer res.(hz) */ #define SNDCTL_SEQ_GETOUTCOUNT _IOR ('Q', 4, int) #define SNDCTL_SEQ_GETINCOUNT _IOR ('Q', 5, int) #define SNDCTL_SEQ_PERCMODE _IOW ('Q', 6, int) #define SNDCTL_FM_LOAD_INSTR _IOW ('Q', 7, struct sbi_instrument) /* Valid for FM only */ #define SNDCTL_SEQ_TESTMIDI _IOW ('Q', 8, int) #define SNDCTL_SEQ_RESETSAMPLES _IOW ('Q', 9, int) #define SNDCTL_SEQ_NRSYNTHS _IOR ('Q',10, int) #define SNDCTL_SEQ_NRMIDIS _IOR ('Q',11, int) #define SNDCTL_MIDI_INFO _IOWR('Q',12, struct midi_info) #define SNDCTL_SEQ_THRESHOLD _IOW ('Q',13, int) #define SNDCTL_SEQ_TRESHOLD SNDCTL_SEQ_THRESHOLD /* there was once a typo */ #define SNDCTL_SYNTH_MEMAVL _IOWR('Q',14, int) /* in=dev#, out=memsize */ #define SNDCTL_FM_4OP_ENABLE _IOW ('Q',15, int) /* in=dev# */ #define SNDCTL_PMGR_ACCESS _IOWR('Q',16, struct patmgr_info) #define SNDCTL_SEQ_PANIC _IO ('Q',17) #define SNDCTL_SEQ_OUTOFBAND _IOW ('Q',18, struct seq_event_rec) struct seq_event_rec { u_char arr[8]; }; #define SNDCTL_TMR_TIMEBASE _IOWR('T', 1, int) #define SNDCTL_TMR_START _IO ('T', 2) #define SNDCTL_TMR_STOP _IO ('T', 3) #define SNDCTL_TMR_CONTINUE _IO ('T', 4) #define SNDCTL_TMR_TEMPO _IOWR('T', 5, int) #define SNDCTL_TMR_SOURCE _IOWR('T', 6, int) # define TMR_INTERNAL 0x00000001 # define TMR_EXTERNAL 0x00000002 # define TMR_MODE_MIDI 0x00000010 # define TMR_MODE_FSK 0x00000020 # define TMR_MODE_CLS 0x00000040 # define TMR_MODE_SMPTE 0x00000080 #define SNDCTL_TMR_METRONOME _IOW ('T', 7, int) #define SNDCTL_TMR_SELECT _IOW ('T', 8, int) /* * Endian aware patch key generation algorithm. */ #if defined(_AIX) || defined(AIX) # define _PATCHKEY(id) (0xfd00|id) #else # define _PATCHKEY(id) ((id<<8)|0xfd) #endif /* * Sample loading mechanism for internal synthesizers (/dev/sequencer) * The following patch_info structure has been designed to support * Gravis UltraSound. It tries to be universal format for uploading * sample based patches but is probably too limited. */ struct patch_info { /* u_short key; Use GUS_PATCH here */ short key; /* Use GUS_PATCH here */ #define GUS_PATCH _PATCHKEY(0x04) #define OBSOLETE_GUS_PATCH _PATCHKEY(0x02) short device_no; /* Synthesizer number */ short instr_no; /* Midi pgm# */ u_long mode; /* * The least significant byte has the same format than the GUS .PAT * files */ #define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */ #define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */ #define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */ #define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */ #define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */ #define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3)*/ #define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */ /* (use the env_rate/env_offs fields). */ /* Linux specific bits */ #define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */ #define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */ #define WAVE_SCALE 0x00040000 /* The scaling info is valid */ /* Other bits must be zeroed */ long len; /* Size of the wave data in bytes */ long loop_start, loop_end; /* Byte offsets from the beginning */ /* * The base_freq and base_note fields are used when computing the * playback speed for a note. The base_note defines the tone frequency * which is heard if the sample is played using the base_freq as the * playback speed. * * The low_note and high_note fields define the minimum and maximum note * frequencies for which this sample is valid. It is possible to define * more than one samples for a instrument number at the same time. The * low_note and high_note fields are used to select the most suitable one. * * The fields base_note, high_note and low_note should contain * the note frequency multiplied by 1000. For example value for the * middle A is 440*1000. */ u_int base_freq; u_long base_note; u_long high_note; u_long low_note; int panning; /* -128=left, 127=right */ int detuning; /* New fields introduced in version 1.99.5 */ /* Envelope. Enabled by mode bit WAVE_ENVELOPES */ u_char env_rate[ 6 ]; /* GUS HW ramping rate */ u_char env_offset[ 6 ]; /* 255 == 100% */ /* * The tremolo, vibrato and scale info are not supported yet. * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or * WAVE_SCALE */ u_char tremolo_sweep; u_char tremolo_rate; u_char tremolo_depth; u_char vibrato_sweep; u_char vibrato_rate; u_char vibrato_depth; int scale_frequency; u_int scale_factor; /* from 0 to 2048 or 0 to 2 */ int volume; int spare[4]; char data[1]; /* The waveform data starts here */ }; struct sysex_info { short key; /* Use GUS_PATCH here */ #define SYSEX_PATCH _PATCHKEY(0x05) #define MAUI_PATCH _PATCHKEY(0x06) short device_no; /* Synthesizer number */ long len; /* Size of the sysex data in bytes */ u_char data[1]; /* Sysex data starts here */ }; /* * Patch management interface (/dev/sequencer, /dev/patmgr#) * Don't use these calls if you want to maintain compatibility with * the future versions of the driver. */ #define PS_NO_PATCHES 0 /* No patch support on device */ #define PS_MGR_NOT_OK 1 /* Plain patch support (no mgr) */ #define PS_MGR_OK 2 /* Patch manager supported */ #define PS_MANAGED 3 /* Patch manager running */ #define SNDCTL_PMGR_IFACE _IOWR('P', 1, struct patmgr_info) /* * The patmgr_info is a fixed size structure which is used for two * different purposes. The intended use is for communication between * the application using /dev/sequencer and the patch manager daemon * associated with a synthesizer device (ioctl(SNDCTL_PMGR_ACCESS)). * * This structure is also used with ioctl(SNDCTL_PGMR_IFACE) which allows * a patch manager daemon to read and write device parameters. This * ioctl available through /dev/sequencer also. Avoid using it since it's * extremely hardware dependent. In addition access trough /dev/sequencer * may confuse the patch manager daemon. */ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ u_long key; /* Don't worry. Reserved for communication between the patch manager and the driver. */ #define PM_K_EVENT 1 /* Event from the /dev/sequencer driver */ #define PM_K_COMMAND 2 /* Request from a application */ #define PM_K_RESPONSE 3 /* From patmgr to application */ #define PM_ERROR 4 /* Error returned by the patmgr */ int device; int command; /* * Commands 0x000 to 0xfff reserved for patch manager programs */ #define PM_GET_DEVTYPE 1 /* Returns type of the patch mgr interface of dev */ #define PMTYPE_FM2 1 /* 2 OP fm */ #define PMTYPE_FM4 2 /* Mixed 4 or 2 op FM (OPL-3) */ #define PMTYPE_WAVE 3 /* Wave table synthesizer (GUS) */ #define PM_GET_NRPGM 2 /* Returns max # of midi programs in parm1 */ #define PM_GET_PGMMAP 3 /* Returns map of loaded midi programs in data8 */ #define PM_GET_PGM_PATCHES 4 /* Return list of patches of a program (parm1) */ #define PM_GET_PATCH 5 /* Return patch header of patch parm1 */ #define PM_SET_PATCH 6 /* Set patch header of patch parm1 */ #define PM_READ_PATCH 7 /* Read patch (wave) data */ #define PM_WRITE_PATCH 8 /* Write patch (wave) data */ /* * Commands 0x1000 to 0xffff are for communication between the patch manager * and the client */ #define _PM_LOAD_PATCH 0x100 /* * Commands above 0xffff reserved for device specific use */ long parm1; long parm2; long parm3; union { u_char data8[4000]; u_short data16[2000]; u_long data32[1000]; struct patch_info patch; } data; }; /* * When a patch manager daemon is present, it will be informed by the * driver when something important happens. For example when the * /dev/sequencer is opened or closed. A record with key == PM_K_EVENT is * returned. The command field contains the event type: */ #define PM_E_OPENED 1 /* /dev/sequencer opened */ #define PM_E_CLOSED 2 /* /dev/sequencer closed */ #define PM_E_PATCH_RESET 3 /* SNDCTL_RESETSAMPLES called */ #define PM_E_PATCH_LOADED 4 /* A patch has been loaded by appl */ /* * /dev/sequencer input events. * * The data written to the /dev/sequencer is a stream of events. Events * are records of 4 or 8 bytes. The first byte defines the size. * Any number of events can be written with a write call. There * is a set of macros for sending these events. Use these macros if you * want to maximize portability of your program. * * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events. * (All input events are currently 4 bytes long. Be prepared to support * 8 byte events also. If you receive any event having first byte >= 128, * it's a 8 byte event. * * The events are documented at the end of this file. * * Normal events (4 bytes) * There is also a 8 byte version of most of the 4 byte events. The * 8 byte one is recommended. */ #define SEQ_NOTEOFF 0 #define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */ #define SEQ_NOTEON 1 #define SEQ_FMNOTEON SEQ_NOTEON #define SEQ_WAIT TMR_WAIT_ABS #define SEQ_PGMCHANGE 3 #define SEQ_FMPGMCHANGE SEQ_PGMCHANGE #define SEQ_SYNCTIMER TMR_START #define SEQ_MIDIPUTC 5 #define SEQ_DRUMON 6 /*** OBSOLETE ***/ #define SEQ_DRUMOFF 7 /*** OBSOLETE ***/ #define SEQ_ECHO TMR_ECHO /* For synching programs with output */ #define SEQ_AFTERTOUCH 9 #define SEQ_CONTROLLER 10 /* * Midi controller numbers * * Controllers 0 to 31 (0x00 to 0x1f) and 32 to 63 (0x20 to 0x3f) * are continuous controllers. * In the MIDI 1.0 these controllers are sent using two messages. * Controller numbers 0 to 31 are used to send the MSB and the * controller numbers 32 to 63 are for the LSB. Note that just 7 bits * are used in MIDI bytes. */ #define CTL_BANK_SELECT 0x00 #define CTL_MODWHEEL 0x01 #define CTL_BREATH 0x02 /* undefined 0x03 */ #define CTL_FOOT 0x04 #define CTL_PORTAMENTO_TIME 0x05 #define CTL_DATA_ENTRY 0x06 #define CTL_MAIN_VOLUME 0x07 #define CTL_BALANCE 0x08 /* undefined 0x09 */ #define CTL_PAN 0x0a #define CTL_EXPRESSION 0x0b /* undefined 0x0c - 0x0f */ #define CTL_GENERAL_PURPOSE1 0x10 #define CTL_GENERAL_PURPOSE2 0x11 #define CTL_GENERAL_PURPOSE3 0x12 #define CTL_GENERAL_PURPOSE4 0x13 /* undefined 0x14 - 0x1f */ /* undefined 0x20 */ /* * The controller numbers 0x21 to 0x3f are reserved for the * least significant bytes of the controllers 0x00 to 0x1f. * These controllers are not recognised by the driver. * * Controllers 64 to 69 (0x40 to 0x45) are on/off switches. * 0=OFF and 127=ON (intermediate values are possible) */ #define CTL_DAMPER_PEDAL 0x40 #define CTL_SUSTAIN CTL_DAMPER_PEDAL /* Alias */ #define CTL_HOLD CTL_DAMPER_PEDAL /* Alias */ #define CTL_PORTAMENTO 0x41 #define CTL_SOSTENUTO 0x42 #define CTL_SOFT_PEDAL 0x43 /* undefined 0x44 */ #define CTL_HOLD2 0x45 /* undefined 0x46 - 0x4f */ #define CTL_GENERAL_PURPOSE5 0x50 #define CTL_GENERAL_PURPOSE6 0x51 #define CTL_GENERAL_PURPOSE7 0x52 #define CTL_GENERAL_PURPOSE8 0x53 /* undefined 0x54 - 0x5a */ #define CTL_EXT_EFF_DEPTH 0x5b #define CTL_TREMOLO_DEPTH 0x5c #define CTL_CHORUS_DEPTH 0x5d #define CTL_DETUNE_DEPTH 0x5e #define CTL_CELESTE_DEPTH CTL_DETUNE_DEPTH /* Alias for the above one */ #define CTL_PHASER_DEPTH 0x5f #define CTL_DATA_INCREMENT 0x60 #define CTL_DATA_DECREMENT 0x61 #define CTL_NONREG_PARM_NUM_LSB 0x62 #define CTL_NONREG_PARM_NUM_MSB 0x63 #define CTL_REGIST_PARM_NUM_LSB 0x64 #define CTL_REGIST_PARM_NUM_MSB 0x65 /* undefined 0x66 - 0x78 */ /* reserved 0x79 - 0x7f */ /* Pseudo controllers (not midi compatible) */ #define CTRL_PITCH_BENDER 255 #define CTRL_PITCH_BENDER_RANGE 254 #define CTRL_EXPRESSION 253 /* Obsolete */ #define CTRL_MAIN_VOLUME 252 /* Obsolete */ #define SEQ_BALANCE 11 #define SEQ_VOLMODE 12 /* * Volume mode decides how volumes are used */ #define VOL_METHOD_ADAGIO 1 #define VOL_METHOD_LINEAR 2 /* * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as * input events. */ /* * Event codes 0xf0 to 0xfc are reserved for future extensions. */ #define SEQ_FULLSIZE 0xfd /* Long events */ /* * SEQ_FULLSIZE events are used for loading patches/samples to the * synthesizer devices. These events are passed directly to the driver * of the associated synthesizer device. There is no limit to the size * of the extended events. These events are not queued but executed * immediately when the write() is called (execution can take several * seconds of time). * * When a SEQ_FULLSIZE message is written to the device, it must * be written using exactly one write() call. Other events cannot * be mixed to the same write. * * For FM synths (YM3812/OPL3) use struct sbi_instrument and write * it to the /dev/sequencer. Don't write other data together with * the instrument structure Set the key field of the structure to * FM_PATCH. The device field is used to route the patch to the * corresponding device. * * For Gravis UltraSound use struct patch_info. Initialize the key field * to GUS_PATCH. */ #define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */ #define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */ /* * Record for FM patches */ typedef u_char sbi_instr_data[32]; struct sbi_instrument { u_short key; /* FM_PATCH or OPL3_PATCH */ #define FM_PATCH _PATCHKEY(0x01) #define OPL3_PATCH _PATCHKEY(0x03) short device; /* Synth# (0-4) */ int channel; /* Program# to be initialized */ sbi_instr_data operators; /* Reg. settings for operator cells * (.SBI format) */ }; struct synth_info { /* Read only */ char name[30]; int device; /* 0-N. INITIALIZE BEFORE CALLING */ int synth_type; #define SYNTH_TYPE_FM 0 #define SYNTH_TYPE_SAMPLE 1 #define SYNTH_TYPE_MIDI 2 /* Midi interface */ int synth_subtype; #define FM_TYPE_ADLIB 0x00 #define FM_TYPE_OPL3 0x01 #define SAMPLE_TYPE_BASIC 0x10 #define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC #define SAMPLE_TYPE_AWE32 0x20 int perc_mode; /* No longer supported */ int nr_voices; int nr_drums; /* Obsolete field */ int instr_bank_size; u_long capabilities; #define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */ #define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */ #define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */ int dummies[19]; /* Reserve space */ }; struct sound_timer_info { char name[32]; int caps; }; #define MIDI_CAP_MPU401 1 /* MPU-401 intelligent mode */ struct midi_info { char name[30]; int device; /* 0-N. INITIALIZE BEFORE CALLING */ u_long capabilities; /* To be defined later */ int dev_type; int dummies[18]; /* Reserve space */ }; /* * ioctl commands for the /dev/midi## */ typedef struct { u_char cmd; char nr_args, nr_returns; u_char data[30]; } mpu_command_rec; #define SNDCTL_MIDI_PRETIME _IOWR('m', 0, int) #define SNDCTL_MIDI_MPUMODE _IOWR('m', 1, int) #define SNDCTL_MIDI_MPUCMD _IOWR('m', 2, mpu_command_rec) #define MIOSPASSTHRU _IOWR('m', 3, int) #define MIOGPASSTHRU _IOWR('m', 4, int) /* * IOCTL commands for /dev/dsp and /dev/audio */ #define SNDCTL_DSP_RESET _IO ('P', 0) #define SNDCTL_DSP_SYNC _IO ('P', 1) #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) #define SNDCTL_DSP_GETBLKSIZE _IOR('P', 4, int) #define SNDCTL_DSP_SETBLKSIZE _IOW('P', 4, int) #define SNDCTL_DSP_SETFMT _IOWR('P',5, int) /* Selects ONE fmt*/ /* * SOUND_PCM_WRITE_CHANNELS is not that different * from SNDCTL_DSP_STEREO */ #define SOUND_PCM_WRITE_CHANNELS _IOWR('P', 6, int) #define SNDCTL_DSP_CHANNELS SOUND_PCM_WRITE_CHANNELS #define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) #define SNDCTL_DSP_POST _IO ('P', 8) /* * SNDCTL_DSP_SETBLKSIZE and the following two calls mostly do * the same thing, i.e. set the block size used in DMA transfers. */ #define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) #define SNDCTL_DSP_SETFRAGMENT _IOWR('P',10, int) #define SNDCTL_DSP_GETFMTS _IOR ('P',11, int) /* Returns a mask */ /* * Buffer status queries. */ typedef struct audio_buf_info { int fragments; /* # of avail. frags (partly used ones not counted) */ int fragstotal; /* Total # of fragments allocated */ int fragsize; /* Size of a fragment in bytes */ int bytes; /* Avail. space in bytes (includes partly used fragments) */ /* Note! 'bytes' could be more than fragments*fragsize */ } audio_buf_info; #define SNDCTL_DSP_GETOSPACE _IOR ('P',12, audio_buf_info) #define SNDCTL_DSP_GETISPACE _IOR ('P',13, audio_buf_info) /* * SNDCTL_DSP_NONBLOCK is the same (but less powerful, since the * action cannot be undone) of FIONBIO. The same can be achieved * by opening the device with O_NDELAY */ #define SNDCTL_DSP_NONBLOCK _IO ('P',14) #define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) #define DSP_CAP_REVISION 0x000000ff /* revision level (0 to 255) */ #define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */ #define DSP_CAP_REALTIME 0x00000200 /* Real time capability */ #define DSP_CAP_BATCH 0x00000400 /* * Device has some kind of internal buffers which may * cause some delays and decrease precision of timing */ #define DSP_CAP_COPROC 0x00000800 /* Has a coprocessor, sometimes it's a DSP but usually not */ #define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */ #define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */ /* * What do these function do ? */ #define SNDCTL_DSP_GETTRIGGER _IOR ('P',16, int) #define SNDCTL_DSP_SETTRIGGER _IOW ('P',16, int) #define PCM_ENABLE_INPUT 0x00000001 #define PCM_ENABLE_OUTPUT 0x00000002 typedef struct count_info { int bytes; /* Total # of bytes processed */ int blocks; /* # of fragment transitions since last time */ int ptr; /* Current DMA pointer value */ } count_info; /* * GETIPTR and GETISPACE are not that different... same for out. */ #define SNDCTL_DSP_GETIPTR _IOR ('P',17, count_info) #define SNDCTL_DSP_GETOPTR _IOR ('P',18, count_info) typedef struct buffmem_desc { caddr_t buffer; int size; } buffmem_desc; #define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, buffmem_desc) #define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, buffmem_desc) #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) #define SNDCTL_DSP_SETDUPLEX _IO ('P', 22) #define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int) /* * I guess these are the readonly version of the same * functions that exist above as SNDCTL_DSP_... */ #define SOUND_PCM_READ_RATE _IOR ('P', 2, int) #define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) #define SOUND_PCM_READ_BITS _IOR ('P', 5, int) #define SOUND_PCM_READ_FILTER _IOR ('P', 7, int) /* * ioctl calls to be used in communication with coprocessors and * DSP chips. */ typedef struct copr_buffer { int command; /* Set to 0 if not used */ int flags; #define CPF_NONE 0x0000 #define CPF_FIRST 0x0001 /* First block */ #define CPF_LAST 0x0002 /* Last block */ int len; int offs; /* If required by the device (0 if not used) */ u_char data[4000]; /* NOTE! 4000 is not 4k */ } copr_buffer; typedef struct copr_debug_buf { int command; /* Used internally. Set to 0 */ int parm1; int parm2; int flags; int len; /* Length of data in bytes */ } copr_debug_buf; typedef struct copr_msg { int len; u_char data[4000]; } copr_msg; #define SNDCTL_COPR_RESET _IO ('C', 0) #define SNDCTL_COPR_LOAD _IOWR('C', 1, copr_buffer) #define SNDCTL_COPR_RDATA _IOWR('C', 2, copr_debug_buf) #define SNDCTL_COPR_RCODE _IOWR('C', 3, copr_debug_buf) #define SNDCTL_COPR_WDATA _IOW ('C', 4, copr_debug_buf) #define SNDCTL_COPR_WCODE _IOW ('C', 5, copr_debug_buf) #define SNDCTL_COPR_RUN _IOWR('C', 6, copr_debug_buf) #define SNDCTL_COPR_HALT _IOWR('C', 7, copr_debug_buf) #define SNDCTL_COPR_SENDMSG _IOW ('C', 8, copr_msg) #define SNDCTL_COPR_RCVMSG _IOR ('C', 9, copr_msg) /* * IOCTL commands for /dev/mixer */ /* * Mixer devices * * There can be up to 20 different analog mixer channels. The * SOUND_MIXER_NRDEVICES gives the currently supported maximum. * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells * the devices supported by the particular mixer. */ #define SOUND_MIXER_NRDEVICES 25 #define SOUND_MIXER_VOLUME 0 /* Master output level */ #define SOUND_MIXER_BASS 1 /* Treble level of all output channels */ #define SOUND_MIXER_TREBLE 2 /* Bass level of all output channels */ #define SOUND_MIXER_SYNTH 3 /* Volume of synthesier input */ #define SOUND_MIXER_PCM 4 /* Output level for the audio device */ #define SOUND_MIXER_SPEAKER 5 /* Output level for the PC speaker * signals */ #define SOUND_MIXER_LINE 6 /* Volume level for the line in jack */ #define SOUND_MIXER_MIC 7 /* Volume for the signal coming from * the microphone jack */ #define SOUND_MIXER_CD 8 /* Volume level for the input signal * connected to the CD audio input */ #define SOUND_MIXER_IMIX 9 /* Recording monitor. It controls the * output volume of the selected * recording sources while recording */ #define SOUND_MIXER_ALTPCM 10 /* Volume of the alternative codec * device */ #define SOUND_MIXER_RECLEV 11 /* Global recording level */ #define SOUND_MIXER_IGAIN 12 /* Input gain */ #define SOUND_MIXER_OGAIN 13 /* Output gain */ /* * The AD1848 codec and compatibles have three line level inputs * (line, aux1 and aux2). Since each card manufacturer have assigned * different meanings to these inputs, it's inpractical to assign * specific meanings (line, cd, synth etc.) to them. */ #define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */ #define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */ #define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */ #define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */ #define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */ #define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */ #define SOUND_MIXER_PHONEIN 20 /* Phone input */ #define SOUND_MIXER_PHONEOUT 21 /* Phone output */ #define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */ #define SOUND_MIXER_RADIO 23 /* Radio in */ #define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */ /* * Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) * Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */ #define SOUND_ONOFF_MIN 28 #define SOUND_ONOFF_MAX 30 #define SOUND_MIXER_MUTE 28 /* 0 or 1 */ #define SOUND_MIXER_ENHANCE 29 /* Enhanced stereo (0, 40, 60 or 80) */ #define SOUND_MIXER_LOUD 30 /* 0 or 1 */ /* Note! Number 31 cannot be used since the sign bit is reserved */ #define SOUND_MIXER_NONE 31 #define SOUND_DEVICE_LABELS { \ "Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \ "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \ "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \ "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"} #define SOUND_DEVICE_NAMES { \ "vol", "bass", "treble", "synth", "pcm", "speaker", "line", \ "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \ "line1", "line2", "line3", "dig1", "dig2", "dig3", \ "phin", "phout", "video", "radio", "monitor"} /* Device bitmask identifiers */ #define SOUND_MIXER_RECSRC 0xff /* 1 bit per recording source */ #define SOUND_MIXER_DEVMASK 0xfe /* 1 bit per supported device */ #define SOUND_MIXER_RECMASK 0xfd /* 1 bit per supp. recording source */ #define SOUND_MIXER_CAPS 0xfc #define SOUND_CAP_EXCL_INPUT 0x00000001 /* Only 1 rec. src at a time */ #define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */ /* Device mask bits */ #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) #define SOUND_MASK_CD (1 << SOUND_MIXER_CD) #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) #define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN) #define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT) #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) #define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR) /* Obsolete macros */ #define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE) #define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE) #define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD) #define MIXER_READ(dev) _IOR('M', dev, int) #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) /* Obsolete macros */ #define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE) #define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE) #define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD) #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) #define MIXER_WRITE(dev) _IOWR('M', dev, int) #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) #define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE) #define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE) #define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD) #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) #define LEFT_CHN 0 #define RIGHT_CHN 1 /* * Level 2 event types for /dev/sequencer */ /* * The 4 most significant bits of byte 0 specify the class of * the event: * * 0x8X = system level events, * 0x9X = device/port specific events, event[1] = device/port, * The last 4 bits give the subtype: * 0x02 = Channel event (event[3] = chn). * 0x01 = note event (event[4] = note). * (0x01 is not used alone but always with bit 0x02). * event[2] = MIDI message code (0x80=note off etc.) * */ #define EV_SEQ_LOCAL 0x80 #define EV_TIMING 0x81 #define EV_CHN_COMMON 0x92 #define EV_CHN_VOICE 0x93 #define EV_SYSEX 0x94 /* * Event types 200 to 220 are reserved for application use. * These numbers will not be used by the driver. */ /* * Events for event type EV_CHN_VOICE */ #define MIDI_NOTEOFF 0x80 #define MIDI_NOTEON 0x90 #define MIDI_KEY_PRESSURE 0xA0 /* * Events for event type EV_CHN_COMMON */ #define MIDI_CTL_CHANGE 0xB0 #define MIDI_PGM_CHANGE 0xC0 #define MIDI_CHN_PRESSURE 0xD0 #define MIDI_PITCH_BEND 0xE0 #define MIDI_SYSTEM_PREFIX 0xF0 /* * Timer event types */ #define TMR_WAIT_REL 1 /* Time relative to the prev time */ #define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */ #define TMR_STOP 3 #define TMR_START 4 #define TMR_CONTINUE 5 #define TMR_TEMPO 6 #define TMR_ECHO 8 #define TMR_CLOCK 9 /* MIDI clock */ #define TMR_SPP 10 /* Song position pointer */ #define TMR_TIMESIG 11 /* Time signature */ /* * Local event types */ #define LOCL_STARTAUDIO 1 #if (!defined(_KERNEL) && !defined(INKERNEL)) || defined(USE_SEQ_MACROS) /* * Some convenience macros to simplify programming of the * /dev/sequencer interface * * These macros define the API which should be used when possible. */ #ifndef USE_SIMPLE_MACROS -void seqbuf_dump __P((void)); /* This function must be provided by programs */ +void seqbuf_dump(void); /* This function must be provided by programs */ /* Sample seqbuf_dump() implementation: * * SEQ_DEFINEBUF (2048); -- Defines a buffer for 2048 bytes * * int seqfd; -- The file descriptor for /dev/sequencer. * * void * seqbuf_dump () * { * if (_seqbufptr) * if (write (seqfd, _seqbuf, _seqbufptr) == -1) * { * perror ("write /dev/sequencer"); * exit (-1); * } * _seqbufptr = 0; * } */ #define SEQ_DEFINEBUF(len) \ u_char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0 #define SEQ_USE_EXTBUF() \ extern u_char _seqbuf[]; \ extern int _seqbuflen;extern int _seqbufptr #define SEQ_DECLAREBUF() SEQ_USE_EXTBUF() #define SEQ_PM_DEFINES struct patmgr_info _pm_info #define _SEQ_NEEDBUF(len) \ if ((_seqbufptr+(len)) > _seqbuflen) \ seqbuf_dump() #define _SEQ_ADVBUF(len) _seqbufptr += len #define SEQ_DUMPBUF seqbuf_dump #else /* * This variation of the sequencer macros is used just to format one event * using fixed buffer. * * The program using the macro library must define the following macros before * using this library. * * #define _seqbuf name of the buffer (u_char[]) * #define _SEQ_ADVBUF(len) If the applic needs to know the exact * size of the event, this macro can be used. * Otherwise this must be defined as empty. * #define _seqbufptr Define the name of index variable or 0 if * not required. */ #define _SEQ_NEEDBUF(len) /* empty */ #endif #define PM_LOAD_PATCH(dev, bank, pgm) \ (SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \ _pm_info.device=dev, _pm_info.data.data8[0]=pgm, \ _pm_info.parm1 = bank, _pm_info.parm2 = 1, \ ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info)) #define PM_LOAD_PATCHES(dev, bank, pgm) \ (SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \ _pm_info.device=dev, bcopy( pgm, _pm_info.data.data8, 128), \ _pm_info.parm1 = bank, _pm_info.parm2 = 128, \ ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info)) #define SEQ_VOLUME_MODE(dev, mode) { \ _SEQ_NEEDBUF(8);\ _seqbuf[_seqbufptr] = SEQ_EXTENDED;\ _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\ _seqbuf[_seqbufptr+2] = (dev);\ _seqbuf[_seqbufptr+3] = (mode);\ _seqbuf[_seqbufptr+4] = 0;\ _seqbuf[_seqbufptr+5] = 0;\ _seqbuf[_seqbufptr+6] = 0;\ _seqbuf[_seqbufptr+7] = 0;\ _SEQ_ADVBUF(8);} /* * Midi voice messages */ #define _CHN_VOICE(dev, event, chn, note, parm) { \ _SEQ_NEEDBUF(8);\ _seqbuf[_seqbufptr] = EV_CHN_VOICE;\ _seqbuf[_seqbufptr+1] = (dev);\ _seqbuf[_seqbufptr+2] = (event);\ _seqbuf[_seqbufptr+3] = (chn);\ _seqbuf[_seqbufptr+4] = (note);\ _seqbuf[_seqbufptr+5] = (parm);\ _seqbuf[_seqbufptr+6] = (0);\ _seqbuf[_seqbufptr+7] = 0;\ _SEQ_ADVBUF(8);} #define SEQ_START_NOTE(dev, chn, note, vol) \ _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol) #define SEQ_STOP_NOTE(dev, chn, note, vol) \ _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol) #define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \ _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure) /* * Midi channel messages */ #define _CHN_COMMON(dev, event, chn, p1, p2, w14) { \ _SEQ_NEEDBUF(8);\ _seqbuf[_seqbufptr] = EV_CHN_COMMON;\ _seqbuf[_seqbufptr+1] = (dev);\ _seqbuf[_seqbufptr+2] = (event);\ _seqbuf[_seqbufptr+3] = (chn);\ _seqbuf[_seqbufptr+4] = (p1);\ _seqbuf[_seqbufptr+5] = (p2);\ *(short *)&_seqbuf[_seqbufptr+6] = (w14);\ _SEQ_ADVBUF(8);} /* * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits * sending any MIDI bytes but it's absolutely not possible. Trying to do * so _will_ cause problems with MPU401 intelligent mode). * * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be * sent by calling SEQ_SYSEX() several times (there must be no other events * between them). First sysex fragment must have 0xf0 in the first byte * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte * between these sysex start and end markers cannot be larger than 0x7f. Also * lengths of each fragments (except the last one) must be 6. * * Breaking the above rules may work with some MIDI ports but is likely to * cause fatal problems with some other devices (such as MPU401). */ #define SEQ_SYSEX(dev, buf, len) { \ int i, l=(len); if (l>6)l=6;\ _SEQ_NEEDBUF(8);\ _seqbuf[_seqbufptr] = EV_SYSEX;\ for(i=0;i #include #ifdef _BSD_FFLAGS_T_ typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */ #undef _BSD_FFLAGS_T_ #endif #if !defined(_KERNEL) && !defined(_POSIX_SOURCE) /* * XXX we need this for struct timespec. We get miscellaneous namespace * pollution with it. */ #include #endif #ifdef _KERNEL #define __dev_t udev_t #else #define __dev_t dev_t #endif #ifndef _POSIX_SOURCE struct ostat { u_int16_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ mode_t st_mode; /* inode protection mode */ nlink_t st_nlink; /* number of hard links */ u_int16_t st_uid; /* user ID of the file's owner */ u_int16_t st_gid; /* group ID of the file's group */ u_int16_t st_rdev; /* device type */ int32_t st_size; /* file size, in bytes */ struct timespec st_atimespec; /* time of last access */ struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_ctimespec; /* time of last file status change */ int32_t st_blksize; /* optimal blocksize for I/O */ int32_t st_blocks; /* blocks allocated for file */ fflags_t st_flags; /* user defined flags for file */ u_int32_t st_gen; /* file generation number */ }; #endif /* !_POSIX_SOURCE */ struct stat { __dev_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ mode_t st_mode; /* inode protection mode */ nlink_t st_nlink; /* number of hard links */ uid_t st_uid; /* user ID of the file's owner */ gid_t st_gid; /* group ID of the file's group */ __dev_t st_rdev; /* device type */ #ifndef _POSIX_SOURCE struct timespec st_atimespec; /* time of last access */ struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_ctimespec; /* time of last file status change */ #else time_t st_atime; /* time of last access */ long st_atimensec; /* nsec of last access */ time_t st_mtime; /* time of last data modification */ long st_mtimensec; /* nsec of last data modification */ time_t st_ctime; /* time of last file status change */ long st_ctimensec; /* nsec of last file status change */ #endif off_t st_size; /* file size, in bytes */ int64_t st_blocks; /* blocks allocated for file */ u_int32_t st_blksize; /* optimal blocksize for I/O */ fflags_t st_flags; /* user defined flags for file */ u_int32_t st_gen; /* file generation number */ int32_t st_lspare; int64_t st_qspare[2]; }; #ifndef _POSIX_SOURCE struct nstat { __dev_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ u_int32_t st_mode; /* inode protection mode */ u_int32_t st_nlink; /* number of hard links */ uid_t st_uid; /* user ID of the file's owner */ gid_t st_gid; /* group ID of the file's group */ __dev_t st_rdev; /* device type */ #ifndef _POSIX_SOURCE struct timespec st_atimespec; /* time of last access */ struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_ctimespec; /* time of last file status change */ #else time_t st_atime; /* time of last access */ long st_atimensec; /* nsec of last access */ time_t st_mtime; /* time of last data modification */ long st_mtimensec; /* nsec of last data modification */ time_t st_ctime; /* time of last file status change */ long st_ctimensec; /* nsec of last file status change */ #endif off_t st_size; /* file size, in bytes */ int64_t st_blocks; /* blocks allocated for file */ u_int32_t st_blksize; /* optimal blocksize for I/O */ fflags_t st_flags; /* user defined flags for file */ u_int32_t st_gen; /* file generation number */ int64_t st_qspare[2]; }; #endif #undef __dev_t #ifndef _POSIX_SOURCE #define st_atime st_atimespec.tv_sec #define st_mtime st_mtimespec.tv_sec #define st_ctime st_ctimespec.tv_sec #endif #define S_ISUID 0004000 /* set user id on execution */ #define S_ISGID 0002000 /* set group id on execution */ #ifndef _POSIX_SOURCE #define S_ISTXT 0001000 /* sticky bit */ #endif #define S_IRWXU 0000700 /* RWX mask for owner */ #define S_IRUSR 0000400 /* R for owner */ #define S_IWUSR 0000200 /* W for owner */ #define S_IXUSR 0000100 /* X for owner */ #ifndef _POSIX_SOURCE #define S_IREAD S_IRUSR #define S_IWRITE S_IWUSR #define S_IEXEC S_IXUSR #endif #define S_IRWXG 0000070 /* RWX mask for group */ #define S_IRGRP 0000040 /* R for group */ #define S_IWGRP 0000020 /* W for group */ #define S_IXGRP 0000010 /* X for group */ #define S_IRWXO 0000007 /* RWX mask for other */ #define S_IROTH 0000004 /* R for other */ #define S_IWOTH 0000002 /* W for other */ #define S_IXOTH 0000001 /* X for other */ #ifndef _POSIX_SOURCE #define S_IFMT 0170000 /* type of file mask */ #define S_IFIFO 0010000 /* named pipe (fifo) */ #define S_IFCHR 0020000 /* character special */ #define S_IFDIR 0040000 /* directory */ #define S_IFBLK 0060000 /* block special */ #define S_IFREG 0100000 /* regular */ #define S_IFLNK 0120000 /* symbolic link */ #define S_IFSOCK 0140000 /* socket */ #define S_IFWHT 0160000 /* whiteout */ #define S_ISVTX 0001000 /* save swapped text even after use */ #endif #define S_ISDIR(m) (((m) & 0170000) == 0040000) /* directory */ #define S_ISCHR(m) (((m) & 0170000) == 0020000) /* char special */ #define S_ISBLK(m) (((m) & 0170000) == 0060000) /* block special */ #define S_ISREG(m) (((m) & 0170000) == 0100000) /* regular file */ #define S_ISFIFO(m) (((m) & 0170000) == 0010000) /* fifo or socket */ #ifndef _POSIX_SOURCE #define S_ISLNK(m) (((m) & 0170000) == 0120000) /* symbolic link */ #define S_ISSOCK(m) (((m) & 0170000) == 0140000) /* socket */ #define S_ISWHT(m) (((m) & 0170000) == 0160000) /* whiteout */ #endif #ifndef _POSIX_SOURCE #define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ /* 7777 */ #define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) /* 0666 */ #define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) #define S_BLKSIZE 512 /* block size used in the stat struct */ /* * Definitions of flags stored in file flags word. * * Super-user and owner changeable flags. */ #define UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */ #define UF_NODUMP 0x00000001 /* do not dump file */ #define UF_IMMUTABLE 0x00000002 /* file may not be changed */ #define UF_APPEND 0x00000004 /* writes to file may only append */ #define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */ #define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */ /* * Super-user changeable flags. */ #define SF_SETTABLE 0xffff0000 /* mask of superuser changeable flags */ #define SF_ARCHIVED 0x00010000 /* file is archived */ #define SF_IMMUTABLE 0x00020000 /* file may not be changed */ #define SF_APPEND 0x00040000 /* writes to file may only append */ #define SF_NOUNLINK 0x00100000 /* file may not be removed or renamed */ #define SF_SNAPSHOT 0x00200000 /* snapshot inode */ #ifdef _KERNEL /* * Shorthand abbreviations of above. */ #define OPAQUE (UF_OPAQUE) #define APPEND (UF_APPEND | SF_APPEND) #define IMMUTABLE (UF_IMMUTABLE | SF_IMMUTABLE) #define NOUNLINK (UF_NOUNLINK | SF_NOUNLINK) #endif #endif /* !_POSIX_SOURCE */ #ifndef _KERNEL __BEGIN_DECLS -int chmod __P((const char *, mode_t)); -int fstat __P((int, struct stat *)); -int mkdir __P((const char *, mode_t)); -int mkfifo __P((const char *, mode_t)); -int stat __P((const char *, struct stat *)); -mode_t umask __P((mode_t)); +int chmod(const char *, mode_t); +int fstat(int, struct stat *); +int mkdir(const char *, mode_t); +int mkfifo(const char *, mode_t); +int stat(const char *, struct stat *); +mode_t umask(mode_t); #ifndef _POSIX_SOURCE -int chflags __P((const char *, u_long)); -int fchflags __P((int, u_long)); -int fchmod __P((int, mode_t)); -int lchmod __P((const char *, mode_t)); -int lstat __P((const char *, struct stat *)); +int chflags(const char *, u_long); +int fchflags(int, u_long); +int fchmod(int, mode_t); +int lchmod(const char *, mode_t); +int lstat(const char *, struct stat *); #endif __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_STAT_H_ */ Index: head/sys/sys/sysctl.h =================================================================== --- head/sys/sys/sysctl.h (revision 92718) +++ head/sys/sys/sysctl.h (revision 92719) @@ -1,610 +1,610 @@ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Karels at Berkeley Software Design, 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. * * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 * $FreeBSD$ */ #ifndef _SYS_SYSCTL_H_ #define _SYS_SYSCTL_H_ #include #include struct thread; /* * Definitions for sysctl call. The sysctl call uses a hierarchical name * for objects that can be examined or modified. The name is expressed as * a sequence of integers. Like a file path name, the meaning of each * component depends on its place in the hierarchy. The top-level and kern * identifiers are defined here, and other identifiers are defined in the * respective subsystem header files. */ #define CTL_MAXNAME 12 /* largest number of components supported */ /* * Each subsystem defined by sysctl defines a list of variables * for that subsystem. Each name is either a node with further * levels defined below it, or it is a leaf of some particular * type given below. Each sysctl level defines a set of name/type * pairs to be used by sysctl(1) in manipulating the subsystem. */ struct ctlname { char *ctl_name; /* subsystem name */ int ctl_type; /* type of name */ }; #define CTLTYPE 0xf /* Mask for the type */ #define CTLTYPE_NODE 1 /* name is a node */ #define CTLTYPE_INT 2 /* name describes an integer */ #define CTLTYPE_STRING 3 /* name describes a string */ #define CTLTYPE_QUAD 4 /* name describes a 64-bit number */ #define CTLTYPE_OPAQUE 5 /* name describes a structure */ #define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */ #define CTLTYPE_UINT 6 /* name describes an unsigned integer */ #define CTLTYPE_LONG 7 /* name describes a long */ #define CTLTYPE_ULONG 8 /* name describes an unsigned long */ #define CTLFLAG_RD 0x80000000 /* Allow reads of variable */ #define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */ #define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR) #define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */ #define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */ #define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */ #define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */ #define CTLFLAG_DYN 0x02000000 /* Dynamic oid - can be freed */ /* * USE THIS instead of a hardwired number from the categories below * to get dynamically assigned sysctl entries using the linker-set * technology. This is the way nearly all new sysctl variables should * be implemented. * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, ""); */ #define OID_AUTO (-1) /* * The starting number for dynamically-assigned entries. WARNING! * ALL static sysctl entries should have numbers LESS than this! */ #define CTL_AUTO_START 0x100 #ifdef _KERNEL #define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \ struct sysctl_req *req /* * This describes the access space for a sysctl request. This is needed * so that we can use the interface from the kernel or from user-space. */ struct sysctl_req { struct thread *td; /* used for access checking */ int lock; void *oldptr; size_t oldlen; size_t oldidx; int (*oldfunc)(struct sysctl_req *, const void *, size_t); void *newptr; size_t newlen; size_t newidx; int (*newfunc)(struct sysctl_req *, void *, size_t); }; SLIST_HEAD(sysctl_oid_list, sysctl_oid); /* * This describes one "oid" in the MIB tree. Potentially more nodes can * be hidden behind it, expanded by the handler. */ struct sysctl_oid { struct sysctl_oid_list *oid_parent; SLIST_ENTRY(sysctl_oid) oid_link; int oid_number; int oid_kind; void *oid_arg1; int oid_arg2; const char *oid_name; int (*oid_handler)(SYSCTL_HANDLER_ARGS); const char *oid_fmt; int oid_refcnt; char *descr; }; #define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l) #define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l) int sysctl_handle_int(SYSCTL_HANDLER_ARGS); int sysctl_handle_long(SYSCTL_HANDLER_ARGS); int sysctl_handle_intptr(SYSCTL_HANDLER_ARGS); int sysctl_handle_string(SYSCTL_HANDLER_ARGS); int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); /* * These functions are used to add/remove an oid from the mib. */ void sysctl_register_oid(struct sysctl_oid *oidp); void sysctl_unregister_oid(struct sysctl_oid *oidp); /* Declare a static oid to allow child oids to be added to it. */ #define SYSCTL_DECL(name) \ extern struct sysctl_oid_list sysctl_##name##_children /* Hide these in macros */ #define SYSCTL_CHILDREN(oid_ptr) (struct sysctl_oid_list *) \ (oid_ptr)->oid_arg1 #define SYSCTL_STATIC_CHILDREN(oid_name) \ (&sysctl_##oid_name##_children) /* === Structs and macros related to context handling === */ /* All dynamically created sysctls can be tracked in a context list. */ struct sysctl_ctx_entry { struct sysctl_oid *entry; TAILQ_ENTRY(sysctl_ctx_entry) link; }; TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); /* This constructs a "raw" MIB oid. */ #define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ static struct sysctl_oid sysctl__##parent##_##name = { \ &sysctl_##parent##_children, { 0 }, \ nbr, kind, a1, a2, #name, handler, fmt, 0, descr }; \ DATA_SET(sysctl_set, sysctl__##parent##_##name); #define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ sysctl_add_oid(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr); /* This constructs a node from which other oids can hang. */ #define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \ struct sysctl_oid_list sysctl_##parent##_##name##_children; \ SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|access, \ (void*)&sysctl_##parent##_##name##_children, 0, handler, \ "N", descr); #define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|access, \ 0, 0, handler, "N", descr); /* Oid for a string. len can be 0 to indicate '\0' termination. */ #define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|access, \ arg, len, sysctl_handle_string, "A", descr) #define SYSCTL_ADD_STRING(ctx, parent, nbr, name, access, arg, len, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|access, \ arg, len, sysctl_handle_string, "A", descr); /* Oid for an int. If ptr is NULL, val is returned. */ #define SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \ ptr, val, sysctl_handle_int, "I", descr) #define SYSCTL_ADD_INT(ctx, parent, nbr, name, access, ptr, val, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_INT|access, \ ptr, val, sysctl_handle_int, "I", descr); /* Oid for an unsigned int. If ptr is NULL, val is returned. */ #define SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_UINT|access, \ ptr, val, sysctl_handle_int, "IU", descr) #define SYSCTL_ADD_UINT(ctx, parent, nbr, name, access, ptr, val, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_UINT|access, \ ptr, val, sysctl_handle_int, "IU", descr); /* Oid for a long. The pointer must be non NULL. */ #define SYSCTL_LONG(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_LONG|access, \ ptr, val, sysctl_handle_long, "L", descr) #define SYSCTL_ADD_LONG(ctx, parent, nbr, name, access, ptr, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_LONG|access, \ ptr, 0, sysctl_handle_long, "L", descr); /* Oid for a long. The pointer must be non NULL. */ #define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|access, \ ptr, val, sysctl_handle_long, "LU", descr) #define SYSCTL_ADD_ULONG(ctx, parent, nbr, name, access, ptr, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_ULONG|access, \ ptr, 0, sysctl_handle_long, "LU", descr); /* Oid for an opaque object. Specified by a pointer and a length. */ #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|access, \ ptr, len, sysctl_handle_opaque, fmt, descr) #define SYSCTL_ADD_OPAQUE(ctx, parent, nbr, name, access, ptr, len, fmt, descr)\ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|access, \ ptr, len, sysctl_handle_opaque, fmt, descr); /* Oid for a struct. Specified by a pointer and a type. */ #define SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|access, \ ptr, sizeof(struct type), sysctl_handle_opaque, \ "S," #type, descr) #define SYSCTL_ADD_STRUCT(ctx, parent, nbr, name, access, ptr, type, descr) \ sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_OPAQUE|access, \ ptr, sizeof(struct type), sysctl_handle_opaque, "S," #type, descr); /* Oid for a procedure. Specified by a pointer and an arg. */ #define SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \ SYSCTL_OID(parent, nbr, name, access, \ ptr, arg, handler, fmt, descr) #define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \ sysctl_add_oid(ctx, parent, nbr, name, access, \ ptr, arg, handler, fmt, descr); #endif /* _KERNEL */ /* * Top-level identifiers */ #define CTL_UNSPEC 0 /* unused */ #define CTL_KERN 1 /* "high kernel": proc, limits */ #define CTL_VM 2 /* virtual memory */ #define CTL_VFS 3 /* file system, mount type is next */ #define CTL_NET 4 /* network, see socket.h */ #define CTL_DEBUG 5 /* debugging parameters */ #define CTL_HW 6 /* generic cpu/io */ #define CTL_MACHDEP 7 /* machine dependent */ #define CTL_USER 8 /* user-level */ #define CTL_P1003_1B 9 /* POSIX 1003.1B */ #define CTL_MAXID 10 /* number of valid top-level ids */ #define CTL_NAMES { \ { 0, 0 }, \ { "kern", CTLTYPE_NODE }, \ { "vm", CTLTYPE_NODE }, \ { "vfs", CTLTYPE_NODE }, \ { "net", CTLTYPE_NODE }, \ { "debug", CTLTYPE_NODE }, \ { "hw", CTLTYPE_NODE }, \ { "machdep", CTLTYPE_NODE }, \ { "user", CTLTYPE_NODE }, \ { "p1003_1b", CTLTYPE_NODE }, \ } /* * CTL_KERN identifiers */ #define KERN_OSTYPE 1 /* string: system version */ #define KERN_OSRELEASE 2 /* string: system release */ #define KERN_OSREV 3 /* int: system revision */ #define KERN_VERSION 4 /* string: compile time info */ #define KERN_MAXVNODES 5 /* int: max vnodes */ #define KERN_MAXPROC 6 /* int: max processes */ #define KERN_MAXFILES 7 /* int: max open files */ #define KERN_ARGMAX 8 /* int: max arguments to exec */ #define KERN_SECURELVL 9 /* int: system security level */ #define KERN_HOSTNAME 10 /* string: hostname */ #define KERN_HOSTID 11 /* int: host identifier */ #define KERN_CLOCKRATE 12 /* struct: struct clockrate */ #define KERN_VNODE 13 /* struct: vnode structures */ #define KERN_PROC 14 /* struct: process entries */ #define KERN_FILE 15 /* struct: file entries */ #define KERN_PROF 16 /* node: kernel profiling info */ #define KERN_POSIX1 17 /* int: POSIX.1 version */ #define KERN_NGROUPS 18 /* int: # of supplemental group ids */ #define KERN_JOB_CONTROL 19 /* int: is job control available */ #define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */ #define KERN_BOOTTIME 21 /* struct: time kernel was booted */ #define KERN_NISDOMAINNAME 22 /* string: YP domain name */ #define KERN_UPDATEINTERVAL 23 /* int: update process sleep time */ #define KERN_OSRELDATE 24 /* int: OS release date */ #define KERN_NTP_PLL 25 /* node: NTP PLL control */ #define KERN_BOOTFILE 26 /* string: name of booted kernel */ #define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */ #define KERN_MAXPROCPERUID 28 /* int: max processes per uid */ #define KERN_DUMPDEV 29 /* dev_t: device to dump on */ #define KERN_IPC 30 /* node: anything related to IPC */ #define KERN_DUMMY 31 /* unused */ #define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */ #define KERN_USRSTACK 33 /* int: address of USRSTACK */ #define KERN_LOGSIGEXIT 34 /* int: do we log sigexit procs? */ #define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */ #define KERN_MAXID 36 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ { "ostype", CTLTYPE_STRING }, \ { "osrelease", CTLTYPE_STRING }, \ { "osrevision", CTLTYPE_INT }, \ { "version", CTLTYPE_STRING }, \ { "maxvnodes", CTLTYPE_INT }, \ { "maxproc", CTLTYPE_INT }, \ { "maxfiles", CTLTYPE_INT }, \ { "argmax", CTLTYPE_INT }, \ { "securelevel", CTLTYPE_INT }, \ { "hostname", CTLTYPE_STRING }, \ { "hostid", CTLTYPE_UINT }, \ { "clockrate", CTLTYPE_STRUCT }, \ { "vnode", CTLTYPE_STRUCT }, \ { "proc", CTLTYPE_STRUCT }, \ { "file", CTLTYPE_STRUCT }, \ { "profiling", CTLTYPE_NODE }, \ { "posix1version", CTLTYPE_INT }, \ { "ngroups", CTLTYPE_INT }, \ { "job_control", CTLTYPE_INT }, \ { "saved_ids", CTLTYPE_INT }, \ { "boottime", CTLTYPE_STRUCT }, \ { "nisdomainname", CTLTYPE_STRING }, \ { "update", CTLTYPE_INT }, \ { "osreldate", CTLTYPE_INT }, \ { "ntp_pll", CTLTYPE_NODE }, \ { "bootfile", CTLTYPE_STRING }, \ { "maxfilesperproc", CTLTYPE_INT }, \ { "maxprocperuid", CTLTYPE_INT }, \ { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \ { "ipc", CTLTYPE_NODE }, \ { "dummy", CTLTYPE_INT }, \ { "ps_strings", CTLTYPE_INT }, \ { "usrstack", CTLTYPE_INT }, \ { "logsigexit", CTLTYPE_INT }, \ { "iov_max", CTLTYPE_INT }, \ } /* * CTL_VFS identifiers */ #define CTL_VFS_NAMES { \ { "vfsconf", CTLTYPE_STRUCT }, \ } /* * KERN_PROC subtypes */ #define KERN_PROC_ALL 0 /* everything */ #define KERN_PROC_PID 1 /* by process id */ #define KERN_PROC_PGRP 2 /* by process group id */ #define KERN_PROC_SESSION 3 /* by session of pid */ #define KERN_PROC_TTY 4 /* by controlling tty */ #define KERN_PROC_UID 5 /* by effective uid */ #define KERN_PROC_RUID 6 /* by real uid */ #define KERN_PROC_ARGS 7 /* get/set arguments/proctitle */ /* * KERN_IPC identifiers */ #define KIPC_MAXSOCKBUF 1 /* int: max size of a socket buffer */ #define KIPC_SOCKBUF_WASTE 2 /* int: wastage factor in sockbuf */ #define KIPC_SOMAXCONN 3 /* int: max length of connection q */ #define KIPC_MAX_LINKHDR 4 /* int: max length of link header */ #define KIPC_MAX_PROTOHDR 5 /* int: max length of network header */ #define KIPC_MAX_HDR 6 /* int: max total length of headers */ #define KIPC_MAX_DATALEN 7 /* int: max length of data? */ /* * CTL_HW identifiers */ #define HW_MACHINE 1 /* string: machine class */ #define HW_MODEL 2 /* string: specific machine model */ #define HW_NCPU 3 /* int: number of cpus */ #define HW_BYTEORDER 4 /* int: machine byte order */ #define HW_PHYSMEM 5 /* int: total memory */ #define HW_USERMEM 6 /* int: non-kernel memory */ #define HW_PAGESIZE 7 /* int: software page size */ #define HW_DISKNAMES 8 /* strings: disk drive names */ #define HW_DISKSTATS 9 /* struct: diskstats[] */ #define HW_FLOATINGPT 10 /* int: has HW floating point? */ #define HW_MACHINE_ARCH 11 /* string: machine architecture */ #define HW_MAXID 12 /* number of valid hw ids */ #define CTL_HW_NAMES { \ { 0, 0 }, \ { "machine", CTLTYPE_STRING }, \ { "model", CTLTYPE_STRING }, \ { "ncpu", CTLTYPE_INT }, \ { "byteorder", CTLTYPE_INT }, \ { "physmem", CTLTYPE_ULONG }, \ { "usermem", CTLTYPE_ULONG }, \ { "pagesize", CTLTYPE_INT }, \ { "disknames", CTLTYPE_STRUCT }, \ { "diskstats", CTLTYPE_STRUCT }, \ { "floatingpoint", CTLTYPE_INT }, \ } /* * CTL_USER definitions */ #define USER_CS_PATH 1 /* string: _CS_PATH */ #define USER_BC_BASE_MAX 2 /* int: BC_BASE_MAX */ #define USER_BC_DIM_MAX 3 /* int: BC_DIM_MAX */ #define USER_BC_SCALE_MAX 4 /* int: BC_SCALE_MAX */ #define USER_BC_STRING_MAX 5 /* int: BC_STRING_MAX */ #define USER_COLL_WEIGHTS_MAX 6 /* int: COLL_WEIGHTS_MAX */ #define USER_EXPR_NEST_MAX 7 /* int: EXPR_NEST_MAX */ #define USER_LINE_MAX 8 /* int: LINE_MAX */ #define USER_RE_DUP_MAX 9 /* int: RE_DUP_MAX */ #define USER_POSIX2_VERSION 10 /* int: POSIX2_VERSION */ #define USER_POSIX2_C_BIND 11 /* int: POSIX2_C_BIND */ #define USER_POSIX2_C_DEV 12 /* int: POSIX2_C_DEV */ #define USER_POSIX2_CHAR_TERM 13 /* int: POSIX2_CHAR_TERM */ #define USER_POSIX2_FORT_DEV 14 /* int: POSIX2_FORT_DEV */ #define USER_POSIX2_FORT_RUN 15 /* int: POSIX2_FORT_RUN */ #define USER_POSIX2_LOCALEDEF 16 /* int: POSIX2_LOCALEDEF */ #define USER_POSIX2_SW_DEV 17 /* int: POSIX2_SW_DEV */ #define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */ #define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */ #define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */ #define USER_MAXID 21 /* number of valid user ids */ #define CTL_USER_NAMES { \ { 0, 0 }, \ { "cs_path", CTLTYPE_STRING }, \ { "bc_base_max", CTLTYPE_INT }, \ { "bc_dim_max", CTLTYPE_INT }, \ { "bc_scale_max", CTLTYPE_INT }, \ { "bc_string_max", CTLTYPE_INT }, \ { "coll_weights_max", CTLTYPE_INT }, \ { "expr_nest_max", CTLTYPE_INT }, \ { "line_max", CTLTYPE_INT }, \ { "re_dup_max", CTLTYPE_INT }, \ { "posix2_version", CTLTYPE_INT }, \ { "posix2_c_bind", CTLTYPE_INT }, \ { "posix2_c_dev", CTLTYPE_INT }, \ { "posix2_char_term", CTLTYPE_INT }, \ { "posix2_fort_dev", CTLTYPE_INT }, \ { "posix2_fort_run", CTLTYPE_INT }, \ { "posix2_localedef", CTLTYPE_INT }, \ { "posix2_sw_dev", CTLTYPE_INT }, \ { "posix2_upe", CTLTYPE_INT }, \ { "stream_max", CTLTYPE_INT }, \ { "tzname_max", CTLTYPE_INT }, \ } #define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */ #define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */ #define CTL_P1003_1B_MEMLOCK 3 /* boolean */ #define CTL_P1003_1B_MEMLOCK_RANGE 4 /* boolean */ #define CTL_P1003_1B_MEMORY_PROTECTION 5 /* boolean */ #define CTL_P1003_1B_MESSAGE_PASSING 6 /* boolean */ #define CTL_P1003_1B_PRIORITIZED_IO 7 /* boolean */ #define CTL_P1003_1B_PRIORITY_SCHEDULING 8 /* boolean */ #define CTL_P1003_1B_REALTIME_SIGNALS 9 /* boolean */ #define CTL_P1003_1B_SEMAPHORES 10 /* boolean */ #define CTL_P1003_1B_FSYNC 11 /* boolean */ #define CTL_P1003_1B_SHARED_MEMORY_OBJECTS 12 /* boolean */ #define CTL_P1003_1B_SYNCHRONIZED_IO 13 /* boolean */ #define CTL_P1003_1B_TIMERS 14 /* boolean */ #define CTL_P1003_1B_AIO_LISTIO_MAX 15 /* int */ #define CTL_P1003_1B_AIO_MAX 16 /* int */ #define CTL_P1003_1B_AIO_PRIO_DELTA_MAX 17 /* int */ #define CTL_P1003_1B_DELAYTIMER_MAX 18 /* int */ #define CTL_P1003_1B_MQ_OPEN_MAX 19 /* int */ #define CTL_P1003_1B_PAGESIZE 20 /* int */ #define CTL_P1003_1B_RTSIG_MAX 21 /* int */ #define CTL_P1003_1B_SEM_NSEMS_MAX 22 /* int */ #define CTL_P1003_1B_SEM_VALUE_MAX 23 /* int */ #define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */ #define CTL_P1003_1B_TIMER_MAX 25 /* int */ #define CTL_P1003_1B_MAXID 26 #define CTL_P1003_1B_NAMES { \ { 0, 0 }, \ { "asynchronous_io", CTLTYPE_INT }, \ { "mapped_files", CTLTYPE_INT }, \ { "memlock", CTLTYPE_INT }, \ { "memlock_range", CTLTYPE_INT }, \ { "memory_protection", CTLTYPE_INT }, \ { "message_passing", CTLTYPE_INT }, \ { "prioritized_io", CTLTYPE_INT }, \ { "priority_scheduling", CTLTYPE_INT }, \ { "realtime_signals", CTLTYPE_INT }, \ { "semaphores", CTLTYPE_INT }, \ { "fsync", CTLTYPE_INT }, \ { "shared_memory_objects", CTLTYPE_INT }, \ { "synchronized_io", CTLTYPE_INT }, \ { "timers", CTLTYPE_INT }, \ { "aio_listio_max", CTLTYPE_INT }, \ { "aio_max", CTLTYPE_INT }, \ { "aio_prio_delta_max", CTLTYPE_INT }, \ { "delaytimer_max", CTLTYPE_INT }, \ { "mq_open_max", CTLTYPE_INT }, \ { "pagesize", CTLTYPE_INT }, \ { "rtsig_max", CTLTYPE_INT }, \ { "nsems_max", CTLTYPE_INT }, \ { "sem_value_max", CTLTYPE_INT }, \ { "sigqueue_max", CTLTYPE_INT }, \ { "timer_max", CTLTYPE_INT }, \ } #ifdef _KERNEL /* * Declare some common oids. */ extern struct sysctl_oid_list sysctl__children; SYSCTL_DECL(_kern); SYSCTL_DECL(_sysctl); SYSCTL_DECL(_vm); SYSCTL_DECL(_vfs); SYSCTL_DECL(_net); SYSCTL_DECL(_debug); SYSCTL_DECL(_debug_sizeof); SYSCTL_DECL(_hw); SYSCTL_DECL(_machdep); SYSCTL_DECL(_user); SYSCTL_DECL(_compat); extern char machine[]; extern char osrelease[]; extern char ostype[]; /* Dynamic oid handling */ struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, int nbr, const char *name, int kind, void *arg1, int arg2, int (*handler) (SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr); int sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse); int sysctl_ctx_init(struct sysctl_ctx_list *clist); int sysctl_ctx_free(struct sysctl_ctx_list *clist); struct sysctl_ctx_entry *sysctl_ctx_entry_add(struct sysctl_ctx_list *clist, struct sysctl_oid *oidp); struct sysctl_ctx_entry *sysctl_ctx_entry_find(struct sysctl_ctx_list *clist, struct sysctl_oid *oidp); int sysctl_ctx_entry_del(struct sysctl_ctx_list *clist, struct sysctl_oid *oidp); int kernel_sysctl(struct thread *td, int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval); int kernel_sysctlbyname(struct thread *td, char *name, void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval); int userland_sysctl(struct thread *td, int *name, u_int namelen, void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen, size_t *retval); int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid, int *nindx, struct sysctl_req *req); #else /* !_KERNEL */ #include __BEGIN_DECLS -int sysctl __P((int *, u_int, void *, size_t *, void *, size_t)); -int sysctlbyname __P((const char *, void *, size_t *, void *, size_t)); -int sysctlnametomib __P((const char *, int *, size_t *)); +int sysctl(int *, u_int, void *, size_t *, void *, size_t); +int sysctlbyname(const char *, void *, size_t *, void *, size_t); +int sysctlnametomib(const char *, int *, size_t *); __END_DECLS #endif /* _KERNEL */ #endif /* !_SYS_SYSCTL_H_ */ Index: head/sys/sys/sysent.h =================================================================== --- head/sys/sys/sysent.h (revision 92718) +++ head/sys/sys/sysent.h (revision 92719) @@ -1,133 +1,133 @@ /*- * Copyright (c) 1982, 1988, 1991 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. * * $FreeBSD$ */ #ifndef _SYS_SYSENT_H_ #define _SYS_SYSENT_H_ struct thread; -typedef int sy_call_t __P((struct thread *, void *)); +typedef int sy_call_t(struct thread *, void *); struct sysent { /* system call table */ int sy_narg; /* number of arguments */ sy_call_t *sy_call; /* implementing function */ }; #define SYF_ARGMASK 0x0000FFFF #define SYF_MPSAFE 0x00010000 #define SCARG(p,k) ((p)->k) /* get arg from args pointer */ /* placeholder till we integrate rest of lite2 syscallargs changes XXX */ struct image_params; struct __sigset; struct trapframe; struct vnode; struct sysentvec { int sv_size; /* number of entries */ struct sysent *sv_table; /* pointer to sysent */ u_int sv_mask; /* optional mask to index */ int sv_sigsize; /* size of signal translation table */ int *sv_sigtbl; /* signal translation table */ int sv_errsize; /* size of errno translation table */ int *sv_errtbl; /* errno translation table */ - int (*sv_transtrap) __P((int, int)); + int (*sv_transtrap)(int, int); /* translate trap-to-signal mapping */ - int (*sv_fixup) __P((register_t **, struct image_params *)); + int (*sv_fixup)(register_t **, struct image_params *); /* stack fixup function */ - void (*sv_sendsig) __P((void (*)(int), int, - struct __sigset *, u_long)); + void (*sv_sendsig)(void (*)(int), int, + struct __sigset *, u_long); /* send signal */ char *sv_sigcode; /* start of sigtramp code */ int *sv_szsigcode; /* size of sigtramp code */ - void (*sv_prepsyscall) __P((struct trapframe *, int *, - u_int *, caddr_t *)); + void (*sv_prepsyscall)(struct trapframe *, int *, + u_int *, caddr_t *); char *sv_name; /* name of binary type */ - int (*sv_coredump) __P((struct thread *, struct vnode *, - off_t)); + int (*sv_coredump)(struct thread *, struct vnode *, + off_t); /* function to dump core, or NULL */ - int (*sv_imgact_try) __P((struct image_params *)); + int (*sv_imgact_try)(struct image_params *); int sv_minsigstksz; /* minimum signal stack size */ }; #ifdef _KERNEL extern struct sysentvec aout_sysvec; extern struct sysentvec elf_freebsd_sysvec; extern struct sysent sysent[]; #define NO_SYSCALL (-1) struct module; struct syscall_module_data { int (*chainevh)(struct module *, int, void *); /* next handler */ void *chainarg; /* arg for next event handler */ int *offset; /* offset into sysent */ struct sysent *new_sysent; /* new sysent */ struct sysent old_sysent; /* old sysent */ }; #define SYSCALL_MODULE(name, offset, new_sysent, evh, arg) \ static struct syscall_module_data name##_syscall_mod = { \ evh, arg, offset, new_sysent, { 0, NULL } \ }; \ \ static moduledata_t name##_mod = { \ #name, \ syscall_module_handler, \ &name##_syscall_mod \ }; \ DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE) #define SYSCALL_MODULE_HELPER(syscallname) \ static int syscallname##_syscall = SYS_##syscallname; \ static struct sysent syscallname##_sysent = { \ (sizeof(struct syscallname ## _args ) \ / sizeof(register_t)), \ (sy_call_t *)& syscallname \ }; \ SYSCALL_MODULE(syscallname, \ & syscallname##_syscall, & syscallname##_sysent, \ NULL, NULL); -int syscall_register __P((int *offset, struct sysent *new_sysent, - struct sysent *old_sysent)); -int syscall_deregister __P((int *offset, struct sysent *old_sysent)); -int syscall_module_handler __P((struct module *mod, int what, void *arg)); +int syscall_register(int *offset, struct sysent *new_sysent, + struct sysent *old_sysent); +int syscall_deregister(int *offset, struct sysent *old_sysent); +int syscall_module_handler(struct module *mod, int what, void *arg); #endif /* _KERNEL */ #endif /* !_SYS_SYSENT_H_ */ Index: head/sys/sys/syslog.h =================================================================== --- head/sys/sys/syslog.h (revision 92718) +++ head/sys/sys/syslog.h (revision 92719) @@ -1,204 +1,204 @@ /* * Copyright (c) 1982, 1986, 1988, 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. * * @(#)syslog.h 8.1 (Berkeley) 6/2/93 * $FreeBSD$ */ #ifndef _SYS_SYSLOG_H_ #define _SYS_SYSLOG_H_ #define _PATH_LOG "/var/run/log" #define _PATH_OLDLOG "/dev/log" /* backward compatibility */ /* * priorities/facilities are encoded into a single 32-bit quantity, where the * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility * (0-big number). Both the priorities and the facilities map roughly * one-to-one to strings in the syslogd(8) source code. This mapping is * included in this file. * * priorities (these are ordered) */ #define LOG_EMERG 0 /* system is unusable */ #define LOG_ALERT 1 /* action must be taken immediately */ #define LOG_CRIT 2 /* critical conditions */ #define LOG_ERR 3 /* error conditions */ #define LOG_WARNING 4 /* warning conditions */ #define LOG_NOTICE 5 /* normal but significant condition */ #define LOG_INFO 6 /* informational */ #define LOG_DEBUG 7 /* debug-level messages */ #define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */ /* extract priority */ #define LOG_PRI(p) ((p) & LOG_PRIMASK) #define LOG_MAKEPRI(fac, pri) ((fac) | (pri)) #ifdef SYSLOG_NAMES #define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ /* mark "facility" */ #define INTERNAL_MARK LOG_MAKEPRI((LOG_NFACILITIES<<3), 0) typedef struct _code { const char *c_name; int c_val; } CODE; CODE prioritynames[] = { { "alert", LOG_ALERT, }, { "crit", LOG_CRIT, }, { "debug", LOG_DEBUG, }, { "emerg", LOG_EMERG, }, { "err", LOG_ERR, }, { "error", LOG_ERR, }, /* DEPRECATED */ { "info", LOG_INFO, }, { "none", INTERNAL_NOPRI, }, /* INTERNAL */ { "notice", LOG_NOTICE, }, { "panic", LOG_EMERG, }, /* DEPRECATED */ { "warn", LOG_WARNING, }, /* DEPRECATED */ { "warning", LOG_WARNING, }, { NULL, -1, } }; #endif /* facility codes */ #define LOG_KERN (0<<3) /* kernel messages */ #define LOG_USER (1<<3) /* random user-level messages */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* authorization messages */ #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ #define LOG_LPR (6<<3) /* line printer subsystem */ #define LOG_NEWS (7<<3) /* network news subsystem */ #define LOG_UUCP (8<<3) /* UUCP subsystem */ #define LOG_CRON (9<<3) /* clock daemon */ #define LOG_AUTHPRIV (10<<3) /* authorization messages (private) */ /* Facility #10 clashes in DEC UNIX, where */ /* it's defined as LOG_MEGASAFE for AdvFS */ /* event logging. */ #define LOG_FTP (11<<3) /* ftp daemon */ #define LOG_NTP (12<<3) /* NTP subsystem */ #define LOG_SECURITY (13<<3) /* security subsystems (firewalling, etc.) */ #define LOG_CONSOLE (14<<3) /* /dev/console output */ /* other codes through 15 reserved for system use */ #define LOG_LOCAL0 (16<<3) /* reserved for local use */ #define LOG_LOCAL1 (17<<3) /* reserved for local use */ #define LOG_LOCAL2 (18<<3) /* reserved for local use */ #define LOG_LOCAL3 (19<<3) /* reserved for local use */ #define LOG_LOCAL4 (20<<3) /* reserved for local use */ #define LOG_LOCAL5 (21<<3) /* reserved for local use */ #define LOG_LOCAL6 (22<<3) /* reserved for local use */ #define LOG_LOCAL7 (23<<3) /* reserved for local use */ #define LOG_NFACILITIES 24 /* current number of facilities */ #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ /* facility of pri */ #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) #ifdef SYSLOG_NAMES CODE facilitynames[] = { { "auth", LOG_AUTH, }, { "authpriv", LOG_AUTHPRIV, }, { "console", LOG_CONSOLE, }, { "cron", LOG_CRON, }, { "daemon", LOG_DAEMON, }, { "ftp", LOG_FTP, }, { "kern", LOG_KERN, }, { "lpr", LOG_LPR, }, { "mail", LOG_MAIL, }, { "mark", INTERNAL_MARK, }, /* INTERNAL */ { "news", LOG_NEWS, }, { "ntp", LOG_NTP, }, { "security", LOG_SECURITY, }, { "syslog", LOG_SYSLOG, }, { "user", LOG_USER, }, { "uucp", LOG_UUCP, }, { "local0", LOG_LOCAL0, }, { "local1", LOG_LOCAL1, }, { "local2", LOG_LOCAL2, }, { "local3", LOG_LOCAL3, }, { "local4", LOG_LOCAL4, }, { "local5", LOG_LOCAL5, }, { "local6", LOG_LOCAL6, }, { "local7", LOG_LOCAL7, }, { NULL, -1, } }; #endif #ifdef _KERNEL #define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */ #endif /* * arguments to setlogmask. */ #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ /* * Option flags for openlog. * * LOG_ODELAY no longer does anything. * LOG_NDELAY is the inverse of what it used to be. */ #define LOG_PID 0x01 /* log the pid with each message */ #define LOG_CONS 0x02 /* log on the console if errors in sending */ #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ #define LOG_PERROR 0x20 /* log to stderr as well */ #ifdef _KERNEL #else /* not _KERNEL */ /* * Don't use va_list in the vsyslog() prototype. Va_list is typedef'd in two * places ( and ), so if we include one * of them here we may collide with the utility's includes. It's unreasonable * for utilities to have to include one of them to include syslog.h, so we get * _BSD_VA_LIST_ from and use it. */ #include #include __BEGIN_DECLS -void closelog __P((void)); -void openlog __P((const char *, int, int)); -int setlogmask __P((int)); -void syslog __P((int, const char *, ...)) __printflike(2, 3); -void vsyslog __P((int, const char *, _BSD_VA_LIST_)) __printflike(2, 0); +void closelog(void); +void openlog(const char *, int, int); +int setlogmask(int); +void syslog(int, const char *, ...) __printflike(2, 3); +void vsyslog(int, const char *, _BSD_VA_LIST_) __printflike(2, 0); __END_DECLS #endif /* !_KERNEL */ #endif Index: head/sys/sys/sysproto.h =================================================================== --- head/sys/sys/sysproto.h (revision 92718) +++ head/sys/sys/sysproto.h (revision 92719) @@ -1,1529 +1,1529 @@ /* * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.107 2002/03/05 16:11:11 rwatson Exp */ #ifndef _SYS_SYSPROTO_H_ #define _SYS_SYSPROTO_H_ #include #include struct proc; struct thread; #define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ 0 : sizeof(register_t) - sizeof(t)) #if BYTE_ORDER == LITTLE_ENDIAN #define PADL_(t) 0 #define PADR_(t) PAD_(t) #else #define PADL_(t) PAD_(t) #define PADR_(t) 0 #endif struct nosys_args { register_t dummy; }; struct sys_exit_args { char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)]; }; struct fork_args { register_t dummy; }; struct read_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; }; struct write_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; }; struct open_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct close_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; }; struct wait_args { char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)]; }; struct link_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char link_l_[PADL_(char *)]; char * link; char link_r_[PADR_(char *)]; }; struct unlink_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; }; struct chdir_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; }; struct fchdir_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; }; struct mknod_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; char dev_l_[PADL_(int)]; int dev; char dev_r_[PADR_(int)]; }; struct chmod_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct chown_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)]; char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)]; }; struct obreak_args { char nsize_l_[PADL_(char *)]; char * nsize; char nsize_r_[PADR_(char *)]; }; struct getfsstat_args { char buf_l_[PADL_(struct statfs *)]; struct statfs * buf; char buf_r_[PADR_(struct statfs *)]; char bufsize_l_[PADL_(long)]; long bufsize; char bufsize_r_[PADR_(long)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct getpid_args { register_t dummy; }; struct mount_args { char type_l_[PADL_(char *)]; char * type; char type_r_[PADR_(char *)]; char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)]; }; struct unmount_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct setuid_args { char uid_l_[PADL_(uid_t)]; uid_t uid; char uid_r_[PADR_(uid_t)]; }; struct getuid_args { register_t dummy; }; struct geteuid_args { register_t dummy; }; struct ptrace_args { char req_l_[PADL_(int)]; int req; char req_r_[PADR_(int)]; char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; char data_l_[PADL_(int)]; int data; char data_r_[PADR_(int)]; }; struct recvmsg_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char msg_l_[PADL_(struct msghdr *)]; struct msghdr * msg; char msg_r_[PADR_(struct msghdr *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct sendmsg_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char msg_l_[PADL_(caddr_t)]; caddr_t msg; char msg_r_[PADR_(caddr_t)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct recvfrom_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char from_l_[PADL_(caddr_t)]; caddr_t from; char from_r_[PADR_(caddr_t)]; char fromlenaddr_l_[PADL_(int *)]; int * fromlenaddr; char fromlenaddr_r_[PADR_(int *)]; }; struct accept_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)]; char anamelen_l_[PADL_(int *)]; int * anamelen; char anamelen_r_[PADR_(int *)]; }; struct getpeername_args { char fdes_l_[PADL_(int)]; int fdes; char fdes_r_[PADR_(int)]; char asa_l_[PADL_(caddr_t)]; caddr_t asa; char asa_r_[PADR_(caddr_t)]; char alen_l_[PADL_(int *)]; int * alen; char alen_r_[PADR_(int *)]; }; struct getsockname_args { char fdes_l_[PADL_(int)]; int fdes; char fdes_r_[PADR_(int)]; char asa_l_[PADL_(caddr_t)]; caddr_t asa; char asa_r_[PADR_(caddr_t)]; char alen_l_[PADL_(int *)]; int * alen; char alen_r_[PADR_(int *)]; }; struct access_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct chflags_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct fchflags_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct sync_args { register_t dummy; }; struct kill_args { char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)]; }; struct getppid_args { register_t dummy; }; struct dup_args { char fd_l_[PADL_(u_int)]; u_int fd; char fd_r_[PADR_(u_int)]; }; struct pipe_args { register_t dummy; }; struct getegid_args { register_t dummy; }; struct profil_args { char samples_l_[PADL_(caddr_t)]; caddr_t samples; char samples_r_[PADR_(caddr_t)]; char size_l_[PADL_(size_t)]; size_t size; char size_r_[PADR_(size_t)]; char offset_l_[PADL_(size_t)]; size_t offset; char offset_r_[PADR_(size_t)]; char scale_l_[PADL_(u_int)]; u_int scale; char scale_r_[PADR_(u_int)]; }; struct ktrace_args { char fname_l_[PADL_(const char *)]; const char * fname; char fname_r_[PADR_(const char *)]; char ops_l_[PADL_(int)]; int ops; char ops_r_[PADR_(int)]; char facs_l_[PADL_(int)]; int facs; char facs_r_[PADR_(int)]; char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; }; struct getgid_args { register_t dummy; }; struct getlogin_args { char namebuf_l_[PADL_(char *)]; char * namebuf; char namebuf_r_[PADR_(char *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; }; struct setlogin_args { char namebuf_l_[PADL_(char *)]; char * namebuf; char namebuf_r_[PADR_(char *)]; }; struct acct_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; }; struct osigpending_args { register_t dummy; }; struct sigaltstack_args { char ss_l_[PADL_(stack_t *)]; stack_t * ss; char ss_r_[PADR_(stack_t *)]; char oss_l_[PADL_(stack_t *)]; stack_t * oss; char oss_r_[PADR_(stack_t *)]; }; struct ioctl_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char com_l_[PADL_(u_long)]; u_long com; char com_r_[PADR_(u_long)]; char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)]; }; struct reboot_args { char opt_l_[PADL_(int)]; int opt; char opt_r_[PADR_(int)]; }; struct revoke_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; }; struct symlink_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char link_l_[PADL_(char *)]; char * link; char link_r_[PADR_(char *)]; }; struct readlink_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char count_l_[PADL_(int)]; int count; char count_r_[PADR_(int)]; }; struct execve_args { char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; char argv_l_[PADL_(char **)]; char ** argv; char argv_r_[PADR_(char **)]; char envv_l_[PADL_(char **)]; char ** envv; char envv_r_[PADR_(char **)]; }; struct umask_args { char newmask_l_[PADL_(int)]; int newmask; char newmask_r_[PADR_(int)]; }; struct chroot_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; }; struct getpagesize_args { register_t dummy; }; struct msync_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct vfork_args { register_t dummy; }; struct sbrk_args { char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)]; }; struct sstk_args { char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)]; }; struct ovadvise_args { char anom_l_[PADL_(int)]; int anom; char anom_r_[PADR_(int)]; }; struct munmap_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; }; struct mprotect_args { char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; }; struct madvise_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char behav_l_[PADL_(int)]; int behav; char behav_r_[PADR_(int)]; }; struct mincore_args { char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char vec_l_[PADL_(char *)]; char * vec; char vec_r_[PADR_(char *)]; }; struct getgroups_args { char gidsetsize_l_[PADL_(u_int)]; u_int gidsetsize; char gidsetsize_r_[PADR_(u_int)]; char gidset_l_[PADL_(gid_t *)]; gid_t * gidset; char gidset_r_[PADR_(gid_t *)]; }; struct setgroups_args { char gidsetsize_l_[PADL_(u_int)]; u_int gidsetsize; char gidsetsize_r_[PADR_(u_int)]; char gidset_l_[PADL_(gid_t *)]; gid_t * gidset; char gidset_r_[PADR_(gid_t *)]; }; struct getpgrp_args { register_t dummy; }; struct setpgid_args { char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; char pgid_l_[PADL_(int)]; int pgid; char pgid_r_[PADR_(int)]; }; struct setitimer_args { char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)]; char itv_l_[PADL_(struct itimerval *)]; struct itimerval * itv; char itv_r_[PADR_(struct itimerval *)]; char oitv_l_[PADL_(struct itimerval *)]; struct itimerval * oitv; char oitv_r_[PADR_(struct itimerval *)]; }; struct owait_args { register_t dummy; }; struct swapon_args { char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; }; struct getitimer_args { char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)]; char itv_l_[PADL_(struct itimerval *)]; struct itimerval * itv; char itv_r_[PADR_(struct itimerval *)]; }; struct getdtablesize_args { register_t dummy; }; struct dup2_args { char from_l_[PADL_(u_int)]; u_int from; char from_r_[PADR_(u_int)]; char to_l_[PADL_(u_int)]; u_int to; char to_r_[PADR_(u_int)]; }; struct fcntl_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char arg_l_[PADL_(long)]; long arg; char arg_r_[PADR_(long)]; }; struct select_args { char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; char ou_l_[PADL_(fd_set *)]; fd_set * ou; char ou_r_[PADR_(fd_set *)]; char ex_l_[PADL_(fd_set *)]; fd_set * ex; char ex_r_[PADR_(fd_set *)]; char tv_l_[PADL_(struct timeval *)]; struct timeval * tv; char tv_r_[PADR_(struct timeval *)]; }; struct fsync_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; }; struct setpriority_args { char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)]; char prio_l_[PADL_(int)]; int prio; char prio_r_[PADR_(int)]; }; struct socket_args { char domain_l_[PADL_(int)]; int domain; char domain_r_[PADR_(int)]; char type_l_[PADL_(int)]; int type; char type_r_[PADR_(int)]; char protocol_l_[PADL_(int)]; int protocol; char protocol_r_[PADR_(int)]; }; struct connect_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)]; char namelen_l_[PADL_(int)]; int namelen; char namelen_r_[PADR_(int)]; }; struct getpriority_args { char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)]; }; struct osigreturn_args { char sigcntxp_l_[PADL_(struct osigcontext *)]; struct osigcontext * sigcntxp; char sigcntxp_r_[PADR_(struct osigcontext *)]; }; struct bind_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)]; char namelen_l_[PADL_(int)]; int namelen; char namelen_r_[PADR_(int)]; }; struct setsockopt_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char level_l_[PADL_(int)]; int level; char level_r_[PADR_(int)]; char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; char val_l_[PADL_(caddr_t)]; caddr_t val; char val_r_[PADR_(caddr_t)]; char valsize_l_[PADL_(int)]; int valsize; char valsize_r_[PADR_(int)]; }; struct listen_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char backlog_l_[PADL_(int)]; int backlog; char backlog_r_[PADR_(int)]; }; struct gettimeofday_args { char tp_l_[PADL_(struct timeval *)]; struct timeval * tp; char tp_r_[PADR_(struct timeval *)]; char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; }; struct getrusage_args { char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)]; char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)]; }; struct getsockopt_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char level_l_[PADL_(int)]; int level; char level_r_[PADR_(int)]; char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; char val_l_[PADL_(caddr_t)]; caddr_t val; char val_r_[PADR_(caddr_t)]; char avalsize_l_[PADL_(int *)]; int * avalsize; char avalsize_r_[PADR_(int *)]; }; struct readv_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char iovp_l_[PADL_(struct iovec *)]; struct iovec * iovp; char iovp_r_[PADR_(struct iovec *)]; char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; }; struct writev_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char iovp_l_[PADL_(struct iovec *)]; struct iovec * iovp; char iovp_r_[PADR_(struct iovec *)]; char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; }; struct settimeofday_args { char tv_l_[PADL_(struct timeval *)]; struct timeval * tv; char tv_r_[PADR_(struct timeval *)]; char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; }; struct fchown_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)]; char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)]; }; struct fchmod_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct setreuid_args { char ruid_l_[PADL_(int)]; int ruid; char ruid_r_[PADR_(int)]; char euid_l_[PADL_(int)]; int euid; char euid_r_[PADR_(int)]; }; struct setregid_args { char rgid_l_[PADL_(int)]; int rgid; char rgid_r_[PADR_(int)]; char egid_l_[PADL_(int)]; int egid; char egid_r_[PADR_(int)]; }; struct rename_args { char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)]; char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; }; struct flock_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)]; }; struct mkfifo_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct sendto_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char to_l_[PADL_(caddr_t)]; caddr_t to; char to_r_[PADR_(caddr_t)]; char tolen_l_[PADL_(int)]; int tolen; char tolen_r_[PADR_(int)]; }; struct shutdown_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)]; }; struct socketpair_args { char domain_l_[PADL_(int)]; int domain; char domain_r_[PADR_(int)]; char type_l_[PADL_(int)]; int type; char type_r_[PADR_(int)]; char protocol_l_[PADL_(int)]; int protocol; char protocol_r_[PADR_(int)]; char rsv_l_[PADL_(int *)]; int * rsv; char rsv_r_[PADR_(int *)]; }; struct mkdir_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct rmdir_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; }; struct utimes_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char tptr_l_[PADL_(struct timeval *)]; struct timeval * tptr; char tptr_r_[PADR_(struct timeval *)]; }; struct adjtime_args { char delta_l_[PADL_(struct timeval *)]; struct timeval * delta; char delta_r_[PADR_(struct timeval *)]; char olddelta_l_[PADL_(struct timeval *)]; struct timeval * olddelta; char olddelta_r_[PADR_(struct timeval *)]; }; struct ogethostid_args { register_t dummy; }; struct setsid_args { register_t dummy; }; struct quotactl_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)]; char arg_l_[PADL_(caddr_t)]; caddr_t arg; char arg_r_[PADR_(caddr_t)]; }; struct oquota_args { register_t dummy; }; struct nfssvc_args { char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; char argp_l_[PADL_(caddr_t)]; caddr_t argp; char argp_r_[PADR_(caddr_t)]; }; struct statfs_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char buf_l_[PADL_(struct statfs *)]; struct statfs * buf; char buf_r_[PADR_(struct statfs *)]; }; struct fstatfs_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(struct statfs *)]; struct statfs * buf; char buf_r_[PADR_(struct statfs *)]; }; struct getfh_args { char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; char fhp_l_[PADL_(struct fhandle *)]; struct fhandle * fhp; char fhp_r_[PADR_(struct fhandle *)]; }; struct getdomainname_args { char domainname_l_[PADL_(char *)]; char * domainname; char domainname_r_[PADR_(char *)]; char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; }; struct setdomainname_args { char domainname_l_[PADL_(char *)]; char * domainname; char domainname_r_[PADR_(char *)]; char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; }; struct uname_args { char name_l_[PADL_(struct utsname *)]; struct utsname * name; char name_r_[PADR_(struct utsname *)]; }; struct sysarch_args { char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; char parms_l_[PADL_(char *)]; char * parms; char parms_r_[PADR_(char *)]; }; struct rtprio_args { char function_l_[PADL_(int)]; int function; char function_r_[PADR_(int)]; char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; char rtp_l_[PADL_(struct rtprio *)]; struct rtprio * rtp; char rtp_r_[PADR_(struct rtprio *)]; }; struct semsys_args { char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)]; }; struct msgsys_args { char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)]; char a6_l_[PADL_(int)]; int a6; char a6_r_[PADR_(int)]; }; struct shmsys_args { char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; }; struct pread_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; }; struct pwrite_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; }; struct ntp_adjtime_args { char tp_l_[PADL_(struct timex *)]; struct timex * tp; char tp_r_[PADR_(struct timex *)]; }; struct setgid_args { char gid_l_[PADL_(gid_t)]; gid_t gid; char gid_r_[PADR_(gid_t)]; }; struct setegid_args { char egid_l_[PADL_(gid_t)]; gid_t egid; char egid_r_[PADR_(gid_t)]; }; struct seteuid_args { char euid_l_[PADL_(uid_t)]; uid_t euid; char euid_r_[PADR_(uid_t)]; }; struct stat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct stat *)]; struct stat * ub; char ub_r_[PADR_(struct stat *)]; }; struct fstat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char sb_l_[PADL_(struct stat *)]; struct stat * sb; char sb_r_[PADR_(struct stat *)]; }; struct lstat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct stat *)]; struct stat * ub; char ub_r_[PADR_(struct stat *)]; }; struct pathconf_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; }; struct fpathconf_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; }; struct __getrlimit_args { char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)]; char rlp_l_[PADL_(struct rlimit *)]; struct rlimit * rlp; char rlp_r_[PADR_(struct rlimit *)]; }; struct __setrlimit_args { char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)]; char rlp_l_[PADL_(struct rlimit *)]; struct rlimit * rlp; char rlp_r_[PADR_(struct rlimit *)]; }; struct getdirentries_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char count_l_[PADL_(u_int)]; u_int count; char count_r_[PADR_(u_int)]; char basep_l_[PADL_(long *)]; long * basep; char basep_r_[PADR_(long *)]; }; struct mmap_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char pos_l_[PADL_(off_t)]; off_t pos; char pos_r_[PADR_(off_t)]; }; struct lseek_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct truncate_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)]; }; struct ftruncate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)]; }; struct sysctl_args { char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; char oldlenp_l_[PADL_(size_t *)]; size_t * oldlenp; char oldlenp_r_[PADR_(size_t *)]; char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; }; struct mlock_args { char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; }; struct munlock_args { char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; }; struct undelete_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; }; struct futimes_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char tptr_l_[PADL_(struct timeval *)]; struct timeval * tptr; char tptr_r_[PADR_(struct timeval *)]; }; struct getpgid_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; }; struct poll_args { char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; char nfds_l_[PADL_(u_int)]; u_int nfds; char nfds_r_[PADR_(u_int)]; char timeout_l_[PADL_(int)]; int timeout; char timeout_r_[PADR_(int)]; }; struct __semctl_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; char semnum_l_[PADL_(int)]; int semnum; char semnum_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char arg_l_[PADL_(union semun *)]; union semun * arg; char arg_r_[PADR_(union semun *)]; }; struct semget_args { char key_l_[PADL_(key_t)]; key_t key; char key_r_[PADR_(key_t)]; char nsems_l_[PADL_(int)]; int nsems; char nsems_r_[PADR_(int)]; char semflg_l_[PADL_(int)]; int semflg; char semflg_r_[PADR_(int)]; }; struct semop_args { char semid_l_[PADL_(int)]; int semid; char semid_r_[PADR_(int)]; char sops_l_[PADL_(struct sembuf *)]; struct sembuf * sops; char sops_r_[PADR_(struct sembuf *)]; char nsops_l_[PADL_(u_int)]; u_int nsops; char nsops_r_[PADR_(u_int)]; }; struct msgctl_args { char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char buf_l_[PADL_(struct msqid_ds *)]; struct msqid_ds * buf; char buf_r_[PADR_(struct msqid_ds *)]; }; struct msgget_args { char key_l_[PADL_(key_t)]; key_t key; char key_r_[PADR_(key_t)]; char msgflg_l_[PADL_(int)]; int msgflg; char msgflg_r_[PADR_(int)]; }; struct msgsnd_args { char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; char msgp_l_[PADL_(void *)]; void * msgp; char msgp_r_[PADR_(void *)]; char msgsz_l_[PADL_(size_t)]; size_t msgsz; char msgsz_r_[PADR_(size_t)]; char msgflg_l_[PADL_(int)]; int msgflg; char msgflg_r_[PADR_(int)]; }; struct msgrcv_args { char msqid_l_[PADL_(int)]; int msqid; char msqid_r_[PADR_(int)]; char msgp_l_[PADL_(void *)]; void * msgp; char msgp_r_[PADR_(void *)]; char msgsz_l_[PADL_(size_t)]; size_t msgsz; char msgsz_r_[PADR_(size_t)]; char msgtyp_l_[PADL_(long)]; long msgtyp; char msgtyp_r_[PADR_(long)]; char msgflg_l_[PADL_(int)]; int msgflg; char msgflg_r_[PADR_(int)]; }; struct shmat_args { char shmid_l_[PADL_(int)]; int shmid; char shmid_r_[PADR_(int)]; char shmaddr_l_[PADL_(void *)]; void * shmaddr; char shmaddr_r_[PADR_(void *)]; char shmflg_l_[PADL_(int)]; int shmflg; char shmflg_r_[PADR_(int)]; }; struct shmctl_args { char shmid_l_[PADL_(int)]; int shmid; char shmid_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char buf_l_[PADL_(struct shmid_ds *)]; struct shmid_ds * buf; char buf_r_[PADR_(struct shmid_ds *)]; }; struct shmdt_args { char shmaddr_l_[PADL_(void *)]; void * shmaddr; char shmaddr_r_[PADR_(void *)]; }; struct shmget_args { char key_l_[PADL_(key_t)]; key_t key; char key_r_[PADR_(key_t)]; char size_l_[PADL_(int)]; int size; char size_r_[PADR_(int)]; char shmflg_l_[PADL_(int)]; int shmflg; char shmflg_r_[PADR_(int)]; }; struct clock_gettime_args { char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; char tp_l_[PADL_(struct timespec *)]; struct timespec * tp; char tp_r_[PADR_(struct timespec *)]; }; struct clock_settime_args { char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; char tp_l_[PADL_(const struct timespec *)]; const struct timespec * tp; char tp_r_[PADR_(const struct timespec *)]; }; struct clock_getres_args { char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; char tp_l_[PADL_(struct timespec *)]; struct timespec * tp; char tp_r_[PADR_(struct timespec *)]; }; struct nanosleep_args { char rqtp_l_[PADL_(const struct timespec *)]; const struct timespec * rqtp; char rqtp_r_[PADR_(const struct timespec *)]; char rmtp_l_[PADL_(struct timespec *)]; struct timespec * rmtp; char rmtp_r_[PADR_(struct timespec *)]; }; struct minherit_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; char inherit_l_[PADL_(int)]; int inherit; char inherit_r_[PADR_(int)]; }; struct rfork_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct openbsd_poll_args { char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; char nfds_l_[PADL_(u_int)]; u_int nfds; char nfds_r_[PADR_(u_int)]; char timeout_l_[PADL_(int)]; int timeout; char timeout_r_[PADR_(int)]; }; struct issetugid_args { register_t dummy; }; struct lchown_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)]; char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)]; }; struct getdents_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)]; }; struct lchmod_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; }; struct lutimes_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char tptr_l_[PADL_(struct timeval *)]; struct timeval * tptr; char tptr_r_[PADR_(struct timeval *)]; }; struct nstat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct nstat *)]; struct nstat * ub; char ub_r_[PADR_(struct nstat *)]; }; struct nfstat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char sb_l_[PADL_(struct nstat *)]; struct nstat * sb; char sb_r_[PADR_(struct nstat *)]; }; struct nlstat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct nstat *)]; struct nstat * ub; char ub_r_[PADR_(struct nstat *)]; }; struct fhstatfs_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char buf_l_[PADL_(struct statfs *)]; struct statfs * buf; char buf_r_[PADR_(struct statfs *)]; }; struct fhopen_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct fhstat_args { char u_fhp_l_[PADL_(const struct fhandle *)]; const struct fhandle * u_fhp; char u_fhp_r_[PADR_(const struct fhandle *)]; char sb_l_[PADL_(struct stat *)]; struct stat * sb; char sb_r_[PADR_(struct stat *)]; }; struct modnext_args { char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)]; }; struct modstat_args { char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)]; char stat_l_[PADL_(struct module_stat *)]; struct module_stat * stat; char stat_r_[PADR_(struct module_stat *)]; }; struct modfnext_args { char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)]; }; struct modfind_args { char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; }; struct kldload_args { char file_l_[PADL_(const char *)]; const char * file; char file_r_[PADR_(const char *)]; }; struct kldunload_args { char fileid_l_[PADL_(int)]; int fileid; char fileid_r_[PADR_(int)]; }; struct kldfind_args { char file_l_[PADL_(const char *)]; const char * file; char file_r_[PADR_(const char *)]; }; struct kldnext_args { char fileid_l_[PADL_(int)]; int fileid; char fileid_r_[PADR_(int)]; }; struct kldstat_args { char fileid_l_[PADL_(int)]; int fileid; char fileid_r_[PADR_(int)]; char stat_l_[PADL_(struct kld_file_stat *)]; struct kld_file_stat * stat; char stat_r_[PADR_(struct kld_file_stat *)]; }; struct kldfirstmod_args { char fileid_l_[PADL_(int)]; int fileid; char fileid_r_[PADR_(int)]; }; struct getsid_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; }; struct setresuid_args { char ruid_l_[PADL_(uid_t)]; uid_t ruid; char ruid_r_[PADR_(uid_t)]; char euid_l_[PADL_(uid_t)]; uid_t euid; char euid_r_[PADR_(uid_t)]; char suid_l_[PADL_(uid_t)]; uid_t suid; char suid_r_[PADR_(uid_t)]; }; struct setresgid_args { char rgid_l_[PADL_(gid_t)]; gid_t rgid; char rgid_r_[PADR_(gid_t)]; char egid_l_[PADL_(gid_t)]; gid_t egid; char egid_r_[PADR_(gid_t)]; char sgid_l_[PADL_(gid_t)]; gid_t sgid; char sgid_r_[PADR_(gid_t)]; }; struct aio_return_args { char aiocbp_l_[PADL_(struct aiocb *)]; struct aiocb * aiocbp; char aiocbp_r_[PADR_(struct aiocb *)]; }; struct aio_suspend_args { char aiocbp_l_[PADL_(struct aiocb *const *)]; struct aiocb *const * aiocbp; char aiocbp_r_[PADR_(struct aiocb *const *)]; char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; char timeout_l_[PADL_(const struct timespec *)]; const struct timespec * timeout; char timeout_r_[PADR_(const struct timespec *)]; }; struct aio_cancel_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char aiocbp_l_[PADL_(struct aiocb *)]; struct aiocb * aiocbp; char aiocbp_r_[PADR_(struct aiocb *)]; }; struct aio_error_args { char aiocbp_l_[PADL_(struct aiocb *)]; struct aiocb * aiocbp; char aiocbp_r_[PADR_(struct aiocb *)]; }; struct aio_read_args { char aiocbp_l_[PADL_(struct aiocb *)]; struct aiocb * aiocbp; char aiocbp_r_[PADR_(struct aiocb *)]; }; struct aio_write_args { char aiocbp_l_[PADL_(struct aiocb *)]; struct aiocb * aiocbp; char aiocbp_r_[PADR_(struct aiocb *)]; }; struct lio_listio_args { char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; char acb_list_l_[PADL_(struct aiocb *const *)]; struct aiocb *const * acb_list; char acb_list_r_[PADR_(struct aiocb *const *)]; char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; char sig_l_[PADL_(struct sigevent *)]; struct sigevent * sig; char sig_r_[PADR_(struct sigevent *)]; }; struct yield_args { register_t dummy; }; struct mlockall_args { char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)]; }; struct munlockall_args { register_t dummy; }; struct __getcwd_args { char buf_l_[PADL_(u_char *)]; u_char * buf; char buf_r_[PADR_(u_char *)]; char buflen_l_[PADL_(u_int)]; u_int buflen; char buflen_r_[PADR_(u_int)]; }; struct sched_setparam_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; char param_l_[PADL_(const struct sched_param *)]; const struct sched_param * param; char param_r_[PADR_(const struct sched_param *)]; }; struct sched_getparam_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; }; struct sched_setscheduler_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; char policy_l_[PADL_(int)]; int policy; char policy_r_[PADR_(int)]; char param_l_[PADL_(const struct sched_param *)]; const struct sched_param * param; char param_r_[PADR_(const struct sched_param *)]; }; struct sched_getscheduler_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; }; struct sched_yield_args { register_t dummy; }; struct sched_get_priority_max_args { char policy_l_[PADL_(int)]; int policy; char policy_r_[PADR_(int)]; }; struct sched_get_priority_min_args { char policy_l_[PADL_(int)]; int policy; char policy_r_[PADR_(int)]; }; struct sched_rr_get_interval_args { char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; char interval_l_[PADL_(struct timespec *)]; struct timespec * interval; char interval_r_[PADR_(struct timespec *)]; }; struct utrace_args { char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; }; struct sendfile_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; char hdtr_l_[PADL_(struct sf_hdtr *)]; struct sf_hdtr * hdtr; char hdtr_r_[PADR_(struct sf_hdtr *)]; char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct kldsym_args { char fileid_l_[PADL_(int)]; int fileid; char fileid_r_[PADR_(int)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; }; struct jail_args { char jail_l_[PADL_(struct jail *)]; struct jail * jail; char jail_r_[PADR_(struct jail *)]; }; struct sigprocmask_args { char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)]; char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; char oset_l_[PADL_(sigset_t *)]; sigset_t * oset; char oset_r_[PADR_(sigset_t *)]; }; struct sigsuspend_args { char sigmask_l_[PADL_(const sigset_t *)]; const sigset_t * sigmask; char sigmask_r_[PADR_(const sigset_t *)]; }; struct sigaction_args { char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; char act_l_[PADL_(const struct sigaction *)]; const struct sigaction * act; char act_r_[PADR_(const struct sigaction *)]; char oact_l_[PADL_(struct sigaction *)]; struct sigaction * oact; char oact_r_[PADR_(struct sigaction *)]; }; struct sigpending_args { char set_l_[PADL_(sigset_t *)]; sigset_t * set; char set_r_[PADR_(sigset_t *)]; }; struct sigreturn_args { char sigcntxp_l_[PADL_(const struct __ucontext *)]; const struct __ucontext * sigcntxp; char sigcntxp_r_[PADR_(const struct __ucontext *)]; }; struct __acl_get_file_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)]; char aclp_l_[PADL_(struct acl *)]; struct acl * aclp; char aclp_r_[PADR_(struct acl *)]; }; struct __acl_set_file_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)]; char aclp_l_[PADL_(struct acl *)]; struct acl * aclp; char aclp_r_[PADR_(struct acl *)]; }; struct __acl_get_fd_args { char filedes_l_[PADL_(int)]; int filedes; char filedes_r_[PADR_(int)]; char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)]; char aclp_l_[PADL_(struct acl *)]; struct acl * aclp; char aclp_r_[PADR_(struct acl *)]; }; struct __acl_set_fd_args { char filedes_l_[PADL_(int)]; int filedes; char filedes_r_[PADR_(int)]; char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)]; char aclp_l_[PADL_(struct acl *)]; struct acl * aclp; char aclp_r_[PADR_(struct acl *)]; }; struct __acl_delete_file_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)]; }; struct __acl_delete_fd_args { char filedes_l_[PADL_(int)]; int filedes; char filedes_r_[PADR_(int)]; char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)]; }; struct __acl_aclcheck_file_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)]; char aclp_l_[PADL_(struct acl *)]; struct acl * aclp; char aclp_r_[PADR_(struct acl *)]; }; struct __acl_aclcheck_fd_args { char filedes_l_[PADL_(int)]; int filedes; char filedes_r_[PADR_(int)]; char type_l_[PADL_(acl_type_t)]; acl_type_t type; char type_r_[PADR_(acl_type_t)]; char aclp_l_[PADL_(struct acl *)]; struct acl * aclp; char aclp_r_[PADR_(struct acl *)]; }; struct extattrctl_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)]; char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)]; }; struct extattr_set_file_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)]; char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)]; char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; }; struct extattr_get_file_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)]; char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)]; char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; }; struct extattr_delete_file_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)]; char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)]; }; struct aio_waitcomplete_args { char aiocbp_l_[PADL_(struct aiocb **)]; struct aiocb ** aiocbp; char aiocbp_r_[PADR_(struct aiocb **)]; char timeout_l_[PADL_(struct timespec *)]; struct timespec * timeout; char timeout_r_[PADR_(struct timespec *)]; }; struct getresuid_args { char ruid_l_[PADL_(uid_t *)]; uid_t * ruid; char ruid_r_[PADR_(uid_t *)]; char euid_l_[PADL_(uid_t *)]; uid_t * euid; char euid_r_[PADR_(uid_t *)]; char suid_l_[PADL_(uid_t *)]; uid_t * suid; char suid_r_[PADR_(uid_t *)]; }; struct getresgid_args { char rgid_l_[PADL_(gid_t *)]; gid_t * rgid; char rgid_r_[PADR_(gid_t *)]; char egid_l_[PADL_(gid_t *)]; gid_t * egid; char egid_r_[PADR_(gid_t *)]; char sgid_l_[PADL_(gid_t *)]; gid_t * sgid; char sgid_r_[PADR_(gid_t *)]; }; struct kqueue_args { register_t dummy; }; struct kevent_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char changelist_l_[PADL_(const struct kevent *)]; const struct kevent * changelist; char changelist_r_[PADR_(const struct kevent *)]; char nchanges_l_[PADL_(int)]; int nchanges; char nchanges_r_[PADR_(int)]; char eventlist_l_[PADL_(struct kevent *)]; struct kevent * eventlist; char eventlist_r_[PADR_(struct kevent *)]; char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; char timeout_l_[PADL_(const struct timespec *)]; const struct timespec * timeout; char timeout_r_[PADR_(const struct timespec *)]; }; struct __cap_get_proc_args { char cap_p_l_[PADL_(struct cap *)]; struct cap * cap_p; char cap_p_r_[PADR_(struct cap *)]; }; struct __cap_set_proc_args { char cap_p_l_[PADL_(struct cap *)]; struct cap * cap_p; char cap_p_r_[PADR_(struct cap *)]; }; struct __cap_get_fd_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char cap_p_l_[PADL_(struct cap *)]; struct cap * cap_p; char cap_p_r_[PADR_(struct cap *)]; }; struct __cap_get_file_args { char path_p_l_[PADL_(const char *)]; const char * path_p; char path_p_r_[PADR_(const char *)]; char cap_p_l_[PADL_(struct cap *)]; struct cap * cap_p; char cap_p_r_[PADR_(struct cap *)]; }; struct __cap_set_fd_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char cap_p_l_[PADL_(struct cap *)]; struct cap * cap_p; char cap_p_r_[PADR_(struct cap *)]; }; struct __cap_set_file_args { char path_p_l_[PADL_(const char *)]; const char * path_p; char path_p_r_[PADR_(const char *)]; char cap_p_l_[PADL_(struct cap *)]; struct cap * cap_p; char cap_p_r_[PADR_(struct cap *)]; }; struct extattr_set_fd_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)]; char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)]; char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; }; struct extattr_get_fd_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)]; char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)]; char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; }; struct extattr_delete_fd_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char attrnamespace_l_[PADL_(int)]; int attrnamespace; char attrnamespace_r_[PADR_(int)]; char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)]; }; struct __setugid_args { char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; struct nfsclnt_args { char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; char argp_l_[PADL_(caddr_t)]; caddr_t argp; char argp_r_[PADR_(caddr_t)]; }; struct eaccess_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct nmount_args { char iovp_l_[PADL_(struct iovec *)]; struct iovec * iovp; char iovp_r_[PADR_(struct iovec *)]; char iovcnt_l_[PADL_(unsigned int)]; unsigned int iovcnt; char iovcnt_r_[PADR_(unsigned int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct kse_exit_args { register_t dummy; }; struct kse_wakeup_args { register_t dummy; }; struct kse_new_args { char mbx_l_[PADL_(struct kse_mailbox *)]; struct kse_mailbox * mbx; char mbx_r_[PADR_(struct kse_mailbox *)]; char new_grp_flag_l_[PADL_(int)]; int new_grp_flag; char new_grp_flag_r_[PADR_(int)]; }; struct thread_wakeup_args { char tmbx_l_[PADL_(struct thread_mailbox *)]; struct thread_mailbox * tmbx; char tmbx_r_[PADR_(struct thread_mailbox *)]; }; struct kse_yield_args { register_t dummy; }; -int nosys __P((struct thread *, struct nosys_args *)); -void sys_exit __P((struct thread *, struct sys_exit_args *)); -int fork __P((struct thread *, struct fork_args *)); -int read __P((struct thread *, struct read_args *)); -int write __P((struct thread *, struct write_args *)); -int open __P((struct thread *, struct open_args *)); -int close __P((struct thread *, struct close_args *)); -int wait4 __P((struct thread *, struct wait_args *)); -int link __P((struct thread *, struct link_args *)); -int unlink __P((struct thread *, struct unlink_args *)); -int chdir __P((struct thread *, struct chdir_args *)); -int fchdir __P((struct thread *, struct fchdir_args *)); -int mknod __P((struct thread *, struct mknod_args *)); -int chmod __P((struct thread *, struct chmod_args *)); -int chown __P((struct thread *, struct chown_args *)); -int obreak __P((struct thread *, struct obreak_args *)); -int getfsstat __P((struct thread *, struct getfsstat_args *)); -int getpid __P((struct thread *, struct getpid_args *)); -int mount __P((struct thread *, struct mount_args *)); -int unmount __P((struct thread *, struct unmount_args *)); -int setuid __P((struct thread *, struct setuid_args *)); -int getuid __P((struct thread *, struct getuid_args *)); -int geteuid __P((struct thread *, struct geteuid_args *)); -int ptrace __P((struct thread *, struct ptrace_args *)); -int recvmsg __P((struct thread *, struct recvmsg_args *)); -int sendmsg __P((struct thread *, struct sendmsg_args *)); -int recvfrom __P((struct thread *, struct recvfrom_args *)); -int accept __P((struct thread *, struct accept_args *)); -int getpeername __P((struct thread *, struct getpeername_args *)); -int getsockname __P((struct thread *, struct getsockname_args *)); -int access __P((struct thread *, struct access_args *)); -int chflags __P((struct thread *, struct chflags_args *)); -int fchflags __P((struct thread *, struct fchflags_args *)); -int sync __P((struct thread *, struct sync_args *)); -int kill __P((struct thread *, struct kill_args *)); -int getppid __P((struct thread *, struct getppid_args *)); -int dup __P((struct thread *, struct dup_args *)); -int pipe __P((struct thread *, struct pipe_args *)); -int getegid __P((struct thread *, struct getegid_args *)); -int profil __P((struct thread *, struct profil_args *)); -int ktrace __P((struct thread *, struct ktrace_args *)); -int getgid __P((struct thread *, struct getgid_args *)); -int getlogin __P((struct thread *, struct getlogin_args *)); -int setlogin __P((struct thread *, struct setlogin_args *)); -int acct __P((struct thread *, struct acct_args *)); -int sigaltstack __P((struct thread *, struct sigaltstack_args *)); -int ioctl __P((struct thread *, struct ioctl_args *)); -int reboot __P((struct thread *, struct reboot_args *)); -int revoke __P((struct thread *, struct revoke_args *)); -int symlink __P((struct thread *, struct symlink_args *)); -int readlink __P((struct thread *, struct readlink_args *)); -int execve __P((struct thread *, struct execve_args *)); -int umask __P((struct thread *, struct umask_args *)); -int chroot __P((struct thread *, struct chroot_args *)); -int msync __P((struct thread *, struct msync_args *)); -int vfork __P((struct thread *, struct vfork_args *)); -int sbrk __P((struct thread *, struct sbrk_args *)); -int sstk __P((struct thread *, struct sstk_args *)); -int ovadvise __P((struct thread *, struct ovadvise_args *)); -int munmap __P((struct thread *, struct munmap_args *)); -int mprotect __P((struct thread *, struct mprotect_args *)); -int madvise __P((struct thread *, struct madvise_args *)); -int mincore __P((struct thread *, struct mincore_args *)); -int getgroups __P((struct thread *, struct getgroups_args *)); -int setgroups __P((struct thread *, struct setgroups_args *)); -int getpgrp __P((struct thread *, struct getpgrp_args *)); -int setpgid __P((struct thread *, struct setpgid_args *)); -int setitimer __P((struct thread *, struct setitimer_args *)); -int swapon __P((struct thread *, struct swapon_args *)); -int getitimer __P((struct thread *, struct getitimer_args *)); -int getdtablesize __P((struct thread *, struct getdtablesize_args *)); -int dup2 __P((struct thread *, struct dup2_args *)); -int fcntl __P((struct thread *, struct fcntl_args *)); -int select __P((struct thread *, struct select_args *)); -int fsync __P((struct thread *, struct fsync_args *)); -int setpriority __P((struct thread *, struct setpriority_args *)); -int socket __P((struct thread *, struct socket_args *)); -int connect __P((struct thread *, struct connect_args *)); -int getpriority __P((struct thread *, struct getpriority_args *)); -int osigreturn __P((struct thread *, struct osigreturn_args *)); -int bind __P((struct thread *, struct bind_args *)); -int setsockopt __P((struct thread *, struct setsockopt_args *)); -int listen __P((struct thread *, struct listen_args *)); -int gettimeofday __P((struct thread *, struct gettimeofday_args *)); -int getrusage __P((struct thread *, struct getrusage_args *)); -int getsockopt __P((struct thread *, struct getsockopt_args *)); -int readv __P((struct thread *, struct readv_args *)); -int writev __P((struct thread *, struct writev_args *)); -int settimeofday __P((struct thread *, struct settimeofday_args *)); -int fchown __P((struct thread *, struct fchown_args *)); -int fchmod __P((struct thread *, struct fchmod_args *)); -int setreuid __P((struct thread *, struct setreuid_args *)); -int setregid __P((struct thread *, struct setregid_args *)); -int rename __P((struct thread *, struct rename_args *)); -int flock __P((struct thread *, struct flock_args *)); -int mkfifo __P((struct thread *, struct mkfifo_args *)); -int sendto __P((struct thread *, struct sendto_args *)); -int shutdown __P((struct thread *, struct shutdown_args *)); -int socketpair __P((struct thread *, struct socketpair_args *)); -int mkdir __P((struct thread *, struct mkdir_args *)); -int rmdir __P((struct thread *, struct rmdir_args *)); -int utimes __P((struct thread *, struct utimes_args *)); -int adjtime __P((struct thread *, struct adjtime_args *)); -int setsid __P((struct thread *, struct setsid_args *)); -int quotactl __P((struct thread *, struct quotactl_args *)); -int nfssvc __P((struct thread *, struct nfssvc_args *)); -int statfs __P((struct thread *, struct statfs_args *)); -int fstatfs __P((struct thread *, struct fstatfs_args *)); -int getfh __P((struct thread *, struct getfh_args *)); -int getdomainname __P((struct thread *, struct getdomainname_args *)); -int setdomainname __P((struct thread *, struct setdomainname_args *)); -int uname __P((struct thread *, struct uname_args *)); -int sysarch __P((struct thread *, struct sysarch_args *)); -int rtprio __P((struct thread *, struct rtprio_args *)); -int semsys __P((struct thread *, struct semsys_args *)); -int msgsys __P((struct thread *, struct msgsys_args *)); -int shmsys __P((struct thread *, struct shmsys_args *)); -int pread __P((struct thread *, struct pread_args *)); -int pwrite __P((struct thread *, struct pwrite_args *)); -int ntp_adjtime __P((struct thread *, struct ntp_adjtime_args *)); -int setgid __P((struct thread *, struct setgid_args *)); -int setegid __P((struct thread *, struct setegid_args *)); -int seteuid __P((struct thread *, struct seteuid_args *)); -int stat __P((struct thread *, struct stat_args *)); -int fstat __P((struct thread *, struct fstat_args *)); -int lstat __P((struct thread *, struct lstat_args *)); -int pathconf __P((struct thread *, struct pathconf_args *)); -int fpathconf __P((struct thread *, struct fpathconf_args *)); -int getrlimit __P((struct thread *, struct __getrlimit_args *)); -int setrlimit __P((struct thread *, struct __setrlimit_args *)); -int getdirentries __P((struct thread *, struct getdirentries_args *)); -int mmap __P((struct thread *, struct mmap_args *)); -int lseek __P((struct thread *, struct lseek_args *)); -int truncate __P((struct thread *, struct truncate_args *)); -int ftruncate __P((struct thread *, struct ftruncate_args *)); -int __sysctl __P((struct thread *, struct sysctl_args *)); -int mlock __P((struct thread *, struct mlock_args *)); -int munlock __P((struct thread *, struct munlock_args *)); -int undelete __P((struct thread *, struct undelete_args *)); -int futimes __P((struct thread *, struct futimes_args *)); -int getpgid __P((struct thread *, struct getpgid_args *)); -int poll __P((struct thread *, struct poll_args *)); -int lkmnosys __P((struct thread *, struct nosys_args *)); -int __semctl __P((struct thread *, struct __semctl_args *)); -int semget __P((struct thread *, struct semget_args *)); -int semop __P((struct thread *, struct semop_args *)); -int msgctl __P((struct thread *, struct msgctl_args *)); -int msgget __P((struct thread *, struct msgget_args *)); -int msgsnd __P((struct thread *, struct msgsnd_args *)); -int msgrcv __P((struct thread *, struct msgrcv_args *)); -int shmat __P((struct thread *, struct shmat_args *)); -int shmctl __P((struct thread *, struct shmctl_args *)); -int shmdt __P((struct thread *, struct shmdt_args *)); -int shmget __P((struct thread *, struct shmget_args *)); -int clock_gettime __P((struct thread *, struct clock_gettime_args *)); -int clock_settime __P((struct thread *, struct clock_settime_args *)); -int clock_getres __P((struct thread *, struct clock_getres_args *)); -int nanosleep __P((struct thread *, struct nanosleep_args *)); -int minherit __P((struct thread *, struct minherit_args *)); -int rfork __P((struct thread *, struct rfork_args *)); -int openbsd_poll __P((struct thread *, struct openbsd_poll_args *)); -int issetugid __P((struct thread *, struct issetugid_args *)); -int lchown __P((struct thread *, struct lchown_args *)); -int getdents __P((struct thread *, struct getdents_args *)); -int lchmod __P((struct thread *, struct lchmod_args *)); -int lutimes __P((struct thread *, struct lutimes_args *)); -int nstat __P((struct thread *, struct nstat_args *)); -int nfstat __P((struct thread *, struct nfstat_args *)); -int nlstat __P((struct thread *, struct nlstat_args *)); -int fhstatfs __P((struct thread *, struct fhstatfs_args *)); -int fhopen __P((struct thread *, struct fhopen_args *)); -int fhstat __P((struct thread *, struct fhstat_args *)); -int modnext __P((struct thread *, struct modnext_args *)); -int modstat __P((struct thread *, struct modstat_args *)); -int modfnext __P((struct thread *, struct modfnext_args *)); -int modfind __P((struct thread *, struct modfind_args *)); -int kldload __P((struct thread *, struct kldload_args *)); -int kldunload __P((struct thread *, struct kldunload_args *)); -int kldfind __P((struct thread *, struct kldfind_args *)); -int kldnext __P((struct thread *, struct kldnext_args *)); -int kldstat __P((struct thread *, struct kldstat_args *)); -int kldfirstmod __P((struct thread *, struct kldfirstmod_args *)); -int getsid __P((struct thread *, struct getsid_args *)); -int setresuid __P((struct thread *, struct setresuid_args *)); -int setresgid __P((struct thread *, struct setresgid_args *)); -int aio_return __P((struct thread *, struct aio_return_args *)); -int aio_suspend __P((struct thread *, struct aio_suspend_args *)); -int aio_cancel __P((struct thread *, struct aio_cancel_args *)); -int aio_error __P((struct thread *, struct aio_error_args *)); -int aio_read __P((struct thread *, struct aio_read_args *)); -int aio_write __P((struct thread *, struct aio_write_args *)); -int lio_listio __P((struct thread *, struct lio_listio_args *)); -int yield __P((struct thread *, struct yield_args *)); -int mlockall __P((struct thread *, struct mlockall_args *)); -int munlockall __P((struct thread *, struct munlockall_args *)); -int __getcwd __P((struct thread *, struct __getcwd_args *)); -int sched_setparam __P((struct thread *, struct sched_setparam_args *)); -int sched_getparam __P((struct thread *, struct sched_getparam_args *)); -int sched_setscheduler __P((struct thread *, struct sched_setscheduler_args *)); -int sched_getscheduler __P((struct thread *, struct sched_getscheduler_args *)); -int sched_yield __P((struct thread *, struct sched_yield_args *)); -int sched_get_priority_max __P((struct thread *, struct sched_get_priority_max_args *)); -int sched_get_priority_min __P((struct thread *, struct sched_get_priority_min_args *)); -int sched_rr_get_interval __P((struct thread *, struct sched_rr_get_interval_args *)); -int utrace __P((struct thread *, struct utrace_args *)); -int sendfile __P((struct thread *, struct sendfile_args *)); -int kldsym __P((struct thread *, struct kldsym_args *)); -int jail __P((struct thread *, struct jail_args *)); -int sigprocmask __P((struct thread *, struct sigprocmask_args *)); -int sigsuspend __P((struct thread *, struct sigsuspend_args *)); -int sigaction __P((struct thread *, struct sigaction_args *)); -int sigpending __P((struct thread *, struct sigpending_args *)); -int sigreturn __P((struct thread *, struct sigreturn_args *)); -int __acl_get_file __P((struct thread *, struct __acl_get_file_args *)); -int __acl_set_file __P((struct thread *, struct __acl_set_file_args *)); -int __acl_get_fd __P((struct thread *, struct __acl_get_fd_args *)); -int __acl_set_fd __P((struct thread *, struct __acl_set_fd_args *)); -int __acl_delete_file __P((struct thread *, struct __acl_delete_file_args *)); -int __acl_delete_fd __P((struct thread *, struct __acl_delete_fd_args *)); -int __acl_aclcheck_file __P((struct thread *, struct __acl_aclcheck_file_args *)); -int __acl_aclcheck_fd __P((struct thread *, struct __acl_aclcheck_fd_args *)); -int extattrctl __P((struct thread *, struct extattrctl_args *)); -int extattr_set_file __P((struct thread *, struct extattr_set_file_args *)); -int extattr_get_file __P((struct thread *, struct extattr_get_file_args *)); -int extattr_delete_file __P((struct thread *, struct extattr_delete_file_args *)); -int aio_waitcomplete __P((struct thread *, struct aio_waitcomplete_args *)); -int getresuid __P((struct thread *, struct getresuid_args *)); -int getresgid __P((struct thread *, struct getresgid_args *)); -int kqueue __P((struct thread *, struct kqueue_args *)); -int kevent __P((struct thread *, struct kevent_args *)); -int __cap_get_proc __P((struct thread *, struct __cap_get_proc_args *)); -int __cap_set_proc __P((struct thread *, struct __cap_set_proc_args *)); -int __cap_get_fd __P((struct thread *, struct __cap_get_fd_args *)); -int __cap_get_file __P((struct thread *, struct __cap_get_file_args *)); -int __cap_set_fd __P((struct thread *, struct __cap_set_fd_args *)); -int __cap_set_file __P((struct thread *, struct __cap_set_file_args *)); -int lkmressys __P((struct thread *, struct nosys_args *)); -int extattr_set_fd __P((struct thread *, struct extattr_set_fd_args *)); -int extattr_get_fd __P((struct thread *, struct extattr_get_fd_args *)); -int extattr_delete_fd __P((struct thread *, struct extattr_delete_fd_args *)); -int __setugid __P((struct thread *, struct __setugid_args *)); -int nfsclnt __P((struct thread *, struct nfsclnt_args *)); -int eaccess __P((struct thread *, struct eaccess_args *)); -int nmount __P((struct thread *, struct nmount_args *)); -int kse_exit __P((struct thread *, struct kse_exit_args *)); -int kse_wakeup __P((struct thread *, struct kse_wakeup_args *)); -int kse_new __P((struct thread *, struct kse_new_args *)); -int thread_wakeup __P((struct thread *, struct thread_wakeup_args *)); -int kse_yield __P((struct thread *, struct kse_yield_args *)); +int nosys(struct thread *, struct nosys_args *); +void sys_exit(struct thread *, struct sys_exit_args *); +int fork(struct thread *, struct fork_args *); +int read(struct thread *, struct read_args *); +int write(struct thread *, struct write_args *); +int open(struct thread *, struct open_args *); +int close(struct thread *, struct close_args *); +int wait4(struct thread *, struct wait_args *); +int link(struct thread *, struct link_args *); +int unlink(struct thread *, struct unlink_args *); +int chdir(struct thread *, struct chdir_args *); +int fchdir(struct thread *, struct fchdir_args *); +int mknod(struct thread *, struct mknod_args *); +int chmod(struct thread *, struct chmod_args *); +int chown(struct thread *, struct chown_args *); +int obreak(struct thread *, struct obreak_args *); +int getfsstat(struct thread *, struct getfsstat_args *); +int getpid(struct thread *, struct getpid_args *); +int mount(struct thread *, struct mount_args *); +int unmount(struct thread *, struct unmount_args *); +int setuid(struct thread *, struct setuid_args *); +int getuid(struct thread *, struct getuid_args *); +int geteuid(struct thread *, struct geteuid_args *); +int ptrace(struct thread *, struct ptrace_args *); +int recvmsg(struct thread *, struct recvmsg_args *); +int sendmsg(struct thread *, struct sendmsg_args *); +int recvfrom(struct thread *, struct recvfrom_args *); +int accept(struct thread *, struct accept_args *); +int getpeername(struct thread *, struct getpeername_args *); +int getsockname(struct thread *, struct getsockname_args *); +int access(struct thread *, struct access_args *); +int chflags(struct thread *, struct chflags_args *); +int fchflags(struct thread *, struct fchflags_args *); +int sync(struct thread *, struct sync_args *); +int kill(struct thread *, struct kill_args *); +int getppid(struct thread *, struct getppid_args *); +int dup(struct thread *, struct dup_args *); +int pipe(struct thread *, struct pipe_args *); +int getegid(struct thread *, struct getegid_args *); +int profil(struct thread *, struct profil_args *); +int ktrace(struct thread *, struct ktrace_args *); +int getgid(struct thread *, struct getgid_args *); +int getlogin(struct thread *, struct getlogin_args *); +int setlogin(struct thread *, struct setlogin_args *); +int acct(struct thread *, struct acct_args *); +int sigaltstack(struct thread *, struct sigaltstack_args *); +int ioctl(struct thread *, struct ioctl_args *); +int reboot(struct thread *, struct reboot_args *); +int revoke(struct thread *, struct revoke_args *); +int symlink(struct thread *, struct symlink_args *); +int readlink(struct thread *, struct readlink_args *); +int execve(struct thread *, struct execve_args *); +int umask(struct thread *, struct umask_args *); +int chroot(struct thread *, struct chroot_args *); +int msync(struct thread *, struct msync_args *); +int vfork(struct thread *, struct vfork_args *); +int sbrk(struct thread *, struct sbrk_args *); +int sstk(struct thread *, struct sstk_args *); +int ovadvise(struct thread *, struct ovadvise_args *); +int munmap(struct thread *, struct munmap_args *); +int mprotect(struct thread *, struct mprotect_args *); +int madvise(struct thread *, struct madvise_args *); +int mincore(struct thread *, struct mincore_args *); +int getgroups(struct thread *, struct getgroups_args *); +int setgroups(struct thread *, struct setgroups_args *); +int getpgrp(struct thread *, struct getpgrp_args *); +int setpgid(struct thread *, struct setpgid_args *); +int setitimer(struct thread *, struct setitimer_args *); +int swapon(struct thread *, struct swapon_args *); +int getitimer(struct thread *, struct getitimer_args *); +int getdtablesize(struct thread *, struct getdtablesize_args *); +int dup2(struct thread *, struct dup2_args *); +int fcntl(struct thread *, struct fcntl_args *); +int select(struct thread *, struct select_args *); +int fsync(struct thread *, struct fsync_args *); +int setpriority(struct thread *, struct setpriority_args *); +int socket(struct thread *, struct socket_args *); +int connect(struct thread *, struct connect_args *); +int getpriority(struct thread *, struct getpriority_args *); +int osigreturn(struct thread *, struct osigreturn_args *); +int bind(struct thread *, struct bind_args *); +int setsockopt(struct thread *, struct setsockopt_args *); +int listen(struct thread *, struct listen_args *); +int gettimeofday(struct thread *, struct gettimeofday_args *); +int getrusage(struct thread *, struct getrusage_args *); +int getsockopt(struct thread *, struct getsockopt_args *); +int readv(struct thread *, struct readv_args *); +int writev(struct thread *, struct writev_args *); +int settimeofday(struct thread *, struct settimeofday_args *); +int fchown(struct thread *, struct fchown_args *); +int fchmod(struct thread *, struct fchmod_args *); +int setreuid(struct thread *, struct setreuid_args *); +int setregid(struct thread *, struct setregid_args *); +int rename(struct thread *, struct rename_args *); +int flock(struct thread *, struct flock_args *); +int mkfifo(struct thread *, struct mkfifo_args *); +int sendto(struct thread *, struct sendto_args *); +int shutdown(struct thread *, struct shutdown_args *); +int socketpair(struct thread *, struct socketpair_args *); +int mkdir(struct thread *, struct mkdir_args *); +int rmdir(struct thread *, struct rmdir_args *); +int utimes(struct thread *, struct utimes_args *); +int adjtime(struct thread *, struct adjtime_args *); +int setsid(struct thread *, struct setsid_args *); +int quotactl(struct thread *, struct quotactl_args *); +int nfssvc(struct thread *, struct nfssvc_args *); +int statfs(struct thread *, struct statfs_args *); +int fstatfs(struct thread *, struct fstatfs_args *); +int getfh(struct thread *, struct getfh_args *); +int getdomainname(struct thread *, struct getdomainname_args *); +int setdomainname(struct thread *, struct setdomainname_args *); +int uname(struct thread *, struct uname_args *); +int sysarch(struct thread *, struct sysarch_args *); +int rtprio(struct thread *, struct rtprio_args *); +int semsys(struct thread *, struct semsys_args *); +int msgsys(struct thread *, struct msgsys_args *); +int shmsys(struct thread *, struct shmsys_args *); +int pread(struct thread *, struct pread_args *); +int pwrite(struct thread *, struct pwrite_args *); +int ntp_adjtime(struct thread *, struct ntp_adjtime_args *); +int setgid(struct thread *, struct setgid_args *); +int setegid(struct thread *, struct setegid_args *); +int seteuid(struct thread *, struct seteuid_args *); +int stat(struct thread *, struct stat_args *); +int fstat(struct thread *, struct fstat_args *); +int lstat(struct thread *, struct lstat_args *); +int pathconf(struct thread *, struct pathconf_args *); +int fpathconf(struct thread *, struct fpathconf_args *); +int getrlimit(struct thread *, struct __getrlimit_args *); +int setrlimit(struct thread *, struct __setrlimit_args *); +int getdirentries(struct thread *, struct getdirentries_args *); +int mmap(struct thread *, struct mmap_args *); +int lseek(struct thread *, struct lseek_args *); +int truncate(struct thread *, struct truncate_args *); +int ftruncate(struct thread *, struct ftruncate_args *); +int __sysctl(struct thread *, struct sysctl_args *); +int mlock(struct thread *, struct mlock_args *); +int munlock(struct thread *, struct munlock_args *); +int undelete(struct thread *, struct undelete_args *); +int futimes(struct thread *, struct futimes_args *); +int getpgid(struct thread *, struct getpgid_args *); +int poll(struct thread *, struct poll_args *); +int lkmnosys(struct thread *, struct nosys_args *); +int __semctl(struct thread *, struct __semctl_args *); +int semget(struct thread *, struct semget_args *); +int semop(struct thread *, struct semop_args *); +int msgctl(struct thread *, struct msgctl_args *); +int msgget(struct thread *, struct msgget_args *); +int msgsnd(struct thread *, struct msgsnd_args *); +int msgrcv(struct thread *, struct msgrcv_args *); +int shmat(struct thread *, struct shmat_args *); +int shmctl(struct thread *, struct shmctl_args *); +int shmdt(struct thread *, struct shmdt_args *); +int shmget(struct thread *, struct shmget_args *); +int clock_gettime(struct thread *, struct clock_gettime_args *); +int clock_settime(struct thread *, struct clock_settime_args *); +int clock_getres(struct thread *, struct clock_getres_args *); +int nanosleep(struct thread *, struct nanosleep_args *); +int minherit(struct thread *, struct minherit_args *); +int rfork(struct thread *, struct rfork_args *); +int openbsd_poll(struct thread *, struct openbsd_poll_args *); +int issetugid(struct thread *, struct issetugid_args *); +int lchown(struct thread *, struct lchown_args *); +int getdents(struct thread *, struct getdents_args *); +int lchmod(struct thread *, struct lchmod_args *); +int lutimes(struct thread *, struct lutimes_args *); +int nstat(struct thread *, struct nstat_args *); +int nfstat(struct thread *, struct nfstat_args *); +int nlstat(struct thread *, struct nlstat_args *); +int fhstatfs(struct thread *, struct fhstatfs_args *); +int fhopen(struct thread *, struct fhopen_args *); +int fhstat(struct thread *, struct fhstat_args *); +int modnext(struct thread *, struct modnext_args *); +int modstat(struct thread *, struct modstat_args *); +int modfnext(struct thread *, struct modfnext_args *); +int modfind(struct thread *, struct modfind_args *); +int kldload(struct thread *, struct kldload_args *); +int kldunload(struct thread *, struct kldunload_args *); +int kldfind(struct thread *, struct kldfind_args *); +int kldnext(struct thread *, struct kldnext_args *); +int kldstat(struct thread *, struct kldstat_args *); +int kldfirstmod(struct thread *, struct kldfirstmod_args *); +int getsid(struct thread *, struct getsid_args *); +int setresuid(struct thread *, struct setresuid_args *); +int setresgid(struct thread *, struct setresgid_args *); +int aio_return(struct thread *, struct aio_return_args *); +int aio_suspend(struct thread *, struct aio_suspend_args *); +int aio_cancel(struct thread *, struct aio_cancel_args *); +int aio_error(struct thread *, struct aio_error_args *); +int aio_read(struct thread *, struct aio_read_args *); +int aio_write(struct thread *, struct aio_write_args *); +int lio_listio(struct thread *, struct lio_listio_args *); +int yield(struct thread *, struct yield_args *); +int mlockall(struct thread *, struct mlockall_args *); +int munlockall(struct thread *, struct munlockall_args *); +int __getcwd(struct thread *, struct __getcwd_args *); +int sched_setparam(struct thread *, struct sched_setparam_args *); +int sched_getparam(struct thread *, struct sched_getparam_args *); +int sched_setscheduler(struct thread *, struct sched_setscheduler_args *); +int sched_getscheduler(struct thread *, struct sched_getscheduler_args *); +int sched_yield(struct thread *, struct sched_yield_args *); +int sched_get_priority_max(struct thread *, struct sched_get_priority_max_args *); +int sched_get_priority_min(struct thread *, struct sched_get_priority_min_args *); +int sched_rr_get_interval(struct thread *, struct sched_rr_get_interval_args *); +int utrace(struct thread *, struct utrace_args *); +int sendfile(struct thread *, struct sendfile_args *); +int kldsym(struct thread *, struct kldsym_args *); +int jail(struct thread *, struct jail_args *); +int sigprocmask(struct thread *, struct sigprocmask_args *); +int sigsuspend(struct thread *, struct sigsuspend_args *); +int sigaction(struct thread *, struct sigaction_args *); +int sigpending(struct thread *, struct sigpending_args *); +int sigreturn(struct thread *, struct sigreturn_args *); +int __acl_get_file(struct thread *, struct __acl_get_file_args *); +int __acl_set_file(struct thread *, struct __acl_set_file_args *); +int __acl_get_fd(struct thread *, struct __acl_get_fd_args *); +int __acl_set_fd(struct thread *, struct __acl_set_fd_args *); +int __acl_delete_file(struct thread *, struct __acl_delete_file_args *); +int __acl_delete_fd(struct thread *, struct __acl_delete_fd_args *); +int __acl_aclcheck_file(struct thread *, struct __acl_aclcheck_file_args *); +int __acl_aclcheck_fd(struct thread *, struct __acl_aclcheck_fd_args *); +int extattrctl(struct thread *, struct extattrctl_args *); +int extattr_set_file(struct thread *, struct extattr_set_file_args *); +int extattr_get_file(struct thread *, struct extattr_get_file_args *); +int extattr_delete_file(struct thread *, struct extattr_delete_file_args *); +int aio_waitcomplete(struct thread *, struct aio_waitcomplete_args *); +int getresuid(struct thread *, struct getresuid_args *); +int getresgid(struct thread *, struct getresgid_args *); +int kqueue(struct thread *, struct kqueue_args *); +int kevent(struct thread *, struct kevent_args *); +int __cap_get_proc(struct thread *, struct __cap_get_proc_args *); +int __cap_set_proc(struct thread *, struct __cap_set_proc_args *); +int __cap_get_fd(struct thread *, struct __cap_get_fd_args *); +int __cap_get_file(struct thread *, struct __cap_get_file_args *); +int __cap_set_fd(struct thread *, struct __cap_set_fd_args *); +int __cap_set_file(struct thread *, struct __cap_set_file_args *); +int lkmressys(struct thread *, struct nosys_args *); +int extattr_set_fd(struct thread *, struct extattr_set_fd_args *); +int extattr_get_fd(struct thread *, struct extattr_get_fd_args *); +int extattr_delete_fd(struct thread *, struct extattr_delete_fd_args *); +int __setugid(struct thread *, struct __setugid_args *); +int nfsclnt(struct thread *, struct nfsclnt_args *); +int eaccess(struct thread *, struct eaccess_args *); +int nmount(struct thread *, struct nmount_args *); +int kse_exit(struct thread *, struct kse_exit_args *); +int kse_wakeup(struct thread *, struct kse_wakeup_args *); +int kse_new(struct thread *, struct kse_new_args *); +int thread_wakeup(struct thread *, struct thread_wakeup_args *); +int kse_yield(struct thread *, struct kse_yield_args *); #ifdef COMPAT_43 struct ocreat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; }; struct olseek_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char offset_l_[PADL_(long)]; long offset; char offset_r_[PADR_(long)]; char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; }; struct ostat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct ostat *)]; struct ostat * ub; char ub_r_[PADR_(struct ostat *)]; }; struct olstat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct ostat *)]; struct ostat * ub; char ub_r_[PADR_(struct ostat *)]; }; struct osigaction_args { char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)]; char nsa_l_[PADL_(struct osigaction *)]; struct osigaction * nsa; char nsa_r_[PADR_(struct osigaction *)]; char osa_l_[PADL_(struct osigaction *)]; struct osigaction * osa; char osa_r_[PADR_(struct osigaction *)]; }; struct osigprocmask_args { char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)]; char mask_l_[PADL_(osigset_t)]; osigset_t mask; char mask_r_[PADR_(osigset_t)]; }; struct ofstat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char sb_l_[PADL_(struct ostat *)]; struct ostat * sb; char sb_r_[PADR_(struct ostat *)]; }; struct getkerninfo_args { char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; char where_l_[PADL_(char *)]; char * where; char where_r_[PADR_(char *)]; char size_l_[PADL_(size_t *)]; size_t * size; char size_r_[PADR_(size_t *)]; char arg_l_[PADL_(int)]; int arg; char arg_r_[PADR_(int)]; }; struct ommap_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char pos_l_[PADL_(long)]; long pos; char pos_r_[PADR_(long)]; }; struct gethostname_args { char hostname_l_[PADL_(char *)]; char * hostname; char hostname_r_[PADR_(char *)]; char len_l_[PADL_(u_int)]; u_int len; char len_r_[PADR_(u_int)]; }; struct sethostname_args { char hostname_l_[PADL_(char *)]; char * hostname; char hostname_r_[PADR_(char *)]; char len_l_[PADL_(u_int)]; u_int len; char len_r_[PADR_(u_int)]; }; struct osend_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)]; char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct orecv_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)]; char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct osigvec_args { char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)]; char nsv_l_[PADL_(struct sigvec *)]; struct sigvec * nsv; char nsv_r_[PADR_(struct sigvec *)]; char osv_l_[PADL_(struct sigvec *)]; struct sigvec * osv; char osv_r_[PADR_(struct sigvec *)]; }; struct osigblock_args { char mask_l_[PADL_(int)]; int mask; char mask_r_[PADR_(int)]; }; struct osigsetmask_args { char mask_l_[PADL_(int)]; int mask; char mask_r_[PADR_(int)]; }; struct osigsuspend_args { char mask_l_[PADL_(osigset_t)]; osigset_t mask; char mask_r_[PADR_(osigset_t)]; }; struct osigstack_args { char nss_l_[PADL_(struct sigstack *)]; struct sigstack * nss; char nss_r_[PADR_(struct sigstack *)]; char oss_l_[PADL_(struct sigstack *)]; struct sigstack * oss; char oss_r_[PADR_(struct sigstack *)]; }; struct orecvmsg_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char msg_l_[PADL_(struct omsghdr *)]; struct omsghdr * msg; char msg_r_[PADR_(struct omsghdr *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct osendmsg_args { char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; char msg_l_[PADL_(caddr_t)]; caddr_t msg; char msg_r_[PADR_(caddr_t)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; struct otruncate_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char length_l_[PADL_(long)]; long length; char length_r_[PADR_(long)]; }; struct oftruncate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char length_l_[PADL_(long)]; long length; char length_r_[PADR_(long)]; }; struct ogetpeername_args { char fdes_l_[PADL_(int)]; int fdes; char fdes_r_[PADR_(int)]; char asa_l_[PADL_(caddr_t)]; caddr_t asa; char asa_r_[PADR_(caddr_t)]; char alen_l_[PADL_(int *)]; int * alen; char alen_r_[PADR_(int *)]; }; struct osethostid_args { char hostid_l_[PADL_(long)]; long hostid; char hostid_r_[PADR_(long)]; }; struct ogetrlimit_args { char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)]; char rlp_l_[PADL_(struct orlimit *)]; struct orlimit * rlp; char rlp_r_[PADR_(struct orlimit *)]; }; struct osetrlimit_args { char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)]; char rlp_l_[PADL_(struct orlimit *)]; struct orlimit * rlp; char rlp_r_[PADR_(struct orlimit *)]; }; struct okillpg_args { char pgid_l_[PADL_(int)]; int pgid; char pgid_r_[PADR_(int)]; char signum_l_[PADL_(int)]; int signum; char signum_r_[PADR_(int)]; }; struct ogetdirentries_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char count_l_[PADL_(u_int)]; u_int count; char count_r_[PADR_(u_int)]; char basep_l_[PADL_(long *)]; long * basep; char basep_r_[PADR_(long *)]; }; -int ocreat __P((struct thread *, struct ocreat_args *)); -int olseek __P((struct thread *, struct olseek_args *)); -int ostat __P((struct thread *, struct ostat_args *)); -int olstat __P((struct thread *, struct olstat_args *)); -int osigaction __P((struct thread *, struct osigaction_args *)); -int osigprocmask __P((struct thread *, struct osigprocmask_args *)); -int osigpending __P((struct thread *, struct osigpending_args *)); -int ofstat __P((struct thread *, struct ofstat_args *)); -int ogetkerninfo __P((struct thread *, struct getkerninfo_args *)); -int ogetpagesize __P((struct thread *, struct getpagesize_args *)); -int ommap __P((struct thread *, struct ommap_args *)); -int owait __P((struct thread *, struct owait_args *)); -int ogethostname __P((struct thread *, struct gethostname_args *)); -int osethostname __P((struct thread *, struct sethostname_args *)); -int oaccept __P((struct thread *, struct accept_args *)); -int osend __P((struct thread *, struct osend_args *)); -int orecv __P((struct thread *, struct orecv_args *)); -int osigvec __P((struct thread *, struct osigvec_args *)); -int osigblock __P((struct thread *, struct osigblock_args *)); -int osigsetmask __P((struct thread *, struct osigsetmask_args *)); -int osigsuspend __P((struct thread *, struct osigsuspend_args *)); -int osigstack __P((struct thread *, struct osigstack_args *)); -int orecvmsg __P((struct thread *, struct orecvmsg_args *)); -int osendmsg __P((struct thread *, struct osendmsg_args *)); -int orecvfrom __P((struct thread *, struct recvfrom_args *)); -int otruncate __P((struct thread *, struct otruncate_args *)); -int oftruncate __P((struct thread *, struct oftruncate_args *)); -int ogetpeername __P((struct thread *, struct ogetpeername_args *)); -int ogethostid __P((struct thread *, struct ogethostid_args *)); -int osethostid __P((struct thread *, struct osethostid_args *)); -int ogetrlimit __P((struct thread *, struct ogetrlimit_args *)); -int osetrlimit __P((struct thread *, struct osetrlimit_args *)); -int okillpg __P((struct thread *, struct okillpg_args *)); -int oquota __P((struct thread *, struct oquota_args *)); -int ogetsockname __P((struct thread *, struct getsockname_args *)); -int ogetdirentries __P((struct thread *, struct ogetdirentries_args *)); +int ocreat(struct thread *, struct ocreat_args *); +int olseek(struct thread *, struct olseek_args *); +int ostat(struct thread *, struct ostat_args *); +int olstat(struct thread *, struct olstat_args *); +int osigaction(struct thread *, struct osigaction_args *); +int osigprocmask(struct thread *, struct osigprocmask_args *); +int osigpending(struct thread *, struct osigpending_args *); +int ofstat(struct thread *, struct ofstat_args *); +int ogetkerninfo(struct thread *, struct getkerninfo_args *); +int ogetpagesize(struct thread *, struct getpagesize_args *); +int ommap(struct thread *, struct ommap_args *); +int owait(struct thread *, struct owait_args *); +int ogethostname(struct thread *, struct gethostname_args *); +int osethostname(struct thread *, struct sethostname_args *); +int oaccept(struct thread *, struct accept_args *); +int osend(struct thread *, struct osend_args *); +int orecv(struct thread *, struct orecv_args *); +int osigvec(struct thread *, struct osigvec_args *); +int osigblock(struct thread *, struct osigblock_args *); +int osigsetmask(struct thread *, struct osigsetmask_args *); +int osigsuspend(struct thread *, struct osigsuspend_args *); +int osigstack(struct thread *, struct osigstack_args *); +int orecvmsg(struct thread *, struct orecvmsg_args *); +int osendmsg(struct thread *, struct osendmsg_args *); +int orecvfrom(struct thread *, struct recvfrom_args *); +int otruncate(struct thread *, struct otruncate_args *); +int oftruncate(struct thread *, struct oftruncate_args *); +int ogetpeername(struct thread *, struct ogetpeername_args *); +int ogethostid(struct thread *, struct ogethostid_args *); +int osethostid(struct thread *, struct osethostid_args *); +int ogetrlimit(struct thread *, struct ogetrlimit_args *); +int osetrlimit(struct thread *, struct osetrlimit_args *); +int okillpg(struct thread *, struct okillpg_args *); +int oquota(struct thread *, struct oquota_args *); +int ogetsockname(struct thread *, struct getsockname_args *); +int ogetdirentries(struct thread *, struct ogetdirentries_args *); #endif /* COMPAT_43 */ #undef PAD_ #undef PADL_ #undef PADR_ #endif /* !_SYS_SYSPROTO_H_ */ Index: head/sys/sys/systm.h =================================================================== --- head/sys/sys/systm.h (revision 92718) +++ head/sys/sys/systm.h (revision 92719) @@ -1,319 +1,319 @@ /*- * Copyright (c) 1982, 1988, 1991, 1993 * 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. * * @(#)systm.h 8.7 (Berkeley) 3/29/95 * $FreeBSD$ */ #ifndef _SYS_SYSTM_H_ #define _SYS_SYSTM_H_ #include #include #include extern int securelevel; /* system security level (see init(8)) */ extern int suser_enabled; /* suser_xxx() is permitted to return 0 */ extern int cold; /* nonzero if we are doing a cold boot */ extern const char *panicstr; /* panic message */ extern int dumping; /* system is dumping */ extern char version[]; /* system version */ extern char copyright[]; /* system copyright */ extern int nswap; /* size of swap space */ extern int nselcoll; /* select collisions since boot */ extern struct mtx sellock; /* select lock variable */ extern struct cv selwait; /* select conditional variable */ extern int physmem; /* physical memory */ extern dev_t dumpdev; /* dump device */ extern long dumplo; /* offset into dumpdev */ extern dev_t rootdev; /* root device */ extern dev_t rootdevs[2]; /* possible root devices */ extern char *rootdevnames[2]; /* names of possible root devices */ extern struct vnode *rootvp; /* vnode equivalent to above */ extern int boothowto; /* reboot flags, from console subsystem */ extern int bootverbose; /* nonzero to print verbose messages */ extern int maxusers; /* system tune hint */ #ifdef INVARIANTS /* The option is always available */ #define KASSERT(exp,msg) do { if (!(exp)) panic msg; } while (0) #else #define KASSERT(exp,msg) #endif /* * XXX the hints declarations are even more misplaced than most declarations * in this file, since they are needed in one file (per arch) and only used * in two files. * XXX most of these variables should be const. */ extern int envmode; extern int hintmode; /* 0 = off. 1 = config, 2 = fallback */ extern char *kern_envp; extern char static_env[]; extern char static_hints[]; /* by config for now */ /* * General function declarations. */ struct clockframe; struct malloc_type; struct mtx; struct proc; struct kse; struct thread; struct tty; struct ucred; struct uio; struct _jmp_buf; -int setjmp __P((struct _jmp_buf *)); -void longjmp __P((struct _jmp_buf *, int)) __dead2; -void Debugger __P((const char *msg)); -int dumpstatus __P((vm_offset_t addr, off_t count)); -int nullop __P((void)); -int eopnotsupp __P((void)); -int seltrue __P((dev_t dev, int which, struct thread *td)); -int ureadc __P((int, struct uio *)); -void *hashinit __P((int count, struct malloc_type *type, u_long *hashmask)); -void *phashinit __P((int count, struct malloc_type *type, u_long *nentries)); +int setjmp(struct _jmp_buf *); +void longjmp(struct _jmp_buf *, int) __dead2; +void Debugger(const char *msg); +int dumpstatus(vm_offset_t addr, off_t count); +int nullop(void); +int eopnotsupp(void); +int seltrue(dev_t dev, int which, struct thread *td); +int ureadc(int, struct uio *); +void *hashinit(int count, struct malloc_type *type, u_long *hashmask); +void *phashinit(int count, struct malloc_type *type, u_long *nentries); #ifdef RESTARTABLE_PANICS -void panic __P((const char *, ...)) __printflike(1, 2); +void panic(const char *, ...) __printflike(1, 2); #else -void panic __P((const char *, ...)) __dead2 __printflike(1, 2); +void panic(const char *, ...) __dead2 __printflike(1, 2); #endif -void cpu_boot __P((int)); -void cpu_rootconf __P((void)); -void critical_enter __P((void)); -void critical_exit __P((void)); -void init_param1 __P((void)); -void init_param2 __P((int physpages)); -void tablefull __P((const char *)); -int kvprintf __P((char const *, void (*)(int, void*), void *, int, - _BSD_VA_LIST_)) __printflike(1, 0); -void log __P((int, const char *, ...)) __printflike(2, 3); -void log_console __P((struct uio *)); -int printf __P((const char *, ...)) __printflike(1, 2); -int snprintf __P((char *, size_t, const char *, ...)) __printflike(3, 4); -int sprintf __P((char *buf, const char *, ...)) __printflike(2, 3); -int uprintf __P((const char *, ...)) __printflike(1, 2); -int vprintf __P((const char *, _BSD_VA_LIST_)) __printflike(1, 0); -int vsnprintf __P((char *, size_t, const char *, _BSD_VA_LIST_)) __printflike(3, 0); -int vsprintf __P((char *buf, const char *, _BSD_VA_LIST_)) __printflike(2, 0); -int ttyprintf __P((struct tty *, const char *, ...)) __printflike(2, 3); -int sscanf __P((const char *, char const *, ...)); -int vsscanf __P((const char *, char const *, _BSD_VA_LIST_)); -long strtol __P((const char *, char **, int)); -u_long strtoul __P((const char *, char **, int)); -quad_t strtoq __P((const char *, char **, int)); -u_quad_t strtouq __P((const char *, char **, int)); -void tprintf __P((struct proc *p, int pri, const char *, ...)) __printflike(3, 4); +void cpu_boot(int); +void cpu_rootconf(void); +void critical_enter(void); +void critical_exit(void); +void init_param1(void); +void init_param2(int physpages); +void tablefull(const char *); +int kvprintf(char const *, void (*)(int, void*), void *, int, + _BSD_VA_LIST_) __printflike(1, 0); +void log(int, const char *, ...) __printflike(2, 3); +void log_console(struct uio *); +int printf(const char *, ...) __printflike(1, 2); +int snprintf(char *, size_t, const char *, ...) __printflike(3, 4); +int sprintf(char *buf, const char *, ...) __printflike(2, 3); +int uprintf(const char *, ...) __printflike(1, 2); +int vprintf(const char *, _BSD_VA_LIST_) __printflike(1, 0); +int vsnprintf(char *, size_t, const char *, _BSD_VA_LIST_) __printflike(3, 0); +int vsprintf(char *buf, const char *, _BSD_VA_LIST_) __printflike(2, 0); +int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3); +int sscanf(const char *, char const *, ...); +int vsscanf(const char *, char const *, _BSD_VA_LIST_); +long strtol(const char *, char **, int); +u_long strtoul(const char *, char **, int); +quad_t strtoq(const char *, char **, int); +u_quad_t strtouq(const char *, char **, int); +void tprintf(struct proc *p, int pri, const char *, ...) __printflike(3, 4); -void bcopy __P((const void *from, void *to, size_t len)); -void ovbcopy __P((const void *from, void *to, size_t len)); +void bcopy(const void *from, void *to, size_t len); +void ovbcopy(const void *from, void *to, size_t len); #ifdef __i386__ -extern void (*bzero) __P((void *buf, size_t len)); +extern void (*bzero)(void *buf, size_t len); #else -void bzero __P((void *buf, size_t len)); +void bzero(void *buf, size_t len); #endif -void *memcpy __P((void *to, const void *from, size_t len)); +void *memcpy(void *to, const void *from, size_t len); -int copystr __P((const void *kfaddr, void *kdaddr, size_t len, - size_t *lencopied)); -int copyinstr __P((const void *udaddr, void *kaddr, size_t len, - size_t *lencopied)); -int copyin __P((const void *udaddr, void *kaddr, size_t len)); -int copyout __P((const void *kaddr, void *udaddr, size_t len)); +int copystr(const void *kfaddr, void *kdaddr, size_t len, + size_t *lencopied); +int copyinstr(const void *udaddr, void *kaddr, size_t len, + size_t *lencopied); +int copyin(const void *udaddr, void *kaddr, size_t len); +int copyout(const void *kaddr, void *udaddr, size_t len); -int fubyte __P((const void *base)); -int subyte __P((void *base, int byte)); -int suibyte __P((void *base, int byte)); -long fuword __P((const void *base)); -int suword __P((void *base, long word)); -int fusword __P((void *base)); -int susword __P((void *base, int word)); +int fubyte(const void *base); +int subyte(void *base, int byte); +int suibyte(void *base, int byte); +long fuword(const void *base); +int suword(void *base, long word); +int fusword(void *base); +int susword(void *base, int word); -void realitexpire __P((void *)); +void realitexpire(void *); -void hardclock __P((struct clockframe *frame)); -void hardclock_process __P((struct thread *td, int user)); -void softclock __P((void *)); -void statclock __P((struct clockframe *frame)); -void statclock_process __P((struct kse *ke, register_t pc, int user)); +void hardclock(struct clockframe *frame); +void hardclock_process(struct thread *td, int user); +void softclock(void *); +void statclock(struct clockframe *frame); +void statclock_process(struct kse *ke, register_t pc, int user); -void startprofclock __P((struct proc *)); -void stopprofclock __P((struct proc *)); -void setstatclockrate __P((int hzrate)); +void startprofclock(struct proc *); +void stopprofclock(struct proc *); +void setstatclockrate(int hzrate); /* flags for suser_xxx() */ #define PRISON_ROOT 1 -int suser __P((struct proc *)); -int suser_td __P((struct thread *)); -int suser_xxx __P((struct ucred *cred, struct proc *proc, int flag)); -int suser_xxx_td __P((struct ucred *cred, struct thread *thread, int flag)); -int cr_cansee __P((struct ucred *u1, struct ucred *u2)); +int suser(struct proc *); +int suser_td(struct thread *); +int suser_xxx(struct ucred *cred, struct proc *proc, int flag); +int suser_xxx_td(struct ucred *cred, struct thread *thread, int flag); +int cr_cansee(struct ucred *u1, struct ucred *u2); -char *getenv __P((const char *name)); -int getenv_int __P((const char *name, int *data)); -int getenv_string __P((const char *name, char *data, int size)); -int getenv_quad __P((const char *name, quad_t *data)); +char *getenv(const char *name); +int getenv_int(const char *name, int *data); +int getenv_string(const char *name, char *data, int size); +int getenv_quad(const char *name, quad_t *data); #ifdef APM_FIXUP_CALLTODO struct timeval; -void adjust_timeout_calltodo __P((struct timeval *time_change)); +void adjust_timeout_calltodo(struct timeval *time_change); #endif /* APM_FIXUP_CALLTODO */ #include /* Initialize the world */ -void consinit __P((void)); -void cpu_initclocks __P((void)); -void usrinfoinit __P((void)); +void consinit(void); +void cpu_initclocks(void); +void usrinfoinit(void); /* Finalize the world. */ -void shutdown_nice __P((int)); +void shutdown_nice(int); /* * Kernel to clock driver interface. */ -void inittodr __P((time_t base)); -void resettodr __P((void)); -void startrtclock __P((void)); +void inittodr(time_t base); +void resettodr(void); +void startrtclock(void); /* Timeouts */ -typedef void timeout_t __P((void *)); /* timeout function type */ +typedef void timeout_t(void *); /* timeout function type */ #define CALLOUT_HANDLE_INITIALIZER(handle) \ { NULL } -void callout_handle_init __P((struct callout_handle *)); -struct callout_handle timeout __P((timeout_t *, void *, int)); -void untimeout __P((timeout_t *, void *, struct callout_handle)); -caddr_t kern_timeout_callwheel_alloc __P((caddr_t v)); -void kern_timeout_callwheel_init __P((void)); +void callout_handle_init(struct callout_handle *); +struct callout_handle timeout(timeout_t *, void *, int); +void untimeout(timeout_t *, void *, struct callout_handle); +caddr_t kern_timeout_callwheel_alloc(caddr_t v); +void kern_timeout_callwheel_init(void); /* Stubs for obsolete functions that used to be for interrupt management */ static __inline void spl0(void) { return; } static __inline intrmask_t splbio(void) { return 0; } static __inline intrmask_t splcam(void) { return 0; } static __inline intrmask_t splclock(void) { return 0; } static __inline intrmask_t splhigh(void) { return 0; } static __inline intrmask_t splimp(void) { return 0; } static __inline intrmask_t splnet(void) { return 0; } static __inline intrmask_t splsoftcam(void) { return 0; } static __inline intrmask_t splsoftclock(void) { return 0; } static __inline intrmask_t splsofttty(void) { return 0; } static __inline intrmask_t splsoftvm(void) { return 0; } static __inline intrmask_t splsofttq(void) { return 0; } static __inline intrmask_t splstatclock(void) { return 0; } static __inline intrmask_t spltty(void) { return 0; } static __inline intrmask_t splvm(void) { return 0; } static __inline void splx(intrmask_t ipl) { return; } /* * Various callout lists. */ /* Exit callout list declarations. */ -typedef void (*exitlist_fn) __P((struct proc *procp)); +typedef void (*exitlist_fn)(struct proc *procp); -int at_exit __P((exitlist_fn function)); -int rm_at_exit __P((exitlist_fn function)); +int at_exit(exitlist_fn function); +int rm_at_exit(exitlist_fn function); /* Fork callout list declarations. */ -typedef void (*forklist_fn) __P((struct proc *parent, struct proc *child, - int flags)); +typedef void (*forklist_fn)(struct proc *parent, struct proc *child, + int flags); -int at_fork __P((forklist_fn function)); -int rm_at_fork __P((forklist_fn function)); +int at_fork(forklist_fn function); +int rm_at_fork(forklist_fn function); /* Exec callout list declarations. */ -typedef void (*execlist_fn) __P((struct proc *procp)); +typedef void (*execlist_fn)(struct proc *procp); -int at_exec __P((execlist_fn function)); -int rm_at_exec __P((execlist_fn function)); +int at_exec(execlist_fn function); +int rm_at_exec(execlist_fn function); /* * Not exactly a callout LIST, but a callout entry. * Allow an external module to define a hardware watchdog tickler. * Normally a process would do this, but there are times when the * kernel needs to be able to hold off the watchdog, when the process * is not active, e.g., when dumping core. */ -typedef void (*watchdog_tickle_fn) __P((void)); +typedef void (*watchdog_tickle_fn)(void); extern watchdog_tickle_fn wdog_tickler; /* * Common `proc' functions are declared here so that proc.h can be included * less often. */ -int msleep __P((void *chan, struct mtx *mtx, int pri, const char *wmesg, - int timo)); +int msleep(void *chan, struct mtx *mtx, int pri, const char *wmesg, + int timo); #define tsleep(chan, pri, wmesg, timo) msleep(chan, NULL, pri, wmesg, timo) -void wakeup __P((void *chan)); -void wakeup_one __P((void *chan)); +void wakeup(void *chan); +void wakeup_one(void *chan); /* * Common `dev_t' stuff are declared here to avoid #include poisoning */ int major(dev_t x); int minor(dev_t x); dev_t makedev(int x, int y); udev_t dev2udev(dev_t x); dev_t udev2dev(udev_t x, int b); int uminor(udev_t dev); int umajor(udev_t dev); udev_t makeudev(int x, int y); /* XXX: Should be void nanodelay(u_int nsec); */ -void DELAY __P((int usec)); +void DELAY(int usec); #endif /* !_SYS_SYSTM_H_ */ Index: head/sys/sys/termios.h =================================================================== --- head/sys/sys/termios.h (revision 92718) +++ head/sys/sys/termios.h (revision 92719) @@ -1,288 +1,288 @@ /* * Copyright (c) 1988, 1989, 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. * * @(#)termios.h 8.3 (Berkeley) 3/28/94 * $FreeBSD$ */ #ifndef _SYS_TERMIOS_H_ #define _SYS_TERMIOS_H_ /* * Special Control Characters * * Index into c_cc[] character array. * * Name Subscript Enabled by */ #define VEOF 0 /* ICANON */ #define VEOL 1 /* ICANON */ #ifndef _POSIX_SOURCE #define VEOL2 2 /* ICANON together with IEXTEN */ #endif #define VERASE 3 /* ICANON */ #ifndef _POSIX_SOURCE #define VWERASE 4 /* ICANON together with IEXTEN */ #endif #define VKILL 5 /* ICANON */ #ifndef _POSIX_SOURCE #define VREPRINT 6 /* ICANON together with IEXTEN */ #define VERASE2 7 /* ICANON */ #endif /* 7 ex-spare 1 */ #define VINTR 8 /* ISIG */ #define VQUIT 9 /* ISIG */ #define VSUSP 10 /* ISIG */ #ifndef _POSIX_SOURCE #define VDSUSP 11 /* ISIG together with IEXTEN */ #endif #define VSTART 12 /* IXON, IXOFF */ #define VSTOP 13 /* IXON, IXOFF */ #ifndef _POSIX_SOURCE #define VLNEXT 14 /* IEXTEN */ #define VDISCARD 15 /* IEXTEN */ #endif #define VMIN 16 /* !ICANON */ #define VTIME 17 /* !ICANON */ #ifndef _POSIX_SOURCE #define VSTATUS 18 /* ICANON together with IEXTEN */ /* 19 spare 2 */ #endif #define NCCS 20 #define _POSIX_VDISABLE 0xff #ifndef _POSIX_SOURCE #define CCEQ(val, c) ((c) == (val) ? (val) != _POSIX_VDISABLE : 0) #endif /* * Input flags - software input processing */ #define IGNBRK 0x00000001 /* ignore BREAK condition */ #define BRKINT 0x00000002 /* map BREAK to SIGINTR */ #define IGNPAR 0x00000004 /* ignore (discard) parity errors */ #define PARMRK 0x00000008 /* mark parity and framing errors */ #define INPCK 0x00000010 /* enable checking of parity errors */ #define ISTRIP 0x00000020 /* strip 8th bit off chars */ #define INLCR 0x00000040 /* map NL into CR */ #define IGNCR 0x00000080 /* ignore CR */ #define ICRNL 0x00000100 /* map CR to NL (ala CRMOD) */ #define IXON 0x00000200 /* enable output flow control */ #define IXOFF 0x00000400 /* enable input flow control */ #ifndef _POSIX_SOURCE #define IXANY 0x00000800 /* any char will restart after stop */ #define IMAXBEL 0x00002000 /* ring bell on input queue full */ #endif /*_POSIX_SOURCE */ /* * Output flags - software output processing */ #define OPOST 0x00000001 /* enable following output processing */ #ifndef _POSIX_SOURCE #define ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */ #define OXTABS 0x00000004 /* expand tabs to spaces */ #define ONOEOT 0x00000008 /* discard EOT's (^D) on output) */ #define OCRNL 0x00000010 /* map CR to NL on output */ #define ONOCR 0x00000020 /* no CR output at column 0 */ #define ONLRET 0x00000040 /* NL performs CR function */ #endif /*_POSIX_SOURCE */ /* * Control flags - hardware control of terminal */ #ifndef _POSIX_SOURCE #define CIGNORE 0x00000001 /* ignore control flags */ #endif #define CSIZE 0x00000300 /* character size mask */ #define CS5 0x00000000 /* 5 bits (pseudo) */ #define CS6 0x00000100 /* 6 bits */ #define CS7 0x00000200 /* 7 bits */ #define CS8 0x00000300 /* 8 bits */ #define CSTOPB 0x00000400 /* send 2 stop bits */ #define CREAD 0x00000800 /* enable receiver */ #define PARENB 0x00001000 /* parity enable */ #define PARODD 0x00002000 /* odd parity, else even */ #define HUPCL 0x00004000 /* hang up on last close */ #define CLOCAL 0x00008000 /* ignore modem status lines */ #ifndef _POSIX_SOURCE #define CCTS_OFLOW 0x00010000 /* CTS flow control of output */ #define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW) #define CRTS_IFLOW 0x00020000 /* RTS flow control of input */ #define CDTR_IFLOW 0x00040000 /* DTR flow control of input */ #define CDSR_OFLOW 0x00080000 /* DSR flow control of output */ #define CCAR_OFLOW 0x00100000 /* DCD flow control of output */ #define MDMBUF 0x00100000 /* old name for CCAR_OFLOW */ #endif /* * "Local" flags - dumping ground for other state * * Warning: some flags in this structure begin with * the letter "I" and look like they belong in the * input flag. */ #ifndef _POSIX_SOURCE #define ECHOKE 0x00000001 /* visual erase for line kill */ #endif /*_POSIX_SOURCE */ #define ECHOE 0x00000002 /* visually erase chars */ #define ECHOK 0x00000004 /* echo NL after line kill */ #define ECHO 0x00000008 /* enable echoing */ #define ECHONL 0x00000010 /* echo NL even if ECHO is off */ #ifndef _POSIX_SOURCE #define ECHOPRT 0x00000020 /* visual erase mode for hardcopy */ #define ECHOCTL 0x00000040 /* echo control chars as ^(Char) */ #endif /*_POSIX_SOURCE */ #define ISIG 0x00000080 /* enable signals INTR, QUIT, [D]SUSP */ #define ICANON 0x00000100 /* canonicalize input lines */ #ifndef _POSIX_SOURCE #define ALTWERASE 0x00000200 /* use alternate WERASE algorithm */ #endif /*_POSIX_SOURCE */ #define IEXTEN 0x00000400 /* enable DISCARD and LNEXT */ #define EXTPROC 0x00000800 /* external processing */ #define TOSTOP 0x00400000 /* stop background jobs from output */ #ifndef _POSIX_SOURCE #define FLUSHO 0x00800000 /* output being flushed (state) */ #define NOKERNINFO 0x02000000 /* no kernel output from VSTATUS */ #define PENDIN 0x20000000 /* XXX retype pending input (state) */ #endif /*_POSIX_SOURCE */ #define NOFLSH 0x80000000 /* don't flush after interrupt */ typedef unsigned int tcflag_t; typedef unsigned char cc_t; typedef unsigned int speed_t; struct termios { tcflag_t c_iflag; /* input flags */ tcflag_t c_oflag; /* output flags */ tcflag_t c_cflag; /* control flags */ tcflag_t c_lflag; /* local flags */ cc_t c_cc[NCCS]; /* control chars */ speed_t c_ispeed; /* input speed */ speed_t c_ospeed; /* output speed */ }; /* * Commands passed to tcsetattr() for setting the termios structure. */ #define TCSANOW 0 /* make change immediate */ #define TCSADRAIN 1 /* drain output, then change */ #define TCSAFLUSH 2 /* drain output, flush input */ #ifndef _POSIX_SOURCE #define TCSASOFT 0x10 /* flag - don't alter h.w. state */ #endif /* * Standard speeds */ #define B0 0 #define B50 50 #define B75 75 #define B110 110 #define B134 134 #define B150 150 #define B200 200 #define B300 300 #define B600 600 #define B1200 1200 #define B1800 1800 #define B2400 2400 #define B4800 4800 #define B9600 9600 #define B19200 19200 #define B38400 38400 #ifndef _POSIX_SOURCE #define B7200 7200 #define B14400 14400 #define B28800 28800 #define B57600 57600 #define B76800 76800 #define B115200 115200 #define B230400 230400 #define B460800 460800 #define B921600 921600 #define EXTA 19200 #define EXTB 38400 #endif /* !_POSIX_SOURCE */ #ifndef _KERNEL #define TCIFLUSH 1 #define TCOFLUSH 2 #define TCIOFLUSH 3 #define TCOOFF 1 #define TCOON 2 #define TCIOFF 3 #define TCION 4 #include __BEGIN_DECLS -speed_t cfgetispeed __P((const struct termios *)); -speed_t cfgetospeed __P((const struct termios *)); -int cfsetispeed __P((struct termios *, speed_t)); -int cfsetospeed __P((struct termios *, speed_t)); -int tcgetattr __P((int, struct termios *)); -int tcsetattr __P((int, int, const struct termios *)); -int tcdrain __P((int)); -int tcflow __P((int, int)); -int tcflush __P((int, int)); -int tcsendbreak __P((int, int)); +speed_t cfgetispeed(const struct termios *); +speed_t cfgetospeed(const struct termios *); +int cfsetispeed(struct termios *, speed_t); +int cfsetospeed(struct termios *, speed_t); +int tcgetattr(int, struct termios *); +int tcsetattr(int, int, const struct termios *); +int tcdrain(int); +int tcflow(int, int); +int tcflush(int, int); +int tcsendbreak(int, int); #ifndef _POSIX_SOURCE -void cfmakeraw __P((struct termios *)); -int cfsetspeed __P((struct termios *, speed_t)); +void cfmakeraw(struct termios *); +int cfsetspeed(struct termios *, speed_t); #endif /* !_POSIX_SOURCE */ __END_DECLS #endif /* !_KERNEL */ #ifndef _POSIX_SOURCE /* * Include tty ioctl's that aren't just for backwards compatibility * with the old tty driver. These ioctl definitions were previously * in . */ #include #endif /* * END OF PROTECTED INCLUDE. */ #endif /* !_SYS_TERMIOS_H_ */ #ifndef _POSIX_SOURCE #include #endif Index: head/sys/sys/time.h =================================================================== --- head/sys/sys/time.h (revision 92718) +++ head/sys/sys/time.h (revision 92719) @@ -1,300 +1,300 @@ /* * 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. * * @(#)time.h 8.5 (Berkeley) 5/4/95 * $FreeBSD$ */ #ifndef _SYS_TIME_H_ #define _SYS_TIME_H_ #include /* * Structure returned by gettimeofday(2) system call, * and used in other calls. */ struct timeval { long tv_sec; /* seconds */ long tv_usec; /* and microseconds */ }; #ifndef _TIMESPEC_DECLARED #define _TIMESPEC_DECLARED struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; #endif #define TIMEVAL_TO_TIMESPEC(tv, ts) \ do { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ } while (0) #define TIMESPEC_TO_TIMEVAL(tv, ts) \ do { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ } while (0) struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of dst correction */ }; #define DST_NONE 0 /* not on dst */ #define DST_USA 1 /* USA style dst */ #define DST_AUST 2 /* Australian style dst */ #define DST_WET 3 /* Western European dst */ #define DST_MET 4 /* Middle European dst */ #define DST_EET 5 /* Eastern European dst */ #define DST_CAN 6 /* Canada */ /* start of struct bintime stuff */ struct bintime { time_t sec; u_int64_t frac; }; static __inline void bintime_addx(struct bintime *bt, u_int64_t x) { u_int64_t u; u = bt->frac; bt->frac += x; if (u > bt->frac) bt->sec++; } static __inline void bintime_add(struct bintime *bt, struct bintime *bt2) { u_int64_t u; u = bt->frac; bt->frac += bt2->frac; if (u > bt->frac) bt->sec++; bt->sec += bt2->sec; } static __inline void bintime_sub(struct bintime *bt, struct bintime *bt2) { u_int64_t u; u = bt->frac; bt->frac -= bt2->frac; if (u < bt->frac) bt->sec--; bt->sec -= bt2->sec; } static __inline void bintime2timespec(struct bintime *bt, struct timespec *ts) { ts->tv_sec = bt->sec; ts->tv_nsec = (1000000000ULL * (u_int32_t)(bt->frac >> 32)) >> 32; } static __inline void timespec2bintime(struct timespec *ts, struct bintime *bt) { bt->sec = ts->tv_sec; bt->frac = ts->tv_nsec * 18446744073ULL; /* int(2^64 / 1000000000) */ } static __inline void bintime2timeval(struct bintime *bt, struct timeval *tv) { tv->tv_sec = bt->sec; tv->tv_usec = (1000000ULL * (u_int32_t)(bt->frac >> 32)) >> 32; } static __inline void timeval2bintime(struct timeval *tv, struct bintime *bt) { bt->sec = tv->tv_sec; bt->frac = tv->tv_usec * 18446744073709ULL; /* int(2^64 / 1000000) */ } /* end of struct bintime stuff */ #ifdef _KERNEL /* Operations on timespecs */ #define timespecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0) #define timespecisset(tvp) ((tvp)->tv_sec || (tvp)->tv_nsec) #define timespeccmp(tvp, uvp, cmp) \ (((tvp)->tv_sec == (uvp)->tv_sec) ? \ ((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) #define timespecadd(vvp, uvp) \ do { \ (vvp)->tv_sec += (uvp)->tv_sec; \ (vvp)->tv_nsec += (uvp)->tv_nsec; \ if ((vvp)->tv_nsec >= 1000000000) { \ (vvp)->tv_sec++; \ (vvp)->tv_nsec -= 1000000000; \ } \ } while (0) #define timespecsub(vvp, uvp) \ do { \ (vvp)->tv_sec -= (uvp)->tv_sec; \ (vvp)->tv_nsec -= (uvp)->tv_nsec; \ if ((vvp)->tv_nsec < 0) { \ (vvp)->tv_sec--; \ (vvp)->tv_nsec += 1000000000; \ } \ } while (0) /* Operations on timevals. */ #define timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) #define timevalisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) #define timevalcmp(tvp, uvp, cmp) \ (((tvp)->tv_sec == (uvp)->tv_sec) ? \ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) /* timevaladd and timevalsub are not inlined */ #endif /* _KERNEL */ #ifndef _KERNEL /* NetBSD/OpenBSD compatible interfaces */ #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) #define timercmp(tvp, uvp, cmp) \ (((tvp)->tv_sec == (uvp)->tv_sec) ? \ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) #define timeradd(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ if ((vvp)->tv_usec >= 1000000) { \ (vvp)->tv_sec++; \ (vvp)->tv_usec -= 1000000; \ } \ } while (0) #define timersub(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ if ((vvp)->tv_usec < 0) { \ (vvp)->tv_sec--; \ (vvp)->tv_usec += 1000000; \ } \ } while (0) #endif /* * Names of the interval timers, and structure * defining a timer setting. */ #define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 struct itimerval { struct timeval it_interval; /* timer interval */ struct timeval it_value; /* current value */ }; /* * Getkerninfo clock information structure */ struct clockinfo { int hz; /* clock frequency */ int tick; /* micro-seconds per hz tick */ int tickadj; /* clock skew rate for adjtime() */ int stathz; /* statistics clock frequency */ int profhz; /* profiling clock frequency */ }; /* CLOCK_REALTIME and TIMER_ABSTIME are supposed to be in time.h */ #ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 #endif #define CLOCK_VIRTUAL 1 #define CLOCK_PROF 2 #define TIMER_RELTIME 0x0 /* relative timer */ #ifndef TIMER_ABSTIME #define TIMER_ABSTIME 0x1 /* absolute timer */ #endif #ifdef _KERNEL extern time_t time_second; void binuptime(struct bintime *bt); void bintime(struct bintime *bt); -void getmicrouptime __P((struct timeval *tv)); -void getmicrotime __P((struct timeval *tv)); -void getnanouptime __P((struct timespec *tsp)); -void getnanotime __P((struct timespec *tsp)); -int itimerdecr __P((struct itimerval *itp, int usec)); -int itimerfix __P((struct timeval *tv)); -void microuptime __P((struct timeval *tv)); -void microtime __P((struct timeval *tv)); -void nanouptime __P((struct timespec *ts)); -void nanotime __P((struct timespec *ts)); -void timevaladd __P((struct timeval *, struct timeval *)); -void timevalsub __P((struct timeval *, struct timeval *)); -int tvtohz __P((struct timeval *)); +void getmicrouptime(struct timeval *tv); +void getmicrotime(struct timeval *tv); +void getnanouptime(struct timespec *tsp); +void getnanotime(struct timespec *tsp); +int itimerdecr(struct itimerval *itp, int usec); +int itimerfix(struct timeval *tv); +void microuptime(struct timeval *tv); +void microtime(struct timeval *tv); +void nanouptime(struct timespec *ts); +void nanotime(struct timespec *ts); +void timevaladd(struct timeval *, struct timeval *); +void timevalsub(struct timeval *, struct timeval *); +int tvtohz(struct timeval *); #else /* !_KERNEL */ #include #include __BEGIN_DECLS -int adjtime __P((const struct timeval *, struct timeval *)); -int futimes __P((int, const struct timeval *)); -int getitimer __P((int, struct itimerval *)); -int gettimeofday __P((struct timeval *, struct timezone *)); -int lutimes __P((const char *, const struct timeval *)); -int setitimer __P((int, const struct itimerval *, struct itimerval *)); -int settimeofday __P((const struct timeval *, const struct timezone *)); -int utimes __P((const char *, const struct timeval *)); +int adjtime(const struct timeval *, struct timeval *); +int futimes(int, const struct timeval *); +int getitimer(int, struct itimerval *); +int gettimeofday(struct timeval *, struct timezone *); +int lutimes(const char *, const struct timeval *); +int setitimer(int, const struct itimerval *, struct itimerval *); +int settimeofday(const struct timeval *, const struct timezone *); +int utimes(const char *, const struct timeval *); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_TIME_H_ */ Index: head/sys/sys/timeb.h =================================================================== --- head/sys/sys/timeb.h (revision 92718) +++ head/sys/sys/timeb.h (revision 92719) @@ -1,61 +1,61 @@ /*- * Copyright (c) 1991, 1993 * 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. * * @(#)timeb.h 8.2 (Berkeley) 1/21/94 * $FreeBSD$ */ #ifndef _SYS_TIMEB_H_ #define _SYS_TIMEB_H_ /* The ftime(2) system call structure -- deprecated. */ struct timeb { time_t time; /* seconds since the Epoch */ unsigned short millitm; /* + milliseconds since the Epoch */ short timezone; /* minutes west of CUT */ short dstflag; /* DST == non-zero */ }; #ifndef _KERNEL #include __BEGIN_DECLS -int ftime __P((struct timeb *)); +int ftime(struct timeb *); __END_DECLS #endif /* _KERNEL */ #endif Index: head/sys/sys/timepps.h =================================================================== --- head/sys/sys/timepps.h (revision 92718) +++ head/sys/sys/timepps.h (revision 92719) @@ -1,190 +1,190 @@ /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * * $FreeBSD$ * * The is a FreeBSD protype version of the "draft-mogul-pps-api-05.txt" * specification for Pulse Per Second timing interfaces. */ #ifndef _SYS_TIMEPPS_H_ #define _SYS_TIMEPPS_H_ #include #define PPS_API_VERS_1 1 typedef int pps_handle_t; typedef unsigned pps_seq_t; typedef struct ntp_fp { unsigned int integral; unsigned int fractional; } ntp_fp_t; typedef union pps_timeu { struct timespec tspec; ntp_fp_t ntpfp; unsigned long longpad[3]; } pps_timeu_t; typedef struct { pps_seq_t assert_sequence; /* assert event seq # */ pps_seq_t clear_sequence; /* clear event seq # */ pps_timeu_t assert_tu; pps_timeu_t clear_tu; int current_mode; /* current mode bits */ } pps_info_t; #define assert_timestamp assert_tu.tspec #define clear_timestamp clear_tu.tspec #define assert_timestamp_ntpfp assert_tu.ntpfp #define clear_timestamp_ntpfp clear_tu.ntpfp typedef struct { int api_version; /* API version # */ int mode; /* mode bits */ pps_timeu_t assert_off_tu; pps_timeu_t clear_off_tu; } pps_params_t; #define assert_offset assert_off_tu.tspec #define clear_offset clear_off_tu.tspec #define assert_offset_ntpfp assert_off_tu.ntpfp #define clear_offset_ntpfp clear_off_tu.ntpfp #define PPS_CAPTUREASSERT 0x01 #define PPS_CAPTURECLEAR 0x02 #define PPS_CAPTUREBOTH 0x03 #define PPS_OFFSETASSERT 0x10 #define PPS_OFFSETCLEAR 0x20 #define PPS_ECHOASSERT 0x40 #define PPS_ECHOCLEAR 0x80 #define PPS_CANWAIT 0x100 #define PPS_CANPOLL 0x200 #define PPS_TSFMT_TSPEC 0x1000 #define PPS_TSFMT_NTPFP 0x2000 #define PPS_KC_HARDPPS 0 #define PPS_KC_HARDPPS_PLL 1 #define PPS_KC_HARDPPS_FLL 2 struct pps_fetch_args { int tsformat; pps_info_t pps_info_buf; struct timespec timeout; }; struct pps_kcbind_args { int kernel_consumer; int edge; int tsformat; }; #define PPS_IOC_CREATE _IO('1', 1) #define PPS_IOC_DESTROY _IO('1', 2) #define PPS_IOC_SETPARAMS _IOW('1', 3, pps_params_t) #define PPS_IOC_GETPARAMS _IOR('1', 4, pps_params_t) #define PPS_IOC_GETCAP _IOR('1', 5, int) #define PPS_IOC_FETCH _IOWR('1', 6, struct pps_fetch_args) #define PPS_IOC_KCBIND _IOW('1', 7, struct pps_kcbind_args) #ifdef _KERNEL struct pps_state { pps_params_t ppsparam; pps_info_t ppsinfo; int kcmode; int ppscap; struct timecounter *ppstc; unsigned ppscount[3]; }; -void pps_event __P((struct pps_state *pps, struct timecounter *tc, unsigned count, int event)); -void pps_init __P((struct pps_state *pps)); -int pps_ioctl __P((u_long cmd, caddr_t data, struct pps_state *pps)); -void hardpps __P((struct timespec *tsp, long nsec)); +void pps_event(struct pps_state *pps, struct timecounter *tc, unsigned count, int event); +void pps_init(struct pps_state *pps); +int pps_ioctl(u_long cmd, caddr_t data, struct pps_state *pps); +void hardpps(struct timespec *tsp, long nsec); #else /* !_KERNEL */ static __inline int time_pps_create(int filedes, pps_handle_t *handle) { int error; *handle = -1; error = ioctl(filedes, PPS_IOC_CREATE, 0); if (error < 0) return (-1); *handle = filedes; return (0); } static __inline int time_pps_destroy(pps_handle_t handle) { return (ioctl(handle, PPS_IOC_DESTROY, 0)); } static __inline int time_pps_setparams(pps_handle_t handle, const pps_params_t *ppsparams) { return (ioctl(handle, PPS_IOC_SETPARAMS, ppsparams)); } static __inline int time_pps_getparams(pps_handle_t handle, pps_params_t *ppsparams) { return (ioctl(handle, PPS_IOC_GETPARAMS, ppsparams)); } static __inline int time_pps_getcap(pps_handle_t handle, int *mode) { return (ioctl(handle, PPS_IOC_GETCAP, mode)); } static __inline int time_pps_fetch(pps_handle_t handle, const int tsformat, pps_info_t *ppsinfobuf, const struct timespec *timeout) { int error; struct pps_fetch_args arg; arg.tsformat = tsformat; if (timeout == NULL) { arg.timeout.tv_sec = -1; arg.timeout.tv_nsec = -1; } else arg.timeout = *timeout; error = ioctl(handle, PPS_IOC_FETCH, &arg); *ppsinfobuf = arg.pps_info_buf; return (error); } static __inline int time_pps_kcbind(pps_handle_t handle, const int kernel_consumer, const int edge, const int tsformat) { struct pps_kcbind_args arg; arg.kernel_consumer = kernel_consumer; arg.edge = edge; arg.tsformat = tsformat; return (ioctl(handle, PPS_IOC_KCBIND, &arg)); } #endif /* !_KERNEL */ #endif /* _SYS_TIMEPPS_H_ */ Index: head/sys/sys/times.h =================================================================== --- head/sys/sys/times.h (revision 92718) +++ head/sys/sys/times.h (revision 92719) @@ -1,66 +1,66 @@ /*- * Copyright (c) 1990, 1993 * 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. * * @(#)times.h 8.4 (Berkeley) 1/21/94 * $FreeBSD$ */ #ifndef _SYS_TIMES_H_ #define _SYS_TIMES_H_ #include #ifdef _BSD_CLOCK_T_ typedef _BSD_CLOCK_T_ clock_t; #undef _BSD_CLOCK_T_ #endif struct tms { clock_t tms_utime; /* User CPU time */ clock_t tms_stime; /* System CPU time */ clock_t tms_cutime; /* User CPU time of terminated child procs */ clock_t tms_cstime; /* System CPU time of terminated child procs */ }; #ifndef _KERNEL #include __BEGIN_DECLS -clock_t times __P((struct tms *)); +clock_t times(struct tms *); __END_DECLS #endif #endif /* !_SYS_TIMES_H_ */ Index: head/sys/sys/timetc.h =================================================================== --- head/sys/sys/timetc.h (revision 92718) +++ head/sys/sys/timetc.h (revision 92719) @@ -1,102 +1,102 @@ /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * * $FreeBSD$ */ #ifndef _SYS_TIMETC_H_ #define _SYS_TIMETC_H_ /* * Structure used to interface to the machine dependent hardware support * for timekeeping. * * A timecounter is a (hard or soft) binary counter which has two properties: * * it runs at a fixed, known frequency. * * it must not roll over in less than (1 + delta)/HZ seconds. "delta" * is expected to be less than 20 msec, but no hard data has been * collected on this. 16 bit at 5 MHz (31 msec) is known to work. * * get_timecount() reads the counter. * * counter_mask removes unimplemented bits from the count value. * * frequency is the counter frequency in hz. * * name is a short mnemonic name for this counter. * * cost is a measure of how long time it takes to read the counter. * * adjustment [PPM << 16] which means that the smallest unit of correction * you can apply amounts to 481.5 usec/year. * * scale_micro [2^32 * usec/tick]. * scale_nano_i [ns/tick]. * scale_nano_f [(ns/2^32)/tick]. * * offset_count is the contents of the counter which corresponds to the * rest of the offset_* values. * * offset_sec [s]. * offset_micro [usec]. * offset_nano [ns/2^32] is misnamed, the real unit is .23283064365... * attoseconds (10E-18) and before you ask: yes, they are in fact * called attoseconds, it comes from "atten" for 18 in Danish/Swedish. * * Each timecounter must supply an array of three timecounters, this is needed * to guarantee atomicity in the code. Index zero is used to transport * modifications, for instance done with sysctl, into the timecounter being * used in a safe way. Such changes may be adopted with a delay of up to 1/HZ, * index one & two are used alternately for the actual timekeeping. * * 'tc_avail' points to the next available (external) timecounter in a * circular queue. This is only valid for index 0. * * `tc_other' points to the next "work" timecounter in a circular queue, * i.e., for index i > 0 it points to index 1 + (i - 1) % NTIMECOUNTER. * We also use it to point from index 0 to index 1. * * `tc_tweak' points to index 0. */ struct timecounter; -typedef unsigned timecounter_get_t __P((struct timecounter *)); -typedef void timecounter_pps_t __P((struct timecounter *)); +typedef unsigned timecounter_get_t(struct timecounter *); +typedef void timecounter_pps_t(struct timecounter *); struct timecounter { /* These fields must be initialized by the driver. */ timecounter_get_t *tc_get_timecount; timecounter_pps_t *tc_poll_pps; unsigned tc_counter_mask; u_int32_t tc_frequency; char *tc_name; void *tc_priv; /* These fields will be managed by the generic code. */ int64_t tc_adjustment; u_int64_t tc_scale; unsigned tc_offset_count; struct bintime tc_offset; struct timeval tc_microtime; struct timespec tc_nanotime; struct timecounter *tc_avail; struct timecounter *tc_tweak; /* Fields not to be copied in tc_windup start with tc_generation */ volatile unsigned tc_generation; struct timecounter *tc_next; }; #ifdef _KERNEL extern struct timecounter *volatile timecounter; -void tc_init __P((struct timecounter *tc)); -void tc_setclock __P((struct timespec *ts)); -void tc_windup __P((void)); -void tc_update __P((struct timecounter *tc)); +void tc_init(struct timecounter *tc); +void tc_setclock(struct timespec *ts); +void tc_windup(void); +void tc_update(struct timecounter *tc); #endif /* !_KERNEL */ #endif /* !_SYS_TIMETC_H_ */ Index: head/sys/sys/timex.h =================================================================== --- head/sys/sys/timex.h (revision 92718) +++ head/sys/sys/timex.h (revision 92719) @@ -1,236 +1,236 @@ /*********************************************************************** * * * Copyright (c) David L. Mills 1993-2001 * * * * Permission to use, copy, modify, and distribute this software and * * its documentation for any purpose and without fee is hereby * * granted, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission * * notice appear in supporting documentation, and that the name * * University of Delaware not be used in advertising or publicity * * pertaining to distribution of the software without specific, * * written prior permission. The University of Delaware makes no * * representations about the suitability this software for any * * purpose. It is provided "as is" without express or implied * * warranty. * * * **********************************************************************/ /* * Modification history timex.h * * 16 Aug 00 David L. Mills * API Version 4. Added MOD_TAI and tai member of ntptimeval * structure. * * 17 Nov 98 David L. Mills * Revised for nanosecond kernel and user interface. * * 26 Sep 94 David L. Mills * Added defines for hybrid phase/frequency-lock loop. * * 19 Mar 94 David L. Mills * Moved defines from kernel routines to header file and added new * defines for PPS phase-lock loop. * * 20 Feb 94 David L. Mills * Revised status codes and structures for external clock and PPS * signal discipline. * * 28 Nov 93 David L. Mills * Adjusted parameters to improve stability and increase poll * interval. * * 17 Sep 93 David L. Mills * Created file * * $FreeBSD$ */ /* * This header file defines the Network Time Protocol (NTP) interfaces * for user and daemon application programs. These are implemented using * defined syscalls and data structures and require specific kernel * support. * * The original precision time kernels developed from 1993 have an * ultimate resolution of one microsecond; however, the most recent * kernels have an ultimate resolution of one nanosecond. In these * kernels, a ntp_adjtime() syscalls can be used to determine which * resolution is in use and to select either one at any time. The * resolution selected affects the scaling of certain fields in the * ntp_gettime() and ntp_adjtime() syscalls, as described below. * * NAME * ntp_gettime - NTP user application interface * * SYNOPSIS * #include * * int ntp_gettime(struct ntptimeval *ntv); * * DESCRIPTION * The time returned by ntp_gettime() is in a timespec structure, * but may be in either microsecond (seconds and microseconds) or * nanosecond (seconds and nanoseconds) format. The particular * format in use is determined by the STA_NANO bit of the status * word returned by the ntp_adjtime() syscall. * * NAME * ntp_adjtime - NTP daemon application interface * * SYNOPSIS * #include * #include * * int syscall(SYS_ntp_adjtime, tptr); * int SYS_ntp_adjtime; * struct timex *tptr; * * DESCRIPTION * Certain fields of the timex structure are interpreted in either * microseconds or nanoseconds according to the state of the * STA_NANO bit in the status word. See the description below for * further information. */ #ifndef _SYS_TIMEX_H_ #define _SYS_TIMEX_H_ 1 #define NTP_API 4 /* NTP API version */ #ifndef MSDOS /* Microsoft specific */ #include #endif /* MSDOS */ /* * The following defines establish the performance envelope of the * kernel discipline loop. Phase or frequency errors greater than * NAXPHASE or MAXFREQ are clamped to these maxima. For update intervals * less than MINSEC, the loop always operates in PLL mode; while, for * update intervals greater than MAXSEC, the loop always operates in FLL * mode. Between these two limits the operating mode is selected by the * STA_FLL bit in the status word. */ #define MAXPHASE 500000000L /* max phase error (ns) */ #define MAXFREQ 500000L /* max freq error (ns/s) */ #define MINSEC 256 /* min FLL update interval (s) */ #define MAXSEC 2048 /* max PLL update interval (s) */ #define NANOSECOND 1000000000L /* nanoseconds in one second */ #define SCALE_PPM (65536 / 1000) /* crude ns/s to scaled PPM */ #define MAXTC 10 /* max time constant */ /* * The following defines and structures define the user interface for * the ntp_gettime() and ntp_adjtime() syscalls. * * Control mode codes (timex.modes) */ #define MOD_OFFSET 0x0001 /* set time offset */ #define MOD_FREQUENCY 0x0002 /* set frequency offset */ #define MOD_MAXERROR 0x0004 /* set maximum time error */ #define MOD_ESTERROR 0x0008 /* set estimated time error */ #define MOD_STATUS 0x0010 /* set clock status bits */ #define MOD_TIMECONST 0x0020 /* set PLL time constant */ #define MOD_PPSMAX 0x0040 /* set PPS maximum averaging time */ #define MOD_TAI 0x0080 /* set TAI offset */ #define MOD_MICRO 0x1000 /* select microsecond resolution */ #define MOD_NANO 0x2000 /* select nanosecond resolution */ #define MOD_CLKB 0x4000 /* select clock B */ #define MOD_CLKA 0x8000 /* select clock A */ /* * Status codes (timex.status) */ #define STA_PLL 0x0001 /* enable PLL updates (rw) */ #define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */ #define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */ #define STA_FLL 0x0008 /* enable FLL mode (rw) */ #define STA_INS 0x0010 /* insert leap (rw) */ #define STA_DEL 0x0020 /* delete leap (rw) */ #define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */ #define STA_FREQHOLD 0x0080 /* hold frequency (rw) */ #define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */ #define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */ #define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */ #define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */ #define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */ #define STA_NANO 0x2000 /* resolution (0 = us, 1 = ns) (ro) */ #define STA_MODE 0x4000 /* mode (0 = PLL, 1 = FLL) (ro) */ #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) /* * Clock states (time_state) */ #define TIME_OK 0 /* no leap second warning */ #define TIME_INS 1 /* insert leap second warning */ #define TIME_DEL 2 /* delete leap second warning */ #define TIME_OOP 3 /* leap second in progress */ #define TIME_WAIT 4 /* leap second has occured */ #define TIME_ERROR 5 /* error (see status word) */ /* * NTP user interface (ntp_gettime()) - used to read kernel clock values * * Note: The time member is in microseconds if STA_NANO is zero and * nanoseconds if not. */ struct ntptimeval { struct timespec time; /* current time (ns) (ro) */ long maxerror; /* maximum error (us) (ro) */ long esterror; /* estimated error (us) (ro) */ long tai; /* TAI offset */ int time_state; /* time status */ }; /* * NTP daemon interface (ntp_adjtime()) - used to discipline CPU clock * oscillator and determine status. * * Note: The offset, precision and jitter members are in microseconds if * STA_NANO is zero and nanoseconds if not. */ struct timex { unsigned int modes; /* clock mode bits (wo) */ long offset; /* time offset (ns/us) (rw) */ long freq; /* frequency offset (scaled PPM) (rw) */ long maxerror; /* maximum error (us) (rw) */ long esterror; /* estimated error (us) (rw) */ int status; /* clock status bits (rw) */ long constant; /* poll interval (log2 s) (rw) */ long precision; /* clock precision (ns/us) (ro) */ long tolerance; /* clock frequency tolerance (scaled * PPM) (ro) */ /* * The following read-only structure members are implemented * only if the PPS signal discipline is configured in the * kernel. They are included in all configurations to insure * portability. */ long ppsfreq; /* PPS frequency (scaled PPM) (ro) */ long jitter; /* PPS jitter (ns/us) (ro) */ int shift; /* interval duration (s) (shift) (ro) */ long stabil; /* PPS stability (scaled PPM) (ro) */ long jitcnt; /* jitter limit exceeded (ro) */ long calcnt; /* calibration intervals (ro) */ long errcnt; /* calibration errors (ro) */ long stbcnt; /* stability limit exceeded (ro) */ }; #ifdef __FreeBSD__ #ifdef _KERNEL struct timecounter; -void ntp_update_second __P((struct timecounter *tc)); +void ntp_update_second(struct timecounter *tc); #else /* !_KERNEL */ #include __BEGIN_DECLS -int ntp_adjtime __P((struct timex *)); -int ntp_gettime __P((struct ntptimeval *)); +int ntp_adjtime(struct timex *); +int ntp_gettime(struct ntptimeval *); __END_DECLS #endif /* _KERNEL */ #endif /* __FreeBSD__ */ #endif /* !_SYS_TIMEX_H_ */ Index: head/sys/sys/tty.h =================================================================== --- head/sys/sys/tty.h (revision 92718) +++ head/sys/sys/tty.h (revision 92719) @@ -1,282 +1,282 @@ /*- * Copyright (c) 1982, 1986, 1993 * 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. * * @(#)tty.h 8.6 (Berkeley) 1/21/94 * $FreeBSD$ */ #ifndef _SYS_TTY_H_ #define _SYS_TTY_H_ #include #include #include /* * Clists are character lists, which is a variable length linked list * of cblocks, with a count of the number of characters in the list. */ struct clist { int c_cc; /* Number of characters in the clist. */ int c_cbcount; /* Number of cblocks. */ int c_cbmax; /* Max # cblocks allowed for this clist. */ int c_cbreserved; /* # cblocks reserved for this clist. */ char *c_cf; /* Pointer to the first cblock. */ char *c_cl; /* Pointer to the last cblock. */ }; /* * Per-tty structure. * * Should be split in two, into device and tty drivers. * Glue could be masks of what to echo and circular buffer * (low, high, timeout). */ struct tty { struct clist t_rawq; /* Device raw input queue. */ long t_rawcc; /* Raw input queue statistics. */ struct clist t_canq; /* Device canonical queue. */ long t_cancc; /* Canonical queue statistics. */ struct clist t_outq; /* Device output queue. */ long t_outcc; /* Output queue statistics. */ int t_line; /* Interface to device drivers. */ union { dev_t t_kdev; /* Device. */ udev_t t_udev; /* Userland (sysctl) instance. */ void *t_devp; /* Keep user/kernel size in sync. */ } ttyu; int t_state; /* Device and driver (TS*) state. */ int t_flags; /* Tty flags. */ int t_timeout; /* Timeout for ttywait() */ struct pgrp *t_pgrp; /* Foreground process group. */ struct session *t_session; /* Enclosing session. */ struct sigio *t_sigio; /* Information for async I/O. */ struct selinfo t_rsel; /* Tty read/oob select. */ struct selinfo t_wsel; /* Tty write select. */ struct termios t_termios; /* Termios state. */ struct winsize t_winsize; /* Window size. */ /* Start output. */ - void (*t_oproc) __P((struct tty *)); + void (*t_oproc)(struct tty *); /* Stop output. */ - void (*t_stop) __P((struct tty *, int)); + void (*t_stop)(struct tty *, int); /* Set hardware state. */ - int (*t_param) __P((struct tty *, struct termios *)); + int (*t_param)(struct tty *, struct termios *); void *t_sc; /* XXX: net/if_sl.c:sl_softc. */ int t_column; /* Tty output column. */ int t_rocount, t_rocol; /* Tty. */ int t_ififosize; /* Total size of upstream fifos. */ int t_ihiwat; /* High water mark for input. */ int t_ilowat; /* Low water mark for input. */ speed_t t_ispeedwat; /* t_ispeed override for watermarks. */ int t_ohiwat; /* High water mark for output. */ int t_olowat; /* Low water mark for output. */ speed_t t_ospeedwat; /* t_ospeed override for watermarks. */ int t_gen; /* Generation number. */ SLIST_ENTRY(tty) t_list; /* Global chain of ttys for pstat(8) */ }; #define t_cc t_termios.c_cc #define t_cflag t_termios.c_cflag #define t_dev ttyu.t_kdev #define t_iflag t_termios.c_iflag #define t_ispeed t_termios.c_ispeed #define t_lflag t_termios.c_lflag #define t_min t_termios.c_min #define t_oflag t_termios.c_oflag #define t_ospeed t_termios.c_ospeed #define t_time t_termios.c_time #define TTIPRI (PSOCK + 1) /* Sleep priority for tty reads. */ #define TTOPRI (PSOCK + 2) /* Sleep priority for tty writes. */ /* * User data unfortunately has to be copied through buffers on the way to * and from clists. The buffers are on the stack so their sizes must be * fairly small. */ #define IBUFSIZ 384 /* Should be >= max value of MIN. */ #define OBUFSIZ 100 #ifndef TTYHOG #define TTYHOG 1024 #endif #ifdef _KERNEL #define TTMAXHIWAT roundup(2048, CBSIZE) #define TTMINHIWAT roundup(100, CBSIZE) #define TTMAXLOWAT 256 #define TTMINLOWAT 32 #endif /* These flags are kept in t_state. */ #define TS_SO_OLOWAT 0x00001 /* Wake up when output <= low water. */ #define TS_ASYNC 0x00002 /* Tty in async I/O mode. */ #define TS_BUSY 0x00004 /* Draining output. */ #define TS_CARR_ON 0x00008 /* Carrier is present. */ #define TS_FLUSH 0x00010 /* Outq has been flushed during DMA. */ #define TS_ISOPEN 0x00020 /* Open has completed. */ #define TS_TBLOCK 0x00040 /* Further input blocked. */ #define TS_TIMEOUT 0x00080 /* Wait for output char processing. */ #define TS_TTSTOP 0x00100 /* Output paused. */ #ifdef notyet #define TS_WOPEN 0x00200 /* Open in progress. */ #endif #define TS_XCLUDE 0x00400 /* Tty requires exclusivity. */ /* State for intra-line fancy editing work. */ #define TS_BKSL 0x00800 /* State for lowercase \ work. */ #define TS_CNTTB 0x01000 /* Counting tab width, ignore FLUSHO. */ #define TS_ERASE 0x02000 /* Within a \.../ for PRTRUB. */ #define TS_LNCH 0x04000 /* Next character is literal. */ #define TS_TYPEN 0x08000 /* Retyping suspended input (PENDIN). */ #define TS_LOCAL (TS_BKSL | TS_CNTTB | TS_ERASE | TS_LNCH | TS_TYPEN) /* Extras. */ #define TS_CAN_BYPASS_L_RINT 0x010000 /* Device in "raw" mode. */ #define TS_CONNECTED 0x020000 /* Connection open. */ #define TS_SNOOP 0x040000 /* Device is being snooped on. */ #define TS_SO_OCOMPLETE 0x080000 /* Wake up when output completes. */ #define TS_ZOMBIE 0x100000 /* Connection lost. */ /* Hardware flow-control-invoked bits. */ #define TS_CAR_OFLOW 0x200000 /* For MDMBUF (XXX handle in driver). */ #ifdef notyet #define TS_CTS_OFLOW 0x400000 /* For CCTS_OFLOW. */ #define TS_DSR_OFLOW 0x800000 /* For CDSR_OFLOW. */ #endif /* Character type information. */ #define ORDINARY 0 #define CONTROL 1 #define BACKSPACE 2 #define NEWLINE 3 #define TAB 4 #define VTAB 5 #define RETURN 6 struct speedtab { int sp_speed; /* Speed. */ int sp_code; /* Code. */ }; /* Modem control commands (driver). */ #define DMSET 0 #define DMBIS 1 #define DMBIC 2 #define DMGET 3 /* Flags on a character passed to ttyinput. */ #define TTY_CHARMASK 0x000000ff /* Character mask */ #define TTY_QUOTE 0x00000100 /* Character quoted */ #define TTY_ERRORMASK 0xff000000 /* Error mask */ #define TTY_FE 0x01000000 /* Framing error */ #define TTY_PE 0x02000000 /* Parity error */ #define TTY_OE 0x04000000 /* Overrun error */ #define TTY_BI 0x08000000 /* Break condition */ /* Is tp controlling terminal for p? */ #define isctty(p, tp) \ ((p)->p_session == (tp)->t_session && (p)->p_flag & P_CONTROLT) /* Is p in background of tp? */ #define isbackground(p, tp) \ (isctty((p), (tp)) && (p)->p_pgrp != (tp)->t_pgrp) /* Unique sleep addresses. */ #define TSA_CARR_ON(tp) ((void *)&(tp)->t_rawq) #define TSA_HUP_OR_INPUT(tp) ((void *)&(tp)->t_rawq.c_cf) #define TSA_OCOMPLETE(tp) ((void *)&(tp)->t_outq.c_cl) #define TSA_OLOWAT(tp) ((void *)&(tp)->t_outq) #define TSA_PTC_READ(tp) ((void *)&(tp)->t_outq.c_cf) #define TSA_PTC_WRITE(tp) ((void *)&(tp)->t_rawq.c_cl) #define TSA_PTS_READ(tp) ((void *)&(tp)->t_canq) #ifdef _KERNEL #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_TTYS); #endif extern struct tty *constty; /* Temporary virtual console. */ -int b_to_q __P((char *cp, int cc, struct clist *q)); -void catq __P((struct clist *from, struct clist *to)); -void clist_alloc_cblocks __P((struct clist *q, int ccmax, int ccres)); -void clist_free_cblocks __P((struct clist *q)); -int getc __P((struct clist *q)); -void ndflush __P((struct clist *q, int cc)); -char *nextc __P((struct clist *q, char *cp, int *c)); -void nottystop __P((struct tty *tp, int rw)); -int putc __P((int c, struct clist *q)); -int q_to_b __P((struct clist *q, char *cp, int cc)); -void termioschars __P((struct termios *t)); -int tputchar __P((int c, struct tty *tp)); -int ttcompat __P((struct tty *tp, u_long com, caddr_t data, int flag)); -int ttioctl __P((struct tty *tp, u_long com, void *data, int flag)); -int ttread __P((struct tty *tp, struct uio *uio, int flag)); -void ttrstrt __P((void *tp)); -int ttsetcompat __P((struct tty *tp, u_long *com, caddr_t data, - struct termios *term)); -void ttsetwater __P((struct tty *tp)); -int ttspeedtab __P((int speed, struct speedtab *table)); -int ttstart __P((struct tty *tp)); -void ttwakeup __P((struct tty *tp)); -int ttwrite __P((struct tty *tp, struct uio *uio, int flag)); -void ttwwakeup __P((struct tty *tp)); -void ttyblock __P((struct tty *tp)); -void ttychars __P((struct tty *tp)); -int ttycheckoutq __P((struct tty *tp, int wait)); -int ttyclose __P((struct tty *tp)); -void ttyflush __P((struct tty *tp, int rw)); -void ttyfree __P((struct tty *tp)); -void ttyinfo __P((struct tty *tp)); -int ttyinput __P((int c, struct tty *tp)); -int ttykqfilter __P((dev_t dev, struct knote *kn)); -int ttylclose __P((struct tty *tp, int flag)); -struct tty *ttymalloc __P((struct tty *tp)); -int ttymodem __P((struct tty *tp, int flag)); -int ttyopen __P((dev_t device, struct tty *tp)); -int ttypoll __P((dev_t dev, int events, struct thread *td)); -int ttyread __P((dev_t dev, struct uio *uio, int flag)); -void ttyregister __P((struct tty *tp)); -int ttysleep __P((struct tty *tp, void *chan, int pri, char *wmesg, - int timeout)); -int ttywait __P((struct tty *tp)); -int ttywrite __P((dev_t dev, struct uio *uio, int flag)); -int unputc __P((struct clist *q)); +int b_to_q(char *cp, int cc, struct clist *q); +void catq(struct clist *from, struct clist *to); +void clist_alloc_cblocks(struct clist *q, int ccmax, int ccres); +void clist_free_cblocks(struct clist *q); +int getc(struct clist *q); +void ndflush(struct clist *q, int cc); +char *nextc(struct clist *q, char *cp, int *c); +void nottystop(struct tty *tp, int rw); +int putc(int c, struct clist *q); +int q_to_b(struct clist *q, char *cp, int cc); +void termioschars(struct termios *t); +int tputchar(int c, struct tty *tp); +int ttcompat(struct tty *tp, u_long com, caddr_t data, int flag); +int ttioctl(struct tty *tp, u_long com, void *data, int flag); +int ttread(struct tty *tp, struct uio *uio, int flag); +void ttrstrt(void *tp); +int ttsetcompat(struct tty *tp, u_long *com, caddr_t data, + struct termios *term); +void ttsetwater(struct tty *tp); +int ttspeedtab(int speed, struct speedtab *table); +int ttstart(struct tty *tp); +void ttwakeup(struct tty *tp); +int ttwrite(struct tty *tp, struct uio *uio, int flag); +void ttwwakeup(struct tty *tp); +void ttyblock(struct tty *tp); +void ttychars(struct tty *tp); +int ttycheckoutq(struct tty *tp, int wait); +int ttyclose(struct tty *tp); +void ttyflush(struct tty *tp, int rw); +void ttyfree(struct tty *tp); +void ttyinfo(struct tty *tp); +int ttyinput(int c, struct tty *tp); +int ttykqfilter(dev_t dev, struct knote *kn); +int ttylclose(struct tty *tp, int flag); +struct tty *ttymalloc(struct tty *tp); +int ttymodem(struct tty *tp, int flag); +int ttyopen(dev_t device, struct tty *tp); +int ttypoll(dev_t dev, int events, struct thread *td); +int ttyread(dev_t dev, struct uio *uio, int flag); +void ttyregister(struct tty *tp); +int ttysleep(struct tty *tp, void *chan, int pri, char *wmesg, + int timeout); +int ttywait(struct tty *tp); +int ttywrite(dev_t dev, struct uio *uio, int flag); +int unputc(struct clist *q); #endif /* _KERNEL */ #endif /* !_SYS_TTY_H_ */ Index: head/sys/sys/types.h =================================================================== --- head/sys/sys/types.h (revision 92718) +++ head/sys/sys/types.h (revision 92719) @@ -1,226 +1,226 @@ /*- * 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 * $FreeBSD$ */ #ifndef _SYS_TYPES_H_ #define _SYS_TYPES_H_ #include /* Machine type dependent parameters. */ #include /* includes */ #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 __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; 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 __const char * c_caddr_t; /* core address, pointer to const */ typedef __volatile char *v_caddr_t; /* core address, pointer to volatile */ typedef int32_t daddr_t; /* disk address */ typedef int64_t daddr64_t; /* 64-bit disk address */ typedef u_int32_t u_daddr_t; /* unsigned disk address */ typedef u_int32_t fixpt_t; /* fixed point number */ #ifndef _GID_T_DECLARED #define _GID_T_DECLARED typedef u_int32_t gid_t; /* group id */ #endif 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 */ #ifdef __alpha__ /* XXX should be in */ typedef int64_t segsz_t; /* segment size */ #else typedef int32_t segsz_t; /* segment size */ #endif typedef int32_t swblk_t; /* swap offset */ typedef int32_t ufs_daddr_t; typedef int32_t ufs_time_t; typedef u_int32_t uid_t; /* user id */ #ifdef _KERNEL typedef int boolean_t; typedef u_int64_t uoff_t; typedef struct vm_page *vm_page_t; struct specinfo; typedef u_int32_t udev_t; /* device number */ typedef struct specinfo *dev_t; #define offsetof(type, field) __offsetof(type, field) #else /* !_KERNEL */ typedef u_int32_t dev_t; /* device number */ #define udev_t dev_t #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 /* _POSIX_SOURCE */ #endif /* !_KERNEL */ #ifdef _BSD_CLOCK_T_ typedef _BSD_CLOCK_T_ clock_t; #undef _BSD_CLOCK_T_ #endif #ifdef _BSD_CLOCKID_T_ typedef _BSD_CLOCKID_T_ clockid_t; #undef _BSD_CLOCKID_T_ #endif #ifdef _BSD_FFLAGS_T_ typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */ #undef _BSD_FFLAGS_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 #ifdef _BSD_TIMER_T_ typedef _BSD_TIMER_T_ timer_t; #undef _BSD_TIMER_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 1024U #endif typedef unsigned long fd_mask; #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ #ifndef howmany #define howmany(x, y) (((x) + ((y) - 1U)) / (y)) #endif typedef struct fd_set { fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; } fd_set; #define _fdset_mask(n) ((fd_mask)1 << ((n) % NFDBITS)) #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= _fdset_mask(n)) #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~_fdset_mask(n)) #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & _fdset_mask(n)) #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 __BEGIN_DECLS #ifndef _FTRUNCATE_DECLARED #define _FTRUNCATE_DECLARED -int ftruncate __P((int, off_t)); +int ftruncate(int, off_t); #endif #ifndef _LSEEK_DECLARED #define _LSEEK_DECLARED -off_t lseek __P((int, off_t, int)); +off_t lseek(int, off_t, int); #endif #ifndef _MMAP_DECLARED #define _MMAP_DECLARED -void * mmap __P((void *, size_t, int, int, int, off_t)); +void * mmap(void *, size_t, int, int, int, off_t); #endif #ifndef _TRUNCATE_DECLARED #define _TRUNCATE_DECLARED -int truncate __P((const char *, off_t)); +int truncate(const char *, off_t); #endif __END_DECLS #endif /* !_KERNEL */ #endif /* !_POSIX_SOURCE */ #endif /* !_SYS_TYPES_H_ */ Index: head/sys/sys/uio.h =================================================================== --- head/sys/sys/uio.h (revision 92718) +++ head/sys/sys/uio.h (revision 92719) @@ -1,106 +1,106 @@ /* * Copyright (c) 1982, 1986, 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. * * @(#)uio.h 8.5 (Berkeley) 2/22/94 * $FreeBSD$ */ #ifndef _SYS_UIO_H_ #define _SYS_UIO_H_ /* * XXX * iov_base should be a void *. */ struct iovec { char *iov_base; /* Base address. */ size_t iov_len; /* Length. */ }; enum uio_rw { UIO_READ, UIO_WRITE }; /* Segment flag values. */ enum uio_seg { UIO_USERSPACE, /* from user data space */ UIO_SYSSPACE, /* from system space */ UIO_USERISPACE, /* from user I space */ UIO_NOCOPY /* don't copy, already in object */ }; #ifdef _KERNEL struct uio { struct iovec *uio_iov; int uio_iovcnt; off_t uio_offset; int uio_resid; enum uio_seg uio_segflg; enum uio_rw uio_rw; struct thread *uio_td; }; /* * Limits * * N.B.: UIO_MAXIOV must be no less than IOV_MAX from * which in turn must be no less than _XOPEN_IOV_MAX from . If * we ever make this tunable (probably pointless), then IOV_MAX should be * removed from and applications would be expected to use * sysconf(3) to find out the correct value, or else assume the worst * (_XOPEN_IOV_MAX). Perhaps UIO_MAXIOV should be simply defined as * IOV_MAX. */ #define UIO_MAXIOV 1024 /* max 1K of iov's */ #define UIO_SMALLIOV 8 /* 8 on stack, else malloc */ struct vm_object; -void uio_yield __P((void)); -int uiomove __P((caddr_t, int, struct uio *)); -int uiomoveco __P((caddr_t, int, struct uio *, struct vm_object *)); -int uioread __P((int, struct uio *, struct vm_object *, int *)); -int copyinfrom __P((const void *src, void *dst, size_t len, int seg)); -int copyinstrfrom __P((const void *src, void *dst, size_t len, - size_t *copied, int seg)); +void uio_yield(void); +int uiomove(caddr_t, int, struct uio *); +int uiomoveco(caddr_t, int, struct uio *, struct vm_object *); +int uioread(int, struct uio *, struct vm_object *, int *); +int copyinfrom(const void *src, void *dst, size_t len, int seg); +int copyinstrfrom(const void *src, void *dst, size_t len, + size_t *copied, int seg); #else /* !_KERNEL */ #include __BEGIN_DECLS -ssize_t readv __P((int, const struct iovec *, int)); -ssize_t writev __P((int, const struct iovec *, int)); +ssize_t readv(int, const struct iovec *, int); +ssize_t writev(int, const struct iovec *, int); __END_DECLS #endif /* _KERNEL */ #endif /* !_SYS_UIO_H_ */ Index: head/sys/sys/un.h =================================================================== --- head/sys/sys/un.h (revision 92718) +++ head/sys/sys/un.h (revision 92719) @@ -1,73 +1,73 @@ /* * 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. * * @(#)un.h 8.3 (Berkeley) 2/19/95 * $FreeBSD$ */ #ifndef _SYS_UN_H_ #define _SYS_UN_H_ /* * Definitions for UNIX IPC domain. */ struct sockaddr_un { u_char sun_len; /* sockaddr len including null */ u_char sun_family; /* AF_UNIX */ char sun_path[104]; /* path name (gag) */ }; /* Socket options. */ #define LOCAL_PEERCRED 0x001 /* retrieve peer credentails */ #ifdef _KERNEL struct mbuf; struct socket; struct sockopt; -int uipc_ctloutput __P((struct socket *so, struct sockopt *sopt)); -int uipc_usrreq __P((struct socket *so, int req, struct mbuf *m, - struct mbuf *nam, struct mbuf *control)); -int unp_connect2 __P((struct socket *so, struct socket *so2)); -void unp_dispose __P((struct mbuf *m)); -int unp_externalize __P((struct mbuf *mbuf, struct mbuf **controlp)); -void unp_init __P((void)); +int uipc_ctloutput(struct socket *so, struct sockopt *sopt); +int uipc_usrreq(struct socket *so, int req, struct mbuf *m, + struct mbuf *nam, struct mbuf *control); +int unp_connect2(struct socket *so, struct socket *so2); +void unp_dispose(struct mbuf *m); +int unp_externalize(struct mbuf *mbuf, struct mbuf **controlp); +void unp_init(void); extern struct pr_usrreqs uipc_usrreqs; #else /* !_KERNEL */ /* actual length of an initialized sockaddr_un */ #define SUN_LEN(su) \ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) #endif /* _KERNEL */ #endif /* !_SYS_UN_H_ */ Index: head/sys/sys/user.h =================================================================== --- head/sys/sys/user.h (revision 92718) +++ head/sys/sys/user.h (revision 92719) @@ -1,191 +1,191 @@ /* * Copyright (c) 1982, 1986, 1989, 1991, 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. * * @(#)user.h 8.2 (Berkeley) 9/23/93 * $FreeBSD$ */ #ifndef _SYS_USER_H_ #define _SYS_USER_H_ #include #ifndef _KERNEL /* stuff that *used* to be included by user.h, or is now needed */ #include #include #include #include #include #include #include #include #include #include /* XXX */ #include /* XXX */ #include /* XXX */ #include /* XXX */ #endif /* !_KERNEL */ #ifndef _SYS_RESOURCEVAR_H_ #include #endif #ifndef _SYS_SIGNALVAR_H_ #include #endif /* * KERN_PROC subtype ops return arrays of selected proc structure entries: * * When adding new fields to this structure, ALWAYS add them at the end * and decrease the size of the spare field by the amount of space that * you are adding. Byte aligned data should be added to the ki_sparestring * space; other entries should be added to the ki_spare space. Always * verify that sizeof(struct kinfo_proc) == KINFO_PROC_SIZE when you are * done. If you change the size of this structure, many programs will stop * working! Once you have added the new field, you will need to add code * to initialize it in two places: kern/kern_proc.c in the function * fill_kinfo_proc and in lib/libkvm/kvm_proc.c in the function kvm_proclist. */ #ifdef __alpha__ #define KINFO_PROC_SIZE 912 /* the correct size for kinfo_proc */ #endif #ifdef __ia64__ #define KINFO_PROC_SIZE 888 #endif #ifdef __i386__ #define KINFO_PROC_SIZE 648 /* the correct size for kinfo_proc */ #endif #ifdef __powerpc__ #define KINFO_PROC_SIZE 656 #endif #ifdef __sparc64__ #define KINFO_PROC_SIZE 888 #endif #ifndef KINFO_PROC_SIZE #error "Unknown architecture" #endif #define WMESGLEN 8 /* size of returned wchan message */ #define MTXNAMELEN 8 /* size of returned mutex name */ #define OCOMMLEN 16 /* size of returned ki_ocomm name */ #define COMMLEN 19 /* size of returned ki_comm name */ #define KI_NGROUPS 16 /* number of groups in ki_groups */ #define LOGNAMELEN 17 /* size of returned ki_login */ struct kinfo_proc { int ki_structsize; /* size of this structure */ int ki_layout; /* reserved: layout identifier */ struct pargs *ki_args; /* address of command arguments */ struct proc *ki_paddr; /* address of proc */ struct user *ki_addr; /* kernel virtual addr of u-area */ struct vnode *ki_tracep; /* pointer to trace file */ struct vnode *ki_textvp; /* pointer to executable file */ struct filedesc *ki_fd; /* pointer to open file info */ struct vmspace *ki_vmspace; /* pointer to kernel vmspace struct */ void *ki_wchan; /* sleep address */ pid_t ki_pid; /* Process identifier */ pid_t ki_ppid; /* parent process id */ pid_t ki_pgid; /* process group id */ pid_t ki_tpgid; /* tty process group id */ pid_t ki_sid; /* Process session ID */ pid_t ki_tsid; /* Terminal session ID */ short ki_jobc; /* job control counter */ udev_t ki_tdev; /* controlling tty dev */ sigset_t ki_siglist; /* Signals arrived but not delivered */ sigset_t ki_sigmask; /* Current signal mask */ sigset_t ki_sigignore; /* Signals being ignored */ sigset_t ki_sigcatch; /* Signals being caught by user */ uid_t ki_uid; /* effective user id */ uid_t ki_ruid; /* Real user id */ uid_t ki_svuid; /* Saved effective user id */ gid_t ki_rgid; /* Real group id */ gid_t ki_svgid; /* Saved effective group id */ short ki_ngroups; /* number of groups */ gid_t ki_groups[KI_NGROUPS]; /* groups */ vm_size_t ki_size; /* virtual size */ segsz_t ki_rssize; /* current resident set size in pages */ segsz_t ki_swrss; /* resident set size before last swap */ segsz_t ki_tsize; /* text size (pages) XXX */ segsz_t ki_dsize; /* data size (pages) XXX */ segsz_t ki_ssize; /* stack size (pages) */ u_short ki_xstat; /* Exit status for wait & stop signal */ u_short ki_acflag; /* Accounting flags */ fixpt_t ki_pctcpu; /* %cpu for process during ki_swtime */ u_int ki_estcpu; /* Time averaged value of ki_cpticks */ u_int ki_slptime; /* Time since last blocked */ u_int ki_swtime; /* Time swapped in or out */ u_int64_t ki_runtime; /* Real time in microsec */ struct timeval ki_start; /* starting time */ struct timeval ki_childtime; /* time used by process children */ long ki_flag; /* P_* flags */ long ki_kiflag; /* KI_* flags (below) */ int ki_traceflag; /* Kernel trace points */ char ki_stat; /* S* process status */ char ki_nice; /* Process "nice" value */ char ki_lock; /* Process lock (prevent swap) count */ char ki_rqindex; /* Run queue index */ u_char ki_oncpu; /* Which cpu we are on */ u_char ki_lastcpu; /* Last cpu we were on */ char ki_ocomm[OCOMMLEN+1]; /* command name */ char ki_wmesg[WMESGLEN+1]; /* wchan message */ char ki_login[LOGNAMELEN+1]; /* setlogin name */ char ki_mtxname[MTXNAMELEN+1]; /* mutex name */ char ki_comm[COMMLEN+1]; /* command name */ char ki_sparestrings[85]; /* spare string space */ struct rusage ki_rusage; /* process rusage statistics */ long ki_sflag; /* PS_* flags */ struct priority ki_pri; /* process priority */ long ki_tdflags; /* XXXKSE kthread flag */ struct pcb *ki_pcb; /* kernel virtual addr of pcb */ void *ki_kstack; /* kernel virtual addr of stack */ long ki_spare[22]; /* spare constants */ }; -void fill_kinfo_proc __P((struct proc *, struct kinfo_proc *)); +void fill_kinfo_proc(struct proc *, struct kinfo_proc *); /* ki_sessflag values */ #define KI_CTTY 0x00000001 /* controlling tty vnode active */ #define KI_SLEADER 0x00000002 /* session leader */ #define KI_MTXBLOCK 0x00000004 /* proc blocked on mutex ki_mtxname */ /* * Per process structure containing data that isn't needed in core * when the process isn't running (esp. when swapped out). */ struct user { struct sigacts u_sigacts; /* *p_sigacts */ struct pstats u_stats; /* *p_stats */ /* * Remaining fields for a.out core dumps - not valid at other times! */ struct kinfo_proc u_kproc; /* eproc */ struct md_coredump u_md; /* glop */ }; #endif Index: head/sys/sys/vnode.h =================================================================== --- head/sys/sys/vnode.h (revision 92718) +++ head/sys/sys/vnode.h (revision 92719) @@ -1,694 +1,694 @@ /* * Copyright (c) 1989, 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. * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 * $FreeBSD$ */ #ifndef _SYS_VNODE_H_ #define _SYS_VNODE_H_ /* * XXX - compatability until lockmgr() goes away or all the #includes are * updated. */ #include #include #include #include #include #include #include #include /* * The vnode is the focus of all file activity in UNIX. There is a * unique vnode allocated for each active file, each current directory, * each mounted-on file, text file, and the root. */ /* * Vnode types. VNON means no type. */ enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD }; /* * Vnode tag types. * These are for the benefit of external programs only (e.g., pstat) * and should NEVER be inspected by the kernel. */ enum vtagtype { VT_NON, VT_UFS, VT_NFS, VT_UNUSED, VT_PC, VT_LFS, VT_LOFS, VT_FDESC, VT_PORTAL, VT_NULL, VT_UMAP, VT_KERNFS, VT_PROCFS, VT_AFS, VT_ISOFS, VT_UNION, VT_MSDOSFS, VT_DEVFS, VT_TFS, VT_VFS, VT_CODA, VT_NTFS, VT_HPFS, VT_NWFS, VT_PSEUDOFS, VT_SMBFS }; /* * Each underlying filesystem allocates its own private area and hangs * it from v_data. If non-null, this area is freed in getnewvnode(). */ TAILQ_HEAD(buflists, buf); -typedef int vop_t __P((void *)); +typedef int vop_t(void *); struct namecache; struct vpollinfo { struct mtx vpi_lock; /* lock to protect below */ struct selinfo vpi_selinfo; /* identity of poller(s) */ short vpi_events; /* what they are looking for */ short vpi_revents; /* what has happened */ }; /* * Reading or writing any of these items requires holding the appropriate lock. * v_freelist is locked by the global vnode_free_list mutex. * v_mntvnodes is locked by the global mntvnodes mutex. * v_flag, v_usecount, v_holdcount and v_writecount are * locked by the v_interlock mutex. * v_pollinfo is locked by the lock contained inside it. */ struct vnode { u_long v_flag; /* vnode flags (see below) */ int v_usecount; /* reference count of users */ int v_writecount; /* reference count of writers */ int v_holdcnt; /* page & buffer references */ u_long v_id; /* capability identifier */ struct mount *v_mount; /* ptr to vfs we are in */ vop_t **v_op; /* vnode operations vector */ TAILQ_ENTRY(vnode) v_freelist; /* vnode freelist */ TAILQ_ENTRY(vnode) v_nmntvnodes; /* vnodes for mount point */ struct buflists v_cleanblkhd; /* clean blocklist head */ struct buflists v_dirtyblkhd; /* dirty blocklist head */ LIST_ENTRY(vnode) v_synclist; /* vnodes with dirty buffers */ long v_numoutput; /* num of writes in progress */ enum vtype v_type; /* vnode type */ union { struct mount *vu_mountedhere;/* ptr to mounted vfs (VDIR) */ struct socket *vu_socket; /* unix ipc (VSOCK) */ struct { struct specinfo *vu_specinfo; /* device (VCHR, VBLK) */ SLIST_ENTRY(vnode) vu_specnext; } vu_spec; struct fifoinfo *vu_fifoinfo; /* fifo (VFIFO) */ } v_un; daddr_t v_lastw; /* last write (write cluster) */ daddr_t v_cstart; /* start block of cluster */ daddr_t v_lasta; /* last allocation (cluster) */ int v_clen; /* length of current cluster */ struct vm_object *v_object; /* Place to store VM object */ struct mtx v_interlock; /* lock on usecount and flag */ struct lock v_lock; /* used if fs don't have one */ struct lock *v_vnlock; /* pointer to vnode lock */ enum vtagtype v_tag; /* type of underlying data */ void *v_data; /* private data for fs */ LIST_HEAD(, namecache) v_cache_src; /* Cache entries from us */ TAILQ_HEAD(, namecache) v_cache_dst; /* Cache entries to us */ struct vnode *v_dd; /* .. vnode */ u_long v_ddid; /* .. capability identifier */ struct vpollinfo *v_pollinfo; struct thread *v_vxproc; /* thread owning VXLOCK */ #ifdef DEBUG_LOCKS const char *filename; /* Source file doing locking */ int line; /* Line number doing locking */ #endif }; #define v_mountedhere v_un.vu_mountedhere #define v_socket v_un.vu_socket #define v_rdev v_un.vu_spec.vu_specinfo #define v_specnext v_un.vu_spec.vu_specnext #define v_fifoinfo v_un.vu_fifoinfo #define VN_POLLEVENT(vp, events) \ do { \ if ((vp)->v_pollinfo != NULL && \ (vp)->v_pollinfo->vpi_events & (events)) \ vn_pollevent((vp), (events)); \ } while (0) #define VN_KNOTE(vp, b) \ do { \ if ((vp)->v_pollinfo != NULL) \ KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note, (b)); \ } while (0) /* * Vnode flags. */ #define VROOT 0x00001 /* root of its file system */ #define VTEXT 0x00002 /* vnode is a pure text prototype */ #define VSYSTEM 0x00004 /* vnode being used by kernel */ #define VISTTY 0x00008 /* vnode represents a tty */ #define VXLOCK 0x00100 /* vnode is locked to change underlying type */ #define VXWANT 0x00200 /* thread is waiting for vnode */ #define VBWAIT 0x00400 /* waiting for output to complete */ #define VNOSYNC 0x01000 /* unlinked, stop syncing */ /* open for business 0x01000 */ #define VOBJBUF 0x02000 /* Allocate buffers in VM object */ #define VCOPYONWRITE 0x04000 /* vnode is doing copy-on-write */ #define VAGE 0x08000 /* Insert vnode at head of free list */ #define VOLOCK 0x10000 /* vnode is locked waiting for an object */ #define VOWANT 0x20000 /* a thread is waiting for VOLOCK */ #define VDOOMED 0x40000 /* This vnode is being recycled */ #define VFREE 0x80000 /* This vnode is on the freelist */ /* open for business 0x100000 */ #define VONWORKLST 0x200000 /* On syncer work-list */ #define VMOUNT 0x400000 /* Mount in progress */ #define VOBJDIRTY 0x800000 /* object might be dirty */ /* * Vnode attributes. A field value of VNOVAL represents a field whose value * is unavailable (getattr) or which is not to be changed (setattr). */ struct vattr { enum vtype va_type; /* vnode type (for create) */ u_short va_mode; /* files access mode and type */ short va_nlink; /* number of references to file */ uid_t va_uid; /* owner user id */ gid_t va_gid; /* owner group id */ udev_t va_fsid; /* file system id */ long va_fileid; /* file id */ u_quad_t va_size; /* file size in bytes */ long va_blocksize; /* blocksize preferred for i/o */ struct timespec va_atime; /* time of last access */ struct timespec va_mtime; /* time of last modification */ struct timespec va_ctime; /* time file changed */ u_long va_gen; /* generation number of file */ u_long va_flags; /* flags defined for file */ udev_t va_rdev; /* device the special file represents */ u_quad_t va_bytes; /* bytes of disk space held by file */ u_quad_t va_filerev; /* file modification number */ u_int va_vaflags; /* operations flags, see below */ long va_spare; /* remain quad aligned */ }; /* * Flags for va_vaflags. */ #define VA_UTIMES_NULL 0x01 /* utimes argument was NULL */ #define VA_EXCLUSIVE 0x02 /* exclusive create request */ /* * Flags for ioflag. (high 16 bits used to ask for read-ahead and * help with write clustering) */ #define IO_UNIT 0x01 /* do I/O as atomic unit */ #define IO_APPEND 0x02 /* append write to end */ #define IO_SYNC 0x04 /* do I/O synchronously */ #define IO_NODELOCKED 0x08 /* underlying node already locked */ #define IO_NDELAY 0x10 /* FNDELAY flag set in file table */ #define IO_VMIO 0x20 /* data already in VMIO space */ #define IO_INVAL 0x40 /* invalidate after I/O */ #define IO_ASYNC 0x80 /* bawrite rather then bdwrite */ #define IO_DIRECT 0x100 /* attempt to bypass buffer cache */ #define IO_NOWDRAIN 0x200 /* do not block on wdrain */ /* * Modes. Some values same as Ixxx entries from inode.h for now. */ #define VADMIN 010000 /* permission to administer vnode */ #define VSUID 004000 /* set user id on execution */ #define VSGID 002000 /* set group id on execution */ #define VSVTX 001000 /* save swapped text even after use */ #define VREAD 000400 /* read, write, execute permissions */ #define VWRITE 000200 #define VEXEC 000100 /* * Token indicating no attribute value yet assigned. */ #define VNOVAL (-1) /* * LK_TIMELOCK timeout for vnode locks (used mainly by the pageout daemon) */ #define VLKTIMEOUT (hz / 20 + 1) #ifdef _KERNEL #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_VNODE); #endif /* * Convert between vnode types and inode formats (since POSIX.1 * defines mode word of stat structure in terms of inode formats). */ extern enum vtype iftovt_tab[]; extern int vttoif_tab[]; #define IFTOVT(mode) (iftovt_tab[((mode) & S_IFMT) >> 12]) #define VTTOIF(indx) (vttoif_tab[(int)(indx)]) #define MAKEIMODE(indx, mode) (int)(VTTOIF(indx) | (mode)) /* * Flags to various vnode functions. */ #define SKIPSYSTEM 0x0001 /* vflush: skip vnodes marked VSYSTEM */ #define FORCECLOSE 0x0002 /* vflush: force file closure */ #define WRITECLOSE 0x0004 /* vflush: only close writable files */ #define DOCLOSE 0x0008 /* vclean: close active files */ #define V_SAVE 0x0001 /* vinvalbuf: sync file first */ #define REVOKEALL 0x0001 /* vop_revoke: revoke all aliases */ #define V_WAIT 0x0001 /* vn_start_write: sleep for suspend */ #define V_NOWAIT 0x0002 /* vn_start_write: don't sleep for suspend */ #define V_XSLEEP 0x0004 /* vn_start_write: just return after sleep */ #define VREF(vp) vref(vp) #ifdef DIAGNOSTIC #define VATTR_NULL(vap) vattr_null(vap) #else #define VATTR_NULL(vap) (*(vap) = va_null) /* initialize a vattr */ #endif /* DIAGNOSTIC */ #define NULLVP ((struct vnode *)NULL) #define VNODEOP_SET(f) \ C_SYSINIT(f##init, SI_SUB_VFS, SI_ORDER_SECOND, vfs_add_vnodeops, &f); \ C_SYSUNINIT(f##uninit, SI_SUB_VFS, SI_ORDER_SECOND, vfs_rm_vnodeops, &f); /* * Global vnode data. */ extern struct vnode *rootvnode; /* root (i.e. "/") vnode */ extern int desiredvnodes; /* number of vnodes desired */ extern vm_zone_t namei_zone; extern int prtactive; /* nonzero to call vprint() */ extern struct vattr va_null; /* predefined null vattr structure */ extern int vfs_ioopt; /* * Macro/function to check for client cache inconsistency w.r.t. leasing. */ #define LEASE_READ 0x1 /* Check lease for readers */ #define LEASE_WRITE 0x2 /* Check lease for modifiers */ -extern void (*lease_updatetime) __P((int deltat)); +extern void (*lease_updatetime)(int deltat); #define VSHOULDFREE(vp) \ (!((vp)->v_flag & (VFREE|VDOOMED)) && \ !(vp)->v_holdcnt && !(vp)->v_usecount && \ (!(vp)->v_object || \ !((vp)->v_object->ref_count || (vp)->v_object->resident_page_count))) #define VMIGHTFREE(vp) \ (!((vp)->v_flag & (VFREE|VDOOMED|VXLOCK)) && \ LIST_EMPTY(&(vp)->v_cache_src) && !(vp)->v_usecount) #define VSHOULDBUSY(vp) \ (((vp)->v_flag & VFREE) && \ ((vp)->v_holdcnt || (vp)->v_usecount)) #define VI_LOCK(vp) mtx_lock(&(vp)->v_interlock) #define VI_TRYLOCK(vp) mtx_trylock(&(vp)->v_interlock) #define VI_UNLOCK(vp) mtx_unlock(&(vp)->v_interlock) #endif /* _KERNEL */ /* * Mods for extensibility. */ /* * Flags for vdesc_flags: */ #define VDESC_MAX_VPS 16 /* Low order 16 flag bits are reserved for willrele flags for vp arguments. */ #define VDESC_VP0_WILLRELE 0x0001 #define VDESC_VP1_WILLRELE 0x0002 #define VDESC_VP2_WILLRELE 0x0004 #define VDESC_VP3_WILLRELE 0x0008 #define VDESC_NOMAP_VPP 0x0100 #define VDESC_VPP_WILLRELE 0x0200 /* * VDESC_NO_OFFSET is used to identify the end of the offset list * and in places where no such field exists. */ #define VDESC_NO_OFFSET -1 /* * This structure describes the vnode operation taking place. */ struct vnodeop_desc { int vdesc_offset; /* offset in vector,first for speed */ char *vdesc_name; /* a readable name for debugging */ int vdesc_flags; /* VDESC_* flags */ /* * These ops are used by bypass routines to map and locate arguments. * Creds and procs are not needed in bypass routines, but sometimes * they are useful to (for example) transport layers. * Nameidata is useful because it has a cred in it. */ int *vdesc_vp_offsets; /* list ended by VDESC_NO_OFFSET */ int vdesc_vpp_offset; /* return vpp location */ int vdesc_cred_offset; /* cred location, if any */ int vdesc_thread_offset; /* thread location, if any */ int vdesc_componentname_offset; /* if any */ /* * Finally, we've got a list of private data (about each operation) * for each transport layer. (Support to manage this list is not * yet part of BSD.) */ caddr_t *vdesc_transports; }; #ifdef _KERNEL /* * A list of all the operation descs. */ extern struct vnodeop_desc *vnodeop_descs[]; /* * Interlock for scanning list of vnodes attached to a mountpoint */ extern struct mtx mntvnode_mtx; /* * This macro is very helpful in defining those offsets in the vdesc struct. * * This is stolen from X11R4. I ignored all the fancy stuff for * Crays, so if you decide to port this to such a serious machine, * you might want to consult Intrinsic.h's XtOffset{,Of,To}. */ #define VOPARG_OFFSET(p_type,field) \ ((int) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) #define VOPARG_OFFSETOF(s_type,field) \ VOPARG_OFFSET(s_type*,field) #define VOPARG_OFFSETTO(S_TYPE,S_OFFSET,STRUCT_P) \ ((S_TYPE)(((char*)(STRUCT_P))+(S_OFFSET))) /* * This structure is used to configure the new vnodeops vector. */ struct vnodeopv_entry_desc { struct vnodeop_desc *opve_op; /* which operation this is */ vop_t *opve_impl; /* code implementing this operation */ }; struct vnodeopv_desc { /* ptr to the ptr to the vector where op should go */ vop_t ***opv_desc_vector_p; struct vnodeopv_entry_desc *opv_desc_ops; /* null terminated list */ }; /* * A generic structure. * This can be used by bypass routines to identify generic arguments. */ struct vop_generic_args { struct vnodeop_desc *a_desc; /* other random data follows, presumably */ }; #ifdef DEBUG_VFS_LOCKS /* * Macros to aid in tracing VFS locking problems. Not totally * reliable since if the thread sleeps between changing the lock * state and checking it with the assert, some other thread could * change the state. They are good enough for debugging a single * filesystem using a single-threaded test. I find that 'cvs co src' * is a pretty good test. */ /* * [dfr] Kludge until I get around to fixing all the vfs locking. */ #define IS_LOCKING_VFS(vp) ((vp)->v_tag == VT_UFS \ || (vp)->v_tag == VT_NFS \ || (vp)->v_tag == VT_LFS \ || (vp)->v_tag == VT_ISOFS \ || (vp)->v_tag == VT_MSDOSFS \ || (vp)->v_tag == VT_DEVFS) #define ASSERT_VOP_LOCKED(vp, str) \ do { \ struct vnode *_vp = (vp); \ \ if (_vp && IS_LOCKING_VFS(_vp) && !VOP_ISLOCKED(_vp, NULL)) \ panic("%s: %p is not locked but should be", str, _vp); \ } while (0) #define ASSERT_VOP_UNLOCKED(vp, str) \ do { \ struct vnode *_vp = (vp); \ int lockstate; \ \ if (_vp && IS_LOCKING_VFS(_vp)) { \ lockstate = VOP_ISLOCKED(_vp, curthread); \ if (lockstate == LK_EXCLUSIVE) \ panic("%s: %p is locked but should not be", \ str, _vp); \ } \ } while (0) #define ASSERT_VOP_ELOCKED(vp, str) \ do { \ struct vnode *_vp = (vp); \ \ if (_vp && IS_LOCKING_VFS(_vp) && \ VOP_ISLOCKED(_vp, curthread) != LK_EXCLUSIVE) \ panic("%s: %p is not exclusive locked but should be", \ str, _vp); \ } while (0) #define ASSERT_VOP_ELOCKED_OTHER(vp, str) \ do { \ struct vnode *_vp = (vp); \ \ if (_vp && IS_LOCKING_VFS(_vp) && \ VOP_ISLOCKED(_vp, curthread) != LK_EXCLOTHER) \ panic("%s: %p is not exclusive locked by another thread", \ str, _vp); \ } while (0) #define ASSERT_VOP_SLOCKED(vp, str) \ do { \ struct vnode *_vp = (vp); \ \ if (_vp && IS_LOCKING_VFS(_vp) && \ VOP_ISLOCKED(_vp, NULL) != LK_SHARED) \ panic("%s: %p is not locked shared but should be", \ str, _vp); \ } while (0) #else #define ASSERT_VOP_LOCKED(vp, str) #define ASSERT_VOP_UNLOCKED(vp, str) #endif /* * VOCALL calls an op given an ops vector. We break it out because BSD's * vclean changes the ops vector and then wants to call ops with the old * vector. */ #define VOCALL(OPSV,OFF,AP) (( *((OPSV)[(OFF)])) (AP)) /* * This call works for vnodes in the kernel. */ #define VCALL(VP,OFF,AP) VOCALL((VP)->v_op,(OFF),(AP)) #define VDESC(OP) (& __CONCAT(OP,_desc)) #define VOFFSET(OP) (VDESC(OP)->vdesc_offset) /* * VMIO support inline */ extern int vmiodirenable; static __inline int vn_canvmio(struct vnode *vp) { if (vp && (vp->v_type == VREG || (vmiodirenable && vp->v_type == VDIR))) return(TRUE); return(FALSE); } /* * Finally, include the default set of vnode operations. */ #include "vnode_if.h" /* * Public vnode manipulation functions. */ struct componentname; struct file; struct mount; struct nameidata; struct ostat; struct thread; struct proc; struct stat; struct nstat; struct ucred; struct uio; struct vattr; struct vnode; -extern int (*lease_check_hook) __P((struct vop_lease_args *)); +extern int (*lease_check_hook)(struct vop_lease_args *); -struct vnode *addaliasu __P((struct vnode *vp, udev_t nvp_rdev)); -int bdevvp __P((dev_t dev, struct vnode **vpp)); +struct vnode *addaliasu(struct vnode *vp, udev_t nvp_rdev); +int bdevvp(dev_t dev, struct vnode **vpp); /* cache_* may belong in namei.h. */ -void cache_enter __P((struct vnode *dvp, struct vnode *vp, - struct componentname *cnp)); -int cache_lookup __P((struct vnode *dvp, struct vnode **vpp, - struct componentname *cnp)); -void cache_purge __P((struct vnode *vp)); -void cache_purgevfs __P((struct mount *mp)); -int cache_leaf_test __P((struct vnode *vp)); -void cvtstat __P((struct stat *st, struct ostat *ost)); -void cvtnstat __P((struct stat *sb, struct nstat *nsb)); -int getnewvnode __P((enum vtagtype tag, - struct mount *mp, vop_t **vops, struct vnode **vpp)); -int lease_check __P((struct vop_lease_args *ap)); -int spec_vnoperate __P((struct vop_generic_args *)); -int speedup_syncer __P((void)); +void cache_enter(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp); +int cache_lookup(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp); +void cache_purge(struct vnode *vp); +void cache_purgevfs(struct mount *mp); +int cache_leaf_test(struct vnode *vp); +void cvtstat(struct stat *st, struct ostat *ost); +void cvtnstat(struct stat *sb, struct nstat *nsb); +int getnewvnode(enum vtagtype tag, + struct mount *mp, vop_t **vops, struct vnode **vpp); +int lease_check(struct vop_lease_args *ap); +int spec_vnoperate(struct vop_generic_args *); +int speedup_syncer(void); #define textvp_fullpath(p, rb, rfb) \ vn_fullpath(FIRST_THREAD_IN_PROC(p), (p)->p_textvp, rb, rfb) -int vn_fullpath __P((struct thread *td, struct vnode *vn, - char **retbuf, char **freebuf)); -int vaccess __P((enum vtype type, mode_t file_mode, uid_t uid, gid_t gid, - mode_t acc_mode, struct ucred *cred, int *privused)); -int vaccess_acl_posix1e __P((enum vtype type, uid_t file_uid, +int vn_fullpath(struct thread *td, struct vnode *vn, + char **retbuf, char **freebuf); +int vaccess(enum vtype type, mode_t file_mode, uid_t uid, gid_t gid, + mode_t acc_mode, struct ucred *cred, int *privused); +int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid, struct acl *acl, mode_t acc_mode, - struct ucred *cred, int *privused)); -void vattr_null __P((struct vattr *vap)); -int vcount __P((struct vnode *vp)); -void vdrop __P((struct vnode *)); -int vfinddev __P((dev_t dev, enum vtype type, struct vnode **vpp)); -void vfs_add_vnodeops __P((const void *)); -void vfs_rm_vnodeops __P((const void *)); -int vflush __P((struct mount *mp, int rootrefs, int flags)); -int vget __P((struct vnode *vp, int lockflag, struct thread *td)); -void vgone __P((struct vnode *vp)); -void vgonel __P((struct vnode *vp, struct thread *td)); -void vhold __P((struct vnode *)); -int vinvalbuf __P((struct vnode *vp, int save, struct ucred *cred, - struct thread *td, int slpflag, int slptimeo)); -int vtruncbuf __P((struct vnode *vp, struct ucred *cred, struct thread *td, - off_t length, int blksize)); -void vprint __P((char *label, struct vnode *vp)); -int vrecycle __P((struct vnode *vp, struct mtx *inter_lkp, - struct thread *td)); -int vn_close __P((struct vnode *vp, - int flags, struct ucred *cred, struct thread *td)); -void vn_finished_write __P((struct mount *mp)); -int vn_isdisk __P((struct vnode *vp, int *errp)); -int vn_lock __P((struct vnode *vp, int flags, struct thread *td)); + struct ucred *cred, int *privused); +void vattr_null(struct vattr *vap); +int vcount(struct vnode *vp); +void vdrop(struct vnode *); +int vfinddev(dev_t dev, enum vtype type, struct vnode **vpp); +void vfs_add_vnodeops(const void *); +void vfs_rm_vnodeops(const void *); +int vflush(struct mount *mp, int rootrefs, int flags); +int vget(struct vnode *vp, int lockflag, struct thread *td); +void vgone(struct vnode *vp); +void vgonel(struct vnode *vp, struct thread *td); +void vhold(struct vnode *); +int vinvalbuf(struct vnode *vp, int save, struct ucred *cred, + struct thread *td, int slpflag, int slptimeo); +int vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td, + off_t length, int blksize); +void vprint(char *label, struct vnode *vp); +int vrecycle(struct vnode *vp, struct mtx *inter_lkp, + struct thread *td); +int vn_close(struct vnode *vp, + int flags, struct ucred *cred, struct thread *td); +void vn_finished_write(struct mount *mp); +int vn_isdisk(struct vnode *vp, int *errp); +int vn_lock(struct vnode *vp, int flags, struct thread *td); #ifdef DEBUG_LOCKS -int debug_vn_lock __P((struct vnode *vp, int flags, struct thread *p, - const char *filename, int line)); +int debug_vn_lock(struct vnode *vp, int flags, struct thread *p, + const char *filename, int line); #define vn_lock(vp,flags,p) debug_vn_lock(vp,flags,p,__FILE__,__LINE__) #endif -int vn_mkdir __P((char *path, int mode, enum uio_seg segflg, struct thread *td)); -int vn_open __P((struct nameidata *ndp, int *flagp, int cmode)); -int vn_open_cred __P((struct nameidata *ndp, int *flagp, int cmode, - struct ucred *cred)); -void vn_pollevent __P((struct vnode *vp, int events)); -void vn_pollgone __P((struct vnode *vp)); -int vn_pollrecord __P((struct vnode *vp, struct thread *p, int events)); -int vn_rdwr __P((enum uio_rw rw, struct vnode *vp, caddr_t base, +int vn_mkdir(char *path, int mode, enum uio_seg segflg, struct thread *td); +int vn_open(struct nameidata *ndp, int *flagp, int cmode); +int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, + struct ucred *cred); +void vn_pollevent(struct vnode *vp, int events); +void vn_pollgone(struct vnode *vp); +int vn_pollrecord(struct vnode *vp, struct thread *p, int events); +int vn_rdwr(enum uio_rw rw, struct vnode *vp, caddr_t base, int len, off_t offset, enum uio_seg segflg, int ioflg, - struct ucred *cred, int *aresid, struct thread *td)); -int vn_rdwr_inchunks __P((enum uio_rw rw, struct vnode *vp, caddr_t base, + struct ucred *cred, int *aresid, struct thread *td); +int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, caddr_t base, int len, off_t offset, enum uio_seg segflg, int ioflg, - struct ucred *cred, int *aresid, struct thread *td)); -int vn_stat __P((struct vnode *vp, struct stat *sb, struct thread *td)); -int vn_start_write __P((struct vnode *vp, struct mount **mpp, int flags)); -dev_t vn_todev __P((struct vnode *vp)); -int vn_write_suspend_wait __P((struct vnode *vp, struct mount *mp, - int flags)); -int vn_writechk __P((struct vnode *vp)); -int vn_extattr_get __P((struct vnode *vp, int ioflg, int attrnamespace, - const char *attrname, int *buflen, char *buf, struct thread *td)); -int vn_extattr_set __P((struct vnode *vp, int ioflg, int attrnamespace, - const char *attrname, int buflen, char *buf, struct thread *td)); + struct ucred *cred, int *aresid, struct thread *td); +int vn_stat(struct vnode *vp, struct stat *sb, struct thread *td); +int vn_start_write(struct vnode *vp, struct mount **mpp, int flags); +dev_t vn_todev(struct vnode *vp); +int vn_write_suspend_wait(struct vnode *vp, struct mount *mp, + int flags); +int vn_writechk(struct vnode *vp); +int vn_extattr_get(struct vnode *vp, int ioflg, int attrnamespace, + const char *attrname, int *buflen, char *buf, struct thread *td); +int vn_extattr_set(struct vnode *vp, int ioflg, int attrnamespace, + const char *attrname, int buflen, char *buf, struct thread *td); int vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace, const char *attrname, struct thread *td); -int vfs_cache_lookup __P((struct vop_lookup_args *ap)); -int vfs_object_create __P((struct vnode *vp, struct thread *td, - struct ucred *cred)); -void vfs_timestamp __P((struct timespec *)); -void vfs_write_resume __P((struct mount *mp)); -void vfs_write_suspend __P((struct mount *mp)); -int vop_stdbmap __P((struct vop_bmap_args *)); -int vop_stdgetwritemount __P((struct vop_getwritemount_args *)); -int vop_stdgetpages __P((struct vop_getpages_args *)); -int vop_stdinactive __P((struct vop_inactive_args *)); -int vop_stdislocked __P((struct vop_islocked_args *)); -int vop_stdlock __P((struct vop_lock_args *)); -int vop_stdputpages __P((struct vop_putpages_args *)); -int vop_stdunlock __P((struct vop_unlock_args *)); -int vop_noislocked __P((struct vop_islocked_args *)); -int vop_nolock __P((struct vop_lock_args *)); -int vop_nopoll __P((struct vop_poll_args *)); -int vop_nounlock __P((struct vop_unlock_args *)); -int vop_stdpathconf __P((struct vop_pathconf_args *)); -int vop_stdpoll __P((struct vop_poll_args *)); -int vop_revoke __P((struct vop_revoke_args *)); -int vop_sharedlock __P((struct vop_lock_args *)); -int vop_eopnotsupp __P((struct vop_generic_args *ap)); -int vop_ebadf __P((struct vop_generic_args *ap)); -int vop_einval __P((struct vop_generic_args *ap)); -int vop_enotty __P((struct vop_generic_args *ap)); -int vop_defaultop __P((struct vop_generic_args *ap)); -int vop_null __P((struct vop_generic_args *ap)); -int vop_panic __P((struct vop_generic_args *ap)); -int vop_stdcreatevobject __P((struct vop_createvobject_args *ap)); -int vop_stddestroyvobject __P((struct vop_destroyvobject_args *ap)); -int vop_stdgetvobject __P((struct vop_getvobject_args *ap)); +int vfs_cache_lookup(struct vop_lookup_args *ap); +int vfs_object_create(struct vnode *vp, struct thread *td, + struct ucred *cred); +void vfs_timestamp(struct timespec *); +void vfs_write_resume(struct mount *mp); +void vfs_write_suspend(struct mount *mp); +int vop_stdbmap(struct vop_bmap_args *); +int vop_stdgetwritemount(struct vop_getwritemount_args *); +int vop_stdgetpages(struct vop_getpages_args *); +int vop_stdinactive(struct vop_inactive_args *); +int vop_stdislocked(struct vop_islocked_args *); +int vop_stdlock(struct vop_lock_args *); +int vop_stdputpages(struct vop_putpages_args *); +int vop_stdunlock(struct vop_unlock_args *); +int vop_noislocked(struct vop_islocked_args *); +int vop_nolock(struct vop_lock_args *); +int vop_nopoll(struct vop_poll_args *); +int vop_nounlock(struct vop_unlock_args *); +int vop_stdpathconf(struct vop_pathconf_args *); +int vop_stdpoll(struct vop_poll_args *); +int vop_revoke(struct vop_revoke_args *); +int vop_sharedlock(struct vop_lock_args *); +int vop_eopnotsupp(struct vop_generic_args *ap); +int vop_ebadf(struct vop_generic_args *ap); +int vop_einval(struct vop_generic_args *ap); +int vop_enotty(struct vop_generic_args *ap); +int vop_defaultop(struct vop_generic_args *ap); +int vop_null(struct vop_generic_args *ap); +int vop_panic(struct vop_generic_args *ap); +int vop_stdcreatevobject(struct vop_createvobject_args *ap); +int vop_stddestroyvobject(struct vop_destroyvobject_args *ap); +int vop_stdgetvobject(struct vop_getvobject_args *ap); -void vfree __P((struct vnode *)); -void vput __P((struct vnode *vp)); -void vrele __P((struct vnode *vp)); -void vref __P((struct vnode *vp)); -void vbusy __P((struct vnode *vp)); +void vfree(struct vnode *); +void vput(struct vnode *vp); +void vrele(struct vnode *vp); +void vref(struct vnode *vp); +void vbusy(struct vnode *vp); void v_addpollinfo(struct vnode *vp); extern vop_t **default_vnodeop_p; extern vop_t **spec_vnodeop_p; extern vop_t **dead_vnodeop_p; #endif /* _KERNEL */ #endif /* !_SYS_VNODE_H_ */ Index: head/sys/sys/wait.h =================================================================== --- head/sys/sys/wait.h (revision 92718) +++ head/sys/sys/wait.h (revision 92719) @@ -1,163 +1,163 @@ /* * Copyright (c) 1982, 1986, 1989, 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. * * @(#)wait.h 8.2 (Berkeley) 7/10/94 * $FreeBSD$ */ #ifndef _SYS_WAIT_H_ #define _SYS_WAIT_H_ /* * This file holds definitions relevant to the wait4 system call * and the alternate interfaces that use it (wait, wait3, waitpid). */ /* * Macros to test the exit status returned by wait * and extract the relevant values. */ #ifdef _POSIX_SOURCE #define _W_INT(i) (i) #else #define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */ #define WCOREFLAG 0200 #endif #define _WSTATUS(x) (_W_INT(x) & 0177) #define _WSTOPPED 0177 /* _WSTATUS if process is stopped */ #define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED) #define WSTOPSIG(x) (_W_INT(x) >> 8) #define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0) #define WTERMSIG(x) (_WSTATUS(x)) #define WIFEXITED(x) (_WSTATUS(x) == 0) #define WEXITSTATUS(x) (_W_INT(x) >> 8) #ifndef _POSIX_SOURCE #define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG) #define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) #define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED) #endif /* * Option bits for the third argument of wait4. WNOHANG causes the * wait to not hang if there are no stopped or terminated processes, rather * returning an error indication in this case (pid==0). WUNTRACED * indicates that the caller should receive status about untraced children * which stop due to signals. If children are stopped and a wait without * this option is done, it is as though they were still running... nothing * about them is returned. */ #define WNOHANG 1 /* don't hang in wait */ #define WUNTRACED 2 /* tell about stopped, untraced children */ #define WLINUXCLONE 0x80000000 /* wait for kthread spawned from linux_clone */ #ifndef _POSIX_SOURCE /* POSIX extensions and 4.2/4.3 compatibility: */ /* * Tokens for special values of the "pid" parameter to wait4. */ #define WAIT_ANY (-1) /* any process */ #define WAIT_MYPGRP 0 /* any process in my process group */ #include /* * Deprecated: * Structure of the information in the status word returned by wait4. * If w_stopval==WSTOPPED, then the second structure describes * the information returned, else the first. */ union wait { int w_status; /* used in syscall */ /* * Terminated process status. */ struct { #if BYTE_ORDER == LITTLE_ENDIAN unsigned int w_Termsig:7, /* termination signal */ w_Coredump:1, /* core dump indicator */ w_Retcode:8, /* exit code if w_termsig==0 */ w_Filler:16; /* upper bits filler */ #endif #if BYTE_ORDER == BIG_ENDIAN unsigned int w_Filler:16, /* upper bits filler */ w_Retcode:8, /* exit code if w_termsig==0 */ w_Coredump:1, /* core dump indicator */ w_Termsig:7; /* termination signal */ #endif } w_T; /* * Stopped process status. Returned * only for traced children unless requested * with the WUNTRACED option bit. */ struct { #if BYTE_ORDER == LITTLE_ENDIAN unsigned int w_Stopval:8, /* == W_STOPPED if stopped */ w_Stopsig:8, /* signal that stopped us */ w_Filler:16; /* upper bits filler */ #endif #if BYTE_ORDER == BIG_ENDIAN unsigned int w_Filler:16, /* upper bits filler */ w_Stopsig:8, /* signal that stopped us */ w_Stopval:8; /* == W_STOPPED if stopped */ #endif } w_S; }; #define w_termsig w_T.w_Termsig #define w_coredump w_T.w_Coredump #define w_retcode w_T.w_Retcode #define w_stopval w_S.w_Stopval #define w_stopsig w_S.w_Stopsig #define WSTOPPED _WSTOPPED #endif /* _POSIX_SOURCE */ #ifndef _KERNEL #include #include __BEGIN_DECLS struct rusage; /* forward declaration */ -pid_t wait __P((int *)); -pid_t waitpid __P((pid_t, int *, int)); +pid_t wait(int *); +pid_t waitpid(pid_t, int *, int); #ifndef _POSIX_SOURCE -pid_t wait3 __P((int *, int, struct rusage *)); -pid_t wait4 __P((pid_t, int *, int, struct rusage *)); +pid_t wait3(int *, int, struct rusage *); +pid_t wait4(pid_t, int *, int, struct rusage *); #endif __END_DECLS #endif #endif