/* $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

/*	Copyright (c) 1984 AT&T	*/
/*	  All Rights Reserved  	*/

/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
/*	The copyright notice above does not evidence any   	*/
/*	actual or intended publication of such source code.	*/

#ident	"$Header: unistd.h 1.17 90/10/29 $"

#ifndef	_SYS_UNISTD_H_

/* $Log:	unistd.h,v $
*/

/*----------------------------------------------------------------------*
 * This file must meet the requirements in volume 2 of the X/Open	*
 * Portability Guide, Issue 3, which should be consulted before any	*
 * changes are made.							*
 *----------------------------------------------------------------------*/

/* ____________________________________________________________________*
 * This file forms part of the POSIX requirement described in sections *
 * 2.8.1 & 2.10 of 1003.1-1988 which should be refered to before       *
 * making any changes.                                                 *
 *_____________________________________________________________________*/

/* POSIX 1003.1-1988 2.8.1 */
/* The value of the NULL symbol must always agree with that defined by the
 * C language standard.
 */
#ifndef NULL
#define	NULL	0
#endif	/* NULL */

/* POSIX 1003.1-1988 2.10.1 */
/* Symbolic constants for the "access" routine: */
#define	R_OK	4	/* Test for Read permission */
#define	W_OK	2	/* Test for Write permission */
#define	X_OK	1	/* Test for eXecute permission */
#define	F_OK	0	/* Test for existence of File */

/* POSIX 1003.1-1988 2.10.2 */
/* Symbolic constants for the "lseek" routine: */
#ifndef SEEK_SET
#define	SEEK_SET	0	/* Set file pointer to "offset" */
#define	SEEK_CUR	1	/* Set file pointer to current plus "offset" */
#define	SEEK_END	2	/* Set file pointer to EOF plus "offset" */
#endif	/* SEEK_SET */

#ifndef _POSIX_SOURCE
#define F_ULOCK	0	/* Unlock a previously locked region */
#define F_LOCK	1	/* Lock a region for exclusive use */
#define F_TLOCK	2	/* Test and lock a region for exclusive use */
#define F_TEST	3	/* Test a region for other processes locks */

/* Path names: */
#define	GF_PATH	"/etc/group"	/* Path name of the "group" file */
#define	PF_PATH	"/etc/passwd"	/* Path name of the "passwd" file */
#endif	/*_POSIX_SOURCE*/

/*
 * POSIX 1003.1-1988 2.10.3
 * Compile time symbolic constants for portability specifications.
 */
#define	_POSIX_JOB_CONTROL	1	/* This indicates that this imple-    */
					/* mentation supports job control.    */
#define _POSIX_SAVED_IDS	1	/* Each process has a saved set-user- */
					/* ID and a saved set-group-ID.       */
#define _POSIX_VERSION	198808		/* This vaule will change with each   */
					/* published version or revision of   */
					/* the standard to indicate the       */
					/* (4digit) year and (2digit) mounth  */
					/* that the standard was approved by  */
					/* IEEE standards board.              */

/*
 * POSIX 1003.1-1988 2.10.4
 * Execution-time constants for portability specifications.
 */

#define	_POSIX_CHOWN_RESTRICTED	1	/* The use of the chown function is   */
					/* restricted to a process with       */
					/* appropriate privileges, and to     */
					/* changing the group ID of a file    */
					/* only to the effective group ID of  */
					/* the process or to one of its supp- */
					/* lementary group IDs.               */
#define	_POSIX_NO_TRUNC	1		/* Pathname components longer than    */
					/* NAME_MAX generate an error.        */
#define	_POSIX_VDISABLE	0		/* Terminal special characters def-   */
					/* ined in <termios.h> can be disabled*/
					/* using this character value, if it  */
					/* is defined. See tcgetattr() and    */
					/* tcsetattr().                       */

/* POSIX 1003.1-1988 8.2.1.2 */
#define	STDIN_FILENO	0	/* Standard input value, stdin. */
#define	STDOUT_FILENO	1	/* Standard output value, stdout */
#define	STDERR_FILENO	2	/* Standard error value, stderr. */

/* POSIX 1003.1-1988 4.8.1.2 */ 
/* name values for the sysconf() function */
#define _SC_ARG_MAX	1
#define _SC_CHILD_MAX	2
#define	_SC_CLK_TCK	3
#define	_SC_NGROUPS_MAX	4
#define	_SC_OPEN_MAX	5
#define	_SC_JOB_CONTROL	6
#define	_SC_SAVED_IDS	7
#define	_SC_VERSION	8

#ifndef _POSIX_SOURCE
#define _SC_PASS_MAX	9
#define _SC_XOPEN_VERSION	10
#define _SC_CUSERID_VERSION	11

#define _XOPEN_VERSION	3
#endif	/* _POSIX_SOURCE */

/* POSIX 1003.1-1988 5.7.1.2 */
/* name values for the pathconf()/fpathconf() functions */
#define	_PC_LINK_MAX	1
#define	_PC_MAX_CANON	2
#define	_PC_MAX_INPUT	3
#define	_PC_NAME_MAX	4
#define	_PC_PATH_MAX	5
#define	_PC_PIPE_BUF	6
#define	_PC_CHOWN_RESTRICTED	7
#define	_PC_NO_TRUNC	8
#define	_PC_VDISABLE	9

/*
 * POSIX IEEE 1003.1-1988 2.8.3
 * Implementaion claiming Common Usages C Language-Dependent support
 * shall declare the result type for all functions not returning a 
 * "plain" int.
 *  ... all other functions shall be declared in unistd.h
 */

#ifndef INKERNEL

#include <sys/types.h>

extern unsigned int	alarm();
extern void	_exit();
extern pid_t	fork();
extern long	fpathconf();
extern char	*getcwd();
extern gid_t	getegid();
extern uid_t	geteuid();
extern gid_t	getgid();
extern char	*getlogin();
extern pid_t	getpgrp();
extern pid_t	getpid();
extern pid_t	getppid();
extern uid_t	getuid();
extern off_t	lseek();
extern long	pathconf();
extern pid_t	setsid();
extern unsigned int	sleep();
extern long	sysconf();
extern pid_t	tcgetpgrp();
extern char	*ttyname();

#ifndef _POSIX_SOURCE
#ifndef NO_XPG3_HDR
extern int	access();
extern int	chdir();
extern int	chown();
extern int	close();
extern char	*ctermid();
extern char	*cuserid();
extern int	dup();
extern int	dup2();
extern int	execl();
extern int	execle();
extern int	execlp();
extern int	execv();
extern int	execve();
extern int	execvp();
extern int	getgroups();
extern int	isatty();
extern int	link();
extern int	pause();
extern int	pipe();
extern int	read();
extern int	rename();
extern int	rmdir();
extern int	setgid();
extern int	setpgid();
extern int	setuid();
extern int	tcsetpgrp();
extern int	unlink();
extern int	write();
#endif	/* NO_XPG3_HDR */
#endif	/* _POSIX_SOURCE */
#endif	/* ! INKERNEL */

#define	_SYS_UNISTD_H_
#endif	/*_SYS_UNISTD_H_*/
