xref: /titanic_41/usr/src/lib/libbc/inc/include/unistd.h (revision 6be356c5780a1ccb886bba08d6eb56b61f021564)
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 2001 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*      Copyright (c) 1984 AT&T */
28 /*        All Rights Reserved   */
29 
30 #ifndef	_BC_SYS_UNISTD_H
31 #define	_BC_SYS_UNISTD_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 /* WARNING: _SC_CLK_TCK and sysconf() are also defined/declared in <time.h>. */
40 #define	_SC_ARG_MAX		1	/* space for argv & envp */
41 #define	_SC_CHILD_MAX		2	/* maximum children per process??? */
42 #define	_SC_CLK_TCK		3	/* clock ticks/sec */
43 #define	_SC_NGROUPS_MAX		4	/* number of groups if multple supp. */
44 #define	_SC_OPEN_MAX		5	/* max open files per process */
45 #define	_SC_JOB_CONTROL		6	/* do we have job control */
46 #define	_SC_SAVED_IDS		7	/* do we have saved uid/gids */
47 #define	_SC_VERSION		8	/* POSIX version supported */
48 
49 #define	_POSIX_JOB_CONTROL	1
50 #define	_POSIX_SAVED_IDS	1
51 #define	_POSIX_VERSION		198808
52 
53 #define	_PC_LINK_MAX		1	/* max links to file/dir */
54 #define	_PC_MAX_CANON		2	/* max line length */
55 #define	_PC_MAX_INPUT		3	/* max "packet" to a tty device */
56 #define	_PC_NAME_MAX		4	/* max pathname component length */
57 #define	_PC_PATH_MAX		5	/* max pathname length */
58 #define	_PC_PIPE_BUF		6	/* size of a pipe */
59 #define	_PC_CHOWN_RESTRICTED	7	/* can we give away files */
60 #define	_PC_NO_TRUNC		8	/* trunc or error on >NAME_MAX */
61 #define	_PC_VDISABLE		9	/* best char to shut off tty c_cc */
62 #define	_PC_LAST		9	/* highest value of any _PC_* */
63 
64 #define	STDIN_FILENO	0
65 #define	STDOUT_FILENO	1
66 #define	STDERR_FILENO	2
67 
68 #ifndef NULL
69 #define	NULL	0
70 #endif
71 
72 #ifndef	_POSIX_SOURCE
73 /*
74  * SVID lockf() requests
75  */
76 #define	F_ULOCK		0	/* Unlock a previously locked region */
77 #define	F_LOCK		1	/* Lock a region for exclusive use */
78 #define	F_TLOCK		2	/* Test and lock a region for exclusive use */
79 #define	F_TEST		3	/* Test a region for other processes locks */
80 
81 /* Path names: */
82 #define	GF_PATH			"/etc/group"
83 #define	PF_PATH			"/etc/passwd"
84 
85 #endif	/* !_POSIX_SOURCE */
86 
87 /*
88  * lseek & access args
89  *
90  * SEEK_* have to track L_* in sys/file.h & SEEK_* in 5include/stdio.h
91  * ?_OK have to track ?_OK in sys/file.h
92  */
93 #ifndef SEEK_SET
94 #define	SEEK_SET	0	/* Set file pointer to "offset" */
95 #define	SEEK_CUR	1	/* Set file pointer to current plus "offset" */
96 #define	SEEK_END	2	/* Set file pointer to EOF plus "offset" */
97 #endif
98 
99 #define	F_OK		0	/* does file exist */
100 #define	X_OK		1	/* is it executable by caller */
101 #define	W_OK		2	/* is it writable by caller */
102 #define	R_OK		4	/* is it readable by caller */
103 
104 #include <sys/types.h>
105 
106 extern void	_exit(int);
107 extern int	access(char *, int);
108 extern unsigned	alarm(unsigned);
109 extern int	chdir(char *);
110 extern int	chmod(char *, mode_t);
111 extern int	chown(char *, uid_t, gid_t);
112 extern int	close(int);
113 extern char	*ctermid(char *);
114 extern char	*cuserid(char *);
115 extern int	dup(int);
116 extern int	dup2(int, int);
117 extern int	execl(char *, ...);
118 extern int	execle(char *, ...);
119 extern int	execlp(char *, ...);
120 extern int	execv(char *, char *[]);
121 extern int	execve(char *, char *[], char *[]);
122 extern int	execvp(char *, char *[]);
123 extern pid_t	fork(void);
124 extern long	fpathconf(int, int);
125 extern char	*getcwd(char *, int);
126 extern gid_t	getegid(void);
127 extern uid_t	geteuid(void);
128 extern gid_t	getgid(void);
129 extern int	getgroups(int, gid_t []);
130 extern char	*getlogin(void);
131 extern pid_t	getpgrp(void);
132 extern pid_t	getpid(void);
133 extern pid_t	getppid(void);
134 extern uid_t	getuid(void);
135 extern int	isatty(int);
136 extern int	link(char *, char *);
137 extern off_t	lseek(int, off_t, int);
138 extern long	pathconf(char *, int);
139 extern int	pause(void);
140 extern int	pipe(int [2]);
141 extern int	read(int, char *, int);
142 extern int	rmdir(char *);
143 extern int	setgid(gid_t);
144 extern int	setpgid(pid_t, pid_t);
145 extern pid_t	setsid(void);
146 extern int	setuid(uid_t);
147 extern unsigned	sleep(unsigned int);
148 extern long	sysconf(int);
149 extern pid_t	tcgetpgrp(int);
150 extern int	tcsetpgrp(int, pid_t);
151 extern char	*ttyname(int);
152 extern int	unlink(char *);
153 extern int	write(int, char *, int);
154 
155 #ifdef	__cplusplus
156 }
157 #endif
158 
159 #endif	/* _BC_SYS_UNISTD_H */
160