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 * <mkslocal.h>, Solaris2 Version - local <mks.h> requirements 24*7c478bd9Sstevel@tonic-gate * 25*7c478bd9Sstevel@tonic-gate * Copyright 1995-1996 (c) Sun Microsystems Inc. 26*7c478bd9Sstevel@tonic-gate * All rights reserved. 27*7c478bd9Sstevel@tonic-gate * 28*7c478bd9Sstevel@tonic-gate */ 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate 33*7c478bd9Sstevel@tonic-gate #define _ALL_SOURCE 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gate #include <stdlib.h> 38*7c478bd9Sstevel@tonic-gate #include <limits.h> 39*7c478bd9Sstevel@tonic-gate #include <wchar.h> 40*7c478bd9Sstevel@tonic-gate #include <widec.h> 41*7c478bd9Sstevel@tonic-gate #include <wctype.h> 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate typedef unsigned char uchar; 44*7c478bd9Sstevel@tonic-gate 45*7c478bd9Sstevel@tonic-gate #define SYSV 1 /* System V compatible */ 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate #ifndef VERSION 48*7c478bd9Sstevel@tonic-gate /* Used for in sh, vi ... */ 49*7c478bd9Sstevel@tonic-gate #define VERSION "MKS InterOpen IXCU 4.3 MB - SUN/SOLARIS2" 50*7c478bd9Sstevel@tonic-gate #endif 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gate /* 53*7c478bd9Sstevel@tonic-gate * Assume that rootname() is called to prepend the proper path prefix 54*7c478bd9Sstevel@tonic-gate */ 55*7c478bd9Sstevel@tonic-gate #define M_CS_PATH "/usr/xpg4/bin" /* posix.2 utilities */ 56*7c478bd9Sstevel@tonic-gate #define M_CS_SHELL "/usr/xpg4/bin/sh" /* posix.2 sh */ 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate #define M_CS_BINDIR "/usr/bin" 59*7c478bd9Sstevel@tonic-gate #define M_CS_ETCDIR "/etc" 60*7c478bd9Sstevel@tonic-gate #define M_CS_LIBDIR "/usr/lib" 61*7c478bd9Sstevel@tonic-gate #define M_CS_SPOOLDIR "/var/spool" 62*7c478bd9Sstevel@tonic-gate #define M_CS_MANPATH "/usr/man" 63*7c478bd9Sstevel@tonic-gate #define M_CS_TMPDIR "/tmp" 64*7c478bd9Sstevel@tonic-gate #define M_CS_NLSDIR "/usr/lib/locale" 65*7c478bd9Sstevel@tonic-gate 66*7c478bd9Sstevel@tonic-gate #define M_BINDIR(path) M_CS_BINDIR"/" #path 67*7c478bd9Sstevel@tonic-gate #define M_ETCDIR(path) M_CS_ETCDIR"/" #path 68*7c478bd9Sstevel@tonic-gate #define M_LIBDIR(path) M_CS_LIBDIR"/" #path 69*7c478bd9Sstevel@tonic-gate #define M_SPOOLDIR(path) M_CS_SPOOLDIR"/" #path 70*7c478bd9Sstevel@tonic-gate #define M_NLSDIR(path) M_CS_NLSDIR"/" #path 71*7c478bd9Sstevel@tonic-gate 72*7c478bd9Sstevel@tonic-gate /* 73*7c478bd9Sstevel@tonic-gate * M_MANPATH - list of pathnames to be used by man utility 74*7c478bd9Sstevel@tonic-gate * M_TMPDIR - pathname of temporary 75*7c478bd9Sstevel@tonic-gate */ 76*7c478bd9Sstevel@tonic-gate #define M_MANPATH M_CS_MANPATH"/" 77*7c478bd9Sstevel@tonic-gate #define M_TMPDIR M_CS_TMPDIR"/" 78*7c478bd9Sstevel@tonic-gate #define M_SYSTEM_TMPDIR "/tmp" 79*7c478bd9Sstevel@tonic-gate 80*7c478bd9Sstevel@tonic-gate #define M_NL_DOM "mks" 81*7c478bd9Sstevel@tonic-gate #define DEF_NLSPATH "/usr/lib/locale/%L/LC_MESSAGES" 82*7c478bd9Sstevel@tonic-gate 83*7c478bd9Sstevel@tonic-gate #define M_RCS_NORCSLIB 1 /* don't use rcslib or its includes */ 84*7c478bd9Sstevel@tonic-gate 85*7c478bd9Sstevel@tonic-gate #define M_MALLOC 1 86*7c478bd9Sstevel@tonic-gate #define M_REALLOC 1 87*7c478bd9Sstevel@tonic-gate #ifdef M_REALLOC 88*7c478bd9Sstevel@tonic-gate #define M_WANT_ANSI_REALLOC 1 89*7c478bd9Sstevel@tonic-gate #endif 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate #define __LDATA__ 1 /* Deprecated */ 92*7c478bd9Sstevel@tonic-gate #define M_LDATA 1 93*7c478bd9Sstevel@tonic-gate 94*7c478bd9Sstevel@tonic-gate #define halloc(n, s) malloc((size_t)((n)*(s))) 95*7c478bd9Sstevel@tonic-gate #define hfree(ptr) free(ptr) 96*7c478bd9Sstevel@tonic-gate #define M_FSDELIM(c) ((c) == '/') 97*7c478bd9Sstevel@tonic-gate 98*7c478bd9Sstevel@tonic-gate /* On POSIX and UNIX there is nothing special to do */ 99*7c478bd9Sstevel@tonic-gate #define m_cp(src, dest, ssb, flags) (M_CP_NOOP) 100*7c478bd9Sstevel@tonic-gate 101*7c478bd9Sstevel@tonic-gate #define __POSIX_JOB_CONTROL /* POSIX.1 job control */ 102*7c478bd9Sstevel@tonic-gate #define __POSIX_WAIT_NOHANG /* waitpid WNOHANG available */ 103*7c478bd9Sstevel@tonic-gate #define __POSIX_SAVED_IDS _POSIX_SAVED_IDS 104*7c478bd9Sstevel@tonic-gate #define __POSIX_NO_TRUNC -1 /* automatic truncation */ 105*7c478bd9Sstevel@tonic-gate #define __POSIX_VDISABLE 0x00 /* Disable function in termios.h */ 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate /* 108*7c478bd9Sstevel@tonic-gate * added for optional facility configuration values 109*7c478bd9Sstevel@tonic-gate */ 110*7c478bd9Sstevel@tonic-gate #define M_POSIX2_C_BIND 1 111*7c478bd9Sstevel@tonic-gate #define M_POSIX2_C_DEV 1 112*7c478bd9Sstevel@tonic-gate #define M_POSIX2_FORT_DEV 1 113*7c478bd9Sstevel@tonic-gate #undef M_POSIX2_FORT_RUN 114*7c478bd9Sstevel@tonic-gate #define M_POSIX2_LOCALEDEF 1 115*7c478bd9Sstevel@tonic-gate #define M_POSIX2_SW_DEV 1 116*7c478bd9Sstevel@tonic-gate #define M_POSIX2_UPE 1 117*7c478bd9Sstevel@tonic-gate #define M_POSIX2_CHAR_TERM 1 118*7c478bd9Sstevel@tonic-gate 119*7c478bd9Sstevel@tonic-gate #undef M_FCLOSE_NOT_POSIX_1 /* Not POSIX.1 section 8.2 */ 120*7c478bd9Sstevel@tonic-gate #undef M_FFLUSH_NOT_POSIX_1 /* Not POSIX.1 section 8.2 */ 121*7c478bd9Sstevel@tonic-gate 122*7c478bd9Sstevel@tonic-gate #define M_BSD_SPRINTF 0 /* sprintf on this system has BSD */ 123*7c478bd9Sstevel@tonic-gate /* semantics, does not return length */ 124*7c478bd9Sstevel@tonic-gate #define M_ENDPWENT 1 /* set to 1 if system provides a */ 125*7c478bd9Sstevel@tonic-gate /* getpwent() routine */ 126*7c478bd9Sstevel@tonic-gate #define M_MATHERR 1 /* math library supports matherr() */ 127*7c478bd9Sstevel@tonic-gate 128*7c478bd9Sstevel@tonic-gate #define M_LOGGER_CONSOLE "/dev/console" 129*7c478bd9Sstevel@tonic-gate 130*7c478bd9Sstevel@tonic-gate #define M_SVFS_INO 1 131*7c478bd9Sstevel@tonic-gate 132*7c478bd9Sstevel@tonic-gate /* 133*7c478bd9Sstevel@tonic-gate * Set I18N flags 134*7c478bd9Sstevel@tonic-gate */ 135*7c478bd9Sstevel@tonic-gate #define M_I18N 1 /* turn on internationalizaion */ 136*7c478bd9Sstevel@tonic-gate #define I18N 1 /* OBSOLESCENT version of M_I18N */ 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gate #define M_I18N_M_ 1 /* Uses m_ on MKS i18n extension routines */ 139*7c478bd9Sstevel@tonic-gate #define M_I18N_MKS_XPG 1 /* Use NL info from XPG4 */ 140*7c478bd9Sstevel@tonic-gate #define M_I18N_MKS_FULL 0 /* Full mks extensions */ 141*7c478bd9Sstevel@tonic-gate #define M_I18N_MB 1 /* Enable multibyte compilation */ 142*7c478bd9Sstevel@tonic-gate #undef M_I18N_LOCKING_SHIFT /* No locking-shift character sets. */ 143*7c478bd9Sstevel@tonic-gate #undef M_VARIANTS /* Invariant characters are */ 144*7c478bd9Sstevel@tonic-gate 145*7c478bd9Sstevel@tonic-gate /* 146*7c478bd9Sstevel@tonic-gate * Interopen Curses for Solaris2 147*7c478bd9Sstevel@tonic-gate */ 148*7c478bd9Sstevel@tonic-gate #undef M_CURSES_MEMMAPPED 149*7c478bd9Sstevel@tonic-gate #define M_TERM_NAME "vt100" 150*7c478bd9Sstevel@tonic-gate #define M_TERMINFO_DIR "/usr/share/lib/terminfo" 151*7c478bd9Sstevel@tonic-gate #define M_CURSES_VERSION "MKS I/XCU 4.3 Curses" 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate #define M_ULIMIT_AVAIL 1 /* <ulimit.h> file available */ 154*7c478bd9Sstevel@tonic-gate #define M_EXPR_POSIX 1 /* decimal only on the expr command line */ 155*7c478bd9Sstevel@tonic-gate 156*7c478bd9Sstevel@tonic-gate #define M_PATH_MAX PATH_MAX 157*7c478bd9Sstevel@tonic-gate 158*7c478bd9Sstevel@tonic-gate /* 159*7c478bd9Sstevel@tonic-gate * Solaris 2 does not use stateful encoding, so we will just convert these 160*7c478bd9Sstevel@tonic-gate * to their stateless equivalent. 161*7c478bd9Sstevel@tonic-gate */ 162*7c478bd9Sstevel@tonic-gate #ifndef _MBSTATE_T 163*7c478bd9Sstevel@tonic-gate #define _MBSTATE_T 164*7c478bd9Sstevel@tonic-gate typedef int mbstate_t; 165*7c478bd9Sstevel@tonic-gate #endif /* ! _MBSTATE_T */ 166*7c478bd9Sstevel@tonic-gate 167*7c478bd9Sstevel@tonic-gate #define mbrlen(c, n, ps) mblen(c, n) 168*7c478bd9Sstevel@tonic-gate #define wcrtomb(c, w, s) wctomb(c, w) 169*7c478bd9Sstevel@tonic-gate #define mbrtowc(p, w, n, s) mbtowc(p, w, n) 170*7c478bd9Sstevel@tonic-gate 171*7c478bd9Sstevel@tonic-gate #define wcsrtombs(w, c, n, s) wcstombs(w, c, n) 172*7c478bd9Sstevel@tonic-gate #define mbsrtowcs(c, w, n, s) mbstowcs(c, w, n) 173