unistd.h revision eec1faa811b20b01f0173edcf9179c3c6ad48243
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _UNISTD_H
#define _UNISTD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Symbolic constants for the "access" routine: */
#define F_OK 0 /* Test for existence of File */
#define F_ULOCK 0 /* Unlock a previously locked region */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
/* Symbolic constants for the "lseek" routine: */
#ifndef SEEK_SET
#define SEEK_SET 0 /* Set file pointer to "offset" */
#endif
#ifndef SEEK_CUR
#endif
#ifndef SEEK_END
#endif
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#ifndef SEEK_DATA
#endif
#ifndef SEEK_HOLE
#endif
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/* Path names: */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/*
* compile-time symbolic constants,
* Support does not mean the feature is enabled.
*/
/* Values unchanged in UNIX 03 */
#define _POSIX_ASYNC_IO 1
#define _POSIX_JOB_CONTROL 1
#define _POSIX_SAVED_IDS 1
#define _POSIX_SYNC_IO 1
/*
* POSIX.1b compile-time symbolic constants.
*/
#if defined(_XPG6)
#define _POSIX_ASYNCHRONOUS_IO 200112L
#define _POSIX_FSYNC 200112L
#define _POSIX_MAPPED_FILES 200112L
#define _POSIX_MEMLOCK 200112L
#define _POSIX_MEMLOCK_RANGE 200112L
#define _POSIX_MEMORY_PROTECTION 200112L
#define _POSIX_MESSAGE_PASSING 200112L
#define _POSIX_PRIORITY_SCHEDULING 200112L
#define _POSIX_REALTIME_SIGNALS 200112L
#define _POSIX_SEMAPHORES 200112L
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
#define _POSIX_SYNCHRONIZED_IO 200112L
#else
#define _POSIX_ASYNCHRONOUS_IO 1
#define _POSIX_FSYNC 1
#define _POSIX_MAPPED_FILES 1
#define _POSIX_MEMLOCK 1
#define _POSIX_MEMLOCK_RANGE 1
#define _POSIX_MEMORY_PROTECTION 1
#define _POSIX_MESSAGE_PASSING 1
#define _POSIX_PRIORITY_SCHEDULING 1
#define _POSIX_REALTIME_SIGNALS 1
#define _POSIX_SEMAPHORES 1
#define _POSIX_SHARED_MEMORY_OBJECTS 1
#define _POSIX_SYNCHRONIZED_IO 1
#endif
/*
* POSIX.1c compile-time symbolic constants.
*/
#if defined(_XPG6)
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
#define _POSIX_THREADS 200112L
#define _POSIX_THREAD_ATTR_STACKADDR 200112L
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
#define _POSIX_THREAD_PROCESS_SHARED 200112L
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
#define _POSIX_TIMERS 200112L
#else
#define _POSIX_THREAD_SAFE_FUNCTIONS 1
#define _POSIX_THREADS 1
#define _POSIX_THREAD_ATTR_STACKADDR 1
#define _POSIX_THREAD_ATTR_STACKSIZE 1
#define _POSIX_THREAD_PROCESS_SHARED 1
#define _POSIX_THREAD_PRIORITY_SCHEDULING 1
#define _POSIX_TIMERS 1
#endif
/* New in UNIX 03 */
#define _POSIX_BARRIERS 200112L
#define _POSIX_CLOCK_SELECTION 200112L
#define _POSIX_IPV6 200112L
#define _POSIX_MONOTONIC_CLOCK 200112L
#define _POSIX_RAW_SOCKETS 200112L
#define _POSIX_READER_WRITER_LOCKS 200112L
#define _POSIX_SPAWN 200112L
#define _POSIX_SPIN_LOCKS 200112L
#define _POSIX_TIMEOUTS 200112L
/*
* Support for the POSIX.1 mutex protocol attribute. For realtime applications
* which need mutexes to support priority inheritance/ceiling.
*/
#if defined(_XPG6)
#define _POSIX_THREAD_PRIO_INHERIT 200112L
#define _POSIX_THREAD_PRIO_PROTECT 200112L
#else
#define _POSIX_THREAD_PRIO_INHERIT 1
#define _POSIX_THREAD_PRIO_PROTECT 1
#endif
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE 0
#endif
#ifndef NULL
#if defined(_LP64)
#define NULL 0L
#else
#define NULL 0
#endif
#endif
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/*
* Large File Summit-related announcement macros. The system supports both
* the additional and transitional Large File Summit interfaces. (The final
* two macros provide a finer granularity breakdown of _LFS64_LARGEFILE.)
*/
#define _LFS_LARGEFILE 1
#define _LFS64_LARGEFILE 1
#define _LFS64_STDIO 1
#define _LFS64_ASYNCHRONOUS_IO 1
/* large file compilation environment setup */
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else /* __PRAGMA_REDEFINE_EXTNAME */
#define ftruncate ftruncate64
#define truncate truncate64
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
/* In the LP64 compilation environment, the APIs are already large file */
#if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else /* __PRAGMA_REDEFINE_EXTNAME */
#define ftruncate64 ftruncate
#define truncate64 truncate
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* _LP64 && _LARGEFILE64_SOURCE */
#if defined(__STDC__)
extern int access(const char *, int);
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int acct(const char *);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern unsigned alarm(unsigned);
/* Marked as LEGACY in SUSv2 and removed in SUSv3 */
defined(__EXTENSIONS__)
extern int brk(void *);
#endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
extern int chdir(const char *);
/* Marked as LEGACY in SUSv2 and removed in SUSv3 */
#if !defined(_POSIX_C_SOURCE) || (defined(_XOPEN_SOURCE) && \
!defined(_XPG6)) || defined(__EXTENSIONS__)
extern int chroot(const char *);
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE))... */
extern int close(int);
#if defined(_XPG4) || defined(__EXTENSIONS__)
extern char *crypt(const char *, const char *);
#endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(__EXTENSIONS__)
extern char *ctermid(char *);
#endif /* (!defined(_POSIX_C_SOURCE) ... */
extern char *ctermid_r(char *);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_REENTRANT) ... */
/* Marked as LEGACY in SUSv2 and removed in SUSv3 */
#if !defined(_XPG6) || defined(__EXTENSIONS__)
extern char *cuserid(char *);
#endif
extern int dup(int);
extern int dup2(int, int);
#if defined(_XPG4) || defined(__EXTENSIONS__)
extern void encrypt(char *, int);
#endif /* defined(XPG4) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern void endusershell(void);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern int execl(const char *, const char *, ...);
extern int execle(const char *, const char *, ...);
extern int execlp(const char *, const char *, ...);
extern int execv(const char *, char *const *);
extern int execve(const char *, char *const *, char *const *);
extern int execvp(const char *, char *const *);
extern void _exit(int)
/*
* The following fattach prototype is duplicated in <stropts.h>. The
* duplication is necessitated by XPG4.2 which requires the prototype
* be defined in <stropts.h>.
*/
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int fattach(int, const char *);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern int fchdir(int);
#if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int fchroot(int);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
defined(__EXTENSIONS__)
extern int fdatasync(int);
#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
/*
* The following fdetach prototype is duplicated in <stropts.h>. The
* duplication is necessitated by XPG4.2 which requires the prototype
* be defined in <stropts.h>.
*/
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int fdetach(const char *);
#endif /* !defined(__XOPEN_OR_POSIX)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX)... */
extern long fpathconf(int, int);
defined(__EXTENSIONS__)
extern int fsync(int);
#endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
defined(__EXTENSIONS__)
extern int getdtablesize(void);
#endif
extern long gethostid(void);
#endif
#if defined(_XPG4_2)
extern int gethostname(char *, size_t);
extern int gethostname(char *, int);
#endif
extern char *getlogin(void);
#if defined(_XPG4) || defined(__EXTENSIONS__)
extern int getopt(int, char *const *, const char *);
extern char *optarg;
/* Marked as LEGACY in SUSv2 and removed in SUSv3 */
#if !defined(_XPG6) || defined(__EXTENSIONS__)
extern char *getpass(const char *);
#endif
#endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
/* Marked as LEGACY in SUSv2 and removed in SUSv3 */
#if !defined(_XPG6) || defined(__EXTENSIONS__)
extern int getpagesize(void);
#endif
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
char *gettxt(const char *, const char *);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern char *getusershell(void);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern char *getwd(char *);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
/*
* The following ioctl prototype is duplicated in <stropts.h>. The
* duplication is necessitated by XPG4.2 which requires the prototype
* be defined in <stropts.h>.
*/
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int ioctl(int, int, ...);
extern int isaexec(const char *, char *const *, char *const *);
extern int issetugid(void);
#endif
extern int isatty(int);
#endif
extern int link(const char *, const char *);
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
defined(__EXTENSIONS__)
#endif
#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(__EXTENSIONS__)
extern int nice(int);
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif
extern long pathconf(const char *, int);
extern int pause(void);
extern int pipe(int *);
#if !defined(_POSIX_C_SOURCE) || defined(_XPG5) || \
defined(__EXTENSIONS__)
#endif
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif
/*
* pthread_atfork() is also declared in <pthread.h> as per SUSv3. The
* declarations are identical. A change to either one may also require
* appropriate namespace updates in order to avoid redeclaration
* warnings in the case where both prototypes are exposed via inclusion
*/
#if !defined(__XOPEN_OR_POSIX) || \
defined(__EXTENSIONS__)
extern int pthread_atfork(void (*) (void), void (*) (void), void (*) (void));
#endif /* !defined(__XOPEN_OR_POSIX) || ((_POSIX_C_SOURCE > 2) ... */
#if !defined(_LP64) && \
(!defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__))
#endif
#if !defined(_POSIX_C_SOURCE) || defined(_XPG5) || \
defined(__EXTENSIONS__)
#endif
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/* per RFC 3542; This is also defined in netdb.h */
extern int rcmd_af(char **, unsigned short, const char *, const char *,
const char *, int *, int);
#endif
#if !defined(__XOPEN_OR_POSIX) || \
defined(_XPG4_2) || defined(__EXTENSIONS__)
size_t);
#endif
defined(__EXTENSIONS__)
extern int rename(const char *, const char *);
#endif /* (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3)... */
#if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
defined(__EXTENSIONS__)
extern int renameat(int, const char *, int, const char *);
#endif /* !defined(__XOPEN_OR_POSIX || defined(_ATFILE_SOURCE)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int resolvepath(const char *, char *, size_t);
/* per RFC 3542; This is also defined in netdb.h */
extern int rexec_af(char **, unsigned short, const char *, const char *,
const char *, int *, int);
#endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
extern int rmdir(const char *);
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/* per RFC 3542; This is also defined in netdb.h */
extern int rresvport_af(int *, int);
#endif
defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int sethostname(char *, int);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern void setusershell(void);
#endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
extern unsigned sleep(unsigned);
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if defined(_XPG4)
/* __EXTENSIONS__ makes the SVID Third Edition prototype in stdlib.h visible */
#endif /* defined(_XPG4) */
extern int symlink(const char *, const char *);
extern void sync(void);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else /* __PRAGMA_REDEFINE_EXTNAME */
#define sysconf __sysconf_xpg5
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* defined(_XPG5) && !defined(_XPG6) */
extern long sysconf(int);
#if !defined(__XOPEN_OR_POSIX) || \
defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX)... */
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
extern char *ttyname(int);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
extern int unlink(const char *);
#if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
defined(__EXTENSIONS__)
extern int unlinkat(int, const char *, int);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
extern int usleep(useconds_t);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern void vhangup(void);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern void yield(void);
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/* transitional large file interface versions */
!defined(__PRAGMA_REDEFINE_EXTNAME))
extern int ftruncate64(int, off64_t);
extern int truncate64(const char *, off64_t);
#endif /* _LARGEFILE64_SOURCE */
#else /* __STDC__ */
extern int access();
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int acct();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern unsigned alarm();
defined(__EXTENSIONS__)
extern int brk();
#endif /* !defined(__XOPEN_OR_POSIX) || (defined(_XPG4_2)... */
extern int chdir();
extern int chown();
#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(__EXTENSIONS__)
extern int chroot();
#endif /* (!defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
extern int close();
#if defined(_XPG4) || defined(__EXTENSIONS__)
extern char *crypt();
#endif /* defined(XPG4) || defined(__EXTENSIONS__) */
extern char *ctermid();
#endif /* (!defined(_POSIX_C_SOURCE) || defined(_XPG3)... */
extern char *ctermid_r();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_REENTRANT) ... */
#if !defined(_XPG6) || defined(__EXTENSIONS__)
extern char *cuserid();
#endif
extern int dup();
extern int dup2();
#if defined(_XPG4) || defined(__EXTENSIONS__)
extern void encrypt();
#endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern void endusershell();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern int execl();
extern int execle();
extern int execlp();
extern int execv();
extern int execve();
extern int execvp();
extern void _exit();
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int fattach();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern int fchdir();
extern int fchown();
#if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
defined(__EXTENSIONS__)
extern int fchownat();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int fchroot();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
defined(__EXTENSIONS__)
extern int fdatasync();
#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
#if !defined(__XOPEN_OR_POSIX)
extern int fdetach();
#endif /* !defined(__XOPEN_OR_POSIX) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern long fpathconf();
defined(__EXTENSIONS__)
extern int fsync();
#endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
defined(__EXTENSIONS__)
extern int ftruncate();
#endif /* !defined(__XOPEN_OR_POSIX) (_POSIX_C_SOURCE > 2)... */
extern char *getcwd();
defined(__EXTENSIONS__)
extern int getdtablesize();
#endif
extern int getgroups();
extern long gethostid();
#endif
extern int gethostname();
#endif
extern char *getlogin();
#if defined(_XPG4) || defined(__EXTENSIONS__)
extern int getopt();
extern char *optarg;
#if !defined(_XPG6) || defined(__EXTENSIONS__)
extern char *getpass();
#endif
#endif /* defined(_XPG4) || defined(__EXTENSIONS__) */
#if !defined(_XPG6) || defined(__EXTENSIONS__)
extern int getpagesize();
#endif
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
char *gettxt();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern char *getusershell();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern char *getwd();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int ioctl();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int isaexec();
extern int issetugid();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern int isatty();
extern int lchown();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) */
extern int link();
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
defined(__EXTENSIONS__)
extern int lockf();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int mincore();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(__EXTENSIONS__)
extern int nice();
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
extern long pathconf();
extern int pause();
extern int pipe();
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG5) || \
defined(__EXTENSIONS__)
#endif
#if !defined(_LP64) && \
(!defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__))
extern void profil();
extern int ptrace();
#endif
#if !defined(__XOPEN_OR_POSIX) || \
defined(__EXTENSIONS__)
extern int pthread_atfork();
#endif /* !defined(__XOPEN_OR_POSIX) || ((_POSIX_C_SOURCE > 2) ... */
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG5) || \
defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG5) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/* per RFC 3542; This is also defined in netdb.h */
extern int rcmd_af();
#endif
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
defined(__EXTENSIONS__)
extern int rename();
#if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
defined(__EXTENSIONS__)
extern int renameat();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
#endif /* (!defined(__XOPEN_OR_POSIX) || (defined(_XPG3)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int resolvepath();
/* per RFC 3542; This is also defined in netdb.h */
extern int rexec_af();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern int rmdir();
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/* per RFC 3542; This is also defined in netdb.h */
extern int rresvport_af();
#endif
defined(__EXTENSIONS__)
extern void *sbrk();
#endif /* !defined(__XOPEN_OR_POSIX)|| (defined(_XPG4_2)... */
extern int setegid();
extern int seteuid();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
extern int setgid();
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int setgroups();
extern int sethostname();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
extern int setpgid();
extern int setregid();
extern int setreuid();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
extern int setuid();
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern void setusershell();
#endif /* !defined(__XOPEN_OR_POSIX)|| defined(__EXTENSIONS__) */
extern unsigned sleep();
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int stime();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if defined(_XPG4)
/* __EXTENSIONS__ makes the SVID Third Edition prototype in stdlib.h visible */
extern void swab();
#endif /* defined(_XPG4) */
extern int symlink();
extern void sync();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if defined(_XPG5)
#ifdef __PRAGMA_REDEFINE_EXTNAME
extern long sysconf();
#else /* __PRAGMA_REDEFINE_EXTNAME */
extern long __sysconf_xpg5();
#define sysconf __sysconf_xpg5
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* defined(_XPG5) */
extern int tcsetpgrp();
#if !defined(__XOPEN_OR_POSIX) || \
defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX)... */
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || \
defined(__EXTENSIONS__)
extern int truncate();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
extern char *ttyname();
extern useconds_t ualarm();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
extern int unlink();
#if !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE) || \
defined(__EXTENSIONS__)
extern int unlinkat();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_ATFILE_SOURCE)... */
extern int usleep();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern void vhangup();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern void yield();
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/* transitional large file interface versions */
!defined(__PRAGMA_REDEFINE_EXTNAME))
extern int ftruncate64();
extern int truncate64();
extern int lockf64();
#endif /* _LARGEFILE64_SOURCE */
#endif /* __STDC__ */
/*
* This atrocity is necessary on sparc because registers modified
* by the child get propagated back to the parent via the window
*/
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#if defined(__sparc)
#pragma unknown_control_flow(vfork)
#endif
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/*
* getlogin_r() & ttyname_r() prototypes are defined here.
*/
/*
* Previous releases of Solaris, starting at 2.3, provided definitions of
* various functions as specified in POSIX.1c, Draft 6. For some of these
* functions, the final POSIX 1003.1c standard had a different number of
* arguments and return values.
*
* The following segment of this header provides support for the standard
* interfaces while supporting applications written under earlier
* releases. The application defines appropriate values of the feature
* test macros _POSIX_C_SOURCE and _POSIX_PTHREAD_SEMANTICS to indicate
* whether it was written to expect the Draft 6 or standard versions of
* these interfaces, before including this header. This header then
* provides a mapping from the source version of the interface to an
* appropriate binary interface. Such mappings permit an application
* to be built from libraries and objects which have mixed expectations
* of the definitions of these functions.
*
* For applications using the Draft 6 definitions, the binary symbol is the
* same as the source symbol, and no explicit mapping is needed. For the
* standard interface, the function func() is mapped to the binary symbol
* _posix_func(). The preferred mechanism for the remapping is a compiler
* #pragma. If the compiler does not provide such a #pragma, the header file
* defines a static function func() which calls the _posix_func() version;
* this has to be done instead of #define since POSIX specifies that an
* application can #undef the symbol and still be bound to the correct
* implementation. Unfortunately, the statics confuse lint so we fallback to
* #define in that case.
*
* NOTE: Support for the Draft 6 definitions is provided for compatibility
* only. New applications/libraries should use the standard definitions.
*/
#if defined(__EXTENSIONS__) || defined(_REENTRANT) || \
defined(_POSIX_PTHREAD_SEMANTICS)
#if defined(__STDC__)
#ifdef __PRAGMA_REDEFINE_EXTNAME
extern int getlogin_r(char *, int);
#else /* __PRAGMA_REDEFINE_EXTNAME */
extern int __posix_getlogin_r(char *, int);
extern int __posix_ttyname_r(int, char *, size_t);
#ifdef __lint
#define getlogin_r __posix_getlogin_r
#define ttyname_r __posix_ttyname_r
#else /* !__lint */
static int
{
}
static int
{
}
#endif /* !__lint */
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
extern char *getlogin_r(char *, int);
extern char *ttyname_r(int, char *, int);
#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
#else /* __STDC__ */
#ifdef __PRAGMA_REDEFINE_EXTNAME
extern int getlogin_r();
extern int ttyname_r();
#else /* __PRAGMA_REDEFINE_EXTNAME */
extern int __posix_getlogin_r();
extern int __posix_ttyname_r();
#ifdef __lint
#define getlogin_r __posix_getlogin_r
#define ttyname_r __posix_ttyname_r
#else /* !__lint */
static int
char *__name;
int __len;
{
}
static int
int __fildes;
char *__buf;
{
}
#endif /* !__lint */
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
extern char *getlogin_r();
extern char *ttyname_r();
#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
#endif /* __STDC__ */
#endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
#ifdef __cplusplus
}
#endif
#endif /* _UNISTD_H */