10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 70Sstevel@tonic-gate * with the License. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate * See the License for the specific language governing permissions 120Sstevel@tonic-gate * and limitations under the License. 130Sstevel@tonic-gate * 140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * CDDL HEADER END 210Sstevel@tonic-gate */ 220Sstevel@tonic-gate /* 23*722Smuffin * Copyright 2001 Sun Microsystems, Inc. All rights reserved. 24*722Smuffin * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate /* Copyright (c) 1984 AT&T */ 280Sstevel@tonic-gate /* All Rights Reserved */ 290Sstevel@tonic-gate 300Sstevel@tonic-gate #ifndef _BC_SYS_UNISTD_H 310Sstevel@tonic-gate #define _BC_SYS_UNISTD_H 320Sstevel@tonic-gate 330Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 340Sstevel@tonic-gate 350Sstevel@tonic-gate #ifdef __cplusplus 360Sstevel@tonic-gate extern "C" { 370Sstevel@tonic-gate #endif 380Sstevel@tonic-gate 390Sstevel@tonic-gate /* WARNING: _SC_CLK_TCK and sysconf() are also defined/declared in <time.h>. */ 400Sstevel@tonic-gate #define _SC_ARG_MAX 1 /* space for argv & envp */ 410Sstevel@tonic-gate #define _SC_CHILD_MAX 2 /* maximum children per process??? */ 420Sstevel@tonic-gate #define _SC_CLK_TCK 3 /* clock ticks/sec */ 430Sstevel@tonic-gate #define _SC_NGROUPS_MAX 4 /* number of groups if multple supp. */ 440Sstevel@tonic-gate #define _SC_OPEN_MAX 5 /* max open files per process */ 450Sstevel@tonic-gate #define _SC_JOB_CONTROL 6 /* do we have job control */ 460Sstevel@tonic-gate #define _SC_SAVED_IDS 7 /* do we have saved uid/gids */ 470Sstevel@tonic-gate #define _SC_VERSION 8 /* POSIX version supported */ 480Sstevel@tonic-gate 490Sstevel@tonic-gate #define _POSIX_JOB_CONTROL 1 500Sstevel@tonic-gate #define _POSIX_SAVED_IDS 1 510Sstevel@tonic-gate #define _POSIX_VERSION 198808 520Sstevel@tonic-gate 530Sstevel@tonic-gate #define _PC_LINK_MAX 1 /* max links to file/dir */ 540Sstevel@tonic-gate #define _PC_MAX_CANON 2 /* max line length */ 550Sstevel@tonic-gate #define _PC_MAX_INPUT 3 /* max "packet" to a tty device */ 560Sstevel@tonic-gate #define _PC_NAME_MAX 4 /* max pathname component length */ 570Sstevel@tonic-gate #define _PC_PATH_MAX 5 /* max pathname length */ 580Sstevel@tonic-gate #define _PC_PIPE_BUF 6 /* size of a pipe */ 590Sstevel@tonic-gate #define _PC_CHOWN_RESTRICTED 7 /* can we give away files */ 600Sstevel@tonic-gate #define _PC_NO_TRUNC 8 /* trunc or error on >NAME_MAX */ 610Sstevel@tonic-gate #define _PC_VDISABLE 9 /* best char to shut off tty c_cc */ 620Sstevel@tonic-gate #define _PC_LAST 9 /* highest value of any _PC_* */ 630Sstevel@tonic-gate 640Sstevel@tonic-gate #define STDIN_FILENO 0 650Sstevel@tonic-gate #define STDOUT_FILENO 1 660Sstevel@tonic-gate #define STDERR_FILENO 2 670Sstevel@tonic-gate 680Sstevel@tonic-gate #ifndef NULL 690Sstevel@tonic-gate #define NULL 0 700Sstevel@tonic-gate #endif 710Sstevel@tonic-gate 720Sstevel@tonic-gate #ifndef _POSIX_SOURCE 730Sstevel@tonic-gate /* 740Sstevel@tonic-gate * SVID lockf() requests 750Sstevel@tonic-gate */ 760Sstevel@tonic-gate #define F_ULOCK 0 /* Unlock a previously locked region */ 770Sstevel@tonic-gate #define F_LOCK 1 /* Lock a region for exclusive use */ 780Sstevel@tonic-gate #define F_TLOCK 2 /* Test and lock a region for exclusive use */ 790Sstevel@tonic-gate #define F_TEST 3 /* Test a region for other processes locks */ 800Sstevel@tonic-gate 810Sstevel@tonic-gate /* Path names: */ 820Sstevel@tonic-gate #define GF_PATH "/etc/group" 830Sstevel@tonic-gate #define PF_PATH "/etc/passwd" 840Sstevel@tonic-gate 850Sstevel@tonic-gate #endif /* !_POSIX_SOURCE */ 860Sstevel@tonic-gate 870Sstevel@tonic-gate /* 880Sstevel@tonic-gate * lseek & access args 890Sstevel@tonic-gate * 900Sstevel@tonic-gate * SEEK_* have to track L_* in sys/file.h & SEEK_* in 5include/stdio.h 910Sstevel@tonic-gate * ?_OK have to track ?_OK in sys/file.h 920Sstevel@tonic-gate */ 930Sstevel@tonic-gate #ifndef SEEK_SET 940Sstevel@tonic-gate #define SEEK_SET 0 /* Set file pointer to "offset" */ 950Sstevel@tonic-gate #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */ 960Sstevel@tonic-gate #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ 970Sstevel@tonic-gate #endif 980Sstevel@tonic-gate 990Sstevel@tonic-gate #define F_OK 0 /* does file exist */ 1000Sstevel@tonic-gate #define X_OK 1 /* is it executable by caller */ 1010Sstevel@tonic-gate #define W_OK 2 /* is it writable by caller */ 1020Sstevel@tonic-gate #define R_OK 4 /* is it readable by caller */ 1030Sstevel@tonic-gate 1040Sstevel@tonic-gate #include <sys/types.h> 1050Sstevel@tonic-gate 106*722Smuffin extern void _exit(int); 107*722Smuffin extern int access(char *, int); 108*722Smuffin extern unsigned alarm(unsigned); 109*722Smuffin extern int chdir(char *); 110*722Smuffin extern int chmod(char *, mode_t); 111*722Smuffin extern int chown(char *, uid_t, gid_t); 112*722Smuffin extern int close(int); 113*722Smuffin extern char *ctermid(char *); 114*722Smuffin extern char *cuserid(char *); 115*722Smuffin extern int dup(int); 116*722Smuffin extern int dup2(int, int); 117*722Smuffin extern int execl(char *, ...); 118*722Smuffin extern int execle(char *, ...); 119*722Smuffin extern int execlp(char *, ...); 120*722Smuffin extern int execv(char *, char *[]); 121*722Smuffin extern int execve(char *, char *[], char *[]); 122*722Smuffin extern int execvp(char *, char *[]); 123*722Smuffin extern pid_t fork(void); 124*722Smuffin extern long fpathconf(int, int); 125*722Smuffin extern char *getcwd(char *, int); 126*722Smuffin extern gid_t getegid(void); 127*722Smuffin extern uid_t geteuid(void); 128*722Smuffin extern gid_t getgid(void); 129*722Smuffin extern int getgroups(int, gid_t []); 130*722Smuffin extern char *getlogin(void); 131*722Smuffin extern pid_t getpgrp(void); 132*722Smuffin extern pid_t getpid(void); 133*722Smuffin extern pid_t getppid(void); 134*722Smuffin extern uid_t getuid(void); 135*722Smuffin extern int isatty(int); 136*722Smuffin extern int link(char *, char *); 137*722Smuffin extern off_t lseek(int, off_t, int); 138*722Smuffin extern long pathconf(char *, int); 139*722Smuffin extern int pause(void); 140*722Smuffin extern int pipe(int [2]); 141*722Smuffin extern int read(int, char *, int); 142*722Smuffin extern int rmdir(char *); 143*722Smuffin extern int setgid(gid_t); 144*722Smuffin extern int setpgid(pid_t, pid_t); 145*722Smuffin extern pid_t setsid(void); 146*722Smuffin extern int setuid(uid_t); 147*722Smuffin extern unsigned sleep(unsigned int); 148*722Smuffin extern long sysconf(int); 149*722Smuffin extern pid_t tcgetpgrp(int); 150*722Smuffin extern int tcsetpgrp(int, pid_t); 151*722Smuffin extern char *ttyname(int); 152*722Smuffin extern int unlink(char *); 153*722Smuffin extern int write(int, char *, int); 1540Sstevel@tonic-gate 1550Sstevel@tonic-gate #ifdef __cplusplus 1560Sstevel@tonic-gate } 1570Sstevel@tonic-gate #endif 1580Sstevel@tonic-gate 1590Sstevel@tonic-gate #endif /* _BC_SYS_UNISTD_H */ 160