param.h revision e913d9ec73b142628c1e26d0225755d49866d9e3
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 2N/A/* All Rights Reserved */ 2N/A * University Copyright- Copyright (c) 1982, 1986, 1988 2N/A * The Regents of the University of California 2N/A * All Rights Reserved 2N/A * University Acknowledgment- Portions of this document are derived from 2N/A * software developed by the University of California, Berkeley, and its 2N/A#
ifndef _ASM /* Avoid typedef headaches for assembly files */ 2N/A * Fundamental variables; don't change too often. 2N/A * _POSIX_VDISABLE has historically been defined in <sys/param.h> since 2N/A * an early merge with AT&T source. It has also historically been defined 2N/A * Subsequent versions of the IEEE Standard as well as the X/Open 2N/A * specifications required that _POSIX_VDISABLE be defined in <unistd.h> 2N/A * while still allowing for it's existence in other headers. With the 2N/A * introduction of XPG6, _POSIX_VDISABLE can only be defined in <unistd.h>. 2N/A#
endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */ 2N/A#
define MAX_INPUT 512 /* Maximum bytes stored in the input queue */ 2N/A#
define MAX_CANON 256 /* Maximum bytes for canonical processing */ #
define MAXUID 2147483647 /* max user id */#
define MAXLINK 32767 /* max links */#
define MINEPHUID 0x80000000u /* min ephemeral user id */#
define NMOUNT 40 /* est. of # mountable fs for quota calc */#
define CANBSIZ 256 /* max size of typewriter line */#
define NOFILE 20 /* this define is here for */ /* compatibility purposes only */ /* and will be removed in a */ * These define the maximum and minimum allowable values of the * configurable parameter NGROUPS_MAX. * NGROUPS_MAX_DEFAULT: *MUST* match NGROUPS_MAX value in limits.h. * Remember that the NFS protocol must rev. before this can be increased * Default process priority. Keep it in sync with limits.h. * Fundamental constants of the implementation--cannot be changed easily. #
define NBPW sizeof (
int)
/* number of bytes in an integer */#
define CMASK 0
22 /* default mask for file creation */#
define CDLIMIT (
1L<<
11)
/* default max write address */#
define NBPS 0x20000 /* Number of bytes per segment */#
define NBPSCTR 512 /* Bytes per disk sector. */#
define UBSIZE 512 /* unix block size. */#
define SCTRSHFT 9 /* Shift for BPSECT. */#
define lobyte(X) (((
unsigned char *)&(X))[0])
#
define hibyte(X) (((
unsigned char *)&(X))[
1])
#
define lobyte(X) (((
unsigned char *)&(X))[
1])
#
define hibyte(X) (((
unsigned char *)&(X))[0])
/* REMOTE -- whether machine is primary, secondary, or regular */ #
define SYSNAME 9 /* # chars in system name */ * MAXPATHLEN defines the longest permissible path length, * including the terminating null, after expanding symbolic links. * TYPICALMAXPATHLEN is used in a few places as an optimization * with a local buffer on the stack to avoid kmem_alloc(). * 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 * MAXNAMELEN is the length (including the terminating null) of * the longest permissible file (component) name. * MAXLINKNAMELEN defines the longest possible permitted datalink name, * including the terminating NUL. Note that this must not be larger * than related networking constants such as LIFNAMSIZ. * The following are defined to be the same as * needed for pipe and FIFO compatibility. #
ifndef PIPE_BUF /* max # bytes atomic in write to a pipe */#
ifndef PIPE_MAX /* max # bytes written to a pipe in a write */#
define NBBY 8 /* number of bits per byte *//* macros replacing interleaving functions */ * File system parameters and macros. * The file system is made out of blocks of at most MAXBSIZE units, * with smaller units (fragments) only in the last direct block. * MAXBSIZE primarily determines the size of buffers in the buffer * pool. It may be made larger without any effect on existing * file systems; however making it smaller make make some file * Note that the blocked devices are assumed to have DEV_BSIZE * "sectors" and that fragments must be some multiple of this size. #
define btodb(
bytes)
/* calculates (bytes / DEV_BSIZE) */ \
#
define dbtob(
db)
/* calculates (db * DEV_BSIZE) */ \
/* 64 bit versions of btodb and dbtob */ #
define lbtodb(
bytes)
/* calculates (bytes / DEV_BSIZE) */ \
#
define ldbtob(
db)
/* calculates (db * DEV_BSIZE) */ \
#
ifndef _ASM /* Avoid typedef headaches for assembly files */ * Size of arg list passed in by user. * Scale factor for scaled integers used to count * %cpu time and load averages. #
define FSHIFT 8 /* bits to right of fixed binary point */ * Delay units are in microseconds. * XXX These macros are not part of the DDI! #
endif /* defined(_KERNEL) && !defined(_ASM) */ * The following is to free utilities from machine dependencies within * an architecture. Must be included after definition of DEV_BSIZE. #
endif /* defined(_KERNEL) && !defined(_ASM) */ * These three variables have been added within the #if defined(lint) * below to ensure visibility to lint. This is a short term workaround * to handle poor interaction between SS12 lint and these variables. * CR 6742611 has been logged to address these issues. * Implementation architecture independent sections of the kernel use extern const unsigned int _nbpg;
#
endif /* defined(_KERNEL) && !defined(_ASM) */#
endif /* defined(_MACHDEP) */ * Some random macros for units conversion. * These are machine independent but contain constants (*PAGESHIFT) which * are only defined in the machine dependent file. * MMU pages to bytes, and back (with and without rounding) * 2 versions of pages to disk blocks * pages to bytes, and back (with and without rounding) * Large Files: The explicit cast of x to unsigned int is deliberately * removed as part of large files work. We pass longlong values to * Cast the input to ptob() to be a page count. This enforces 64-bit * math on 64-bit kernels. For 32-bit kernels, callers must explicitly * cast the input to be a 64-bit type if values greater than 4GB/PAGESIZE * disk blocks to pages, rounded and truncated * POSIX.4 related configuration parameters #
else /* (defined(_KERNEL) || defined(_KMEMUSER)) */ * The following are assorted machine dependent values which can be * obtained in a machine independent manner through sysconf(2) or * sysinfo(2). In order to guarantee that these provide the expected * value at all times, the System Private interface (leading underscore) extern long _sysconf(
int);
/* System Private interface to sysconf() */ #
endif /* !defined(_ASM) */#
endif /* (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP) */#
endif /* _SYS_PARAM_H */