1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 1996-2003 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gate /* 30*7c478bd9Sstevel@tonic-gate * <mkslocal.h>, POSIX Version - local <mks.h> requirements 31*7c478bd9Sstevel@tonic-gate * 32*7c478bd9Sstevel@tonic-gate * This generic POSIX version should be used as a template for creation of 33*7c478bd9Sstevel@tonic-gate * any new <mkslocal.h> file. 34*7c478bd9Sstevel@tonic-gate * 35*7c478bd9Sstevel@tonic-gate * Copyright 1985, 1993 by Mortice Kern Systems Inc. All rights reserved. 36*7c478bd9Sstevel@tonic-gate * 37*7c478bd9Sstevel@tonic-gate * $Header: /rd/h/posix/rcs/mkslocal.h 1.168 1995/06/21 20:33:29 jeffhe Exp mark $ 38*7c478bd9Sstevel@tonic-gate */ 39*7c478bd9Sstevel@tonic-gate 40*7c478bd9Sstevel@tonic-gate #if 0 /* not required for POSIX systems; here for documentation only */ 41*7c478bd9Sstevel@tonic-gate 42*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate #ifndef VERSION 45*7c478bd9Sstevel@tonic-gate #define VERSION "MKS InterOpen I/XCU 4.3 SB" /* Used for version# */ 46*7c478bd9Sstevel@tonic-gate #endif 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate 49*7c478bd9Sstevel@tonic-gate #define name-of-system 1 /* for identifying system (i.e. BSD, SYSV, 50*7c478bd9Sstevel@tonic-gate * DOS, etc) 51*7c478bd9Sstevel@tonic-gate */ 52*7c478bd9Sstevel@tonic-gate 53*7c478bd9Sstevel@tonic-gate #ifndef __STDC__ 54*7c478bd9Sstevel@tonic-gate /* For non-ANSI C compilers, we need to define 55*7c478bd9Sstevel@tonic-gate * the character encoding for some special control characters 56*7c478bd9Sstevel@tonic-gate * If these are NOT defined here, then <mks.h> will use 57*7c478bd9Sstevel@tonic-gate * the ASCII encodings as the default values. 58*7c478bd9Sstevel@tonic-gate * 59*7c478bd9Sstevel@tonic-gate * For ANSI C compilers, there are special C character constants supported 60*7c478bd9Sstevel@tonic-gate * by the compiler. <mks.h> will properly handle this. 61*7c478bd9Sstevel@tonic-gate * 62*7c478bd9Sstevel@tonic-gate */ 63*7c478bd9Sstevel@tonic-gate #define M_ALERT '\7' /* ASCII encoding for \a */ 64*7c478bd9Sstevel@tonic-gate #define M_VTAB '\13' /* ASCII encoding for <VT> */ 65*7c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate 68*7c478bd9Sstevel@tonic-gate /* M_ESCAPE - the system default character encoding for the <ESC> character 69*7c478bd9Sstevel@tonic-gate * If this is not defined here, then <mks.h> will 70*7c478bd9Sstevel@tonic-gate * default to use the ASCII encodings. 71*7c478bd9Sstevel@tonic-gate */ 72*7c478bd9Sstevel@tonic-gate #define M_ESCAPE '\033' /* ASCII default code for <ESC> */ 73*7c478bd9Sstevel@tonic-gate 74*7c478bd9Sstevel@tonic-gate #define SETVBUF(fp,bp,f,s) setvbuf(fp,f,bp,s) /* for some SysV and Xenix 75*7c478bd9Sstevel@tonic-gate * systems, which have unusual 76*7c478bd9Sstevel@tonic-gate * calling sequences 77*7c478bd9Sstevel@tonic-gate */ 78*7c478bd9Sstevel@tonic-gate 79*7c478bd9Sstevel@tonic-gate #define M_DEFAULT_PATH "/bin:/usr/bin" 80*7c478bd9Sstevel@tonic-gate /* Default PATH. Not used yet. 81*7c478bd9Sstevel@tonic-gate */ 82*7c478bd9Sstevel@tonic-gate 83*7c478bd9Sstevel@tonic-gate 84*7c478bd9Sstevel@tonic-gate #define M_CS_PATH "/bin:/usr/bin" 85*7c478bd9Sstevel@tonic-gate /* This string is a list of directories where 86*7c478bd9Sstevel@tonic-gate * all the POSIX.2 utilities can be found. 87*7c478bd9Sstevel@tonic-gate * Returned by constr(_CS_PATH, buf, len). 88*7c478bd9Sstevel@tonic-gate * The shell uses this search path in 89*7c478bd9Sstevel@tonic-gate * command -p util ... 90*7c478bd9Sstevel@tonic-gate * The list plus "." is used by login 91*7c478bd9Sstevel@tonic-gate * and sh as the default $PATH. 92*7c478bd9Sstevel@tonic-gate */ 93*7c478bd9Sstevel@tonic-gate 94*7c478bd9Sstevel@tonic-gate #define M_CS_SHELL "/bin/sh" 95*7c478bd9Sstevel@tonic-gate /* The pathname of the shell utility. 96*7c478bd9Sstevel@tonic-gate * Returned by confstr(_CS_SHELL, buf, len). 97*7c478bd9Sstevel@tonic-gate * This string defines the path to the 98*7c478bd9Sstevel@tonic-gate * the POSIX.2 command language interpreter, 99*7c478bd9Sstevel@tonic-gate * so we do not have to search M_CS_PATH. 100*7c478bd9Sstevel@tonic-gate */ 101*7c478bd9Sstevel@tonic-gate 102*7c478bd9Sstevel@tonic-gate #define M_CS_BINDIR "/bin" 103*7c478bd9Sstevel@tonic-gate #define M_CS_LIBDIR "/lib" 104*7c478bd9Sstevel@tonic-gate #define M_CS_TMPDIR "/tmp" 105*7c478bd9Sstevel@tonic-gate #define M_CS_ETCDIR "/etc" 106*7c478bd9Sstevel@tonic-gate #define M_CS_SPOOLDIR "/spool" 107*7c478bd9Sstevel@tonic-gate #define M_CS_NLSDIR "/lib/nls" 108*7c478bd9Sstevel@tonic-gate #define M_CS_MANPATH "/man" 109*7c478bd9Sstevel@tonic-gate /* the M_CS_* strings are used by MKS's version 110*7c478bd9Sstevel@tonic-gate * of the POSIX.2 confstr() API. 111*7c478bd9Sstevel@tonic-gate * The M_CS_*DIR strings point to system 112*7c478bd9Sstevel@tonic-gate * default directories. 113*7c478bd9Sstevel@tonic-gate * The M_CS_*PATH strings may be a list of 114*7c478bd9Sstevel@tonic-gate * colon seperated system directories 115*7c478bd9Sstevel@tonic-gate */ 116*7c478bd9Sstevel@tonic-gate 117*7c478bd9Sstevel@tonic-gate 118*7c478bd9Sstevel@tonic-gate #define M_BINDIR(path) "/bin/" # path 119*7c478bd9Sstevel@tonic-gate /* M_BINDIR - directory where the POSIX.2 120*7c478bd9Sstevel@tonic-gate * utilities live. (e.g ed, ...) 121*7c478bd9Sstevel@tonic-gate */ 122*7c478bd9Sstevel@tonic-gate 123*7c478bd9Sstevel@tonic-gate #define M_LIBDIR(path) M_CS_LIBDIR # path 124*7c478bd9Sstevel@tonic-gate /* Define to convert a pathname relative to the 125*7c478bd9Sstevel@tonic-gate * library directory to an absolute pathname. 126*7c478bd9Sstevel@tonic-gate * Traditional systems would use "/usr/lib/" 127*7c478bd9Sstevel@tonic-gate * <mks.h> should always be overridden. 128*7c478bd9Sstevel@tonic-gate * 129*7c478bd9Sstevel@tonic-gate * Used by bc, cron 130*7c478bd9Sstevel@tonic-gate */ 131*7c478bd9Sstevel@tonic-gate 132*7c478bd9Sstevel@tonic-gate #define M_ETCDIR(path) M_CS_ETCDIR # path 133*7c478bd9Sstevel@tonic-gate /* Define to convert a pathname relative to the 134*7c478bd9Sstevel@tonic-gate * etcetera directory to an absolute pathname. 135*7c478bd9Sstevel@tonic-gate * Traditional systems would use "/etc/" 136*7c478bd9Sstevel@tonic-gate * <mks.h> should always be overridden. 137*7c478bd9Sstevel@tonic-gate * Used by file, vi, sh, ccg, lex, awk 138*7c478bd9Sstevel@tonic-gate */ 139*7c478bd9Sstevel@tonic-gate 140*7c478bd9Sstevel@tonic-gate #define M_SPOOLDIR(path) M_CS_SPOOLDIR # path 141*7c478bd9Sstevel@tonic-gate /* Define to convert a pathname relative to the 142*7c478bd9Sstevel@tonic-gate * spool directory to an absolute pathname. 143*7c478bd9Sstevel@tonic-gate * Traditional systems would use "/usr/spool/" 144*7c478bd9Sstevel@tonic-gate * <mks.h> should always be overridden. 145*7c478bd9Sstevel@tonic-gate */ 146*7c478bd9Sstevel@tonic-gate 147*7c478bd9Sstevel@tonic-gate #define M_NLSDIR(path) "M_CS_NLSDIR # path 148*7c478bd9Sstevel@tonic-gate /* Directory name used by the locale program 149*7c478bd9Sstevel@tonic-gate * to locate specific compiled locales. 150*7c478bd9Sstevel@tonic-gate * Should always be set, if using the mks 151*7c478bd9Sstevel@tonic-gate * supplied i18n package. Possible location 152*7c478bd9Sstevel@tonic-gate * might be /usr/lib/nls. 153*7c478bd9Sstevel@tonic-gate */ 154*7c478bd9Sstevel@tonic-gate #define M_TMPDIR M_CS_TMPDIR /* Temporary file storage directory. 155*7c478bd9Sstevel@tonic-gate * Used for P_tmpdir in case its not defined 156*7c478bd9Sstevel@tonic-gate * in <stdio.h> 157*7c478bd9Sstevel@tonic-gate */ 158*7c478bd9Sstevel@tonic-gate 159*7c478bd9Sstevel@tonic-gate #define M_MANPATH M_CS_MANPATH 160*7c478bd9Sstevel@tonic-gate /* a list of colon seperated pathnames 161*7c478bd9Sstevel@tonic-gate * which the man utility uses 162*7c478bd9Sstevel@tonic-gate * as the default search path 163*7c478bd9Sstevel@tonic-gate * (e.g when MANPATH environment variable 164*7c478bd9Sstevel@tonic-gate * not initialized. 165*7c478bd9Sstevel@tonic-gate */ 166*7c478bd9Sstevel@tonic-gate 167*7c478bd9Sstevel@tonic-gate 168*7c478bd9Sstevel@tonic-gate 169*7c478bd9Sstevel@tonic-gate #define M_SYSTEM_HELP "help.cmd"/* help command only: If the help command 170*7c478bd9Sstevel@tonic-gate * doesn't know about a given request for help 171*7c478bd9Sstevel@tonic-gate * then pass the help request on to another 172*7c478bd9Sstevel@tonic-gate * help program. Note that if the name for 173*7c478bd9Sstevel@tonic-gate * the other is also help, there must be 174*7c478bd9Sstevel@tonic-gate * some form of name qualification. No attempt 175*7c478bd9Sstevel@tonic-gate * will be made if this is not defined. 176*7c478bd9Sstevel@tonic-gate * <mks.h> will default to undefined 177*7c478bd9Sstevel@tonic-gate */ 178*7c478bd9Sstevel@tonic-gate 179*7c478bd9Sstevel@tonic-gate #define DEF_NLSPATH "/lib/nls/locale/%L/%N.cat" 180*7c478bd9Sstevel@tonic-gate /* define the default path that should be used 181*7c478bd9Sstevel@tonic-gate * by MKS's implementation of catopen() when 182*7c478bd9Sstevel@tonic-gate * trying to open the message cataloges 183*7c478bd9Sstevel@tonic-gate * If you are not using MKS's implementation 184*7c478bd9Sstevel@tonic-gate * of catopen(), then this definition 185*7c478bd9Sstevel@tonic-gate * is not required. 186*7c478bd9Sstevel@tonic-gate */ 187*7c478bd9Sstevel@tonic-gate 188*7c478bd9Sstevel@tonic-gate #define M_ENDPWENT 1 /* set to 1 if system provides a endpwent() 189*7c478bd9Sstevel@tonic-gate * routine. 190*7c478bd9Sstevel@tonic-gate * Normally, systems provide this routine 191*7c478bd9Sstevel@tonic-gate * only if getpw*() routines allocate 192*7c478bd9Sstevel@tonic-gate * some resources which a user may want 193*7c478bd9Sstevel@tonic-gate * to deallocate when finished accessing the 194*7c478bd9Sstevel@tonic-gate * user getpw*() routines 195*7c478bd9Sstevel@tonic-gate * This is the case for conventional 196*7c478bd9Sstevel@tonic-gate * UNIX systems 197*7c478bd9Sstevel@tonic-gate */ 198*7c478bd9Sstevel@tonic-gate 199*7c478bd9Sstevel@tonic-gate #undef M_SHBLTIN_ANYCMD /* set to 1 if you want ability to create an 200*7c478bd9Sstevel@tonic-gate * executable with any name, using shbltin.c. 201*7c478bd9Sstevel@tonic-gate * [ shbltin.c was created to satisfy 202*7c478bd9Sstevel@tonic-gate * POSIX.2-1992 Section 2.3 "regular built-in 203*7c478bd9Sstevel@tonic-gate * utilities". ] 204*7c478bd9Sstevel@tonic-gate * If this is undefined, then the only valid 205*7c478bd9Sstevel@tonic-gate * command names are those listed in an 206*7c478bd9Sstevel@tonic-gate * internal table in shbltin.c which are 207*7c478bd9Sstevel@tonic-gate * are checked at run-time against 208*7c478bd9Sstevel@tonic-gate * basename(argv[0]). 209*7c478bd9Sstevel@tonic-gate * If the command name is not listed in the 210*7c478bd9Sstevel@tonic-gate * table, then program will exit 211*7c478bd9Sstevel@tonic-gate * with an error message. 212*7c478bd9Sstevel@tonic-gate * 213*7c478bd9Sstevel@tonic-gate * Normally, this is undefined, since 214*7c478bd9Sstevel@tonic-gate * it becomes too easy to get into an infinite 215*7c478bd9Sstevel@tonic-gate * loop if you name this executable to a 216*7c478bd9Sstevel@tonic-gate * non-bltin command. 217*7c478bd9Sstevel@tonic-gate */ 218*7c478bd9Sstevel@tonic-gate 219*7c478bd9Sstevel@tonic-gate /* shbltin: 220*7c478bd9Sstevel@tonic-gate * shbltin.c is configurable but its configuration is done 221*7c478bd9Sstevel@tonic-gate * in mkslocal.mk. 222*7c478bd9Sstevel@tonic-gate * See M_SHBLTIN_ULIMIT 223*7c478bd9Sstevel@tonic-gate * See M_SHBLTIN_HASH 224*7c478bd9Sstevel@tonic-gate * See M_SHBLTIN_TYPE 225*7c478bd9Sstevel@tonic-gate * See M_SHBLTIN_XPG4 226*7c478bd9Sstevel@tonic-gate */ 227*7c478bd9Sstevel@tonic-gate 228*7c478bd9Sstevel@tonic-gate #undef M_FNMATCH_DUALCASE /* fnmatch(): If this #define is set, then 229*7c478bd9Sstevel@tonic-gate * fnmatch will ignore case in file name 230*7c478bd9Sstevel@tonic-gate * matches *unless* the environment variable 231*7c478bd9Sstevel@tonic-gate * at runtime has DUALCASE set. 232*7c478bd9Sstevel@tonic-gate * For a conforming system, this should *not* 233*7c478bd9Sstevel@tonic-gate * be defined. <mks.h> will default to 234*7c478bd9Sstevel@tonic-gate * undefined. 235*7c478bd9Sstevel@tonic-gate */ 236*7c478bd9Sstevel@tonic-gate 237*7c478bd9Sstevel@tonic-gate #undef M_SMALLSTACK /* Define this to 1 on systems that have 238*7c478bd9Sstevel@tonic-gate * a fixed size stack compiled into programs, 239*7c478bd9Sstevel@tonic-gate * and a small (probably 64k) data segment. 240*7c478bd9Sstevel@tonic-gate */ 241*7c478bd9Sstevel@tonic-gate 242*7c478bd9Sstevel@tonic-gate #undef M_NULL /* define this if you want to change the 243*7c478bd9Sstevel@tonic-gate * system default defintion of NULL. 244*7c478bd9Sstevel@tonic-gate * (e.g #define M_NULL ((void*)0) 245*7c478bd9Sstevel@tonic-gate */ 246*7c478bd9Sstevel@tonic-gate #define M_MALLOC 1 /* Define M_MALLOC if your system has either 247*7c478bd9Sstevel@tonic-gate * of the following two problems: 248*7c478bd9Sstevel@tonic-gate * 1) ANSI does not specify returning a valid 249*7c478bd9Sstevel@tonic-gate * errno if malloc() returns NULL. 250*7c478bd9Sstevel@tonic-gate * But, MKS code assumes a valid errno 251*7c478bd9Sstevel@tonic-gate * as is returned in most UNIX systems. 252*7c478bd9Sstevel@tonic-gate * 2) ANSI says it is implementation defined 253*7c478bd9Sstevel@tonic-gate * whether or not malloc(0) returns a valid 254*7c478bd9Sstevel@tonic-gate * pointer. 255*7c478bd9Sstevel@tonic-gate * MKS code assumes that a valid pointer 256*7c478bd9Sstevel@tonic-gate * is returned. 257*7c478bd9Sstevel@tonic-gate * 258*7c478bd9Sstevel@tonic-gate * Defining M_MALLOC requires an m_malloc() 259*7c478bd9Sstevel@tonic-gate * function, which MKS provides. 260*7c478bd9Sstevel@tonic-gate * Undefining M_MALLOC causes m_malloc() to be 261*7c478bd9Sstevel@tonic-gate * renamed to malloc(). (See mks.h) 262*7c478bd9Sstevel@tonic-gate */ 263*7c478bd9Sstevel@tonic-gate 264*7c478bd9Sstevel@tonic-gate #define M_REALLOC 1 /* Defining M_REALLOC will cause 265*7c478bd9Sstevel@tonic-gate * m_realloc() to be used in place of the 266*7c478bd9Sstevel@tonic-gate * systems realloc(). 267*7c478bd9Sstevel@tonic-gate * This is necessary: 268*7c478bd9Sstevel@tonic-gate * a) if you do not have an ANSI realloc() 269*7c478bd9Sstevel@tonic-gate * b) if the system realloc() 270*7c478bd9Sstevel@tonic-gate * has the following problem: 271*7c478bd9Sstevel@tonic-gate * - ANSI does not specify returning a valid 272*7c478bd9Sstevel@tonic-gate * errno if malloc() returns NULL. 273*7c478bd9Sstevel@tonic-gate * But, MKS code assumes a valid errno 274*7c478bd9Sstevel@tonic-gate * as is returned in most UNIX systems. 275*7c478bd9Sstevel@tonic-gate * 276*7c478bd9Sstevel@tonic-gate * Defining M_REALLOC requires an m_realloc() 277*7c478bd9Sstevel@tonic-gate * function, which MKS provides. 278*7c478bd9Sstevel@tonic-gate * Undefining M_MALLOC causes m_malloc() to be 279*7c478bd9Sstevel@tonic-gate * renamed to malloc(). (See mks.h) 280*7c478bd9Sstevel@tonic-gate */ 281*7c478bd9Sstevel@tonic-gate #ifdef M_REALLOC 282*7c478bd9Sstevel@tonic-gate #define M_WANT_ANSI_REALLOC 1 /* Use #undef M_WANT_ANSI_REALLOC 283*7c478bd9Sstevel@tonic-gate * if your system has an ANSI realloc() function 284*7c478bd9Sstevel@tonic-gate * 285*7c478bd9Sstevel@tonic-gate * Defining M_WANT_ANSI_REALLOC can only be 286*7c478bd9Sstevel@tonic-gate * done if M_REALLOC is also defined. 287*7c478bd9Sstevel@tonic-gate * Use M_WANT_ANSI_REALLOC if your system 288*7c478bd9Sstevel@tonic-gate * does not support either of the following 289*7c478bd9Sstevel@tonic-gate * 2 features: 290*7c478bd9Sstevel@tonic-gate * 291*7c478bd9Sstevel@tonic-gate * 1) ANSI says that if the ptr passed to 292*7c478bd9Sstevel@tonic-gate * realloc is NULL, then it will act like 293*7c478bd9Sstevel@tonic-gate * a malloc() 294*7c478bd9Sstevel@tonic-gate * 2) ANSI says that if the ptr passed is 295*7c478bd9Sstevel@tonic-gate * not NULL and the size is 0, then the 296*7c478bd9Sstevel@tonic-gate * object that ptr points to is freed. 297*7c478bd9Sstevel@tonic-gate * 298*7c478bd9Sstevel@tonic-gate * Defining M_REALLOC requires an m_realloc() 299*7c478bd9Sstevel@tonic-gate * function, which MKS provides. 300*7c478bd9Sstevel@tonic-gate * Undefining M_MALLOC causes m_realloc() to be 301*7c478bd9Sstevel@tonic-gate * renamed to realloc(). (See mks.h) 302*7c478bd9Sstevel@tonic-gate */ 303*7c478bd9Sstevel@tonic-gate #endif /* M_REALLOC */ 304*7c478bd9Sstevel@tonic-gate 305*7c478bd9Sstevel@tonic-gate 306*7c478bd9Sstevel@tonic-gate #define M_MAXMALLOC 64 /* Define the maximum number of kilobytes (K) 307*7c478bd9Sstevel@tonic-gate * that can be requested from malloc(). 308*7c478bd9Sstevel@tonic-gate * This is intended for segmented systems 309*7c478bd9Sstevel@tonic-gate * where max allocation by malloc() is smaller 310*7c478bd9Sstevel@tonic-gate * than the total mallocable memory; 311*7c478bd9Sstevel@tonic-gate * some programs will assume they can do 312*7c478bd9Sstevel@tonic-gate * multiple mallocs of this # of K to allocate 313*7c478bd9Sstevel@tonic-gate * a large data structure. 314*7c478bd9Sstevel@tonic-gate * By default, this is not defined; malloc can 315*7c478bd9Sstevel@tonic-gate * allocate up to MAX_INT bytes. 316*7c478bd9Sstevel@tonic-gate */ 317*7c478bd9Sstevel@tonic-gate 318*7c478bd9Sstevel@tonic-gate #define __LDATA__ 1 /* DEPRECATED */ 319*7c478bd9Sstevel@tonic-gate #define M_LDATA 1 /* For most modern systems this will be set. 320*7c478bd9Sstevel@tonic-gate * Some systems (e.g DOS) have a large and 321*7c478bd9Sstevel@tonic-gate * small program model. 322*7c478bd9Sstevel@tonic-gate * Thus, various programs have two buffer sizes 323*7c478bd9Sstevel@tonic-gate * built into them -- large and small. The 324*7c478bd9Sstevel@tonic-gate * small buffer size is normally sub-optimal, 325*7c478bd9Sstevel@tonic-gate * but permits the data to fit in the small 326*7c478bd9Sstevel@tonic-gate * buffer (say 64k) 327*7c478bd9Sstevel@tonic-gate */ 328*7c478bd9Sstevel@tonic-gate 329*7c478bd9Sstevel@tonic-gate #ifndef PATH_MAX 330*7c478bd9Sstevel@tonic-gate #define M_PATH_MAX 2048 /* For systems where pathconf(file,_PC_PATH_MAX) 331*7c478bd9Sstevel@tonic-gate * can return -1 and NOT set errno 332*7c478bd9Sstevel@tonic-gate * (which means that PATH_MAX for 'file' 333*7c478bd9Sstevel@tonic-gate * is unlimited), 334*7c478bd9Sstevel@tonic-gate * we provide a suitable LARGE value 335*7c478bd9Sstevel@tonic-gate * that can be returned by m_pathmax(). 336*7c478bd9Sstevel@tonic-gate * This number should be sufficiently large 337*7c478bd9Sstevel@tonic-gate * to handle most (if not all) reasonable 338*7c478bd9Sstevel@tonic-gate * pathnames for a particular system. 339*7c478bd9Sstevel@tonic-gate * m_pathmax() is usually used to determine 340*7c478bd9Sstevel@tonic-gate * how large a buffer must be allocated to store 341*7c478bd9Sstevel@tonic-gate * pathnames. 342*7c478bd9Sstevel@tonic-gate */ 343*7c478bd9Sstevel@tonic-gate #endif /* PATH_MAX */ 344*7c478bd9Sstevel@tonic-gate 345*7c478bd9Sstevel@tonic-gate #define M_EXPTIME 1 /* For systems whose files maintain an 346*7c478bd9Sstevel@tonic-gate * additional time field, generally expiry time. 347*7c478bd9Sstevel@tonic-gate * The stat structure must have a member 348*7c478bd9Sstevel@tonic-gate * st_etime and the utimbuf a member exptime. 349*7c478bd9Sstevel@tonic-gate * <mks.h> will default to undefined. 350*7c478bd9Sstevel@tonic-gate */ 351*7c478bd9Sstevel@tonic-gate 352*7c478bd9Sstevel@tonic-gate #undef ROOTGID 353*7c478bd9Sstevel@tonic-gate #undef ROOTUID /* Some systems may use a different user id 354*7c478bd9Sstevel@tonic-gate * to indicate the superuser. 355*7c478bd9Sstevel@tonic-gate * If it is not defined here, then <mks.h> 356*7c478bd9Sstevel@tonic-gate * will define it to be 0 which is the 357*7c478bd9Sstevel@tonic-gate * value used in conventional UNIX. 358*7c478bd9Sstevel@tonic-gate */ 359*7c478bd9Sstevel@tonic-gate 360*7c478bd9Sstevel@tonic-gate #define M_AUDIT 1 /* For systems which maintain file auditing 361*7c478bd9Sstevel@tonic-gate * information. M_AUDITW1 and M_AUDITW2 must 362*7c478bd9Sstevel@tonic-gate * be defined, and return one or two audit 363*7c478bd9Sstevel@tonic-gate * words from the stat structure. m_audmode 364*7c478bd9Sstevel@tonic-gate * must be defined in the local libraries 365*7c478bd9Sstevel@tonic-gate * to convert from these two words, to ls style 366*7c478bd9Sstevel@tonic-gate * letter information. <mks.h> will default to 367*7c478bd9Sstevel@tonic-gate * undefined. 368*7c478bd9Sstevel@tonic-gate */ 369*7c478bd9Sstevel@tonic-gate #define M_AUDITW1(sbp) ? /* Fetch first audit word from stat pointer, 370*7c478bd9Sstevel@tonic-gate * if M_AUDIT defined. 371*7c478bd9Sstevel@tonic-gate */ 372*7c478bd9Sstevel@tonic-gate #define M_AUDITW2(sbp) ? /* Fetch second audit word from stat pointer, 373*7c478bd9Sstevel@tonic-gate * if M_AUDIT defined. Define as `0' if no 374*7c478bd9Sstevel@tonic-gate * second audit word. 375*7c478bd9Sstevel@tonic-gate */ 376*7c478bd9Sstevel@tonic-gate 377*7c478bd9Sstevel@tonic-gate #undef M_DEVIO /* use #define M_DEVIO 1 on systems that 378*7c478bd9Sstevel@tonic-gate * requires special interfaces 379*7c478bd9Sstevel@tonic-gate * to perform I/O on devices. 380*7c478bd9Sstevel@tonic-gate * (e.g cannot use the standard open,read,write 381*7c478bd9Sstevel@tonic-gate * interface) 382*7c478bd9Sstevel@tonic-gate * See <devio.h> for details on this 383*7c478bd9Sstevel@tonic-gate * special interface. 384*7c478bd9Sstevel@tonic-gate * Default is undefined; no special device i/o 385*7c478bd9Sstevel@tonic-gate * interface is used. 386*7c478bd9Sstevel@tonic-gate */ 387*7c478bd9Sstevel@tonic-gate 388*7c478bd9Sstevel@tonic-gate #undef M_DEVBIN /* Use #define M_DEVBIN 1 389*7c478bd9Sstevel@tonic-gate * on systems that have devices that do not 390*7c478bd9Sstevel@tonic-gate * allow raw I/O be written directly 391*7c478bd9Sstevel@tonic-gate * to the device. 392*7c478bd9Sstevel@tonic-gate * These systems tend to process the data 393*7c478bd9Sstevel@tonic-gate * before actually writing the data to the 394*7c478bd9Sstevel@tonic-gate * device. 395*7c478bd9Sstevel@tonic-gate * (e.g DOS disk devices do some character 396*7c478bd9Sstevel@tonic-gate * translations. This routine is intended 397*7c478bd9Sstevel@tonic-gate * to disable this behaviour.) 398*7c478bd9Sstevel@tonic-gate * The definition of m_devbin() and m_devstd() 399*7c478bd9Sstevel@tonic-gate * is done in <mks.h>. 400*7c478bd9Sstevel@tonic-gate * If this is defined, then <mks.h> defines 401*7c478bd9Sstevel@tonic-gate * the prototypes m_devbin() and m_devstd() 402*7c478bd9Sstevel@tonic-gate * Otherwise it undefines m_devstd() 403*7c478bd9Sstevel@tonic-gate * and set m_devbin to return a dummy value of 0 404*7c478bd9Sstevel@tonic-gate * 405*7c478bd9Sstevel@tonic-gate * MKS has selected some utilities 406*7c478bd9Sstevel@tonic-gate * to recognize this fact and to handle 407*7c478bd9Sstevel@tonic-gate * these I/O cases specially. 408*7c478bd9Sstevel@tonic-gate * Such utilities include cp, mv, and pax 409*7c478bd9Sstevel@tonic-gate */ 410*7c478bd9Sstevel@tonic-gate 411*7c478bd9Sstevel@tonic-gate #define M_SETENV 1 /* Some systems require special preparation */ 412*7c478bd9Sstevel@tonic-gate char **m_setenv ANSI((void));/* for use of the environment variables via 413*7c478bd9Sstevel@tonic-gate * environ; m_setenv call makes sure that 414*7c478bd9Sstevel@tonic-gate * environ is set up. <mks.h> will default to 415*7c478bd9Sstevel@tonic-gate * m_setenv returning environ. M_SETENV 416*7c478bd9Sstevel@tonic-gate * must be set to indicate to mks.h that a C 417*7c478bd9Sstevel@tonic-gate * function has been defined. 418*7c478bd9Sstevel@tonic-gate */ 419*7c478bd9Sstevel@tonic-gate 420*7c478bd9Sstevel@tonic-gate #define m_setbinary(fp) /* On systems supporting text and binary files, 421*7c478bd9Sstevel@tonic-gate * (i.e. "rb" and "wb" to fopen work different 422*7c478bd9Sstevel@tonic-gate * from "r" and "w"), there is a requirement 423*7c478bd9Sstevel@tonic-gate * to be able to set stdin/stdout to binary 424*7c478bd9Sstevel@tonic-gate * mode. m_setbinary on such systems should 425*7c478bd9Sstevel@tonic-gate * perform this action. On other systems, this 426*7c478bd9Sstevel@tonic-gate * macro should define itself out of existence. 427*7c478bd9Sstevel@tonic-gate * Normally this macro would be defined in 428*7c478bd9Sstevel@tonic-gate * <stdio.h>. <mks.h> defaults to defining 429*7c478bd9Sstevel@tonic-gate * it out of existence, if not defined. 430*7c478bd9Sstevel@tonic-gate */ 431*7c478bd9Sstevel@tonic-gate 432*7c478bd9Sstevel@tonic-gate #define M_TFGETC 0 /* Do we have POSIX.1-deficient termios? 433*7c478bd9Sstevel@tonic-gate * On POSIX.1 or SVID compliant systems, 434*7c478bd9Sstevel@tonic-gate * define it as 0 and mks.h will 435*7c478bd9Sstevel@tonic-gate * map m_tfgetc(fp,tp) to fgetc(fp). 436*7c478bd9Sstevel@tonic-gate * On deficient systems (e.g. BSD), 437*7c478bd9Sstevel@tonic-gate * define it as 1 and ensure a m_tfgetc() 438*7c478bd9Sstevel@tonic-gate * routine is provided. 439*7c478bd9Sstevel@tonic-gate */ 440*7c478bd9Sstevel@tonic-gate 441*7c478bd9Sstevel@tonic-gate #define M_STTY_CC 1 /* The stty command control-character setting 442*7c478bd9Sstevel@tonic-gate * is very system specific. The default code 443*7c478bd9Sstevel@tonic-gate * in stty.c works only for the ascii character 444*7c478bd9Sstevel@tonic-gate * set. <mks.h> will default to M_STTY_CC 445*7c478bd9Sstevel@tonic-gate * being undefined, resulting using the default 446*7c478bd9Sstevel@tonic-gate * code. arg is the string passed to stty; *cp 447*7c478bd9Sstevel@tonic-gate * should have the resulting value stored in it. 448*7c478bd9Sstevel@tonic-gate * A 0 return value indicates success; other- 449*7c478bd9Sstevel@tonic-gate * wise an error message will be printed. 450*7c478bd9Sstevel@tonic-gate */ 451*7c478bd9Sstevel@tonic-gate 452*7c478bd9Sstevel@tonic-gate #define M_LOGIN_GETTY 1 /* Use #define M_LOGIN_GETTY 1 453*7c478bd9Sstevel@tonic-gate * on systems that do not provide a 454*7c478bd9Sstevel@tonic-gate * getty utility. 455*7c478bd9Sstevel@tonic-gate * This is for use in the login utility to 456*7c478bd9Sstevel@tonic-gate * display a banner that would conventionally 457*7c478bd9Sstevel@tonic-gate * be displayed by the UNIX getty utility 458*7c478bd9Sstevel@tonic-gate * that would have run before login. 459*7c478bd9Sstevel@tonic-gate * If M_LOGIN_GETTY is not defined here, 460*7c478bd9Sstevel@tonic-gate * then login will not print this banner info. 461*7c478bd9Sstevel@tonic-gate */ 462*7c478bd9Sstevel@tonic-gate 463*7c478bd9Sstevel@tonic-gate #define M_MANPAGER "more -A -s" 464*7c478bd9Sstevel@tonic-gate /* default command that is executed 465*7c478bd9Sstevel@tonic-gate * by the man utility to display a man page 466*7c478bd9Sstevel@tonic-gate * when the user's PAGER environment 467*7c478bd9Sstevel@tonic-gate * variable is not set. 468*7c478bd9Sstevel@tonic-gate */ 469*7c478bd9Sstevel@tonic-gate 470*7c478bd9Sstevel@tonic-gate #define M_TTYGROUP "tty" /* Name of the group that owns tty's. 471*7c478bd9Sstevel@tonic-gate * If this isn't defined, then <mks.h> 472*7c478bd9Sstevel@tonic-gate * will leave it undefined. 473*7c478bd9Sstevel@tonic-gate * This is related to the MKS default 474*7c478bd9Sstevel@tonic-gate * access enforcment policy for use 475*7c478bd9Sstevel@tonic-gate * by m_wallow(), mesg, talk, and write. 476*7c478bd9Sstevel@tonic-gate * If undefined, it is assumed that no security 477*7c478bd9Sstevel@tonic-gate * is available on tty's. 478*7c478bd9Sstevel@tonic-gate */ 479*7c478bd9Sstevel@tonic-gate 480*7c478bd9Sstevel@tonic-gate #undef M_CONSOLE /* This is defined to indicate that a pc 481*7c478bd9Sstevel@tonic-gate * style console is used instead of a tty. 482*7c478bd9Sstevel@tonic-gate * This allows for the elimination of 483*7c478bd9Sstevel@tonic-gate * unnecessary calls to m_wallow() from 484*7c478bd9Sstevel@tonic-gate * pc compiles. 485*7c478bd9Sstevel@tonic-gate * Default is undef; m_wallow calls are made. 486*7c478bd9Sstevel@tonic-gate */ 487*7c478bd9Sstevel@tonic-gate 488*7c478bd9Sstevel@tonic-gate #define M_LKSUFFIX ".lock" /* Suffix for lock file used by mailx and 489*7c478bd9Sstevel@tonic-gate * tsmail (name of mailbox to be locked 490*7c478bd9Sstevel@tonic-gate * is the prefix). ".lock" is typically 491*7c478bd9Sstevel@tonic-gate * used by UNIX sendmail. This should be 492*7c478bd9Sstevel@tonic-gate * set to the same suffix as used by other 493*7c478bd9Sstevel@tonic-gate * mail agents on the machine. 494*7c478bd9Sstevel@tonic-gate */ 495*7c478bd9Sstevel@tonic-gate 496*7c478bd9Sstevel@tonic-gate #define M_LS_OPT_D 1 /* ls command: Support -D (list only dirs) 497*7c478bd9Sstevel@tonic-gate * This option is non-standard on any unix 498*7c478bd9Sstevel@tonic-gate * system, so is only an option. 499*7c478bd9Sstevel@tonic-gate * Default is not defined, so ls doesn't support 500*7c478bd9Sstevel@tonic-gate * this option. 501*7c478bd9Sstevel@tonic-gate */ 502*7c478bd9Sstevel@tonic-gate 503*7c478bd9Sstevel@tonic-gate #define M_LOGGER_OPTIONS (log_pid|log_user) 504*7c478bd9Sstevel@tonic-gate /* Set up default options for the logger utility 505*7c478bd9Sstevel@tonic-gate * The logger utility allows the log lines to 506*7c478bd9Sstevel@tonic-gate * be prefixed by pid, ppid, a timestamp, 507*7c478bd9Sstevel@tonic-gate * and/or the login username. 508*7c478bd9Sstevel@tonic-gate * If an implementation wishes to 509*7c478bd9Sstevel@tonic-gate * force some of these prefixes then it 510*7c478bd9Sstevel@tonic-gate * should OR together one or more of the 511*7c478bd9Sstevel@tonic-gate * appropriate constants: 512*7c478bd9Sstevel@tonic-gate * log_pid 513*7c478bd9Sstevel@tonic-gate * log_ppid 514*7c478bd9Sstevel@tonic-gate * log_timestamp 515*7c478bd9Sstevel@tonic-gate * log_user 516*7c478bd9Sstevel@tonic-gate * If M_LOGGER_OPTIONS is not defined here then 517*7c478bd9Sstevel@tonic-gate * logger.c uses the default: 518*7c478bd9Sstevel@tonic-gate * (log_pid|log_user). 519*7c478bd9Sstevel@tonic-gate */ 520*7c478bd9Sstevel@tonic-gate 521*7c478bd9Sstevel@tonic-gate #define M_LOGGER_CONSOLE "/dev/console" 522*7c478bd9Sstevel@tonic-gate /* logger command: If you wish to use the 523*7c478bd9Sstevel@tonic-gate * default, trivial, logging routines, then 524*7c478bd9Sstevel@tonic-gate * define M_LOGGER_CONSOLE to the name of 525*7c478bd9Sstevel@tonic-gate * a device or file, to which logger may 526*7c478bd9Sstevel@tonic-gate * append the log messages. 527*7c478bd9Sstevel@tonic-gate * If this variable is *not* defined, then 528*7c478bd9Sstevel@tonic-gate * the local system must have m_logger, and 529*7c478bd9Sstevel@tonic-gate * m_logger_close defined and retrieve 530*7c478bd9Sstevel@tonic-gate * either by the make process, or in the 531*7c478bd9Sstevel@tonic-gate * libraries. See the documentation for 532*7c478bd9Sstevel@tonic-gate * the calling sequence of these routines. 533*7c478bd9Sstevel@tonic-gate */ 534*7c478bd9Sstevel@tonic-gate 535*7c478bd9Sstevel@tonic-gate #undef M_COMPRESSION_AVAIL /* 536*7c478bd9Sstevel@tonic-gate * Not defining M_COMPRESSION_AVAIL indicates 537*7c478bd9Sstevel@tonic-gate * that the compression libary code is not 538*7c478bd9Sstevel@tonic-gate * available. 539*7c478bd9Sstevel@tonic-gate * Changing the #undef to #define should only 540*7c478bd9Sstevel@tonic-gate * be done if the code in libc/mks/m_comp.c 541*7c478bd9Sstevel@tonic-gate * is implemented. 542*7c478bd9Sstevel@tonic-gate * 543*7c478bd9Sstevel@tonic-gate * Because UNiSYS holds the patent on the 544*7c478bd9Sstevel@tonic-gate * adaptive Lempel-Ziv compression algorithm, 545*7c478bd9Sstevel@tonic-gate * MKS may not provide the compression 546*7c478bd9Sstevel@tonic-gate * source code (see libc/mks/m_comp.c) 547*7c478bd9Sstevel@tonic-gate * in which case the -z option in pax/tar/cpio 548*7c478bd9Sstevel@tonic-gate * must be disabled. 549*7c478bd9Sstevel@tonic-gate * If the compression algorithm is implemented 550*7c478bd9Sstevel@tonic-gate * in m_comp.c, then this macro can be defined. 551*7c478bd9Sstevel@tonic-gate */ 552*7c478bd9Sstevel@tonic-gate 553*7c478bd9Sstevel@tonic-gate #define M_TAR_TAPENAME "/dev/mt/%c%c" 554*7c478bd9Sstevel@tonic-gate /* Set up default file name that the pax/tar 555*7c478bd9Sstevel@tonic-gate * utilities will use (e.g when 'f' option 556*7c478bd9Sstevel@tonic-gate * not specified) 557*7c478bd9Sstevel@tonic-gate * This file name is usually a tape device name 558*7c478bd9Sstevel@tonic-gate * Two %c's field specifiers can be included 559*7c478bd9Sstevel@tonic-gate * in the file name; 560*7c478bd9Sstevel@tonic-gate * the first is replaced with tapenumber, 561*7c478bd9Sstevel@tonic-gate * the 2nd with tape density 562*7c478bd9Sstevel@tonic-gate * (l, m, or h, for low, medium or high). 563*7c478bd9Sstevel@tonic-gate * If you either don't have multiple 564*7c478bd9Sstevel@tonic-gate * tapes, or densities, you can leave off extra 565*7c478bd9Sstevel@tonic-gate * %c's. 566*7c478bd9Sstevel@tonic-gate * 567*7c478bd9Sstevel@tonic-gate * If this is not defined then pax/tar.h 568*7c478bd9Sstevel@tonic-gate * will use "/dev/mt/%c%c" 569*7c478bd9Sstevel@tonic-gate */ 570*7c478bd9Sstevel@tonic-gate 571*7c478bd9Sstevel@tonic-gate #undef M_GUNZIP /* When defined, m_dc_open() will test for 572*7c478bd9Sstevel@tonic-gate * gzip-compressed files, and call the 573*7c478bd9Sstevel@tonic-gate * appropriate routines to uncompress them, 574*7c478bd9Sstevel@tonic-gate * in addition the normal operation of testing 575*7c478bd9Sstevel@tonic-gate * for compress-compressed files. 576*7c478bd9Sstevel@tonic-gate */ 577*7c478bd9Sstevel@tonic-gate 578*7c478bd9Sstevel@tonic-gate #undef M_VI_NO_RECOVER /* vi command: when defined will not include the 579*7c478bd9Sstevel@tonic-gate * :preserve and :recover commands. 580*7c478bd9Sstevel@tonic-gate */ 581*7c478bd9Sstevel@tonic-gate 582*7c478bd9Sstevel@tonic-gate #define M_VI_COPYRIGHT 1 /* vi command: When sold as a separate product, 583*7c478bd9Sstevel@tonic-gate * vi prints a copyright notice. This flag 584*7c478bd9Sstevel@tonic-gate * causes the notice to be printed. Default is 585*7c478bd9Sstevel@tonic-gate * not defined, which causes vi to NOT print 586*7c478bd9Sstevel@tonic-gate * the copyright notice. 587*7c478bd9Sstevel@tonic-gate */ 588*7c478bd9Sstevel@tonic-gate 589*7c478bd9Sstevel@tonic-gate #define M_MAKEOS "OS:=POSIX" /*for $(OS) in "make" */ 590*7c478bd9Sstevel@tonic-gate /* make command: builtin rule which defines the 591*7c478bd9Sstevel@tonic-gate * $(OS) variable expansion. 592*7c478bd9Sstevel@tonic-gate * Default is not defined, which is an error. 593*7c478bd9Sstevel@tonic-gate */ 594*7c478bd9Sstevel@tonic-gate 595*7c478bd9Sstevel@tonic-gate #undef M_MAKE_EXIT_DIRECT /* If this is defined, make will call exit() 596*7c478bd9Sstevel@tonic-gate * directly when it receives a signal, rather 597*7c478bd9Sstevel@tonic-gate * than clearing the handler and re-sending 598*7c478bd9Sstevel@tonic-gate * itself the signal. For 1003.2 conformance, 599*7c478bd9Sstevel@tonic-gate * this must not be defined. 600*7c478bd9Sstevel@tonic-gate */ 601*7c478bd9Sstevel@tonic-gate 602*7c478bd9Sstevel@tonic-gate #define M_MAKEFILES ".MAKEFILES:makefile Makefile" 603*7c478bd9Sstevel@tonic-gate /* rule that make uses when trying to locate 604*7c478bd9Sstevel@tonic-gate * the default makefile to run 605*7c478bd9Sstevel@tonic-gate */ 606*7c478bd9Sstevel@tonic-gate 607*7c478bd9Sstevel@tonic-gate #define M_MAKEDIRSEPSTR "/" /* Default string of characters that make 608*7c478bd9Sstevel@tonic-gate * will look at and use when manipulating 609*7c478bd9Sstevel@tonic-gate * path names. 610*7c478bd9Sstevel@tonic-gate */ 611*7c478bd9Sstevel@tonic-gate #define M_GETSWITCHAR '-' /* Default character used to indicate an 612*7c478bd9Sstevel@tonic-gate * option to a command. Note - on some 613*7c478bd9Sstevel@tonic-gate * systems, this may actually be a system-call 614*7c478bd9Sstevel@tonic-gate * instead of a constant. As a consequence 615*7c478bd9Sstevel@tonic-gate * this define should not be used as a 616*7c478bd9Sstevel@tonic-gate * global initializer. 617*7c478bd9Sstevel@tonic-gate */ 618*7c478bd9Sstevel@tonic-gate #define M_MAKE_BUFFER_SIZE 8192 /* max line length handled by make parser */ 619*7c478bd9Sstevel@tonic-gate #define M_MAKE_STRING_SIZE 8192 /* make macro expansion max string size */ 620*7c478bd9Sstevel@tonic-gate #define M_MAKE_PATSUB_SIZE 1024 /* make pattern/substitution max string size */ 621*7c478bd9Sstevel@tonic-gate 622*7c478bd9Sstevel@tonic-gate #define M_FLDSEP ':' /* The field separator character used in 623*7c478bd9Sstevel@tonic-gate * the PATH environment variable (for sh), 624*7c478bd9Sstevel@tonic-gate * and for the entries in the group database 625*7c478bd9Sstevel@tonic-gate * (e.g /etc/group) and the user database 626*7c478bd9Sstevel@tonic-gate * (e.g /etc/passwd) files. 627*7c478bd9Sstevel@tonic-gate * If this is not defined here, then <mks.h> 628*7c478bd9Sstevel@tonic-gate * will default to ':'. 629*7c478bd9Sstevel@tonic-gate */ 630*7c478bd9Sstevel@tonic-gate 631*7c478bd9Sstevel@tonic-gate #undef M_TEXT_CR /* Some systems use <cr><lf> pairs rather than 632*7c478bd9Sstevel@tonic-gate * simple <lf>s to delimit text lines. On 633*7c478bd9Sstevel@tonic-gate * these systems, this should be defined. 634*7c478bd9Sstevel@tonic-gate * Default is undefined. 635*7c478bd9Sstevel@tonic-gate */ 636*7c478bd9Sstevel@tonic-gate 637*7c478bd9Sstevel@tonic-gate #define M_FPPSLOW 1 /* This should be defined for systems whose 638*7c478bd9Sstevel@tonic-gate * floating point operations 639*7c478bd9Sstevel@tonic-gate * are slower than integral operations. 640*7c478bd9Sstevel@tonic-gate * If this in undefined, the assumption will 641*7c478bd9Sstevel@tonic-gate * be fast floating point. 642*7c478bd9Sstevel@tonic-gate */ 643*7c478bd9Sstevel@tonic-gate 644*7c478bd9Sstevel@tonic-gate #define __CLK_TCK 100 /* units for times() */ 645*7c478bd9Sstevel@tonic-gate 646*7c478bd9Sstevel@tonic-gate #undef M_NOOWNER /* for systems which don't have user/group 647*7c478bd9Sstevel@tonic-gate * owners on files. 648*7c478bd9Sstevel@tonic-gate * <mks.h> will default to undefined. 649*7c478bd9Sstevel@tonic-gate * Used by pax 650*7c478bd9Sstevel@tonic-gate */ 651*7c478bd9Sstevel@tonic-gate 652*7c478bd9Sstevel@tonic-gate #define M_FSDELIM(ch) ((ch)=='/') /* for systems who have special characters to 653*7c478bd9Sstevel@tonic-gate * delimit file systems, this returns true if 654*7c478bd9Sstevel@tonic-gate * the given character is a file system 655*7c478bd9Sstevel@tonic-gate * delimiter; <mks.h> will default to '/'. 656*7c478bd9Sstevel@tonic-gate * ispathdelim() is a deprecated form. 657*7c478bd9Sstevel@tonic-gate */ 658*7c478bd9Sstevel@tonic-gate 659*7c478bd9Sstevel@tonic-gate #define M_DRDELIM(ch) (0) /* for systems whose names parse with a leading 660*7c478bd9Sstevel@tonic-gate * drive separated by a drive delimiter char, 661*7c478bd9Sstevel@tonic-gate * (e.g. ':' on dos systems); posix systems 662*7c478bd9Sstevel@tonic-gate * simply return false, i.e. no, character 663*7c478bd9Sstevel@tonic-gate * is not a drive delimiter. 664*7c478bd9Sstevel@tonic-gate * <mks.h> will default to (0). 665*7c478bd9Sstevel@tonic-gate */ 666*7c478bd9Sstevel@tonic-gate 667*7c478bd9Sstevel@tonic-gate #define M_DIRSTAT(pathname, dirp, statbuf) stat((pathname), (statbuf)) 668*7c478bd9Sstevel@tonic-gate /* prototype definition: 669*7c478bd9Sstevel@tonic-gate * int M_DIRSTAT(char* pathname, 670*7c478bd9Sstevel@tonic-gate * DIR* dirp, 671*7c478bd9Sstevel@tonic-gate * struct stat* statbuf); 672*7c478bd9Sstevel@tonic-gate * On POSIX and conventional UNIX systems 673*7c478bd9Sstevel@tonic-gate * this macro is defined as: 674*7c478bd9Sstevel@tonic-gate * stat((pathname), (statbuf)) 675*7c478bd9Sstevel@tonic-gate /* On systems where the file information is 676*7c478bd9Sstevel@tonic-gate * maintained in the directory (not the inode) 677*7c478bd9Sstevel@tonic-gate * the DIR structure may contain this info, 678*7c478bd9Sstevel@tonic-gate * in which case the information can be returned 679*7c478bd9Sstevel@tonic-gate * without doing a stat(). This may be a 680*7c478bd9Sstevel@tonic-gate * performance enhancement. 681*7c478bd9Sstevel@tonic-gate * dirp is the DIR * pointer returned by opendir 682*7c478bd9Sstevel@tonic-gate */ 683*7c478bd9Sstevel@tonic-gate 684*7c478bd9Sstevel@tonic-gate #define M_HIDDEN(dirp, dp) ((dp)->d_name[0] == '.') 685*7c478bd9Sstevel@tonic-gate /* prototype definition: 686*7c478bd9Sstevel@tonic-gate * int M_HIDDEN(DIR* dirp, struct* dirent) 687*7c478bd9Sstevel@tonic-gate * 688*7c478bd9Sstevel@tonic-gate * Some utilities (e.g ls) recognize certain 689*7c478bd9Sstevel@tonic-gate * filenames as being "hidden" files. 690*7c478bd9Sstevel@tonic-gate * In conventional UNIX systems this has been 691*7c478bd9Sstevel@tonic-gate * the '.' prefix. 692*7c478bd9Sstevel@tonic-gate * On other systems, with other conventions 693*7c478bd9Sstevel@tonic-gate * the M_HIDDEN macro should be suitably 694*7c478bd9Sstevel@tonic-gate * modified 695*7c478bd9Sstevel@tonic-gate * 696*7c478bd9Sstevel@tonic-gate * If this is not defined, then 697*7c478bd9Sstevel@tonic-gate * <mks.h> defaults to traditional unix, a 698*7c478bd9Sstevel@tonic-gate * leading `.'. 699*7c478bd9Sstevel@tonic-gate */ 700*7c478bd9Sstevel@tonic-gate 701*7c478bd9Sstevel@tonic-gate #undef M_NO_FORK /* Define for non-POSIX systems that do not 702*7c478bd9Sstevel@tonic-gate * have a true fork(), and must use some sort 703*7c478bd9Sstevel@tonic-gate * of spawn call (for example, DOS). 704*7c478bd9Sstevel@tonic-gate * By default undefined; there is a fork. 705*7c478bd9Sstevel@tonic-gate */ 706*7c478bd9Sstevel@tonic-gate 707*7c478bd9Sstevel@tonic-gate #undef M_SYNC_FORK /* fork() is synchronous (DOS). (sh) 708*7c478bd9Sstevel@tonic-gate * Default is undefined; posix.1 fork provided. 709*7c478bd9Sstevel@tonic-gate */ 710*7c478bd9Sstevel@tonic-gate 711*7c478bd9Sstevel@tonic-gate #undef M_FEXEC /* Use fexec[ve] when possible. 712*7c478bd9Sstevel@tonic-gate * Only define if fexec is faster than fork/exec 713*7c478bd9Sstevel@tonic-gate * (sh, ...) 714*7c478bd9Sstevel@tonic-gate * By default undefined; fork is reasonable 715*7c478bd9Sstevel@tonic-gate * performance. 716*7c478bd9Sstevel@tonic-gate */ 717*7c478bd9Sstevel@tonic-gate 718*7c478bd9Sstevel@tonic-gate #undef M_EXEC_FILETYPE /* File name types for executables. 719*7c478bd9Sstevel@tonic-gate * For example, .exe and .ksh. 720*7c478bd9Sstevel@tonic-gate * For the shell, you need to define shexecve() 721*7c478bd9Sstevel@tonic-gate * and testpath() in sh$(ORG).c. 722*7c478bd9Sstevel@tonic-gate * By default undefined; no file name types. 723*7c478bd9Sstevel@tonic-gate */ 724*7c478bd9Sstevel@tonic-gate 725*7c478bd9Sstevel@tonic-gate #undef M_NO_IDS /* POSIX uids and gids. 726*7c478bd9Sstevel@tonic-gate * (sh: set -p; umask; test -[rwx]) 727*7c478bd9Sstevel@tonic-gate */ 728*7c478bd9Sstevel@tonic-gate 729*7c478bd9Sstevel@tonic-gate #undef M_NO_ST_INO /* stat's st_ino is meaningless. (pax; test -ef) 730*7c478bd9Sstevel@tonic-gate */ 731*7c478bd9Sstevel@tonic-gate 732*7c478bd9Sstevel@tonic-gate #undef M_SVFS_INO /* statvfs() provides valid f_ffree and 733*7c478bd9Sstevel@tonic-gate * f_files fields which describe the number 734*7c478bd9Sstevel@tonic-gate * of free file slots and the total number 735*7c478bd9Sstevel@tonic-gate * of file slots in a filesystem. Used 736*7c478bd9Sstevel@tonic-gate * by df. 737*7c478bd9Sstevel@tonic-gate */ 738*7c478bd9Sstevel@tonic-gate 739*7c478bd9Sstevel@tonic-gate #undef M_NO_PIPE /* no pipe(), use temp files. (sh, popen) 740*7c478bd9Sstevel@tonic-gate * Default is undefined; posix.1 pipes provided. 741*7c478bd9Sstevel@tonic-gate */ 742*7c478bd9Sstevel@tonic-gate 743*7c478bd9Sstevel@tonic-gate #undef M_LOCKING_OPEN /* Open'd files are locked, (DOS, OS2) 744*7c478bd9Sstevel@tonic-gate * and cannot be unlink'd or rename'd. 745*7c478bd9Sstevel@tonic-gate */ 746*7c478bd9Sstevel@tonic-gate 747*7c478bd9Sstevel@tonic-gate #undef M_USE_SIGNAL /* Has no sigaction, use signal (SVR3). 748*7c478bd9Sstevel@tonic-gate * (sh, ...) 749*7c478bd9Sstevel@tonic-gate */ 750*7c478bd9Sstevel@tonic-gate 751*7c478bd9Sstevel@tonic-gate #undef M_NO_IO_EINTR /* Tty I/O does not return EINTR 752*7c478bd9Sstevel@tonic-gate * when SIGINT signal handler returns. 753*7c478bd9Sstevel@tonic-gate * (sh, ?) 754*7c478bd9Sstevel@tonic-gate */ 755*7c478bd9Sstevel@tonic-gate 756*7c478bd9Sstevel@tonic-gate #undef M_TTY_ICANON /* Tty is always in ICANON mode. 757*7c478bd9Sstevel@tonic-gate * (sh,ex,mailx) 758*7c478bd9Sstevel@tonic-gate */ 759*7c478bd9Sstevel@tonic-gate 760*7c478bd9Sstevel@tonic-gate #define M_TTYNAME "/dev/tty" /* Device to open to access the controlling 761*7c478bd9Sstevel@tonic-gate * tty; posix.2 does require this to be /dev/tty 762*7c478bd9Sstevel@tonic-gate * but dos for example calls it /dev/con. 763*7c478bd9Sstevel@tonic-gate * <mks.h> will default to /dev/tty. 764*7c478bd9Sstevel@tonic-gate */ 765*7c478bd9Sstevel@tonic-gate 766*7c478bd9Sstevel@tonic-gate #define M_NULLNAME "/dev/null" /* Device to open for the null device as defined 767*7c478bd9Sstevel@tonic-gate * by posix.2. It is required to be named 768*7c478bd9Sstevel@tonic-gate * /dev/null, but dos for example calls it 769*7c478bd9Sstevel@tonic-gate * /dev/nul. <mks.h> will default to /dev/null. 770*7c478bd9Sstevel@tonic-gate */ 771*7c478bd9Sstevel@tonic-gate 772*7c478bd9Sstevel@tonic-gate #define M_FCLOSE_NOT_POSIX_1 1 /* fclose() does not conform to posix.1 section 773*7c478bd9Sstevel@tonic-gate * 8.2. An explicit lseek must be done on the 774*7c478bd9Sstevel@tonic-gate * stream prior to an fclose for the seek 775*7c478bd9Sstevel@tonic-gate * pointer to be correct. <mks.h> will default 776*7c478bd9Sstevel@tonic-gate * to undefined. 777*7c478bd9Sstevel@tonic-gate */ 778*7c478bd9Sstevel@tonic-gate 779*7c478bd9Sstevel@tonic-gate #define M_FFLUSH_NOT_POSIX_1 1 /* fflush() does not conform to posix.1 section 780*7c478bd9Sstevel@tonic-gate * 8.2. <mks.h> will default to undefined. 781*7c478bd9Sstevel@tonic-gate * If undefined, then mks.h will turn m_fflush 782*7c478bd9Sstevel@tonic-gate * into fflush. If defined, then mks.h will 783*7c478bd9Sstevel@tonic-gate * leave m_fflush alone, and a stdio-specific 784*7c478bd9Sstevel@tonic-gate * routine m_fflush() must be provided which 785*7c478bd9Sstevel@tonic-gate * actually conforms to the standard. 786*7c478bd9Sstevel@tonic-gate */ 787*7c478bd9Sstevel@tonic-gate 788*7c478bd9Sstevel@tonic-gate 789*7c478bd9Sstevel@tonic-gate #define M_NL_DOM "mks" /* String used as default name (domain name) 790*7c478bd9Sstevel@tonic-gate * to get mks utility messages via the xpg 791*7c478bd9Sstevel@tonic-gate * catopen/catgets message translation functions 792*7c478bd9Sstevel@tonic-gate * For example, in XPG: 793*7c478bd9Sstevel@tonic-gate * catopen (M_NL_DOM, ...) 794*7c478bd9Sstevel@tonic-gate */ 795*7c478bd9Sstevel@tonic-gate 796*7c478bd9Sstevel@tonic-gate 797*7c478bd9Sstevel@tonic-gate #define M_L_CUSERID 16 /* Length of longest user id returned by 798*7c478bd9Sstevel@tonic-gate * cuserid() routine. 799*7c478bd9Sstevel@tonic-gate * Used for L_cuserid in case its not 800*7c478bd9Sstevel@tonic-gate * defined in <stdio.h> 801*7c478bd9Sstevel@tonic-gate */ 802*7c478bd9Sstevel@tonic-gate 803*7c478bd9Sstevel@tonic-gate #define M_FSMOUNT "/etc/mtab" 804*7c478bd9Sstevel@tonic-gate /* This pathname is passed as the 1st argument 805*7c478bd9Sstevel@tonic-gate * to setmntent() routine. 806*7c478bd9Sstevel@tonic-gate * On conventional UNIX systems, this 807*7c478bd9Sstevel@tonic-gate * pathname identifies a file that contains 808*7c478bd9Sstevel@tonic-gate * a list of all the actively mounted systems. 809*7c478bd9Sstevel@tonic-gate * The mount utility is normally responsible 810*7c478bd9Sstevel@tonic-gate * for adding entries to this file 811*7c478bd9Sstevel@tonic-gate * and umount utility deletes the entries. 812*7c478bd9Sstevel@tonic-gate */ 813*7c478bd9Sstevel@tonic-gate #define M_FSALL "/etc/fstab" 814*7c478bd9Sstevel@tonic-gate /* this pathname identifies a file that 815*7c478bd9Sstevel@tonic-gate * is similar to M_FSMOUNT, but instead of 816*7c478bd9Sstevel@tonic-gate * the actively mounted file systems, it 817*7c478bd9Sstevel@tonic-gate * has a list of ALL possible filesytems 818*7c478bd9Sstevel@tonic-gate * that could be mounted. 819*7c478bd9Sstevel@tonic-gate * This file normally used by the mount 820*7c478bd9Sstevel@tonic-gate * command to find all the file systems 821*7c478bd9Sstevel@tonic-gate * to mount by default. 822*7c478bd9Sstevel@tonic-gate */ 823*7c478bd9Sstevel@tonic-gate 824*7c478bd9Sstevel@tonic-gate #define M_NLSCHARMAP "/usr/lib/nls/charmap/ISO_8859-1" 825*7c478bd9Sstevel@tonic-gate /* Name of default charmap file to use in 826*7c478bd9Sstevel@tonic-gate * localedef if -f charmap option isn't 827*7c478bd9Sstevel@tonic-gate * used. 828*7c478bd9Sstevel@tonic-gate */ 829*7c478bd9Sstevel@tonic-gate 830*7c478bd9Sstevel@tonic-gate #define M_ISEOV(error) (error == EINVAL) 831*7c478bd9Sstevel@tonic-gate /* This macro is used after an unsuccessful 832*7c478bd9Sstevel@tonic-gate * read() or m_devread() to determine 833*7c478bd9Sstevel@tonic-gate * if end-of-volume has been encountered. 834*7c478bd9Sstevel@tonic-gate * This macro should be invoked using the 835*7c478bd9Sstevel@tonic-gate * errno returned by the read(). 836*7c478bd9Sstevel@tonic-gate * The macro should evaluate to 1 (true) 837*7c478bd9Sstevel@tonic-gate * if it can determine the EOV condition 838*7c478bd9Sstevel@tonic-gate * from this errno. 839*7c478bd9Sstevel@tonic-gate * Otherwise, should evaluate to 0 (false) 840*7c478bd9Sstevel@tonic-gate * <mks.h> defaults to 0, i.e. never EOV 841*7c478bd9Sstevel@tonic-gate */ 842*7c478bd9Sstevel@tonic-gate 843*7c478bd9Sstevel@tonic-gate #define M_COMPRESS_DEFBITS 16 844*7c478bd9Sstevel@tonic-gate /* Default # of bits to compress in compress. 845*7c478bd9Sstevel@tonic-gate * If not defined, compress defaults to 16. 846*7c478bd9Sstevel@tonic-gate * Probably only useful on systems with limited 847*7c478bd9Sstevel@tonic-gate * memory capacity. 848*7c478bd9Sstevel@tonic-gate */ 849*7c478bd9Sstevel@tonic-gate 850*7c478bd9Sstevel@tonic-gate #define M_CURSES_VERSION "MKS Interopen Curses" 851*7c478bd9Sstevel@tonic-gate /* Curses product version string. This 852*7c478bd9Sstevel@tonic-gate * string will be imbedded in the excutable 853*7c478bd9Sstevel@tonic-gate * for an application. This string should 854*7c478bd9Sstevel@tonic-gate * be set to the vendor's product code used 855*7c478bd9Sstevel@tonic-gate * for Curses. 856*7c478bd9Sstevel@tonic-gate */ 857*7c478bd9Sstevel@tonic-gate 858*7c478bd9Sstevel@tonic-gate #undef M_CURSES_MEMMAPPED /* Define this symbol to compile up curses 859*7c478bd9Sstevel@tonic-gate * for a memory mapped display, such as the PC. 860*7c478bd9Sstevel@tonic-gate * Rather than allocating memory for the main 861*7c478bd9Sstevel@tonic-gate * screen window, this is compiled to point 862*7c478bd9Sstevel@tonic-gate * directly at the mapped memory. This will 863*7c478bd9Sstevel@tonic-gate * require some custom code. 864*7c478bd9Sstevel@tonic-gate */ 865*7c478bd9Sstevel@tonic-gate 866*7c478bd9Sstevel@tonic-gate #define M_TERM_NAME "dumb" 867*7c478bd9Sstevel@tonic-gate /* Default terminal name used if TERM is 868*7c478bd9Sstevel@tonic-gate * not set in the environment. 869*7c478bd9Sstevel@tonic-gate */ 870*7c478bd9Sstevel@tonic-gate 871*7c478bd9Sstevel@tonic-gate #define M_TERMINFO_DIR "/usr/lib/terminfo" 872*7c478bd9Sstevel@tonic-gate /* Default location for the terminfo database 873*7c478bd9Sstevel@tonic-gate * if TERMINFO is not set in the environment. 874*7c478bd9Sstevel@tonic-gate * 875*7c478bd9Sstevel@tonic-gate * NOTE: Only define this macro if curses 876*7c478bd9Sstevel@tonic-gate * is available on this system since 877*7c478bd9Sstevel@tonic-gate * this macro is also used to 878*7c478bd9Sstevel@tonic-gate * determine if "curses" is available 879*7c478bd9Sstevel@tonic-gate */ 880*7c478bd9Sstevel@tonic-gate 881*7c478bd9Sstevel@tonic-gate #define M_BSD_SPRINTF 1 /* Defined if sprintf on this system has BSD 882*7c478bd9Sstevel@tonic-gate * semantics ie. if sprintf() returns a pointer 883*7c478bd9Sstevel@tonic-gate * to the string rather than the number of 884*7c478bd9Sstevel@tonic-gate * characters printed. 885*7c478bd9Sstevel@tonic-gate */ 886*7c478bd9Sstevel@tonic-gate 887*7c478bd9Sstevel@tonic-gate #define M_IS_NATIVE_LOCALE(s) (strcmp(s, "POSIX") == 0 || strcmp(s, "C") == 0) 888*7c478bd9Sstevel@tonic-gate /* Change this definition to define the locale 889*7c478bd9Sstevel@tonic-gate * that the machine level comparison function 890*7c478bd9Sstevel@tonic-gate * strcmp conforms to. On all ascii machines, 891*7c478bd9Sstevel@tonic-gate * strcmp will order the same as the POSIX 892*7c478bd9Sstevel@tonic-gate * locale. <mks.h> defaults to the def'n given 893*7c478bd9Sstevel@tonic-gate * here. 894*7c478bd9Sstevel@tonic-gate */ 895*7c478bd9Sstevel@tonic-gate 896*7c478bd9Sstevel@tonic-gate #undef M_NOT_646 /* Define this symbol if the local invariant 897*7c478bd9Sstevel@tonic-gate * character set does not conform to ISO646. 898*7c478bd9Sstevel@tonic-gate * Normally, this would only be set for 899*7c478bd9Sstevel@tonic-gate * EBCDIC systems. 900*7c478bd9Sstevel@tonic-gate * Several utilities (e.g pax/tar/cpio) 901*7c478bd9Sstevel@tonic-gate * are explicitly required to use 646, 902*7c478bd9Sstevel@tonic-gate * so if this flag is defined, then there 903*7c478bd9Sstevel@tonic-gate * is special code which will be 904*7c478bd9Sstevel@tonic-gate * compiled in to do the appropriate 905*7c478bd9Sstevel@tonic-gate * character set translation. 906*7c478bd9Sstevel@tonic-gate */ 907*7c478bd9Sstevel@tonic-gate 908*7c478bd9Sstevel@tonic-gate #define M_FILENAME_CODESET "IS8859" 909*7c478bd9Sstevel@tonic-gate /* If M_NOT_646 is defined, then you must 910*7c478bd9Sstevel@tonic-gate * define the codeset that filenames are 911*7c478bd9Sstevel@tonic-gate * stored in. This must be a string value, 912*7c478bd9Sstevel@tonic-gate * that can be passed into iconv. 913*7c478bd9Sstevel@tonic-gate * Theoretically, this could be a call to 914*7c478bd9Sstevel@tonic-gate * setlocale, to some extention that would 915*7c478bd9Sstevel@tonic-gate * return the name of the charmap. 916*7c478bd9Sstevel@tonic-gate */ 917*7c478bd9Sstevel@tonic-gate 918*7c478bd9Sstevel@tonic-gate #define M_STKCHK expression /* Define this macro on systems that have a 919*7c478bd9Sstevel@tonic-gate * fixed size stack. 920*7c478bd9Sstevel@tonic-gate * This macro should define an expression 921*7c478bd9Sstevel@tonic-gate * that can be used to check if the current 922*7c478bd9Sstevel@tonic-gate * C function stack is within some distance 923*7c478bd9Sstevel@tonic-gate * from the end of available stack size. 924*7c478bd9Sstevel@tonic-gate * Return 0 if it is -- i.e. unsafe to 925*7c478bd9Sstevel@tonic-gate * recurse further. 926*7c478bd9Sstevel@tonic-gate * <mks.h> defaults to undefined; 927*7c478bd9Sstevel@tonic-gate * i.e. no stack bounds checking. 928*7c478bd9Sstevel@tonic-gate * This is only called from a few programs 929*7c478bd9Sstevel@tonic-gate * which allow the user to perform recursion. 930*7c478bd9Sstevel@tonic-gate */ 931*7c478bd9Sstevel@tonic-gate 932*7c478bd9Sstevel@tonic-gate #define M_ST_RDEV(sb) ((sb).st_rdev) 933*7c478bd9Sstevel@tonic-gate #define M_DEVMAJOR(statp) ((uint)major((statp)->st_rdev)) 934*7c478bd9Sstevel@tonic-gate /* Prototype: uint M_DEVMAJOR(struct stat *); 935*7c478bd9Sstevel@tonic-gate * 936*7c478bd9Sstevel@tonic-gate * Return the major device number given 937*7c478bd9Sstevel@tonic-gate * a "struct stat *". 938*7c478bd9Sstevel@tonic-gate * Assumes the stat structure pointer 939*7c478bd9Sstevel@tonic-gate * represents a special device file. 940*7c478bd9Sstevel@tonic-gate * MKS recommends all systems define 941*7c478bd9Sstevel@tonic-gate * some method of extracting this information 942*7c478bd9Sstevel@tonic-gate * from this structure 943*7c478bd9Sstevel@tonic-gate * (eg. define a st_rdev or st_major member 944*7c478bd9Sstevel@tonic-gate * in the struct stat.) 945*7c478bd9Sstevel@tonic-gate * This macro must be defined to return some 946*7c478bd9Sstevel@tonic-gate * unsigned integer value. 947*7c478bd9Sstevel@tonic-gate */ 948*7c478bd9Sstevel@tonic-gate 949*7c478bd9Sstevel@tonic-gate #define M_DEVMINOR(statp) ((uint)minor((statp)->st_rdev)) 950*7c478bd9Sstevel@tonic-gate /* Prototype: uint M_DEVMINOR(struct stat *); 951*7c478bd9Sstevel@tonic-gate * 952*7c478bd9Sstevel@tonic-gate * Return the minor device number given 953*7c478bd9Sstevel@tonic-gate * a "struct stat *". 954*7c478bd9Sstevel@tonic-gate * Same recommendations as M_DEVMAJOR above. 955*7c478bd9Sstevel@tonic-gate */ 956*7c478bd9Sstevel@tonic-gate 957*7c478bd9Sstevel@tonic-gate #define M_DEVMAKE(mjr, mnr) (makedev((mjr), (mnr))) 958*7c478bd9Sstevel@tonic-gate /* Build a dev_t from a major and minor # 959*7c478bd9Sstevel@tonic-gate * M_DEVMAKE(M_DEVMAJOR(sbp), M_DEVMINOR(sbp)) 960*7c478bd9Sstevel@tonic-gate * just returns the dev_t from the stat buf 961*7c478bd9Sstevel@tonic-gate */ 962*7c478bd9Sstevel@tonic-gate 963*7c478bd9Sstevel@tonic-gate #define M_INODIRENT(name, dirbuf) ((ino_t)((dirbuf)->d_ino)) 964*7c478bd9Sstevel@tonic-gate /* Prototype: 965*7c478bd9Sstevel@tonic-gate * ino_t M_INODIRENT(char *, struct dirent *); 966*7c478bd9Sstevel@tonic-gate * 967*7c478bd9Sstevel@tonic-gate * Return the inode belonging to the directory 968*7c478bd9Sstevel@tonic-gate * entry corresponding to dirbuf. The name 969*7c478bd9Sstevel@tonic-gate * parameter is the path name given to a 970*7c478bd9Sstevel@tonic-gate * previous call to opendir(). 971*7c478bd9Sstevel@tonic-gate */ 972*7c478bd9Sstevel@tonic-gate 973*7c478bd9Sstevel@tonic-gate #define M_ST_BLOCKS(sbp) ((sbp)->st_blocks) 974*7c478bd9Sstevel@tonic-gate #define M_ST_BLKSIZE(sbp) ((sbp)->st_blksize) 975*7c478bd9Sstevel@tonic-gate /* If the implementation supports, in the stat 976*7c478bd9Sstevel@tonic-gate * structure, the actual disk space allocation 977*7c478bd9Sstevel@tonic-gate * to a given file, then M_ST_BLOCKS should 978*7c478bd9Sstevel@tonic-gate * be defined to return that member from the 979*7c478bd9Sstevel@tonic-gate * passed stat structure pointer. 980*7c478bd9Sstevel@tonic-gate * M_ST_BLKSIZE should be the number of bytes 981*7c478bd9Sstevel@tonic-gate * in a M_ST_BLOCKS unit; normally a 982*7c478bd9Sstevel@tonic-gate * different member of the stat structure. 983*7c478bd9Sstevel@tonic-gate * 984*7c478bd9Sstevel@tonic-gate * These macros are not required. 985*7c478bd9Sstevel@tonic-gate * Programs that use these macros 986*7c478bd9Sstevel@tonic-gate * will fall back on computing these 987*7c478bd9Sstevel@tonic-gate * values from the st_size field. 988*7c478bd9Sstevel@tonic-gate */ 989*7c478bd9Sstevel@tonic-gate 990*7c478bd9Sstevel@tonic-gate #define M_MATHERR 0 /* If the math library supports matherr(), 991*7c478bd9Sstevel@tonic-gate * define with a non-zero value. 992*7c478bd9Sstevel@tonic-gate * MKS recommends that all ANSI-C libraries 993*7c478bd9Sstevel@tonic-gate * support this. 994*7c478bd9Sstevel@tonic-gate * By default, not defined. 995*7c478bd9Sstevel@tonic-gate */ 996*7c478bd9Sstevel@tonic-gate 997*7c478bd9Sstevel@tonic-gate #define M_AWK_SUBSEP "\034" /* Default SUBSEP value in awk. This value 998*7c478bd9Sstevel@tonic-gate * is appropriate for ASCII based character 999*7c478bd9Sstevel@tonic-gate * sets. 1000*7c478bd9Sstevel@tonic-gate */ 1001*7c478bd9Sstevel@tonic-gate 1002*7c478bd9Sstevel@tonic-gate #define M_FSCLOSE(fp) fclose(fp) 1003*7c478bd9Sstevel@tonic-gate /* define M_FSCLOSE(fp) to be the function 1004*7c478bd9Sstevel@tonic-gate * that cleans up the resources allocated 1005*7c478bd9Sstevel@tonic-gate * by m_fsopen(). 1006*7c478bd9Sstevel@tonic-gate * Since m_fsopen() implementation is system 1007*7c478bd9Sstevel@tonic-gate * specific, so is M_FSCLOSE(). 1008*7c478bd9Sstevel@tonic-gate */ 1009*7c478bd9Sstevel@tonic-gate 1010*7c478bd9Sstevel@tonic-gate #define M_LEX_8BIT 1 /* If this is defined, lex will produce 1011*7c478bd9Sstevel@tonic-gate * 8-bit tables by default (the normal 1012*7c478bd9Sstevel@tonic-gate * default is 7-bit tables). 1013*7c478bd9Sstevel@tonic-gate */ 1014*7c478bd9Sstevel@tonic-gate 1015*7c478bd9Sstevel@tonic-gate #define M_NUMSIZE 30 /* M_NUMSIZE should be defined to the length 1016*7c478bd9Sstevel@tonic-gate * in character positions, of the longest 1017*7c478bd9Sstevel@tonic-gate * number that can be sprintf()'d into a string 1018*7c478bd9Sstevel@tonic-gate * (longest of any type of number, 1019*7c478bd9Sstevel@tonic-gate * eg. float, long, double ...) 1020*7c478bd9Sstevel@tonic-gate * For example, if your system prints 1021*7c478bd9Sstevel@tonic-gate * 30 characters for sprintf(str, "%le", float) 1022*7c478bd9Sstevel@tonic-gate * then M_NUMSIZE should be set to at least 30. 1023*7c478bd9Sstevel@tonic-gate * 1024*7c478bd9Sstevel@tonic-gate * This is used in awk to guess at the size 1025*7c478bd9Sstevel@tonic-gate * that each element of an sprintf() will be 1026*7c478bd9Sstevel@tonic-gate * so that it can internally allocate enough 1027*7c478bd9Sstevel@tonic-gate * storage. 1028*7c478bd9Sstevel@tonic-gate * 1029*7c478bd9Sstevel@tonic-gate * If this is not defined, then a default 1030*7c478bd9Sstevel@tonic-gate * value is used from <mks.h> 1031*7c478bd9Sstevel@tonic-gate */ 1032*7c478bd9Sstevel@tonic-gate 1033*7c478bd9Sstevel@tonic-gate /* 1034*7c478bd9Sstevel@tonic-gate * File System (Naming) Attributes. 1035*7c478bd9Sstevel@tonic-gate * M_ONE_DOT, M_NO_LEADING_DOT, and M_SHORT_EXT are deprecated, in favour 1036*7c478bd9Sstevel@tonic-gate * of the m_fstype() function. However, until all code has been converted 1037*7c478bd9Sstevel@tonic-gate * they must be set appropriately. The obsolescent versions do not permit 1038*7c478bd9Sstevel@tonic-gate * supporting a system with multiple filesystem types: they are all statically 1039*7c478bd9Sstevel@tonic-gate * tested via pre-processor directives. The new version permits mixing for 1040*7c478bd9Sstevel@tonic-gate * example of a posix file system, with say a dos floppy file system, such 1041*7c478bd9Sstevel@tonic-gate * as is available on many unix systems today. 1042*7c478bd9Sstevel@tonic-gate * If your system is posix conformant, do not set any of these variables 1043*7c478bd9Sstevel@tonic-gate * or functions; <mks.h> will default to a #define for m_fstype to 1044*7c478bd9Sstevel@tonic-gate * a POSIX style naming convention. 1045*7c478bd9Sstevel@tonic-gate */ 1046*7c478bd9Sstevel@tonic-gate #undef M_FSTYPE /* If m_fstype is defined in mkslocal.h, 1047*7c478bd9Sstevel@tonic-gate * either as a #define, or a function decl. 1048*7c478bd9Sstevel@tonic-gate * then define M_FSTYPE, so <mks.h> won't 1049*7c478bd9Sstevel@tonic-gate * define m_fstype into M_FSTYPE_POSIX. 1050*7c478bd9Sstevel@tonic-gate */ 1051*7c478bd9Sstevel@tonic-gate 1052*7c478bd9Sstevel@tonic-gate #undef m_fstype(path) /* Either #define, or function returning a 1053*7c478bd9Sstevel@tonic-gate * combination of file naming attributes, 1054*7c478bd9Sstevel@tonic-gate * and the file system type. On a system 1055*7c478bd9Sstevel@tonic-gate * with only one file system type, this would 1056*7c478bd9Sstevel@tonic-gate * be a #define; on a system with multiple a 1057*7c478bd9Sstevel@tonic-gate * function which would decide based on the 1058*7c478bd9Sstevel@tonic-gate * path arg given. Either M_FSTYPE_POSIX or 1059*7c478bd9Sstevel@tonic-gate * M_FSTYPE_FAT, should be or'ed with any of 1060*7c478bd9Sstevel@tonic-gate * M_FSATTR_ONE_DOT, M_FSATTR_SHORT_EXT and 1061*7c478bd9Sstevel@tonic-gate * M_FSATTR_NO_LEADING_DOT. These three 1062*7c478bd9Sstevel@tonic-gate * M_FSATTR_ bit flags conform to the three 1063*7c478bd9Sstevel@tonic-gate * following obsolete defines. 1064*7c478bd9Sstevel@tonic-gate */ 1065*7c478bd9Sstevel@tonic-gate 1066*7c478bd9Sstevel@tonic-gate #undef M_ONE_DOT /* Use #define M_ONE_DOT 1 1067*7c478bd9Sstevel@tonic-gate * for non-posix files systems which 1068*7c478bd9Sstevel@tonic-gate * permit only one dot in a filename. 1069*7c478bd9Sstevel@tonic-gate * Thus, for example, y.tab.c, will become 1070*7c478bd9Sstevel@tonic-gate * ytab.c, based on this #define. 1071*7c478bd9Sstevel@tonic-gate * <mks.h> will default to undefined. 1072*7c478bd9Sstevel@tonic-gate */ 1073*7c478bd9Sstevel@tonic-gate 1074*7c478bd9Sstevel@tonic-gate #undef M_NO_LEADING_DOT /* Use #define M_NO_LEADING_DOT 1 for 1075*7c478bd9Sstevel@tonic-gate * non-posix file systems which do not 1076*7c478bd9Sstevel@tonic-gate * permit a leading dot in a filename. 1077*7c478bd9Sstevel@tonic-gate * Thus, for example, .profile will become 1078*7c478bd9Sstevel@tonic-gate * profile.ksh based on this #define. 1079*7c478bd9Sstevel@tonic-gate * <mks.h> will default to undefined. 1080*7c478bd9Sstevel@tonic-gate */ 1081*7c478bd9Sstevel@tonic-gate 1082*7c478bd9Sstevel@tonic-gate #undef M_SHORT_EXT /* Use #define M_SHORT_EXT 1 1083*7c478bd9Sstevel@tonic-gate * for non-posix file systems which 1084*7c478bd9Sstevel@tonic-gate * permit only a limited number of characters 1085*7c478bd9Sstevel@tonic-gate * after a dot in a filename. 1086*7c478bd9Sstevel@tonic-gate * Defining M_SHORT_EXT will limit filenames 1087*7c478bd9Sstevel@tonic-gate * to 3 characters after the dot. 1088*7c478bd9Sstevel@tonic-gate * For example, y.output will become y.out 1089*7c478bd9Sstevel@tonic-gate * <mks.h> will default to undefined. 1090*7c478bd9Sstevel@tonic-gate */ 1091*7c478bd9Sstevel@tonic-gate 1092*7c478bd9Sstevel@tonic-gate /* 1093*7c478bd9Sstevel@tonic-gate * customizations for ps field specifiers and widths 1094*7c478bd9Sstevel@tonic-gate * This will vary from system to system depending on the max size 1095*7c478bd9Sstevel@tonic-gate * of the values in the different fields 1096*7c478bd9Sstevel@tonic-gate * The following are UNIX (e.g SYSV and BSD) std defaults 1097*7c478bd9Sstevel@tonic-gate */ 1098*7c478bd9Sstevel@tonic-gate #define M_PS_FFMT { m_textstr(4865, "ruser=UID", "I"),\ 1099*7c478bd9Sstevel@tonic-gate m_textstr(4866, "pid,ppid,pcpu=C", "I"),\ 1100*7c478bd9Sstevel@tonic-gate m_textstr(4861, "stime,tty=TTY", "I"), "atime,args",\ 1101*7c478bd9Sstevel@tonic-gate NULL }; 1102*7c478bd9Sstevel@tonic-gate #define M_PS_JFMT { m_textstr(4867, "pid,sid,pgid=PGRP", "I"),\ 1103*7c478bd9Sstevel@tonic-gate m_textstr(4862, "tty=TTY", "I"), "atime,args", NULL }; 1104*7c478bd9Sstevel@tonic-gate #define M_PS_LFMT { m_textstr(4868, "flags,state,ruid=UID", "I"),\ 1105*7c478bd9Sstevel@tonic-gate m_textstr(4866, "pid,ppid,pcpu=C", "I"),\ 1106*7c478bd9Sstevel@tonic-gate m_textstr(4869, "pri,nice,addr,vsz=SZ", "I"),\ 1107*7c478bd9Sstevel@tonic-gate m_textstr(4870, "wchan,tty=TTY", "I"),\ 1108*7c478bd9Sstevel@tonic-gate m_textstr(4863, "atime,comm=COMD", "I"), NULL }; 1109*7c478bd9Sstevel@tonic-gate #define M_PS_DEFFMT { m_textstr(4864, "pid,tty=TTY", "I"), "atime,comm",\ 1110*7c478bd9Sstevel@tonic-gate NULL }; 1111*7c478bd9Sstevel@tonic-gate #define M_PS_PID_WIDTH 5 1112*7c478bd9Sstevel@tonic-gate #define M_PS_XPID_WIDTH 8 1113*7c478bd9Sstevel@tonic-gate #define M_PS_GID_WIDTH 5 1114*7c478bd9Sstevel@tonic-gate #define M_PS_UID_WIDTH 5 1115*7c478bd9Sstevel@tonic-gate #define M_PS_TTY_WIDTH 7 1116*7c478bd9Sstevel@tonic-gate /* 1117*7c478bd9Sstevel@tonic-gate * The syntax for specifying and displaying terminal names in ps and who 1118*7c478bd9Sstevel@tonic-gate * is required to be the same. 1119*7c478bd9Sstevel@tonic-gate * Since who gets the names from the utmp file, the ps utility 1120*7c478bd9Sstevel@tonic-gate * (and the m_psread() function) needs to know what format these terminal 1121*7c478bd9Sstevel@tonic-gate * names are presented in the utmp file. 1122*7c478bd9Sstevel@tonic-gate * It would appear that all systems have devices in the /dev/ file system 1123*7c478bd9Sstevel@tonic-gate * and that terminal names are displayed as the name rooted from "/dev". 1124*7c478bd9Sstevel@tonic-gate * Since ttyname() returns a full pathname, we can just strip 1125*7c478bd9Sstevel@tonic-gate * off the "/dev/" prefix and we will get the correct name. 1126*7c478bd9Sstevel@tonic-gate * 1127*7c478bd9Sstevel@tonic-gate * The ps utility uses ttyname() to get the name of the controlling terminal. 1128*7c478bd9Sstevel@tonic-gate * M_PS_TTY_PREFIX_TOSTRIP is a prefix string that must be removed from 1129*7c478bd9Sstevel@tonic-gate * the name that ttyname() returns in order to match the name returned 1130*7c478bd9Sstevel@tonic-gate * by m_psread(). 1131*7c478bd9Sstevel@tonic-gate * If no prefix is to be removed, then a zero length string ("") should be used 1132*7c478bd9Sstevel@tonic-gate */ 1133*7c478bd9Sstevel@tonic-gate #define M_PS_TTY_PREFIX_TOSTRIP "/dev/" 1134*7c478bd9Sstevel@tonic-gate 1135*7c478bd9Sstevel@tonic-gate 1136*7c478bd9Sstevel@tonic-gate #define M_LOCALE_NLS_DIR "/usr/lib" 1137*7c478bd9Sstevel@tonic-gate /* Define this if you have a system that 1138*7c478bd9Sstevel@tonic-gate * implements the MKS rootname() function 1139*7c478bd9Sstevel@tonic-gate * (e.g not a no-op) 1140*7c478bd9Sstevel@tonic-gate * and you want to specify the absolute 1141*7c478bd9Sstevel@tonic-gate * pathname to the NLS directory 1142*7c478bd9Sstevel@tonic-gate * which is independent of semantics of rootname(). 1143*7c478bd9Sstevel@tonic-gate * Depending on the implementation of rootname(), 1144*7c478bd9Sstevel@tonic-gate * it may prefix the path with $ROOTDIR environment 1145*7c478bd9Sstevel@tonic-gate * variable or it may return a path relative to 1146*7c478bd9Sstevel@tonic-gate * the know location of where the product has 1147*7c478bd9Sstevel@tonic-gate * been installed (or maybe something else!) 1148*7c478bd9Sstevel@tonic-gate * 1149*7c478bd9Sstevel@tonic-gate * If this is not defined, then locale will 1150*7c478bd9Sstevel@tonic-gate * call confstr(_CS_NLSDIR), which in turn calls 1151*7c478bd9Sstevel@tonic-gate * rootname(M_NLSDIR), and you get this resultant 1152*7c478bd9Sstevel@tonic-gate * pathname. 1153*7c478bd9Sstevel@tonic-gate * 1154*7c478bd9Sstevel@tonic-gate * Thus, if you want locale to look in the system native 1155*7c478bd9Sstevel@tonic-gate * nls directory, then define this. 1156*7c478bd9Sstevel@tonic-gate * Otherwise, it will probably look in a user 1157*7c478bd9Sstevel@tonic-gate * specified directory, or the product installation 1158*7c478bd9Sstevel@tonic-gate * directory. 1159*7c478bd9Sstevel@tonic-gate */ 1160*7c478bd9Sstevel@tonic-gate 1161*7c478bd9Sstevel@tonic-gate 1162*7c478bd9Sstevel@tonic-gate /* Cron configuration options: 1163*7c478bd9Sstevel@tonic-gate * M_CRON_USESFIFO define this (to 1) if your cron is implemented 1164*7c478bd9Sstevel@tonic-gate * using a FIFO (normally found in /usr/lib/cron/FIFO) 1165*7c478bd9Sstevel@tonic-gate * to accept communication from the at/batch/crontab 1166*7c478bd9Sstevel@tonic-gate * utilities when notifying cron of changes to the 1167*7c478bd9Sstevel@tonic-gate * at/batch queues or the user crontabs. 1168*7c478bd9Sstevel@tonic-gate * If this is not defined, then cron will expect 1169*7c478bd9Sstevel@tonic-gate * a signal (SIGUSR) from at/batch/crontab to indicate 1170*7c478bd9Sstevel@tonic-gate * a change in the at/batch queues or the crontabs 1171*7c478bd9Sstevel@tonic-gate * 1172*7c478bd9Sstevel@tonic-gate * M_CRONVARS_DEFINED define this if you define the pathnames below. 1173*7c478bd9Sstevel@tonic-gate * If you don't define this, then the pathnames that cron 1174*7c478bd9Sstevel@tonic-gate * uses is defined in src/cron/cronvars.c. 1175*7c478bd9Sstevel@tonic-gate * (e.g it uses the rootname() and the M_SPOOLDIR, 1176*7c478bd9Sstevel@tonic-gate * M_LIBDIR macros ) 1177*7c478bd9Sstevel@tonic-gate * 1178*7c478bd9Sstevel@tonic-gate * This can be used to override cronvars.c definitions 1179*7c478bd9Sstevel@tonic-gate * This is useful on systems that you don't want to 1180*7c478bd9Sstevel@tonic-gate * use MKS's cron daemon and thus, you have to define 1181*7c478bd9Sstevel@tonic-gate * the directories/files where the system cron expects 1182*7c478bd9Sstevel@tonic-gate * things. 1183*7c478bd9Sstevel@tonic-gate */ 1184*7c478bd9Sstevel@tonic-gate #undef M_CRON_USESFIFO 1185*7c478bd9Sstevel@tonic-gate 1186*7c478bd9Sstevel@tonic-gate #undef M_CRONVARS_DEFINED 1187*7c478bd9Sstevel@tonic-gate 1188*7c478bd9Sstevel@tonic-gate /* the following M_CRON_* macros necessary only 1189*7c478bd9Sstevel@tonic-gate * if M_CRONVARS_DEFINED is defined above 1190*7c478bd9Sstevel@tonic-gate */ 1191*7c478bd9Sstevel@tonic-gate #undef M_CRON_SPOOLDIR /* usually /usr/spool/cron */ 1192*7c478bd9Sstevel@tonic-gate #undef M_CRON_LIBDIR /* usually /usr/lib/cron */ 1193*7c478bd9Sstevel@tonic-gate #undef M_CRON_CRONTABSDIR /* usually /usr/spool/cron/crontabs */ 1194*7c478bd9Sstevel@tonic-gate #undef M_CRON_ATJOBSDIR /* usually /usr/spool/cron/atjobs */ 1195*7c478bd9Sstevel@tonic-gate #undef M_CRON_LOGFILE /* usually /usr/lib/cron/log */ 1196*7c478bd9Sstevel@tonic-gate #undef M_CRON_PIDFILE /* usually /usr/lib/cron/pid */ 1197*7c478bd9Sstevel@tonic-gate #undef M_CRON_QUEUEDEFSFILE /* usually /usr/lib/cron/queuedefs */ 1198*7c478bd9Sstevel@tonic-gate #undef M_CRON_FIFOFILE /* usually /usr/lib/cron/FIFO */ 1199*7c478bd9Sstevel@tonic-gate /* FIFOFILE only necessary if M_CRON_USESFIFO 1200*7c478bd9Sstevel@tonic-gate * is defined 1201*7c478bd9Sstevel@tonic-gate */ 1202*7c478bd9Sstevel@tonic-gate /* 1203*7c478bd9Sstevel@tonic-gate * M_CRON_MAILER: 1204*7c478bd9Sstevel@tonic-gate * This is a string that specifies a utility names 1205*7c478bd9Sstevel@tonic-gate * or a shell filter (e.g pipeline) that gets executed by the 1206*7c478bd9Sstevel@tonic-gate * cron daemon to deliver mail messages. 1207*7c478bd9Sstevel@tonic-gate * If this is NOT defined here, the the default case is used (see <mks.h>) 1208*7c478bd9Sstevel@tonic-gate * 1209*7c478bd9Sstevel@tonic-gate * Default case: 1210*7c478bd9Sstevel@tonic-gate * #define M_CRON_MAILER "sed -e s/^~/~~/ | mailx " 1211*7c478bd9Sstevel@tonic-gate * 1212*7c478bd9Sstevel@tonic-gate * Assumes only POSIX.2 mailx is available. 1213*7c478bd9Sstevel@tonic-gate * Must be careful when cron sends output to mailx. 1214*7c478bd9Sstevel@tonic-gate * We must ensure that lines with leading '~' are escaped 1215*7c478bd9Sstevel@tonic-gate * so mailx doesn't interpret these lines 1216*7c478bd9Sstevel@tonic-gate * This string MUST include a trailing space character. 1217*7c478bd9Sstevel@tonic-gate */ 1218*7c478bd9Sstevel@tonic-gate #define M_CRON_MAILER "sed -e s/^~/~~/ | mailx " 1219*7c478bd9Sstevel@tonic-gate 1220*7c478bd9Sstevel@tonic-gate 1221*7c478bd9Sstevel@tonic-gate /* 1222*7c478bd9Sstevel@tonic-gate * Defining M_SYSTEM_TMPDIR indicates that a system global 1223*7c478bd9Sstevel@tonic-gate * temporary directory should be used on this system. 1224*7c478bd9Sstevel@tonic-gate * This will override M_TMPDIR, and any calls to rootname(M_TMPDIR) 1225*7c478bd9Sstevel@tonic-gate * which is relative to the product installation directory 1226*7c478bd9Sstevel@tonic-gate */ 1227*7c478bd9Sstevel@tonic-gate #define M_SYSTEM_TMPDIR "/tmp" 1228*7c478bd9Sstevel@tonic-gate 1229*7c478bd9Sstevel@tonic-gate /* 1230*7c478bd9Sstevel@tonic-gate * ex/vi's recover command (and the program of the same name) 1231*7c478bd9Sstevel@tonic-gate * requires a directory in which to store any preserved tmp files. 1232*7c478bd9Sstevel@tonic-gate * Normally these are stored in rootname(M_ETCDIR(recover)) 1233*7c478bd9Sstevel@tonic-gate * which is becomes a directory name relative to ROOTDIR env variable (on DOS) 1234*7c478bd9Sstevel@tonic-gate * or relative to the product installation directory. 1235*7c478bd9Sstevel@tonic-gate * Defining M_PRESERVEDIR will ensure that this directory is used 1236*7c478bd9Sstevel@tonic-gate * and calls to rootname() are bypassed. 1237*7c478bd9Sstevel@tonic-gate * (e.g the absolute directory name defined by M_PRESERVEDIR will be used) 1238*7c478bd9Sstevel@tonic-gate */ 1239*7c478bd9Sstevel@tonic-gate #define M_PRESERVEDIR "/var/recover" 1240*7c478bd9Sstevel@tonic-gate 1241*7c478bd9Sstevel@tonic-gate /* 1242*7c478bd9Sstevel@tonic-gate * Defining M_SYSTEM_MAILDIR will cause mailx to use this 1243*7c478bd9Sstevel@tonic-gate * absolute directory name - e.g bypass the call to rootname() so 1244*7c478bd9Sstevel@tonic-gate * it doesn't become relative to product installation directory. 1245*7c478bd9Sstevel@tonic-gate */ 1246*7c478bd9Sstevel@tonic-gate #define M_SYSTEM_MAILDIR "/usr/mail" 1247*7c478bd9Sstevel@tonic-gate 1248*7c478bd9Sstevel@tonic-gate 1249*7c478bd9Sstevel@tonic-gate #undef M_ULIMIT_AVAIL /* define this if your system provides the SystemV 1250*7c478bd9Sstevel@tonic-gate * ulimit() API and the <ulimit.h> header file 1251*7c478bd9Sstevel@tonic-gate * 1252*7c478bd9Sstevel@tonic-gate * This information is used by 'at' utility 1253*7c478bd9Sstevel@tonic-gate */ 1254*7c478bd9Sstevel@tonic-gate 1255*7c478bd9Sstevel@tonic-gate /* 1256*7c478bd9Sstevel@tonic-gate * Shell configuration options. 1257*7c478bd9Sstevel@tonic-gate * NOTE: If not defined here, then there may be 1258*7c478bd9Sstevel@tonic-gate * a default defined in src/sh/sh.h; NOT <mks.h>. 1259*7c478bd9Sstevel@tonic-gate * 1260*7c478bd9Sstevel@tonic-gate * You must configure built-in utilities in sh/sh.mk. 1261*7c478bd9Sstevel@tonic-gate * Currently, test and printf can be built-in. 1262*7c478bd9Sstevel@tonic-gate * If you just compile the shell without -D's, 1263*7c478bd9Sstevel@tonic-gate * you do not get these built-in utilities. 1264*7c478bd9Sstevel@tonic-gate */ 1265*7c478bd9Sstevel@tonic-gate #define M_SH_ULIMIT 0 /* Shell SVR4 ulimit built-in. 1266*7c478bd9Sstevel@tonic-gate * Uses getrlimit/setrlimit(2). 1267*7c478bd9Sstevel@tonic-gate * 1268*7c478bd9Sstevel@tonic-gate * NOTE: This may be defined in mkslocal.mk 1269*7c478bd9Sstevel@tonic-gate * along with the build configuration required 1270*7c478bd9Sstevel@tonic-gate * for shbltin.c. 1271*7c478bd9Sstevel@tonic-gate */ 1272*7c478bd9Sstevel@tonic-gate /* M_SH_GETCWD removed, no longer used. default for physical cd/pwd */ 1273*7c478bd9Sstevel@tonic-gate #define M_SH_BGNICE 0 /* Set -o bgnice for interactive shell. 1274*7c478bd9Sstevel@tonic-gate */ 1275*7c478bd9Sstevel@tonic-gate #define M_SH_BUILTIN_SEARCH 1 /* Do path search for utility built-ins. 1276*7c478bd9Sstevel@tonic-gate * See POSIX.2/D12, section 3.9.1.1. 1277*7c478bd9Sstevel@tonic-gate * Currently they are: 1278*7c478bd9Sstevel@tonic-gate * [, echo, test, time, printf, pwd. 1279*7c478bd9Sstevel@tonic-gate */ 1280*7c478bd9Sstevel@tonic-gate #define M_SH_RSH 0 /* rsh is installed as a link to sh. 1281*7c478bd9Sstevel@tonic-gate * Vendor option, not required by any standard. 1282*7c478bd9Sstevel@tonic-gate * Not recommended on UNIX. 1283*7c478bd9Sstevel@tonic-gate */ 1284*7c478bd9Sstevel@tonic-gate #define M_SH_USER_FDS 10 /* Number of user file descriptors. 1285*7c478bd9Sstevel@tonic-gate * The value for [n] in redirection 1286*7c478bd9Sstevel@tonic-gate * can be between 0 and M_SH_USER_FDS-1. 1287*7c478bd9Sstevel@tonic-gate * Must be >= 10, should be <= OPEN_MAX/2. 1288*7c478bd9Sstevel@tonic-gate */ 1289*7c478bd9Sstevel@tonic-gate #define M_SH_LINE_MAX LINE_MAX /* Shell input line buffer size. 1290*7c478bd9Sstevel@tonic-gate */ 1291*7c478bd9Sstevel@tonic-gate #undef M_JOB_CONTROL_OFF /* Disable job control, 1292*7c478bd9Sstevel@tonic-gate * were _POSIX_JOB_CONTROL is defined. 1293*7c478bd9Sstevel@tonic-gate */ 1294*7c478bd9Sstevel@tonic-gate #undef M_COPYRIGHT /* MKS Toolkit. 1295*7c478bd9Sstevel@tonic-gate * Print MKS copyright on startup (sh). 1296*7c478bd9Sstevel@tonic-gate */ 1297*7c478bd9Sstevel@tonic-gate #undef M_SH_CRITERROR /* MKS Toolkit. 1298*7c478bd9Sstevel@tonic-gate * set -o criterror (DOS, OS/2). 1299*7c478bd9Sstevel@tonic-gate */ 1300*7c478bd9Sstevel@tonic-gate 1301*7c478bd9Sstevel@tonic-gate #define M_SH_MAX_FUNCTION_EVAL_DEPTH 100 1302*7c478bd9Sstevel@tonic-gate /* The limit on how deep function 1303*7c478bd9Sstevel@tonic-gate * evaluation can go when shell 1304*7c478bd9Sstevel@tonic-gate * functions execute shell functions. 1305*7c478bd9Sstevel@tonic-gate * This stops the shell from crashing 1306*7c478bd9Sstevel@tonic-gate * if an infinitely recursive function 1307*7c478bd9Sstevel@tonic-gate * is evaluated. If the value is 0 1308*7c478bd9Sstevel@tonic-gate * then functions can't be executed at 1309*7c478bd9Sstevel@tonic-gate * all, if the value is 1 then 1310*7c478bd9Sstevel@tonic-gate * functions can't execute other 1311*7c478bd9Sstevel@tonic-gate * functions, and so on. If the macro 1312*7c478bd9Sstevel@tonic-gate * M_STKCHK is defined then there will 1313*7c478bd9Sstevel@tonic-gate * be no limit and M_STKCHK will be 1314*7c478bd9Sstevel@tonic-gate * used to prevent a crash. 1315*7c478bd9Sstevel@tonic-gate */ 1316*7c478bd9Sstevel@tonic-gate 1317*7c478bd9Sstevel@tonic-gate #undef M_SPAWN /* This code is prototype code only. It 1318*7c478bd9Sstevel@tonic-gate * has not been tested, and should not be 1319*7c478bd9Sstevel@tonic-gate * used. 1320*7c478bd9Sstevel@tonic-gate * This code is not supported, except through 1321*7c478bd9Sstevel@tonic-gate * special arrangements with MKS. 1322*7c478bd9Sstevel@tonic-gate */ 1323*7c478bd9Sstevel@tonic-gate 1324*7c478bd9Sstevel@tonic-gate 1325*7c478bd9Sstevel@tonic-gate #define M_EXPR_POSIX 1 1326*7c478bd9Sstevel@tonic-gate /* 1327*7c478bd9Sstevel@tonic-gate * POSIX requires that numbers on the 1328*7c478bd9Sstevel@tonic-gate * expr command line always be considered 1329*7c478bd9Sstevel@tonic-gate * decimal. We support octal and hex as 1330*7c478bd9Sstevel@tonic-gate * as well. Defining this will turn that 1331*7c478bd9Sstevel@tonic-gate * extension off by default, but it is still 1332*7c478bd9Sstevel@tonic-gate * accessible by specifying the new '-W' flag 1333*7c478bd9Sstevel@tonic-gate */ 1334*7c478bd9Sstevel@tonic-gate 1335*7c478bd9Sstevel@tonic-gate #undef M_RE_SUB_ANCHOR /* Define this if you wish your baisc regular 1336*7c478bd9Sstevel@tonic-gate * expressions to support anchors 1337*7c478bd9Sstevel@tonic-gate * (^ and $) inside of subexpressions. 1338*7c478bd9Sstevel@tonic-gate * See POSIX.2 section 2.8.3.5. 1339*7c478bd9Sstevel@tonic-gate */ 1340*7c478bd9Sstevel@tonic-gate 1341*7c478bd9Sstevel@tonic-gate 1342*7c478bd9Sstevel@tonic-gate /* 1343*7c478bd9Sstevel@tonic-gate * In order to get full Posix.2 i18n, then you must either: 1344*7c478bd9Sstevel@tonic-gate * 1345*7c478bd9Sstevel@tonic-gate * i) Use the full mks ansi-c library; mks localedef, mks locale.h file... 1346*7c478bd9Sstevel@tonic-gate * ii) Extend your own ansi-c library to contain the mks specified functions 1347*7c478bd9Sstevel@tonic-gate * as described in the mks Porting and Tuning Guide. 1348*7c478bd9Sstevel@tonic-gate * 1349*7c478bd9Sstevel@tonic-gate * Otherwise, it is not possible to conform to posix .2. 1350*7c478bd9Sstevel@tonic-gate * 1351*7c478bd9Sstevel@tonic-gate * You may still turn on I18N, and get as much internationalization as is 1352*7c478bd9Sstevel@tonic-gate * possible using a standard ANSI-C compiler. 1353*7c478bd9Sstevel@tonic-gate * 1354*7c478bd9Sstevel@tonic-gate * Your options are: 1355*7c478bd9Sstevel@tonic-gate * i) Full posix conformance. You must have i or ii above, and must define 1356*7c478bd9Sstevel@tonic-gate * M_I18N and M_I18N_MKS_{FULL,XPG}. 1357*7c478bd9Sstevel@tonic-gate * ii) I18N at ANSI-C level. You must define I18N, do not 1358*7c478bd9Sstevel@tonic-gate * define M_I18N_MKS_{FULL,XPG}. 1359*7c478bd9Sstevel@tonic-gate * iii) No I18N. Do not define I18N, do not define M_I18N_MKS_{FULL,XPG}. */ 1360*7c478bd9Sstevel@tonic-gate #define I18N 1 /* OBSOLESCENT version of I18N 1361*7c478bd9Sstevel@tonic-gate * This should be removed when all occurances 1362*7c478bd9Sstevel@tonic-gate * of I18N are removed from the MKS code 1363*7c478bd9Sstevel@tonic-gate */ 1364*7c478bd9Sstevel@tonic-gate #define M_I18N 1 /* Do we want internationalized code? To build 1365*7c478bd9Sstevel@tonic-gate * a system where everything gets deleted at 1366*7c478bd9Sstevel@tonic-gate * compile time via #define's when possible, 1367*7c478bd9Sstevel@tonic-gate * this flag should be set. <mks.h> does not 1368*7c478bd9Sstevel@tonic-gate * define I18N, but it is normal to set it. 1369*7c478bd9Sstevel@tonic-gate */ 1370*7c478bd9Sstevel@tonic-gate #define M_I18N_MKS_FULL 1 /* Defining this, indicates you are using 1371*7c478bd9Sstevel@tonic-gate * MKS i18n extension routines 1372*7c478bd9Sstevel@tonic-gate * (e.g m_collrange(), m_collequiv() ... 1373*7c478bd9Sstevel@tonic-gate * localedtconv, localeldconv() ...) 1374*7c478bd9Sstevel@tonic-gate * Defining this to 2 indicates that you 1375*7c478bd9Sstevel@tonic-gate * want to use MKS's implementation of these 1376*7c478bd9Sstevel@tonic-gate * routines and the implementation of MKS's 1377*7c478bd9Sstevel@tonic-gate * format of the locale data files. 1378*7c478bd9Sstevel@tonic-gate * Defining this to 1 indicates you don't want 1379*7c478bd9Sstevel@tonic-gate * MKS's implementation, and you must write 1380*7c478bd9Sstevel@tonic-gate * your own code for m_collrange(), collequiv() 1381*7c478bd9Sstevel@tonic-gate * ... 1382*7c478bd9Sstevel@tonic-gate * note: there are some routines like 1383*7c478bd9Sstevel@tonic-gate * localedtconv which can obtain the 1384*7c478bd9Sstevel@tonic-gate * necessary info from nl_langinfo() 1385*7c478bd9Sstevel@tonic-gate * if this is supported 1386*7c478bd9Sstevel@tonic-gate * See M_I18N_MKS_XPG below 1387*7c478bd9Sstevel@tonic-gate */ 1388*7c478bd9Sstevel@tonic-gate #define M_I18N_MKS_XPG 1 /* This is only useful if M_I18N_MKS_FULL == 1. 1389*7c478bd9Sstevel@tonic-gate * This flag indicates that nl_langinfo() 1390*7c478bd9Sstevel@tonic-gate * is available and can be used to 1391*7c478bd9Sstevel@tonic-gate * retrieve some of the locale information. 1392*7c478bd9Sstevel@tonic-gate * ( used in localeldconv() and localedtconv() 1393*7c478bd9Sstevel@tonic-gate * routines) 1394*7c478bd9Sstevel@tonic-gate */ 1395*7c478bd9Sstevel@tonic-gate 1396*7c478bd9Sstevel@tonic-gate #define M_I18N_M_ 1 /* MKS has defined some additions i18n API's. 1397*7c478bd9Sstevel@tonic-gate * (e.g m_collequiv, m_collrange ...) 1398*7c478bd9Sstevel@tonic-gate * This flag indicates that these API's start 1399*7c478bd9Sstevel@tonic-gate * with "m_". 1400*7c478bd9Sstevel@tonic-gate * It is the MKS intention that if these 1401*7c478bd9Sstevel@tonic-gate * extentions get approved/standardized 1402*7c478bd9Sstevel@tonic-gate * (by POSIX or ANSI or ...) 1403*7c478bd9Sstevel@tonic-gate * all code will have the m_ removed. 1404*7c478bd9Sstevel@tonic-gate * Since it is not yet approved, 1405*7c478bd9Sstevel@tonic-gate * we are maintaining the mks conventions of 1406*7c478bd9Sstevel@tonic-gate * prefixing our private libraries with m_. 1407*7c478bd9Sstevel@tonic-gate * If you have chosen to implement these 1408*7c478bd9Sstevel@tonic-gate * routines without the m_ do not define 1409*7c478bd9Sstevel@tonic-gate * M_I18N_M_ 1410*7c478bd9Sstevel@tonic-gate */ 1411*7c478bd9Sstevel@tonic-gate 1412*7c478bd9Sstevel@tonic-gate #define M_I18N_MB 1 /* Define if multibyte character support 1413*7c478bd9Sstevel@tonic-gate * is required. 1414*7c478bd9Sstevel@tonic-gate */ 1415*7c478bd9Sstevel@tonic-gate 1416*7c478bd9Sstevel@tonic-gate #define M_LOCALEINFO_IN_DIRECTORY 1 1417*7c478bd9Sstevel@tonic-gate /* This macro indicates if the locale 1418*7c478bd9Sstevel@tonic-gate * information is stored in a directory, 1419*7c478bd9Sstevel@tonic-gate * or in a file. 1420*7c478bd9Sstevel@tonic-gate * For instance, many systems use 1421*7c478bd9Sstevel@tonic-gate * /usr/lib/locale 1422*7c478bd9Sstevel@tonic-gate * as a directory to store all their locale 1423*7c478bd9Sstevel@tonic-gate * information. 1424*7c478bd9Sstevel@tonic-gate * In this directory is stored the info 1425*7c478bd9Sstevel@tonic-gate * for each supported locale. 1426*7c478bd9Sstevel@tonic-gate * (e.g POSIX, C, en_US, fr, ...) 1427*7c478bd9Sstevel@tonic-gate * It is assumed that there is one entry here 1428*7c478bd9Sstevel@tonic-gate * for each supported locale. 1429*7c478bd9Sstevel@tonic-gate * If these entries are sub-directories, 1430*7c478bd9Sstevel@tonic-gate * then this macro is defined. 1431*7c478bd9Sstevel@tonic-gate * If these entries are files, then do not 1432*7c478bd9Sstevel@tonic-gate * define this macro. 1433*7c478bd9Sstevel@tonic-gate */ 1434*7c478bd9Sstevel@tonic-gate 1435*7c478bd9Sstevel@tonic-gate #undef M_I18N_LOCKING_SHIFT /* Define if any multibyte character sets 1436*7c478bd9Sstevel@tonic-gate * used are locking-shift character sets. 1437*7c478bd9Sstevel@tonic-gate */ 1438*7c478bd9Sstevel@tonic-gate 1439*7c478bd9Sstevel@tonic-gate 1440*7c478bd9Sstevel@tonic-gate #undef M_VARIANTS /* This can be defined on EBCDIC systems 1441*7c478bd9Sstevel@tonic-gate * where the POSIX.2 portable characters are not 1442*7c478bd9Sstevel@tonic-gate * invariant across all the code pages 1443*7c478bd9Sstevel@tonic-gate * supported. 1444*7c478bd9Sstevel@tonic-gate * By defineing this, user is allowed 1445*7c478bd9Sstevel@tonic-gate * to define the encodings 1446*7c478bd9Sstevel@tonic-gate * for these characters as they switch between 1447*7c478bd9Sstevel@tonic-gate * the various code pages by setting up 1448*7c478bd9Sstevel@tonic-gate * the VARIANTS environment variable.. 1449*7c478bd9Sstevel@tonic-gate * so that the various utilities will cope 1450*7c478bd9Sstevel@tonic-gate * with the different encodings gracefully. 1451*7c478bd9Sstevel@tonic-gate */ 1452*7c478bd9Sstevel@tonic-gate /* Source code hints: 1453*7c478bd9Sstevel@tonic-gate * if you define this, you will need 1454*7c478bd9Sstevel@tonic-gate * h/variant.h, h/m_invari.h 1455*7c478bd9Sstevel@tonic-gate * libc/mks/getsyntx.c, 1456*7c478bd9Sstevel@tonic-gate * libc/mks/m_varian.c 1457*7c478bd9Sstevel@tonic-gate * 1458*7c478bd9Sstevel@tonic-gate * If this is not defined, then all you need 1459*7c478bd9Sstevel@tonic-gate * is 1460*7c478bd9Sstevel@tonic-gate * h/m_invar.h 1461*7c478bd9Sstevel@tonic-gate */ 1462*7c478bd9Sstevel@tonic-gate 1463*7c478bd9Sstevel@tonic-gate /* 1464*7c478bd9Sstevel@tonic-gate * Define the following if you want the corresponding posix define with 1465*7c478bd9Sstevel@tonic-gate * a single leading underscore 1466*7c478bd9Sstevel@tonic-gate */ 1467*7c478bd9Sstevel@tonic-gate #define __POSIX_JOB_CONTROL _POSIX_JOB_CONTROL 1468*7c478bd9Sstevel@tonic-gate #define __POSIX_SAVED_IDS _POSIX_SAVED_IDS 1469*7c478bd9Sstevel@tonic-gate #define __POSIX_NO_TRUNC (-1) 1470*7c478bd9Sstevel@tonic-gate #define __POSIX_VDISABLE 0xff 1471*7c478bd9Sstevel@tonic-gate 1472*7c478bd9Sstevel@tonic-gate /* 1473*7c478bd9Sstevel@tonic-gate * On some systems where code size and performance are problems, it 1474*7c478bd9Sstevel@tonic-gate * may be desirable to use a simplified version of the m_loxclose() routine 1475*7c478bd9Sstevel@tonic-gate * in programs that don't require the full functionality. If this is the 1476*7c478bd9Sstevel@tonic-gate * case and routine m_loxqclose() has been provided, define the following 1477*7c478bd9Sstevel@tonic-gate * macro. (Refer to the Library/eXecutable/Object interface documentation 1478*7c478bd9Sstevel@tonic-gate * for more information. 1479*7c478bd9Sstevel@tonic-gate */ 1480*7c478bd9Sstevel@tonic-gate #undef M_LOXQCLOSE 1481*7c478bd9Sstevel@tonic-gate 1482*7c478bd9Sstevel@tonic-gate /* 1483*7c478bd9Sstevel@tonic-gate * some systems require overrides after <mks.h> is read. 1484*7c478bd9Sstevel@tonic-gate * If your system requires this, define M_MKSEXTRA_H here 1485*7c478bd9Sstevel@tonic-gate * so that the "#include <mksextra.h>" is exposed in <mks.h> 1486*7c478bd9Sstevel@tonic-gate */ 1487*7c478bd9Sstevel@tonic-gate #undef M_MKSEXTRA_H 1488*7c478bd9Sstevel@tonic-gate 1489*7c478bd9Sstevel@tonic-gate /* 1490*7c478bd9Sstevel@tonic-gate * mailx configuration 1491*7c478bd9Sstevel@tonic-gate */ 1492*7c478bd9Sstevel@tonic-gate 1493*7c478bd9Sstevel@tonic-gate /* 1494*7c478bd9Sstevel@tonic-gate * Many mail systems support the non-standard "Content-Length" header 1495*7c478bd9Sstevel@tonic-gate * which contains the length of the body of the message (not including 1496*7c478bd9Sstevel@tonic-gate * the headers) in bytes. Defining M_MAILX_CONTENT_LENGTH_ENABLE will 1497*7c478bd9Sstevel@tonic-gate * turn on code in mailx to generate this header when mail is sent and 1498*7c478bd9Sstevel@tonic-gate * honour it when scanning mailboxes. 1499*7c478bd9Sstevel@tonic-gate */ 1500*7c478bd9Sstevel@tonic-gate #undef M_MAILX_CONTENT_LENGHT_ENABLE 1501*7c478bd9Sstevel@tonic-gate 1502*7c478bd9Sstevel@tonic-gate #endif /* 0. not required for POSIX systems; here for documentation only */ 1503*7c478bd9Sstevel@tonic-gate 1504*7c478bd9Sstevel@tonic-gate 1505*7c478bd9Sstevel@tonic-gate #define halloc(n,s) malloc((size_t)((n)*(s)))/* alloc big chunk of mem*/ 1506*7c478bd9Sstevel@tonic-gate #define hfree(ptr) free(ptr) /* free big chunk of mem */ 1507*7c478bd9Sstevel@tonic-gate #define m_cp(src, dest, ssb, flags) (M_CP_NOOP) 1508*7c478bd9Sstevel@tonic-gate #define rootname(fn) fn /* make relative to root */ 1509*7c478bd9Sstevel@tonic-gate 1510*7c478bd9Sstevel@tonic-gate 1511*7c478bd9Sstevel@tonic-gate /* 1512*7c478bd9Sstevel@tonic-gate * MKS makes use of types that may or may not already be defined in the 1513*7c478bd9Sstevel@tonic-gate * system <sys/types.h> file. If not defined, then they must be defined 1514*7c478bd9Sstevel@tonic-gate * here. (The problem is a lack of #if directive to determine an existing 1515*7c478bd9Sstevel@tonic-gate * typedef. 1516*7c478bd9Sstevel@tonic-gate */ 1517*7c478bd9Sstevel@tonic-gate typedef unsigned char uchar; 1518*7c478bd9Sstevel@tonic-gate typedef unsigned short ushort; 1519*7c478bd9Sstevel@tonic-gate typedef unsigned int uint; 1520*7c478bd9Sstevel@tonic-gate typedef unsigned long ulong; 1521*7c478bd9Sstevel@tonic-gate 1522*7c478bd9Sstevel@tonic-gate /* 1523*7c478bd9Sstevel@tonic-gate * Define any Optional Facility Configuration Values here. 1524*7c478bd9Sstevel@tonic-gate * See POSIX.2, 2.13.2, Table 2-18 1525*7c478bd9Sstevel@tonic-gate * We define them here as M_ entries; this allows unistd.h to test the 1526*7c478bd9Sstevel@tonic-gate * M_ variable, and if defined, define the official _POSIX2_ variable. 1527*7c478bd9Sstevel@tonic-gate * **Note: It isn't permitted for a real conforming unistd.h to #include <mks.h> 1528*7c478bd9Sstevel@tonic-gate * due to name space contamination problems. A real, conforming implementation 1529*7c478bd9Sstevel@tonic-gate * will manually modify their unistd.h to define the _POSIX2 variables 1530*7c478bd9Sstevel@tonic-gate * appropriately. 1531*7c478bd9Sstevel@tonic-gate */ 1532*7c478bd9Sstevel@tonic-gate #define M_POSIX2_C_BIND 1 1533*7c478bd9Sstevel@tonic-gate #define M_POSIX2_C_DEV 1 1534*7c478bd9Sstevel@tonic-gate #undef M_POSIX2_FORT_DEV 1535*7c478bd9Sstevel@tonic-gate #undef M_POSIX2_FORT_RUN 1536*7c478bd9Sstevel@tonic-gate #define M_POSIX2_LOCALEDEF 1 1537*7c478bd9Sstevel@tonic-gate #define M_POSIX2_SW_DEV 1 1538*7c478bd9Sstevel@tonic-gate 1539*7c478bd9Sstevel@tonic-gate /* 1540*7c478bd9Sstevel@tonic-gate * New definitions for I/PSU 3.3 1541*7c478bd9Sstevel@tonic-gate */ 1542*7c478bd9Sstevel@tonic-gate 1543*7c478bd9Sstevel@tonic-gate #undef M_POSIX_PFNCS_ONLY /* define this to be true if the implementation 1544*7c478bd9Sstevel@tonic-gate * only supports the portable filename 1545*7c478bd9Sstevel@tonic-gate * set as defined in POSIX.1 1546*7c478bd9Sstevel@tonic-gate */ 1547*7c478bd9Sstevel@tonic-gate 1548*7c478bd9Sstevel@tonic-gate #undef M_NO_STIME /* set this define to be true if the system 1549*7c478bd9Sstevel@tonic-gate * does not support the stime() API. 1550*7c478bd9Sstevel@tonic-gate */ 1551*7c478bd9Sstevel@tonic-gate 1552*7c478bd9Sstevel@tonic-gate #undef M_TTYSTREAM /* if it isn't possible to open a new console 1553*7c478bd9Sstevel@tonic-gate * stream through device names, define this 1554*7c478bd9Sstevel@tonic-gate * macro to be true. The support library must 1555*7c478bd9Sstevel@tonic-gate * define a routine "m_ttystream()" that can 1556*7c478bd9Sstevel@tonic-gate * return the required stream. 1557*7c478bd9Sstevel@tonic-gate */ 1558*7c478bd9Sstevel@tonic-gate 1559*7c478bd9Sstevel@tonic-gate #undef M_NOT_ROOT /* this should be defined to be the name of a 1560*7c478bd9Sstevel@tonic-gate * library routine that returns true if the 1561*7c478bd9Sstevel@tonic-gate * process has appropriate privileges 1562*7c478bd9Sstevel@tonic-gate */ 1563*7c478bd9Sstevel@tonic-gate 1564*7c478bd9Sstevel@tonic-gate #undef M_NO_VI_KEYPAD /* this should be defined when the system 1565*7c478bd9Sstevel@tonic-gate * can't support keypad and cursor-key 1566*7c478bd9Sstevel@tonic-gate * functions in vi. 1567*7c478bd9Sstevel@tonic-gate */ 1568*7c478bd9Sstevel@tonic-gate 1569*7c478bd9Sstevel@tonic-gate #undef M_USERID_FMT /* format string for printing out the user 1570*7c478bd9Sstevel@tonic-gate * name. It is "%-8.8s" by default. 1571*7c478bd9Sstevel@tonic-gate */ 1572*7c478bd9Sstevel@tonic-gate 1573*7c478bd9Sstevel@tonic-gate #undef M_USE_M_CP /* indicates that code is to use the m_cp() 1574*7c478bd9Sstevel@tonic-gate * interface. 1575*7c478bd9Sstevel@tonic-gate * (Note - this API is not fully supported 1576*7c478bd9Sstevel@tonic-gate * in the IPSU.3.X development line. Full 1577*7c478bd9Sstevel@tonic-gate * support will be available in a future 1578*7c478bd9Sstevel@tonic-gate * major release.) 1579*7c478bd9Sstevel@tonic-gate */ 1580*7c478bd9Sstevel@tonic-gate 1581*7c478bd9Sstevel@tonic-gate #undef M_GUESS_FILE_TYPE /* If the system provides alternative 1582*7c478bd9Sstevel@tonic-gate * mechanisms for determining the type of a 1583*7c478bd9Sstevel@tonic-gate * file, define this macro to true. If you are 1584*7c478bd9Sstevel@tonic-gate * using this feature, you must provide a new 1585*7c478bd9Sstevel@tonic-gate * function int m_guess_file_type(char *name); 1586*7c478bd9Sstevel@tonic-gate * Returns true if type of file name is 1587*7c478bd9Sstevel@tonic-gate * successfully identified. 1588*7c478bd9Sstevel@tonic-gate * (Note - this API is not fully supported in 1589*7c478bd9Sstevel@tonic-gate * the IPSU.3.X development line. Full 1590*7c478bd9Sstevel@tonic-gate * support will be available in a future 1591*7c478bd9Sstevel@tonic-gate * major release.) 1592*7c478bd9Sstevel@tonic-gate */ 1593*7c478bd9Sstevel@tonic-gate 1594*7c478bd9Sstevel@tonic-gate #undef M_INCR_NICE /* default nice incr, if this macro is not 1595*7c478bd9Sstevel@tonic-gate * defined a builtin default will be used 1596*7c478bd9Sstevel@tonic-gate * (see the source for nice for more details.) 1597*7c478bd9Sstevel@tonic-gate */ 1598*7c478bd9Sstevel@tonic-gate 1599*7c478bd9Sstevel@tonic-gate #undef M_INCR_RENICE /* default renice incr, if this macro is 1600*7c478bd9Sstevel@tonic-gate * not defined a builtin default will be 1601*7c478bd9Sstevel@tonic-gate * used (see the source for renice for more 1602*7c478bd9Sstevel@tonic-gate * details.) 1603*7c478bd9Sstevel@tonic-gate */ 1604*7c478bd9Sstevel@tonic-gate 1605*7c478bd9Sstevel@tonic-gate #undef M_PS_COMM_WIDTH /* width of command field printed by PS */ 1606*7c478bd9Sstevel@tonic-gate 1607*7c478bd9Sstevel@tonic-gate #undef M_PS_USER_WIDTH /* width of user and ruser fields printed by 1608*7c478bd9Sstevel@tonic-gate * PS 1609*7c478bd9Sstevel@tonic-gate */ 1610*7c478bd9Sstevel@tonic-gate 1611*7c478bd9Sstevel@tonic-gate #undef M_PS_PRI_WIDTH /* width of PRI field printed by PS */ 1612*7c478bd9Sstevel@tonic-gate 1613*7c478bd9Sstevel@tonic-gate #undef M_UT_TIME_STRING /* true if utmp ut_time struct is a string 1614*7c478bd9Sstevel@tonic-gate * instead of a number. 1615*7c478bd9Sstevel@tonic-gate */ 1616*7c478bd9Sstevel@tonic-gate 1617*7c478bd9Sstevel@tonic-gate #undef M_SH_ENTRY1 1618*7c478bd9Sstevel@tonic-gate #undef M_SH_ENTRY2 1619*7c478bd9Sstevel@tonic-gate #undef M_SH_ENTRY3 1620*7c478bd9Sstevel@tonic-gate /* The above 3 macros are provide in the 1621*7c478bd9Sstevel@tonic-gate * shell to allow system-specific extensions 1622*7c478bd9Sstevel@tonic-gate * to be added. 1623*7c478bd9Sstevel@tonic-gate * (Note - this API is not fully supported in 1624*7c478bd9Sstevel@tonic-gate * the IPSU.3.X development line. Full 1625*7c478bd9Sstevel@tonic-gate * support will be available in a future 1626*7c478bd9Sstevel@tonic-gate * major release.) 1627*7c478bd9Sstevel@tonic-gate */ 1628*7c478bd9Sstevel@tonic-gate 1629*7c478bd9Sstevel@tonic-gate #undef M_NO_CANONICAL_MODE /* set this macro to true if the system 1630*7c478bd9Sstevel@tonic-gate * doesn't support tty buffering in 1631*7c478bd9Sstevel@tonic-gate * canonical mode. 1632*7c478bd9Sstevel@tonic-gate */ 1633*7c478bd9Sstevel@tonic-gate 1634*7c478bd9Sstevel@tonic-gate #undef M_NO_PASSWD_SCAN /* true if system doesn't provide a 1635*7c478bd9Sstevel@tonic-gate * mechanism for scanning a list of all 1636*7c478bd9Sstevel@tonic-gate * users on the system. 1637*7c478bd9Sstevel@tonic-gate */ 1638*7c478bd9Sstevel@tonic-gate 1639*7c478bd9Sstevel@tonic-gate #define M_GROUP_PASSWD(grp) "" 1640*7c478bd9Sstevel@tonic-gate /* prototype: 1641*7c478bd9Sstevel@tonic-gate * char *M_GROUP_PASSWD(struct group *grp) 1642*7c478bd9Sstevel@tonic-gate * This api returns a pointer to a string 1643*7c478bd9Sstevel@tonic-gate * that contains the password for group 'grp'. 1644*7c478bd9Sstevel@tonic-gate * If no password is available, then an empty string should be 1645*7c478bd9Sstevel@tonic-gate * returned. 1646*7c478bd9Sstevel@tonic-gate * 1647*7c478bd9Sstevel@tonic-gate * On historical UNIX systems, group passwords are found in 1648*7c478bd9Sstevel@tonic-gate * the gr_passwd member in struct group. 1649*7c478bd9Sstevel@tonic-gate * Thus, this macro should be defined as 1650*7c478bd9Sstevel@tonic-gate * #define M_GROUP_PASSWD(grp) grp->gr_passwd 1651*7c478bd9Sstevel@tonic-gate * 1652*7c478bd9Sstevel@tonic-gate * On systems that do not provide group passwords, 1653*7c478bd9Sstevel@tonic-gate * then macro can be defined as an empty string: 1654*7c478bd9Sstevel@tonic-gate * #define M_GROUP_PASSWD(grp) "" 1655*7c478bd9Sstevel@tonic-gate * 1656*7c478bd9Sstevel@tonic-gate */ 1657*7c478bd9Sstevel@tonic-gate 1658*7c478bd9Sstevel@tonic-gate 1659*7c478bd9Sstevel@tonic-gate #undef M_RCS_NORCSLIB /* Set this macro to true in order 1660*7c478bd9Sstevel@tonic-gate * remove rcslib dependency of utilities 1661*7c478bd9Sstevel@tonic-gate * such as ident. 1662*7c478bd9Sstevel@tonic-gate */ 1663*7c478bd9Sstevel@tonic-gate 1664*7c478bd9Sstevel@tonic-gate #undef M_CHMOD_LINK /* Set this macro to true if the system is 1665*7c478bd9Sstevel@tonic-gate * able to perform a chmod() of a link as 1666*7c478bd9Sstevel@tonic-gate * opposed to following the link. 1667*7c478bd9Sstevel@tonic-gate */ 1668*7c478bd9Sstevel@tonic-gate /* 1669*7c478bd9Sstevel@tonic-gate * Include any system-specific prototypes here 1670*7c478bd9Sstevel@tonic-gate */ 1671*7c478bd9Sstevel@tonic-gate 1672*7c478bd9Sstevel@tonic-gate /* 1673*7c478bd9Sstevel@tonic-gate * Include any #define's to avoid name clashes with namespace polluting 1674*7c478bd9Sstevel@tonic-gate * operating system routines 1675*7c478bd9Sstevel@tonic-gate * 1676*7c478bd9Sstevel@tonic-gate * e.g.: #define openfile MKSopenfile 1677*7c478bd9Sstevel@tonic-gate */ 1678*7c478bd9Sstevel@tonic-gate 1679