/*
 * $Header: /smsa/bsd:include/unistd.h:bsd  1.12  $
 * $Source: /smsa/bsd:include/unistd.h: $
 *
 * Copyright (c) 1989,1990 Acorn Computers Ltd., Cambridge, England
 */

#ifndef __unistd_h
#define __unistd_h

#define NULL 0

/* access(2) requests */
#define	F_OK		0	/* does file exist */
#define	X_OK		1	/* is it executable by caller */
#define	W_OK		2	/* writable by caller */
#define	R_OK		4	/* readable by caller */

#define SEEK_SET 0 /* start of stream (see fseek) */
#define SEEK_CUR 1 /* current position in stream (see fseek) */
#define SEEK_END 2 /* end of stream (see fseek) */               

#define STDIN_FILENO  0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2

#define _POSIX_VERSION 198808L	/* which standard is being conformed to */
#ifndef	_POSIX_SOURCE
#define _XOPEN_VERSION 3
#endif

#define _POSIX_JOB_CONTROL	1
#define _POSIX_SAVED_IDS	1
#define _POSIX_NO_TRUNC		1
#define _POSIX_CHOWN_RESTRICTED 1
#define _POSIX_VDISABLE		255

#define _SC_ARG_MAX             0
#define _SC_CHILD_MAX           1
#define _SC_CLK_TCK             2
#define _SC_JOB_CONTROL         3
#define _SC_NGROUPS_MAX         4
#define _SC_OPEN_MAX            5
#define _SC_PASS_MAX            6
#define _SC_SAVED_IDS           7
#define _SC_VERSION             8
#define _SC_XOPEN_VERSION       9

#define _PC_CHOWN_RESTRICTED    0
#define _PC_LINK_MAX            1
#define _PC_MAX_CANON           2
#define _PC_MAX_INPUT           3
#define _PC_NAME_MAX            4
#define _PC_NO_TRUNC            5
#define _PC_PATH_MAX            6
#define _PC_PIPE_BUF            7
#define _PC_VDISABLE            8

#ifndef	_KERNEL

# if !defined(__sys_types_h) && !defined(_NO_SYS_TYPES_H)
#  include "sys/types.h"
# endif

extern int access (const char * /*path*/, int /*amode*/);
extern unsigned int alarm (unsigned int /*seconds*/);
extern int chdir (const char * /*path*/);
extern int chown (const char * /*path*/, int /*uid_t owner*/, int /*gid_t group*/);
extern int close (int /*fildes*/);
extern char *ctermid (char * /*s*/);
extern char *cuserid (char * /*s*/);
extern int dup2 (int /*fildes*/, int /*fildes2*/);
extern int dup (int /*fildes*/);
extern int execl (const char * /*path*/, ...);
extern int execv (const char * /*path*/, char * /*argv*/[]);
extern int execle (const char * /*path*/, ...);
extern int execve (const char * /*path*/, char * /*argv*/[], char * /*envp*/[]);
extern int execlp (const char * /*file*/, ...);
extern int execvp (const char * /*file*/, char * /*argv*/[]);
extern void _exit (int /*status*/);
extern pid_t fork (void);
extern long fpathconf (int /*fildes*/, int /*name*/);
extern char *getcwd (char * /*buf*/, int /*size*/);
extern gid_t getegid (void);
extern uid_t geteuid (void);
extern gid_t getgid (void);
extern int getgroups (int /*gidsetsize*/, gid_t /*grouplist*/[]);
extern char *getlogin (void);
extern pid_t getpgrp (void);
extern pid_t getpid (void);
extern pid_t getppid (void);
extern uid_t getuid (void);
extern int isatty (int /*fildes*/);
extern int link (const char * /*path1*/, const char * /*path2*/);
extern off_t lseek (int /*fildes*/, off_t /*offset*/, int /*whence*/);
extern long pathconf (const char * /*path*/, int /*name*/);
extern int pause (void);
extern int pipe (int /*fildes*/[2]);
extern int read (int /*fildes*/, void * /*buf*/, unsigned /*nbyte*/);
extern int rename (const char * /*old*/, const char * /*new*/);
extern int rmdir (const char * /*path*/);
extern int setgid (int /*gid_t gid*/);
extern int setpgid (int /*pid_t pid*/, int /*pid_t pgid*/);
extern pid_t setsid (void);
extern int setuid (int /*uid_t uid*/);
extern unsigned sleep (unsigned /*seconds*/);
extern long sysconf (int /*name*/);
extern pid_t tcgetpgrp (int /*fildes*/);
extern int tcsetpgrp (int /*fildes*/, int /*pid_t pgrp_id*/);
extern char *ttyname (int /*fildes*/);
extern int unlink (const char * /*path*/);
extern int write (int /*fildes*/, const void * /*buf*/, unsigned /*nbytes*/);
#endif/*_KERNEL*/

#endif/*__unistd_h*/
