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