17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*5d54f3d8Smuffin * Copyright 2001 Sun Microsystems, Inc. All rights reserved. 24*5d54f3d8Smuffin * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate /* Copyright (c) 1984 AT&T */ 287c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifndef _BC_SYS_UNISTD_H 317c478bd9Sstevel@tonic-gate #define _BC_SYS_UNISTD_H 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #ifdef __cplusplus 367c478bd9Sstevel@tonic-gate extern "C" { 377c478bd9Sstevel@tonic-gate #endif 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate /* WARNING: _SC_CLK_TCK and sysconf() are also defined/declared in <time.h>. */ 407c478bd9Sstevel@tonic-gate #define _SC_ARG_MAX 1 /* space for argv & envp */ 417c478bd9Sstevel@tonic-gate #define _SC_CHILD_MAX 2 /* maximum children per process??? */ 427c478bd9Sstevel@tonic-gate #define _SC_CLK_TCK 3 /* clock ticks/sec */ 437c478bd9Sstevel@tonic-gate #define _SC_NGROUPS_MAX 4 /* number of groups if multple supp. */ 447c478bd9Sstevel@tonic-gate #define _SC_OPEN_MAX 5 /* max open files per process */ 457c478bd9Sstevel@tonic-gate #define _SC_JOB_CONTROL 6 /* do we have job control */ 467c478bd9Sstevel@tonic-gate #define _SC_SAVED_IDS 7 /* do we have saved uid/gids */ 477c478bd9Sstevel@tonic-gate #define _SC_VERSION 8 /* POSIX version supported */ 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate #define _POSIX_JOB_CONTROL 1 507c478bd9Sstevel@tonic-gate #define _POSIX_SAVED_IDS 1 517c478bd9Sstevel@tonic-gate #define _POSIX_VERSION 198808 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate #define _PC_LINK_MAX 1 /* max links to file/dir */ 547c478bd9Sstevel@tonic-gate #define _PC_MAX_CANON 2 /* max line length */ 557c478bd9Sstevel@tonic-gate #define _PC_MAX_INPUT 3 /* max "packet" to a tty device */ 567c478bd9Sstevel@tonic-gate #define _PC_NAME_MAX 4 /* max pathname component length */ 577c478bd9Sstevel@tonic-gate #define _PC_PATH_MAX 5 /* max pathname length */ 587c478bd9Sstevel@tonic-gate #define _PC_PIPE_BUF 6 /* size of a pipe */ 597c478bd9Sstevel@tonic-gate #define _PC_CHOWN_RESTRICTED 7 /* can we give away files */ 607c478bd9Sstevel@tonic-gate #define _PC_NO_TRUNC 8 /* trunc or error on >NAME_MAX */ 617c478bd9Sstevel@tonic-gate #define _PC_VDISABLE 9 /* best char to shut off tty c_cc */ 627c478bd9Sstevel@tonic-gate #define _PC_LAST 9 /* highest value of any _PC_* */ 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate #define STDIN_FILENO 0 657c478bd9Sstevel@tonic-gate #define STDOUT_FILENO 1 667c478bd9Sstevel@tonic-gate #define STDERR_FILENO 2 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate #ifndef NULL 697c478bd9Sstevel@tonic-gate #define NULL 0 707c478bd9Sstevel@tonic-gate #endif 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate #ifndef _POSIX_SOURCE 737c478bd9Sstevel@tonic-gate /* 747c478bd9Sstevel@tonic-gate * SVID lockf() requests 757c478bd9Sstevel@tonic-gate */ 767c478bd9Sstevel@tonic-gate #define F_ULOCK 0 /* Unlock a previously locked region */ 777c478bd9Sstevel@tonic-gate #define F_LOCK 1 /* Lock a region for exclusive use */ 787c478bd9Sstevel@tonic-gate #define F_TLOCK 2 /* Test and lock a region for exclusive use */ 797c478bd9Sstevel@tonic-gate #define F_TEST 3 /* Test a region for other processes locks */ 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate /* Path names: */ 827c478bd9Sstevel@tonic-gate #define GF_PATH "/etc/group" 837c478bd9Sstevel@tonic-gate #define PF_PATH "/etc/passwd" 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate #endif /* !_POSIX_SOURCE */ 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate /* 887c478bd9Sstevel@tonic-gate * lseek & access args 897c478bd9Sstevel@tonic-gate * 907c478bd9Sstevel@tonic-gate * SEEK_* have to track L_* in sys/file.h & SEEK_* in 5include/stdio.h 917c478bd9Sstevel@tonic-gate * ?_OK have to track ?_OK in sys/file.h 927c478bd9Sstevel@tonic-gate */ 937c478bd9Sstevel@tonic-gate #ifndef SEEK_SET 947c478bd9Sstevel@tonic-gate #define SEEK_SET 0 /* Set file pointer to "offset" */ 957c478bd9Sstevel@tonic-gate #define SEEK_CUR 1 /* Set file pointer to current plus "offset" */ 967c478bd9Sstevel@tonic-gate #define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ 977c478bd9Sstevel@tonic-gate #endif 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gate #define F_OK 0 /* does file exist */ 1007c478bd9Sstevel@tonic-gate #define X_OK 1 /* is it executable by caller */ 1017c478bd9Sstevel@tonic-gate #define W_OK 2 /* is it writable by caller */ 1027c478bd9Sstevel@tonic-gate #define R_OK 4 /* is it readable by caller */ 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate #include <sys/types.h> 1057c478bd9Sstevel@tonic-gate 106*5d54f3d8Smuffin extern void _exit(int); 107*5d54f3d8Smuffin extern int access(char *, int); 108*5d54f3d8Smuffin extern unsigned alarm(unsigned); 109*5d54f3d8Smuffin extern int chdir(char *); 110*5d54f3d8Smuffin extern int chmod(char *, mode_t); 111*5d54f3d8Smuffin extern int chown(char *, uid_t, gid_t); 112*5d54f3d8Smuffin extern int close(int); 113*5d54f3d8Smuffin extern char *ctermid(char *); 114*5d54f3d8Smuffin extern char *cuserid(char *); 115*5d54f3d8Smuffin extern int dup(int); 116*5d54f3d8Smuffin extern int dup2(int, int); 117*5d54f3d8Smuffin extern int execl(char *, ...); 118*5d54f3d8Smuffin extern int execle(char *, ...); 119*5d54f3d8Smuffin extern int execlp(char *, ...); 120*5d54f3d8Smuffin extern int execv(char *, char *[]); 121*5d54f3d8Smuffin extern int execve(char *, char *[], char *[]); 122*5d54f3d8Smuffin extern int execvp(char *, char *[]); 123*5d54f3d8Smuffin extern pid_t fork(void); 124*5d54f3d8Smuffin extern long fpathconf(int, int); 125*5d54f3d8Smuffin extern char *getcwd(char *, int); 126*5d54f3d8Smuffin extern gid_t getegid(void); 127*5d54f3d8Smuffin extern uid_t geteuid(void); 128*5d54f3d8Smuffin extern gid_t getgid(void); 129*5d54f3d8Smuffin extern int getgroups(int, gid_t []); 130*5d54f3d8Smuffin extern char *getlogin(void); 131*5d54f3d8Smuffin extern pid_t getpgrp(void); 132*5d54f3d8Smuffin extern pid_t getpid(void); 133*5d54f3d8Smuffin extern pid_t getppid(void); 134*5d54f3d8Smuffin extern uid_t getuid(void); 135*5d54f3d8Smuffin extern int isatty(int); 136*5d54f3d8Smuffin extern int link(char *, char *); 137*5d54f3d8Smuffin extern off_t lseek(int, off_t, int); 138*5d54f3d8Smuffin extern long pathconf(char *, int); 139*5d54f3d8Smuffin extern int pause(void); 140*5d54f3d8Smuffin extern int pipe(int [2]); 141*5d54f3d8Smuffin extern int read(int, char *, int); 142*5d54f3d8Smuffin extern int rmdir(char *); 143*5d54f3d8Smuffin extern int setgid(gid_t); 144*5d54f3d8Smuffin extern int setpgid(pid_t, pid_t); 145*5d54f3d8Smuffin extern pid_t setsid(void); 146*5d54f3d8Smuffin extern int setuid(uid_t); 147*5d54f3d8Smuffin extern unsigned sleep(unsigned int); 148*5d54f3d8Smuffin extern long sysconf(int); 149*5d54f3d8Smuffin extern pid_t tcgetpgrp(int); 150*5d54f3d8Smuffin extern int tcsetpgrp(int, pid_t); 151*5d54f3d8Smuffin extern char *ttyname(int); 152*5d54f3d8Smuffin extern int unlink(char *); 153*5d54f3d8Smuffin extern int write(int, char *, int); 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1567c478bd9Sstevel@tonic-gate } 1577c478bd9Sstevel@tonic-gate #endif 1587c478bd9Sstevel@tonic-gate 1597c478bd9Sstevel@tonic-gate #endif /* _BC_SYS_UNISTD_H */ 160