Annotation of kernel/bsd/sys/systm.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
        !             3:  *
        !             4:  * @APPLE_LICENSE_HEADER_START@
        !             5:  * 
        !             6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
        !             7:  * Reserved.  This file contains Original Code and/or Modifications of
        !             8:  * Original Code as defined in and that are subject to the Apple Public
        !             9:  * Source License Version 1.1 (the "License").  You may not use this file
        !            10:  * except in compliance with the License.  Please obtain a copy of the
        !            11:  * License at http://www.apple.com/publicsource and read it before using
        !            12:  * this file.
        !            13:  * 
        !            14:  * The Original Code and all software distributed under the License are
        !            15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
        !            16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
        !            17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
        !            18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
        !            19:  * License for the specific language governing rights and limitations
        !            20:  * under the License.
        !            21:  * 
        !            22:  * @APPLE_LICENSE_HEADER_END@
        !            23:  */
        !            24: 
        !            25: /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
        !            26: /*-
        !            27:  * Copyright (c) 1982, 1988, 1991, 1993
        !            28:  *     The Regents of the University of California.  All rights reserved.
        !            29:  * (c) UNIX System Laboratories, Inc.
        !            30:  * All or some portions of this file are derived from material licensed
        !            31:  * to the University of California by American Telephone and Telegraph
        !            32:  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
        !            33:  * the permission of UNIX System Laboratories, Inc.
        !            34:  *
        !            35:  * Redistribution and use in source and binary forms, with or without
        !            36:  * modification, are permitted provided that the following conditions
        !            37:  * are met:
        !            38:  * 1. Redistributions of source code must retain the above copyright
        !            39:  *    notice, this list of conditions and the following disclaimer.
        !            40:  * 2. Redistributions in binary form must reproduce the above copyright
        !            41:  *    notice, this list of conditions and the following disclaimer in the
        !            42:  *    documentation and/or other materials provided with the distribution.
        !            43:  * 3. All advertising materials mentioning features or use of this software
        !            44:  *    must display the following acknowledgement:
        !            45:  *     This product includes software developed by the University of
        !            46:  *     California, Berkeley and its contributors.
        !            47:  * 4. Neither the name of the University nor the names of its contributors
        !            48:  *    may be used to endorse or promote products derived from this software
        !            49:  *    without specific prior written permission.
        !            50:  *
        !            51:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
        !            52:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            53:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            54:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
        !            55:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            56:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            57:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            58:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            59:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            60:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            61:  * SUCH DAMAGE.
        !            62:  *
        !            63:  *     @(#)systm.h     8.7 (Berkeley) 3/29/95
        !            64:  */
        !            65: 
        !            66: /*
        !            67:  * The `securelevel' variable controls the security level of the system.
        !            68:  * It can only be decreased by process 1 (/sbin/init).
        !            69:  *
        !            70:  * Security levels are as follows:
        !            71:  *   -1        permannently insecure mode - always run system in level 0 mode.
        !            72:  *    0        insecure mode - immutable and append-only flags make be turned off.
        !            73:  *     All devices may be read or written subject to permission modes.
        !            74:  *    1        secure mode - immutable and append-only flags may not be changed;
        !            75:  *     raw disks of mounted filesystems, /dev/mem, and /dev/kmem are
        !            76:  *     read-only.
        !            77:  *    2        highly secure mode - same as (1) plus raw disks are always
        !            78:  *     read-only whether mounted or not. This level precludes tampering 
        !            79:  *     with filesystems by unmounting them, but also inhibits running
        !            80:  *     newfs while the system is secured.
        !            81:  *
        !            82:  * In normal operation, the system runs in level 0 mode while single user
        !            83:  * and in level 1 mode while multiuser. If level 2 mode is desired while
        !            84:  * running multiuser, it can be set in the multiuser startup script
        !            85:  * (/etc/rc.local) using sysctl(1). If it is desired to run the system
        !            86:  * in level 0 mode while multiuser, initialize the variable securelevel
        !            87:  * in /sys/kern/kern_sysctl.c to -1. Note that it is NOT initialized to
        !            88:  * zero as that would allow the vmunix binary to be patched to -1.
        !            89:  * Without initialization, securelevel loads in the BSS area which only
        !            90:  * comes into existence when the kernel is loaded and hence cannot be
        !            91:  * patched by a stalking hacker.
        !            92:  */
        !            93: 
        !            94: #ifndef _SYS_SYSTM_H_
        !            95: #define        _SYS_SYSTM_H_
        !            96: 
        !            97: #include <sys/types.h>
        !            98: #include <sys/time.h>
        !            99: #include <sys/tty.h>
        !           100: #include <sys/vm.h>
        !           101:  
        !           102: extern int securelevel;                /* system security level */
        !           103: extern const char *panicstr;   /* panic message */
        !           104: extern char version[];         /* system version */
        !           105: extern char copyright[];       /* system copyright */
        !           106: 
        !           107: extern int nblkdev;            /* number of entries in bdevsw */
        !           108: extern int nchrdev;            /* number of entries in cdevsw */
        !           109: 
        !           110: extern dev_t rootdev;          /* root device */
        !           111: extern struct vnode *rootvp;   /* vnode equivalent to above */
        !           112: 
        !           113: extern struct sysent {         /* system call table */
        !           114:        int16_t         sy_narg;        /* number of args */
        !           115:        int16_t         sy_parallel;/* can execute in parallel */
        !           116:        int32_t         (*sy_call)();   /* implementing function */
        !           117: } sysent[];
        !           118: extern int nsysent;
        !           119: 
        !           120: extern int     boothowto;      /* reboot flags, from console subsystem */
        !           121: extern int     show_space;
        !           122: 
        !           123: #include <sys/cdefs.h>
        !           124: 
        !           125: /*
        !           126:  * General function declarations.
        !           127:  */
        !           128: int    nullop __P((void));
        !           129: int    enodev ();              /* avoid actual prototype for multiple use */
        !           130: void   enodev_strat();
        !           131: int    nulldev();
        !           132: int    enoioctl __P((void));
        !           133: int    enxio __P((void));
        !           134: int    eopnotsupp __P((void));
        !           135: int    einval __P((void));
        !           136: int    seltrue __P((dev_t dev, int which, struct proc *p));
        !           137: void   *hashinit __P((int count, int type, u_long *hashmask));
        !           138: int    nosys __P((struct proc *, void *, register_t *));
        !           139: 
        !           140: #ifdef __GNUC__
        !           141: volatile void  panic __P((const char *, ...));
        !           142: #else
        !           143: void   panic __P((const char *, ...));
        !           144: #endif
        !           145: void   tablefull __P((const char *));
        !           146: void   addlog __P((const char *, ...));
        !           147: void   log __P((int, const char *, ...));
        !           148: void   printf __P((const char *, ...)) __attribute__ ((format (printf, 1, 2)));
        !           149: int    sprintf __P((char *buf, const char *, ...)) __attribute__ ((format (printf, 2, 3)));
        !           150: void   kprintf __P((const char *, ...)) __attribute__ ((format (printf, 1, 2)));
        !           151: void   ttyprintf __P((struct tty *, const char *, ...)) __attribute__ ((format (printf, 2, 3)));
        !           152: 
        !           153: void   bcopy __P((const void *from, void *to, size_t len));
        !           154: void   ovbcopy __P((const void *from, void *to, size_t len));
        !           155: void   bzero __P((void *buf, size_t len));
        !           156: 
        !           157: int    copystr __P((void *kfaddr, void *kdaddr, size_t len, size_t *done));
        !           158: int    copyinstr __P((void *udaddr, void *kaddr, size_t len, size_t *done));
        !           159: int    copyoutstr __P((void *kaddr, void *udaddr, size_t len, size_t *done));
        !           160: int    copyin __P((void *udaddr, void *kaddr, size_t len));
        !           161: int    copyout __P((void *kaddr, void *udaddr, size_t len));
        !           162: int    copywithin __P((void *saddr, void *daddr, size_t len));
        !           163: 
        !           164: int    fubyte __P((void *base));
        !           165: #ifdef notdef
        !           166: int    fuibyte __P((void *base));
        !           167: #endif
        !           168: int    subyte __P((void *base, int byte));
        !           169: int    suibyte __P((void *base, int byte));
        !           170: long   fuword __P((void *base));
        !           171: long   fuiword __P((void *base));
        !           172: int    suword __P((void *base, long word));
        !           173: int    suiword __P((void *base, long word));
        !           174: 
        !           175: int    hzto __P((struct timeval *tv));
        !           176: typedef void (*timeout_fcn_t)(void *);
        !           177: void   timeout __P((void (*)(void *), void *arg, int ticks));
        !           178: int    untimeout __P((void (*)(void *), void *arg));
        !           179: void   realitexpire __P((void *));
        !           180: 
        !           181: void   hardclock __P((caddr_t pc, int ps));
        !           182: void   gatherstats __P((caddr_t pc, int ps));
        !           183: 
        !           184: void   initclocks __P((void));
        !           185: 
        !           186: void   startprofclock __P((struct proc *));
        !           187: void   stopprofclock __P((struct proc *));
        !           188: void   setstatclockrate __P((int hzrate));
        !           189:   
        !           190: #include <libkern/libkern.h>
        !           191: 
        !           192: #ifdef DDB
        !           193: /* debugger entry points */
        !           194: int    Debugger __P((void));   /* in DDB only */
        !           195: int    read_symtab_from_file __P((struct proc *,struct vnode *,const char *));
        !           196: #endif
        !           197: #endif /* !_SYS_SYSTM_H_ */
        !           198: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.