Blame posix/unistd.h

Packit 6c4009
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 *	POSIX Standard: 2.10 Symbolic Constants		<unistd.h>
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef	_UNISTD_H
Packit 6c4009
#define	_UNISTD_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* These may be used to determine what facilities are present at compile time.
Packit 6c4009
   Their values can be obtained at run time from `sysconf'.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K8
Packit 6c4009
/* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008.  */
Packit 6c4009
# define _POSIX_VERSION	200809L
Packit 6c4009
#elif defined __USE_XOPEN2K
Packit 6c4009
/* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001.  */
Packit 6c4009
# define _POSIX_VERSION	200112L
Packit 6c4009
#elif defined __USE_POSIX199506
Packit 6c4009
/* POSIX Standard approved as ISO/IEC 9945-1 as of June 1995.  */
Packit 6c4009
# define _POSIX_VERSION	199506L
Packit 6c4009
#elif defined __USE_POSIX199309
Packit 6c4009
/* POSIX Standard approved as ISO/IEC 9945-1 as of September 1993.  */
Packit 6c4009
# define _POSIX_VERSION	199309L
Packit 6c4009
#else
Packit 6c4009
/* POSIX Standard approved as ISO/IEC 9945-1 as of September 1990.  */
Packit 6c4009
# define _POSIX_VERSION	199009L
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* These are not #ifdef __USE_POSIX2 because they are
Packit 6c4009
   in the theoretically application-owned namespace.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K8
Packit 6c4009
# define __POSIX2_THIS_VERSION	200809L
Packit 6c4009
/* The utilities on GNU systems also correspond to this version.  */
Packit 6c4009
#elif defined __USE_XOPEN2K
Packit 6c4009
/* The utilities on GNU systems also correspond to this version.  */
Packit 6c4009
# define __POSIX2_THIS_VERSION	200112L
Packit 6c4009
#elif defined __USE_POSIX199506
Packit 6c4009
/* The utilities on GNU systems also correspond to this version.  */
Packit 6c4009
# define __POSIX2_THIS_VERSION	199506L
Packit 6c4009
#else
Packit 6c4009
/* The utilities on GNU systems also correspond to this version.  */
Packit 6c4009
# define __POSIX2_THIS_VERSION	199209L
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* The utilities on GNU systems also correspond to this version.  */
Packit 6c4009
#define _POSIX2_VERSION	__POSIX2_THIS_VERSION
Packit 6c4009
Packit 6c4009
/* This symbol was required until the 2001 edition of POSIX.  */
Packit 6c4009
#define	_POSIX2_C_VERSION	__POSIX2_THIS_VERSION
Packit 6c4009
Packit 6c4009
/* If defined, the implementation supports the
Packit 6c4009
   C Language Bindings Option.  */
Packit 6c4009
#define	_POSIX2_C_BIND	__POSIX2_THIS_VERSION
Packit 6c4009
Packit 6c4009
/* If defined, the implementation supports the
Packit 6c4009
   C Language Development Utilities Option.  */
Packit 6c4009
#define	_POSIX2_C_DEV	__POSIX2_THIS_VERSION
Packit 6c4009
Packit 6c4009
/* If defined, the implementation supports the
Packit 6c4009
   Software Development Utilities Option.  */
Packit 6c4009
#define	_POSIX2_SW_DEV	__POSIX2_THIS_VERSION
Packit 6c4009
Packit 6c4009
/* If defined, the implementation supports the
Packit 6c4009
   creation of locales with the localedef utility.  */
Packit 6c4009
#define _POSIX2_LOCALEDEF       __POSIX2_THIS_VERSION
Packit 6c4009
Packit 6c4009
/* X/Open version number to which the library conforms.  It is selectable.  */
Packit 6c4009
#ifdef __USE_XOPEN2K8
Packit 6c4009
# define _XOPEN_VERSION	700
Packit 6c4009
#elif defined __USE_XOPEN2K
Packit 6c4009
# define _XOPEN_VERSION	600
Packit 6c4009
#elif defined __USE_UNIX98
Packit 6c4009
# define _XOPEN_VERSION	500
Packit 6c4009
#else
Packit 6c4009
# define _XOPEN_VERSION	4
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Commands and utilities from XPG4 are available.  */
Packit 6c4009
#define _XOPEN_XCU_VERSION	4
Packit 6c4009
Packit 6c4009
/* We are compatible with the old published standards as well.  */
Packit 6c4009
#define _XOPEN_XPG2	1
Packit 6c4009
#define _XOPEN_XPG3	1
Packit 6c4009
#define _XOPEN_XPG4	1
Packit 6c4009
Packit 6c4009
/* The X/Open Unix extensions are available.  */
Packit 6c4009
#define _XOPEN_UNIX	1
Packit 6c4009
Packit 6c4009
/* The enhanced internationalization capabilities according to XPG4.2
Packit 6c4009
   are present.  */
Packit 6c4009
#define	_XOPEN_ENH_I18N	1
Packit 6c4009
Packit 6c4009
/* The legacy interfaces are also available.  */
Packit 6c4009
#define _XOPEN_LEGACY	1
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Get values of POSIX options:
Packit 6c4009
Packit 6c4009
   If these symbols are defined, the corresponding features are
Packit 6c4009
   always available.  If not, they may be available sometimes.
Packit 6c4009
   The current values can be obtained with `sysconf'.
Packit 6c4009
Packit 6c4009
   _POSIX_JOB_CONTROL		Job control is supported.
Packit 6c4009
   _POSIX_SAVED_IDS		Processes have a saved set-user-ID
Packit 6c4009
				and a saved set-group-ID.
Packit 6c4009
   _POSIX_REALTIME_SIGNALS	Real-time, queued signals are supported.
Packit 6c4009
   _POSIX_PRIORITY_SCHEDULING	Priority scheduling is supported.
Packit 6c4009
   _POSIX_TIMERS		POSIX.4 clocks and timers are supported.
Packit 6c4009
   _POSIX_ASYNCHRONOUS_IO	Asynchronous I/O is supported.
Packit 6c4009
   _POSIX_PRIORITIZED_IO	Prioritized asynchronous I/O is supported.
Packit 6c4009
   _POSIX_SYNCHRONIZED_IO	Synchronizing file data is supported.
Packit 6c4009
   _POSIX_FSYNC			The fsync function is present.
Packit 6c4009
   _POSIX_MAPPED_FILES		Mapping of files to memory is supported.
Packit 6c4009
   _POSIX_MEMLOCK		Locking of all memory is supported.
Packit 6c4009
   _POSIX_MEMLOCK_RANGE		Locking of ranges of memory is supported.
Packit 6c4009
   _POSIX_MEMORY_PROTECTION	Setting of memory protections is supported.
Packit 6c4009
   _POSIX_MESSAGE_PASSING	POSIX.4 message queues are supported.
Packit 6c4009
   _POSIX_SEMAPHORES		POSIX.4 counting semaphores are supported.
Packit 6c4009
   _POSIX_SHARED_MEMORY_OBJECTS	POSIX.4 shared memory objects are supported.
Packit 6c4009
   _POSIX_THREADS		POSIX.1c pthreads are supported.
Packit 6c4009
   _POSIX_THREAD_ATTR_STACKADDR	Thread stack address attribute option supported.
Packit 6c4009
   _POSIX_THREAD_ATTR_STACKSIZE	Thread stack size attribute option supported.
Packit 6c4009
   _POSIX_THREAD_SAFE_FUNCTIONS	Thread-safe functions are supported.
Packit 6c4009
   _POSIX_THREAD_PRIORITY_SCHEDULING
Packit 6c4009
				POSIX.1c thread execution scheduling supported.
Packit 6c4009
   _POSIX_THREAD_PRIO_INHERIT	Thread priority inheritance option supported.
Packit 6c4009
   _POSIX_THREAD_PRIO_PROTECT	Thread priority protection option supported.
Packit 6c4009
   _POSIX_THREAD_PROCESS_SHARED	Process-shared synchronization supported.
Packit 6c4009
   _POSIX_PII			Protocol-independent interfaces are supported.
Packit 6c4009
   _POSIX_PII_XTI		XTI protocol-indep. interfaces are supported.
Packit 6c4009
   _POSIX_PII_SOCKET		Socket protocol-indep. interfaces are supported.
Packit 6c4009
   _POSIX_PII_INTERNET		Internet family of protocols supported.
Packit 6c4009
   _POSIX_PII_INTERNET_STREAM	Connection-mode Internet protocol supported.
Packit 6c4009
   _POSIX_PII_INTERNET_DGRAM	Connectionless Internet protocol supported.
Packit 6c4009
   _POSIX_PII_OSI		ISO/OSI family of protocols supported.
Packit 6c4009
   _POSIX_PII_OSI_COTS		Connection-mode ISO/OSI service supported.
Packit 6c4009
   _POSIX_PII_OSI_CLTS		Connectionless ISO/OSI service supported.
Packit 6c4009
   _POSIX_POLL			Implementation supports `poll' function.
Packit 6c4009
   _POSIX_SELECT		Implementation supports `select' and `pselect'.
Packit 6c4009
Packit 6c4009
   _XOPEN_REALTIME		X/Open realtime support is available.
Packit 6c4009
   _XOPEN_REALTIME_THREADS	X/Open realtime thread support is available.
Packit 6c4009
   _XOPEN_SHM			Shared memory interface according to XPG4.2.
Packit 6c4009
Packit 6c4009
   _XBS5_ILP32_OFF32		Implementation provides environment with 32-bit
Packit 6c4009
				int, long, pointer, and off_t types.
Packit 6c4009
   _XBS5_ILP32_OFFBIG		Implementation provides environment with 32-bit
Packit 6c4009
				int, long, and pointer and off_t with at least
Packit 6c4009
				64 bits.
Packit 6c4009
   _XBS5_LP64_OFF64		Implementation provides environment with 32-bit
Packit 6c4009
				int, and 64-bit long, pointer, and off_t types.
Packit 6c4009
   _XBS5_LPBIG_OFFBIG		Implementation provides environment with at
Packit 6c4009
				least 32 bits int and long, pointer, and off_t
Packit 6c4009
				with at least 64 bits.
Packit 6c4009
Packit 6c4009
   If any of these symbols is defined as -1, the corresponding option is not
Packit 6c4009
   true for any file.  If any is defined as other than -1, the corresponding
Packit 6c4009
   option is true for all files.  If a symbol is not defined at all, the value
Packit 6c4009
   for a specific file can be obtained from `pathconf' and `fpathconf'.
Packit 6c4009
Packit 6c4009
   _POSIX_CHOWN_RESTRICTED	Only the super user can use `chown' to change
Packit 6c4009
				the owner of a file.  `chown' can only be used
Packit 6c4009
				to change the group ID of a file to a group of
Packit 6c4009
				which the calling process is a member.
Packit 6c4009
   _POSIX_NO_TRUNC		Pathname components longer than
Packit 6c4009
				NAME_MAX generate an error.
Packit 6c4009
   _POSIX_VDISABLE		If defined, if the value of an element of the
Packit 6c4009
				`c_cc' member of `struct termios' is
Packit 6c4009
				_POSIX_VDISABLE, no character will have the
Packit 6c4009
				effect associated with that element.
Packit 6c4009
   _POSIX_SYNC_IO		Synchronous I/O may be performed.
Packit 6c4009
   _POSIX_ASYNC_IO		Asynchronous I/O may be performed.
Packit 6c4009
   _POSIX_PRIO_IO		Prioritized Asynchronous I/O may be performed.
Packit 6c4009
Packit 6c4009
   Support for the Large File Support interface is not generally available.
Packit 6c4009
   If it is available the following constants are defined to one.
Packit 6c4009
   _LFS64_LARGEFILE		Low-level I/O supports large files.
Packit 6c4009
   _LFS64_STDIO			Standard I/O supports large files.
Packit 6c4009
   */
Packit 6c4009
Packit 6c4009
#include <bits/posix_opt.h>
Packit 6c4009
Packit 6c4009
/* Get the environment definitions from Unix98.  */
Packit 6c4009
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
Packit 6c4009
# include <bits/environments.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Standard file descriptors.  */
Packit 6c4009
#define	STDIN_FILENO	0	/* Standard input.  */
Packit 6c4009
#define	STDOUT_FILENO	1	/* Standard output.  */
Packit 6c4009
#define	STDERR_FILENO	2	/* Standard error output.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* All functions that are not declared anywhere else.  */
Packit 6c4009
Packit 6c4009
#include <bits/types.h>
Packit 6c4009
Packit 6c4009
#ifndef	__ssize_t_defined
Packit 6c4009
typedef __ssize_t ssize_t;
Packit 6c4009
# define __ssize_t_defined
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#define	__need_size_t
Packit 6c4009
#define __need_NULL
Packit 6c4009
#include <stddef.h>
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN || defined __USE_XOPEN2K
Packit 6c4009
/* The Single Unix specification says that some more types are
Packit 6c4009
   available here.  */
Packit 6c4009
# ifndef __gid_t_defined
Packit 6c4009
typedef __gid_t gid_t;
Packit 6c4009
#  define __gid_t_defined
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# ifndef __uid_t_defined
Packit 6c4009
typedef __uid_t uid_t;
Packit 6c4009
#  define __uid_t_defined
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# ifndef __off_t_defined
Packit 6c4009
#  ifndef __USE_FILE_OFFSET64
Packit 6c4009
typedef __off_t off_t;
Packit 6c4009
#  else
Packit 6c4009
typedef __off64_t off_t;
Packit 6c4009
#  endif
Packit 6c4009
#  define __off_t_defined
Packit 6c4009
# endif
Packit 6c4009
# if defined __USE_LARGEFILE64 && !defined __off64_t_defined
Packit 6c4009
typedef __off64_t off64_t;
Packit 6c4009
#  define __off64_t_defined
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# ifndef __useconds_t_defined
Packit 6c4009
typedef __useconds_t useconds_t;
Packit 6c4009
#  define __useconds_t_defined
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# ifndef __pid_t_defined
Packit 6c4009
typedef __pid_t pid_t;
Packit 6c4009
#  define __pid_t_defined
Packit 6c4009
# endif
Packit 6c4009
#endif	/* X/Open */
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
Packit 6c4009
# ifndef __intptr_t_defined
Packit 6c4009
typedef __intptr_t intptr_t;
Packit 6c4009
#  define __intptr_t_defined
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC || defined __USE_XOPEN
Packit 6c4009
# ifndef __socklen_t_defined
Packit 6c4009
typedef __socklen_t socklen_t;
Packit 6c4009
#  define __socklen_t_defined
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Values for the second argument to access.
Packit 6c4009
   These may be OR'd together.  */
Packit 6c4009
#define	R_OK	4		/* Test for read permission.  */
Packit 6c4009
#define	W_OK	2		/* Test for write permission.  */
Packit 6c4009
#define	X_OK	1		/* Test for execute permission.  */
Packit 6c4009
#define	F_OK	0		/* Test for existence.  */
Packit 6c4009
Packit 6c4009
/* Test for access to NAME using the real UID and real GID.  */
Packit 6c4009
extern int access (const char *__name, int __type) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Test for access to NAME using the effective UID and GID
Packit 6c4009
   (as normal file operations use).  */
Packit 6c4009
extern int euidaccess (const char *__name, int __type)
Packit 6c4009
     __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* An alias for `euidaccess', used by some other systems.  */
Packit 6c4009
extern int eaccess (const char *__name, int __type)
Packit 6c4009
     __THROW __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_ATFILE
Packit 6c4009
/* Test for access to FILE relative to the directory FD is open on.
Packit 6c4009
   If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess',
Packit 6c4009
   otherwise use real IDs like `access'.  */
Packit 6c4009
extern int faccessat (int __fd, const char *__file, int __type, int __flag)
Packit 6c4009
     __THROW __nonnull ((2)) __wur;
Packit 6c4009
#endif /* Use GNU.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Values for the WHENCE argument to lseek.  */
Packit 6c4009
#ifndef	_STDIO_H		/* <stdio.h> has the same definitions.  */
Packit 6c4009
# define SEEK_SET	0	/* Seek from beginning of file.  */
Packit 6c4009
# define SEEK_CUR	1	/* Seek from current position.  */
Packit 6c4009
# define SEEK_END	2	/* Seek from end of file.  */
Packit 6c4009
# ifdef __USE_GNU
Packit 6c4009
#  define SEEK_DATA	3	/* Seek to next data.  */
Packit 6c4009
#  define SEEK_HOLE	4	/* Seek to next hole.  */
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC && !defined L_SET
Packit 6c4009
/* Old BSD names for the same constants; just for compatibility.  */
Packit 6c4009
# define L_SET		SEEK_SET
Packit 6c4009
# define L_INCR		SEEK_CUR
Packit 6c4009
# define L_XTND		SEEK_END
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Move FD's file position to OFFSET bytes from the
Packit 6c4009
   beginning of the file (if WHENCE is SEEK_SET),
Packit 6c4009
   the current position (if WHENCE is SEEK_CUR),
Packit 6c4009
   or the end of the file (if WHENCE is SEEK_END).
Packit 6c4009
   Return the new file position.  */
Packit 6c4009
#ifndef __USE_FILE_OFFSET64
Packit 6c4009
extern __off_t lseek (int __fd, __off_t __offset, int __whence) __THROW;
Packit 6c4009
#else
Packit 6c4009
# ifdef __REDIRECT_NTH
Packit 6c4009
extern __off64_t __REDIRECT_NTH (lseek,
Packit 6c4009
				 (int __fd, __off64_t __offset, int __whence),
Packit 6c4009
				 lseek64);
Packit 6c4009
# else
Packit 6c4009
#  define lseek lseek64
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
#ifdef __USE_LARGEFILE64
Packit 6c4009
extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
Packit 6c4009
     __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Close the file descriptor FD.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern int close (int __fd);
Packit 6c4009
Packit 6c4009
/* Read NBYTES into BUF from FD.  Return the
Packit 6c4009
   number read, -1 for errors or 0 for EOF.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur;
Packit 6c4009
Packit 6c4009
/* Write N bytes of BUF to FD.  Return the number written, or -1.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur;
Packit 6c4009
Packit 6c4009
#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
Packit 6c4009
# ifndef __USE_FILE_OFFSET64
Packit 6c4009
/* Read NBYTES into BUF from FD at the given position OFFSET without
Packit 6c4009
   changing the file pointer.  Return the number read, -1 for errors
Packit 6c4009
   or 0 for EOF.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
Packit 6c4009
		      __off_t __offset) __wur;
Packit 6c4009
Packit 6c4009
/* Write N bytes of BUF to FD at the given position OFFSET without
Packit 6c4009
   changing the file pointer.  Return the number written, or -1.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern ssize_t pwrite (int __fd, const void *__buf, size_t __n,
Packit 6c4009
		       __off_t __offset) __wur;
Packit 6c4009
# else
Packit 6c4009
#  ifdef __REDIRECT
Packit 6c4009
extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes,
Packit 6c4009
				   __off64_t __offset),
Packit 6c4009
			   pread64) __wur;
Packit 6c4009
extern ssize_t __REDIRECT (pwrite, (int __fd, const void *__buf,
Packit 6c4009
				    size_t __nbytes, __off64_t __offset),
Packit 6c4009
			   pwrite64) __wur;
Packit 6c4009
#  else
Packit 6c4009
#   define pread pread64
Packit 6c4009
#   define pwrite pwrite64
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
# ifdef __USE_LARGEFILE64
Packit 6c4009
/* Read NBYTES into BUF from FD at the given position OFFSET without
Packit 6c4009
   changing the file pointer.  Return the number read, -1 for errors
Packit 6c4009
   or 0 for EOF.  */
Packit 6c4009
extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
Packit 6c4009
			__off64_t __offset) __wur;
Packit 6c4009
/* Write N bytes of BUF to FD at the given position OFFSET without
Packit 6c4009
   changing the file pointer.  Return the number written, or -1.  */
Packit 6c4009
extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n,
Packit 6c4009
			 __off64_t __offset) __wur;
Packit 6c4009
# endif
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Create a one-way communication channel (pipe).
Packit 6c4009
   If successful, two file descriptors are stored in PIPEDES;
Packit 6c4009
   bytes written on PIPEDES[1] can be read from PIPEDES[0].
Packit 6c4009
   Returns 0 if successful, -1 if not.  */
Packit 6c4009
extern int pipe (int __pipedes[2]) __THROW __wur;
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Same as pipe but apply flags passed in FLAGS to the new file
Packit 6c4009
   descriptors.  */
Packit 6c4009
extern int pipe2 (int __pipedes[2], int __flags) __THROW __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Schedule an alarm.  In SECONDS seconds, the process will get a SIGALRM.
Packit 6c4009
   If SECONDS is zero, any currently scheduled alarm will be cancelled.
Packit 6c4009
   The function returns the number of seconds remaining until the last
Packit 6c4009
   alarm scheduled would have signaled, or zero if there wasn't one.
Packit 6c4009
   There is no return value to indicate an error, but you can set `errno'
Packit 6c4009
   to 0 and check its value after calling `alarm', and this might tell you.
Packit 6c4009
   The signal may come late due to processor scheduling.  */
Packit 6c4009
extern unsigned int alarm (unsigned int __seconds) __THROW;
Packit 6c4009
Packit 6c4009
/* Make the process sleep for SECONDS seconds, or until a signal arrives
Packit 6c4009
   and is not ignored.  The function returns the number of seconds less
Packit 6c4009
   than SECONDS which it actually slept (thus zero if it slept the full time).
Packit 6c4009
   If a signal handler does a `longjmp' or modifies the handling of the
Packit 6c4009
   SIGALRM signal while inside `sleep' call, the handling of the SIGALRM
Packit 6c4009
   signal afterwards is undefined.  There is no return value to indicate
Packit 6c4009
   error, but if `sleep' returns SECONDS, it probably didn't work.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern unsigned int sleep (unsigned int __seconds);
Packit 6c4009
Packit 6c4009
#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
Packit 6c4009
    || defined __USE_MISC
Packit 6c4009
/* Set an alarm to go off (generating a SIGALRM signal) in VALUE
Packit 6c4009
   microseconds.  If INTERVAL is nonzero, when the alarm goes off, the
Packit 6c4009
   timer is reset to go off every INTERVAL microseconds thereafter.
Packit 6c4009
   Returns the number of microseconds remaining before the alarm.  */
Packit 6c4009
extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
Packit 6c4009
     __THROW;
Packit 6c4009
Packit 6c4009
/* Sleep USECONDS microseconds, or until a signal arrives that is not blocked
Packit 6c4009
   or ignored.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern int usleep (__useconds_t __useconds);
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Suspend the process until a signal arrives.
Packit 6c4009
   This always returns -1 and sets `errno' to EINTR.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern int pause (void);
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Change the owner and group of FILE.  */
Packit 6c4009
extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
Packit 6c4009
     __THROW __nonnull ((1)) __wur;
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
Packit 6c4009
/* Change the owner and group of the file that FD is open on.  */
Packit 6c4009
extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Change owner and group of FILE, if it is a symbolic
Packit 6c4009
   link the ownership of the symbolic link is changed.  */
Packit 6c4009
extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
Packit 6c4009
     __THROW __nonnull ((1)) __wur;
Packit 6c4009
Packit 6c4009
#endif /* Use X/Open Unix.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_ATFILE
Packit 6c4009
/* Change the owner and group of FILE relative to the directory FD is open
Packit 6c4009
   on.  */
Packit 6c4009
extern int fchownat (int __fd, const char *__file, __uid_t __owner,
Packit 6c4009
		     __gid_t __group, int __flag)
Packit 6c4009
     __THROW __nonnull ((2)) __wur;
Packit 6c4009
#endif /* Use GNU.  */
Packit 6c4009
Packit 6c4009
/* Change the process's working directory to PATH.  */
Packit 6c4009
extern int chdir (const char *__path) __THROW __nonnull ((1)) __wur;
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
Packit 6c4009
/* Change the process's working directory to the one FD is open on.  */
Packit 6c4009
extern int fchdir (int __fd) __THROW __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Get the pathname of the current working directory,
Packit 6c4009
   and put it in SIZE bytes of BUF.  Returns NULL if the
Packit 6c4009
   directory couldn't be determined or SIZE was too small.
Packit 6c4009
   If successful, returns BUF.  In GNU, if BUF is NULL,
Packit 6c4009
   an array is allocated with `malloc'; the array is SIZE
Packit 6c4009
   bytes long, unless SIZE == 0, in which case it is as
Packit 6c4009
   big as necessary.  */
Packit 6c4009
extern char *getcwd (char *__buf, size_t __size) __THROW __wur;
Packit 6c4009
Packit 6c4009
#ifdef	__USE_GNU
Packit 6c4009
/* Return a malloc'd string containing the current directory name.
Packit 6c4009
   If the environment variable `PWD' is set, and its value is correct,
Packit 6c4009
   that value is used.  */
Packit 6c4009
extern char *get_current_dir_name (void) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
Packit 6c4009
    || defined __USE_MISC
Packit 6c4009
/* Put the absolute pathname of the current working directory in BUF.
Packit 6c4009
   If successful, return BUF.  If not, put an error message in
Packit 6c4009
   BUF and return NULL.  BUF should be at least PATH_MAX bytes long.  */
Packit 6c4009
extern char *getwd (char *__buf)
Packit 6c4009
     __THROW __nonnull ((1)) __attribute_deprecated__ __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Duplicate FD, returning a new file descriptor on the same file.  */
Packit 6c4009
extern int dup (int __fd) __THROW __wur;
Packit 6c4009
Packit 6c4009
/* Duplicate FD to FD2, closing FD2 and making it open on the same file.  */
Packit 6c4009
extern int dup2 (int __fd, int __fd2) __THROW;
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Duplicate FD to FD2, closing FD2 and making it open on the same
Packit 6c4009
   file while setting flags according to FLAGS.  */
Packit 6c4009
extern int dup3 (int __fd, int __fd2, int __flags) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* NULL-terminated array of "NAME=VALUE" environment variables.  */
Packit 6c4009
extern char **__environ;
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
extern char **environ;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Replace the current process, executing PATH with arguments ARGV and
Packit 6c4009
   environment ENVP.  ARGV and ENVP are terminated by NULL pointers.  */
Packit 6c4009
extern int execve (const char *__path, char *const __argv[],
Packit 6c4009
		   char *const __envp[]) __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K8
Packit 6c4009
/* Execute the file FD refers to, overlaying the running program image.
Packit 6c4009
   ARGV and ENVP are passed to the new program, as for `execve'.  */
Packit 6c4009
extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
Packit 6c4009
     __THROW __nonnull ((2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Execute PATH with arguments ARGV and environment from `environ'.  */
Packit 6c4009
extern int execv (const char *__path, char *const __argv[])
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Execute PATH with all arguments after PATH until a NULL pointer,
Packit 6c4009
   and the argument after that for environment.  */
Packit 6c4009
extern int execle (const char *__path, const char *__arg, ...)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Execute PATH with all arguments after PATH until
Packit 6c4009
   a NULL pointer and environment from `environ'.  */
Packit 6c4009
extern int execl (const char *__path, const char *__arg, ...)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Execute FILE, searching in the `PATH' environment variable if it contains
Packit 6c4009
   no slashes, with arguments ARGV and environment from `environ'.  */
Packit 6c4009
extern int execvp (const char *__file, char *const __argv[])
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
/* Execute FILE, searching in the `PATH' environment variable if
Packit 6c4009
   it contains no slashes, with all arguments after FILE until a
Packit 6c4009
   NULL pointer and environment from `environ'.  */
Packit 6c4009
extern int execlp (const char *__file, const char *__arg, ...)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Execute FILE, searching in the `PATH' environment variable if it contains
Packit 6c4009
   no slashes, with arguments ARGV and environment from `environ'.  */
Packit 6c4009
extern int execvpe (const char *__file, char *const __argv[],
Packit 6c4009
		    char *const __envp[])
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC || defined __USE_XOPEN
Packit 6c4009
/* Add INC to priority of the current process.  */
Packit 6c4009
extern int nice (int __inc) __THROW __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Terminate program execution with the low-order 8 bits of STATUS.  */
Packit 6c4009
extern void _exit (int __status) __attribute__ ((__noreturn__));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
Packit 6c4009
   the `_SC_*' symbols for the NAME argument to `sysconf';
Packit 6c4009
   and the `_CS_*' symbols for the NAME argument to `confstr'.  */
Packit 6c4009
#include <bits/confname.h>
Packit 6c4009
Packit 6c4009
/* Get file-specific configuration information about PATH.  */
Packit 6c4009
extern long int pathconf (const char *__path, int __name)
Packit 6c4009
     __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
/* Get file-specific configuration about descriptor FD.  */
Packit 6c4009
extern long int fpathconf (int __fd, int __name) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the value of the system variable NAME.  */
Packit 6c4009
extern long int sysconf (int __name) __THROW;
Packit 6c4009
Packit 6c4009
#ifdef	__USE_POSIX2
Packit 6c4009
/* Get the value of the string-valued system variable NAME.  */
Packit 6c4009
extern size_t confstr (int __name, char *__buf, size_t __len) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Get the process ID of the calling process.  */
Packit 6c4009
extern __pid_t getpid (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the process ID of the calling process's parent.  */
Packit 6c4009
extern __pid_t getppid (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the process group ID of the calling process.  */
Packit 6c4009
extern __pid_t getpgrp (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the process group ID of process PID.  */
Packit 6c4009
extern __pid_t __getpgid (__pid_t __pid) __THROW;
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
Packit 6c4009
extern __pid_t getpgid (__pid_t __pid) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Set the process group ID of the process matching PID to PGID.
Packit 6c4009
   If PID is zero, the current process's process group ID is set.
Packit 6c4009
   If PGID is zero, the process ID of the process is used.  */
Packit 6c4009
extern int setpgid (__pid_t __pid, __pid_t __pgid) __THROW;
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
Packit 6c4009
/* Both System V and BSD have `setpgrp' functions, but with different
Packit 6c4009
   calling conventions.  The BSD function is the same as POSIX.1 `setpgid'
Packit 6c4009
   (above).  The System V function takes no arguments and puts the calling
Packit 6c4009
   process in its on group like `setpgid (0, 0)'.
Packit 6c4009
Packit 6c4009
   New programs should always use `setpgid' instead.
Packit 6c4009
Packit 6c4009
   GNU provides the POSIX.1 function.  */
Packit 6c4009
Packit 6c4009
/* Set the process group ID of the calling process to its own PID.
Packit 6c4009
   This is exactly the same as `setpgid (0, 0)'.  */
Packit 6c4009
extern int setpgrp (void) __THROW;
Packit 6c4009
Packit 6c4009
#endif	/* Use misc or X/Open.  */
Packit 6c4009
Packit 6c4009
/* Create a new session with the calling process as its leader.
Packit 6c4009
   The process group IDs of the session and the calling process
Packit 6c4009
   are set to the process ID of the calling process, which is returned.  */
Packit 6c4009
extern __pid_t setsid (void) __THROW;
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
Packit 6c4009
/* Return the session ID of the given process.  */
Packit 6c4009
extern __pid_t getsid (__pid_t __pid) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Get the real user ID of the calling process.  */
Packit 6c4009
extern __uid_t getuid (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the effective user ID of the calling process.  */
Packit 6c4009
extern __uid_t geteuid (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the real group ID of the calling process.  */
Packit 6c4009
extern __gid_t getgid (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Get the effective group ID of the calling process.  */
Packit 6c4009
extern __gid_t getegid (void) __THROW;
Packit 6c4009
Packit 6c4009
/* If SIZE is zero, return the number of supplementary groups
Packit 6c4009
   the calling process is in.  Otherwise, fill in the group IDs
Packit 6c4009
   of its supplementary groups in LIST and return the number written.  */
Packit 6c4009
extern int getgroups (int __size, __gid_t __list[]) __THROW __wur;
Packit 6c4009
Packit 6c4009
#ifdef	__USE_GNU
Packit 6c4009
/* Return nonzero iff the calling process is in group GID.  */
Packit 6c4009
extern int group_member (__gid_t __gid) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Set the user ID of the calling process to UID.
Packit 6c4009
   If the calling process is the super-user, set the real
Packit 6c4009
   and effective user IDs, and the saved set-user-ID to UID;
Packit 6c4009
   if not, the effective user ID is set to UID.  */
Packit 6c4009
extern int setuid (__uid_t __uid) __THROW __wur;
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
Packit 6c4009
/* Set the real user ID of the calling process to RUID,
Packit 6c4009
   and the effective user ID of the calling process to EUID.  */
Packit 6c4009
extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Set the effective user ID of the calling process to UID.  */
Packit 6c4009
extern int seteuid (__uid_t __uid) __THROW __wur;
Packit 6c4009
#endif /* Use POSIX.1-2001.  */
Packit 6c4009
Packit 6c4009
/* Set the group ID of the calling process to GID.
Packit 6c4009
   If the calling process is the super-user, set the real
Packit 6c4009
   and effective group IDs, and the saved set-group-ID to GID;
Packit 6c4009
   if not, the effective group ID is set to GID.  */
Packit 6c4009
extern int setgid (__gid_t __gid) __THROW __wur;
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
Packit 6c4009
/* Set the real group ID of the calling process to RGID,
Packit 6c4009
   and the effective group ID of the calling process to EGID.  */
Packit 6c4009
extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_XOPEN2K
Packit 6c4009
/* Set the effective group ID of the calling process to GID.  */
Packit 6c4009
extern int setegid (__gid_t __gid) __THROW __wur;
Packit 6c4009
#endif /* Use POSIX.1-2001.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Fetch the real user ID, effective user ID, and saved-set user ID,
Packit 6c4009
   of the calling process.  */
Packit 6c4009
extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
Packit 6c4009
     __THROW;
Packit 6c4009
Packit 6c4009
/* Fetch the real group ID, effective group ID, and saved-set group ID,
Packit 6c4009
   of the calling process.  */
Packit 6c4009
extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
Packit 6c4009
     __THROW;
Packit 6c4009
Packit 6c4009
/* Set the real user ID, effective user ID, and saved-set user ID,
Packit 6c4009
   of the calling process to RUID, EUID, and SUID, respectively.  */
Packit 6c4009
extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
Packit 6c4009
     __THROW __wur;
Packit 6c4009
Packit 6c4009
/* Set the real group ID, effective group ID, and saved-set group ID,
Packit 6c4009
   of the calling process to RGID, EGID, and SGID, respectively.  */
Packit 6c4009
extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
Packit 6c4009
     __THROW __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Clone the calling process, creating an exact copy.
Packit 6c4009
   Return -1 for errors, 0 to the new process,
Packit 6c4009
   and the process ID of the new process to the old process.  */
Packit 6c4009
extern __pid_t fork (void) __THROWNL;
Packit 6c4009
Packit 6c4009
#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
Packit 6c4009
    || defined __USE_MISC
Packit 6c4009
/* Clone the calling process, but without copying the whole address space.
Packit 6c4009
   The calling process is suspended until the new process exits or is
Packit 6c4009
   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
Packit 6c4009
   and the process ID of the new process to the old process.  */
Packit 6c4009
extern __pid_t vfork (void) __THROW;
Packit 6c4009
#endif /* Use misc or XPG < 7. */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the pathname of the terminal FD is open on, or NULL on errors.
Packit 6c4009
   The returned storage is good only until the next call to this function.  */
Packit 6c4009
extern char *ttyname (int __fd) __THROW;
Packit 6c4009
Packit 6c4009
/* Store at most BUFLEN characters of the pathname of the terminal FD is
Packit 6c4009
   open on in BUF.  Return 0 on success, otherwise an error number.  */
Packit 6c4009
extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
Packit 6c4009
     __THROW __nonnull ((2)) __wur;
Packit 6c4009
Packit 6c4009
/* Return 1 if FD is a valid descriptor associated
Packit 6c4009
   with a terminal, zero if not.  */
Packit 6c4009
extern int isatty (int __fd) __THROW;
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Return the index into the active-logins file (utmp) for
Packit 6c4009
   the controlling terminal.  */
Packit 6c4009
extern int ttyslot (void) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Make a link to FROM named TO.  */
Packit 6c4009
extern int link (const char *__from, const char *__to)
Packit 6c4009
     __THROW __nonnull ((1, 2)) __wur;
Packit 6c4009
Packit 6c4009
#ifdef __USE_ATFILE
Packit 6c4009
/* Like link but relative paths in TO and FROM are interpreted relative
Packit 6c4009
   to FROMFD and TOFD respectively.  */
Packit 6c4009
extern int linkat (int __fromfd, const char *__from, int __tofd,
Packit 6c4009
		   const char *__to, int __flags)
Packit 6c4009
     __THROW __nonnull ((2, 4)) __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
Packit 6c4009
/* Make a symbolic link to FROM named TO.  */
Packit 6c4009
extern int symlink (const char *__from, const char *__to)
Packit 6c4009
     __THROW __nonnull ((1, 2)) __wur;
Packit 6c4009
Packit 6c4009
/* Read the contents of the symbolic link PATH into no more than
Packit 6c4009
   LEN bytes of BUF.  The contents are not null-terminated.
Packit 6c4009
   Returns the number of characters read, or -1 for errors.  */
Packit 6c4009
extern ssize_t readlink (const char *__restrict __path,
Packit 6c4009
			 char *__restrict __buf, size_t __len)
Packit 6c4009
     __THROW __nonnull ((1, 2)) __wur;
Packit 6c4009
#endif /* Use POSIX.1-2001.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_ATFILE
Packit 6c4009
/* Like symlink but a relative path in TO is interpreted relative to TOFD.  */
Packit 6c4009
extern int symlinkat (const char *__from, int __tofd,
Packit 6c4009
		      const char *__to) __THROW __nonnull ((1, 3)) __wur;
Packit 6c4009
Packit 6c4009
/* Like readlink but a relative PATH is interpreted relative to FD.  */
Packit 6c4009
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
Packit 6c4009
			   char *__restrict __buf, size_t __len)
Packit 6c4009
     __THROW __nonnull ((2, 3)) __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Remove the link NAME.  */
Packit 6c4009
extern int unlink (const char *__name) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
#ifdef __USE_ATFILE
Packit 6c4009
/* Remove the link NAME relative to FD.  */
Packit 6c4009
extern int unlinkat (int __fd, const char *__name, int __flag)
Packit 6c4009
     __THROW __nonnull ((2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Remove the directory PATH.  */
Packit 6c4009
extern int rmdir (const char *__path) __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the foreground process group ID of FD.  */
Packit 6c4009
extern __pid_t tcgetpgrp (int __fd) __THROW;
Packit 6c4009
Packit 6c4009
/* Set the foreground process group ID of FD set PGRP_ID.  */
Packit 6c4009
extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the login name of the user.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern char *getlogin (void);
Packit 6c4009
#ifdef __USE_POSIX199506
Packit 6c4009
/* Return at most NAME_LEN characters of the login name of the user in NAME.
Packit 6c4009
   If it cannot be determined or some other error occurred, return the error
Packit 6c4009
   code.  Otherwise return 0.
Packit 6c4009
Packit 6c4009
   This function is a possible cancellation point and therefore not
Packit 6c4009
   marked with __THROW.  */
Packit 6c4009
extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef	__USE_MISC
Packit 6c4009
/* Set the login name returned by `getlogin'.  */
Packit 6c4009
extern int setlogin (const char *__name) __THROW __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef	__USE_POSIX2
Packit 6c4009
/* Get definitions and prototypes for functions to process the
Packit 6c4009
   arguments in ARGV (ARGC of them, minus the program name) for
Packit 6c4009
   options given in OPTS.  */
Packit 6c4009
# include <bits/getopt_posix.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
Packit 6c4009
/* Put the name of the current host in no more than LEN bytes of NAME.
Packit 6c4009
   The result is null-terminated if LEN is large enough for the full
Packit 6c4009
   name and the terminator.  */
Packit 6c4009
extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC
Packit 6c4009
/* Set the name of the current host to NAME, which is LEN bytes long.
Packit 6c4009
   This call is restricted to the super-user.  */
Packit 6c4009
extern int sethostname (const char *__name, size_t __len)
Packit 6c4009
     __THROW __nonnull ((1)) __wur;
Packit 6c4009
Packit 6c4009
/* Set the current machine's Internet number to ID.
Packit 6c4009
   This call is restricted to the super-user.  */
Packit 6c4009
extern int sethostid (long int __id) __THROW __wur;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Get and set the NIS (aka YP) domain name, if any.
Packit 6c4009
   Called just like `gethostname' and `sethostname'.
Packit 6c4009
   The NIS domain name is usually the empty string when not using NIS.  */
Packit 6c4009
extern int getdomainname (char *__name, size_t __len)
Packit 6c4009
     __THROW __nonnull ((1)) __wur;
Packit 6c4009
extern int setdomainname (const char *__name, size_t __len)
Packit 6c4009
     __THROW __nonnull ((1)) __wur;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Revoke access permissions to all processes currently communicating
Packit 6c4009
   with the control terminal, and then send a SIGHUP signal to the process
Packit 6c4009
   group of the control terminal.  */
Packit 6c4009
extern int vhangup (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Revoke the access of all descriptors currently open on FILE.  */
Packit 6c4009
extern int revoke (const char *__file) __THROW __nonnull ((1)) __wur;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Enable statistical profiling, writing samples of the PC into at most
Packit 6c4009
   SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling
Packit 6c4009
   is enabled, the system examines the user PC and increments
Packit 6c4009
   SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536].  If SCALE is zero,
Packit 6c4009
   disable profiling.  Returns zero on success, -1 on error.  */
Packit 6c4009
extern int profil (unsigned short int *__sample_buffer, size_t __size,
Packit 6c4009
		   size_t __offset, unsigned int __scale)
Packit 6c4009
     __THROW __nonnull ((1));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Turn accounting on if NAME is an existing file.  The system will then write
Packit 6c4009
   a record for each process as it terminates, to this file.  If NAME is NULL,
Packit 6c4009
   turn accounting off.  This call is restricted to the super-user.  */
Packit 6c4009
extern int acct (const char *__name) __THROW;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Successive calls return the shells listed in `/etc/shells'.  */
Packit 6c4009
extern char *getusershell (void) __THROW;
Packit 6c4009
extern void endusershell (void) __THROW; /* Discard cached info.  */
Packit 6c4009
extern void setusershell (void) __THROW; /* Rewind and re-read the file.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Put the program in the background, and dissociate from the controlling
Packit 6c4009
   terminal.  If NOCHDIR is zero, do `chdir ("/")'.  If NOCLOSE is zero,
Packit 6c4009
   redirects stdin, stdout, and stderr to /dev/null.  */
Packit 6c4009
extern int daemon (int __nochdir, int __noclose) __THROW __wur;
Packit 6c4009
#endif /* Use misc.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
Packit 6c4009
/* Make PATH be the root directory (the starting point for absolute paths).
Packit 6c4009
   This call is restricted to the super-user.  */
Packit 6c4009
extern int chroot (const char *__path) __THROW __nonnull ((1)) __wur;
Packit 6c4009
Packit 6c4009
/* Prompt with PROMPT and read a string from the terminal without echoing.
Packit 6c4009
   Uses /dev/tty if possible; otherwise stderr and stdin.  */
Packit 6c4009
extern char *getpass (const char *__prompt) __nonnull ((1));
Packit 6c4009
#endif /* Use misc || X/Open.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Make all changes done to FD actually appear on disk.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
extern int fsync (int __fd);
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
/* Make all changes done to all files on the file system associated
Packit 6c4009
   with FD actually appear on disk.  */
Packit 6c4009
extern int syncfs (int __fd) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
Packit 6c4009
Packit 6c4009
/* Return identifier for the current host.  */
Packit 6c4009
extern long int gethostid (void);
Packit 6c4009
Packit 6c4009
/* Make all changes done to all files actually appear on disk.  */
Packit 6c4009
extern void sync (void) __THROW;
Packit 6c4009
Packit 6c4009
Packit 6c4009
# if defined __USE_MISC || !defined __USE_XOPEN2K
Packit 6c4009
/* Return the number of bytes in a page.  This is the system's page size,
Packit 6c4009
   which is not necessarily the same as the hardware page size.  */
Packit 6c4009
extern int getpagesize (void)  __THROW __attribute__ ((__const__));
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Return the maximum number of file descriptors
Packit 6c4009
   the current process could possibly have.  */
Packit 6c4009
extern int getdtablesize (void) __THROW;
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
#endif /* Use misc || X/Open Unix.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
Packit 6c4009
Packit 6c4009
/* Truncate FILE to LENGTH bytes.  */
Packit 6c4009
# ifndef __USE_FILE_OFFSET64
Packit 6c4009
extern int truncate (const char *__file, __off_t __length)
Packit 6c4009
     __THROW __nonnull ((1)) __wur;
Packit 6c4009
# else
Packit 6c4009
#  ifdef __REDIRECT_NTH
Packit 6c4009
extern int __REDIRECT_NTH (truncate,
Packit 6c4009
			   (const char *__file, __off64_t __length),
Packit 6c4009
			   truncate64) __nonnull ((1)) __wur;
Packit 6c4009
#  else
Packit 6c4009
#   define truncate truncate64
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
# ifdef __USE_LARGEFILE64
Packit 6c4009
extern int truncate64 (const char *__file, __off64_t __length)
Packit 6c4009
     __THROW __nonnull ((1)) __wur;
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
#endif /* Use X/Open Unix || POSIX 2008.  */
Packit 6c4009
Packit 6c4009
#if defined __USE_POSIX199309 \
Packit 6c4009
    || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
Packit 6c4009
Packit 6c4009
/* Truncate the file FD is open on to LENGTH bytes.  */
Packit 6c4009
# ifndef __USE_FILE_OFFSET64
Packit 6c4009
extern int ftruncate (int __fd, __off_t __length) __THROW __wur;
Packit 6c4009
# else
Packit 6c4009
#  ifdef __REDIRECT_NTH
Packit 6c4009
extern int __REDIRECT_NTH (ftruncate, (int __fd, __off64_t __length),
Packit 6c4009
			   ftruncate64) __wur;
Packit 6c4009
#  else
Packit 6c4009
#   define ftruncate ftruncate64
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
# ifdef __USE_LARGEFILE64
Packit 6c4009
extern int ftruncate64 (int __fd, __off64_t __length) __THROW __wur;
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
#endif /* Use POSIX.1b || X/Open Unix || XPG6.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
Packit 6c4009
    || defined __USE_MISC
Packit 6c4009
Packit 6c4009
/* Set the end of accessible data space (aka "the break") to ADDR.
Packit 6c4009
   Returns zero on success and -1 for errors (with errno set).  */
Packit 6c4009
extern int brk (void *__addr) __THROW __wur;
Packit 6c4009
Packit 6c4009
/* Increase or decrease the end of accessible data space by DELTA bytes.
Packit 6c4009
   If successful, returns the address the previous end of data space
Packit 6c4009
   (i.e. the beginning of the new space, if DELTA > 0);
Packit 6c4009
   returns (void *) -1 for errors (with errno set).  */
Packit 6c4009
extern void *sbrk (intptr_t __delta) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Invoke `system call' number SYSNO, passing it the remaining arguments.
Packit 6c4009
   This is completely system-dependent, and not often useful.
Packit 6c4009
Packit 6c4009
   In Unix, `syscall' sets `errno' for all errors and most calls return -1
Packit 6c4009
   for errors; in many systems you cannot pass arguments or get return
Packit 6c4009
   values for all system calls (`pipe', `fork', and `getppid' typically
Packit 6c4009
   among them).
Packit 6c4009
Packit 6c4009
   In Mach, all system calls take normal arguments and always return an
Packit 6c4009
   error code (zero for success).  */
Packit 6c4009
extern long int syscall (long int __sysno, ...) __THROW;
Packit 6c4009
Packit 6c4009
#endif	/* Use misc.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
#if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) && !defined F_LOCK
Packit 6c4009
/* NOTE: These declarations also appear in <fcntl.h>; be sure to keep both
Packit 6c4009
   files consistent.  Some systems have them there and some here, and some
Packit 6c4009
   software depends on the macros being defined without including both.  */
Packit 6c4009
Packit 6c4009
/* `lockf' is a simpler interface to the locking facilities of `fcntl'.
Packit 6c4009
   LEN is always relative to the current file position.
Packit 6c4009
   The CMD argument is one of the following.
Packit 6c4009
Packit 6c4009
   This function is a cancellation point and therefore not marked with
Packit 6c4009
   __THROW.  */
Packit 6c4009
Packit 6c4009
# define F_ULOCK 0	/* Unlock a previously locked region.  */
Packit 6c4009
# define F_LOCK  1	/* Lock a region for exclusive use.  */
Packit 6c4009
# define F_TLOCK 2	/* Test and lock a region for exclusive use.  */
Packit 6c4009
# define F_TEST  3	/* Test a region for other processes locks.  */
Packit 6c4009
Packit 6c4009
# ifndef __USE_FILE_OFFSET64
Packit 6c4009
extern int lockf (int __fd, int __cmd, __off_t __len) __wur;
Packit 6c4009
# else
Packit 6c4009
#  ifdef __REDIRECT
Packit 6c4009
extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len),
Packit 6c4009
		       lockf64) __wur;
Packit 6c4009
#  else
Packit 6c4009
#   define lockf lockf64
Packit 6c4009
#  endif
Packit 6c4009
# endif
Packit 6c4009
# ifdef __USE_LARGEFILE64
Packit 6c4009
extern int lockf64 (int __fd, int __cmd, __off64_t __len) __wur;
Packit 6c4009
# endif
Packit 6c4009
#endif /* Use misc and F_LOCK not already defined.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
Packit 6c4009
/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno'
Packit 6c4009
   set to EINTR.  */
Packit 6c4009
Packit 6c4009
# define TEMP_FAILURE_RETRY(expression) \
Packit 6c4009
  (__extension__							      \
Packit 6c4009
    ({ long int __result;						      \
Packit 6c4009
       do __result = (long int) (expression);				      \
Packit 6c4009
       while (__result == -1L && errno == EINTR);			      \
Packit 6c4009
       __result; }))
Packit 6c4009
Packit 6c4009
/* Copy LENGTH bytes from INFD to OUTFD.  */
Packit 6c4009
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
Packit 6c4009
			 int __outfd, __off64_t *__poutoff,
Packit 6c4009
			 size_t __length, unsigned int __flags);
Packit 6c4009
#endif /* __USE_GNU */
Packit 6c4009
Packit 6c4009
#if defined __USE_POSIX199309 || defined __USE_UNIX98
Packit 6c4009
/* Synchronize at least the data part of a file with the underlying
Packit 6c4009
   media.  */
Packit 6c4009
extern int fdatasync (int __fildes);
Packit 6c4009
#endif /* Use POSIX199309 */
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* One-way hash PHRASE, returning a string suitable for storage in the
Packit 6c4009
   user database.  SALT selects the one-way function to use, and
Packit 6c4009
   ensures that no two users' hashes are the same, even if they use
Packit 6c4009
   the same passphrase.  The return value points to static storage
Packit 6c4009
   which will be overwritten by the next call to crypt.  */
Packit 6c4009
extern char *crypt (const char *__key, const char *__salt)
Packit 6c4009
     __THROW __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef	__USE_XOPEN
Packit 6c4009
/* Swab pairs bytes in the first N bytes of the area pointed to by
Packit 6c4009
   FROM and copy the result to TO.  The value of TO must not be in the
Packit 6c4009
   range [FROM - N + 1, FROM - 1].  If N is odd the first byte in FROM
Packit 6c4009
   is without partner.  */
Packit 6c4009
extern void swab (const void *__restrict __from, void *__restrict __to,
Packit 6c4009
		  ssize_t __n) __THROW __nonnull ((1, 2));
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Prior to Issue 6, the Single Unix Specification required these
Packit 6c4009
   prototypes to appear in this header.  They are also found in
Packit 6c4009
   <stdio.h>.  */
Packit 6c4009
#if defined __USE_XOPEN && !defined __USE_XOPEN2K
Packit 6c4009
/* Return the name of the controlling terminal.  */
Packit 6c4009
extern char *ctermid (char *__s) __THROW;
Packit 6c4009
Packit 6c4009
/* Return the name of the current user.  */
Packit 6c4009
extern char *cuserid (char *__s);
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Unix98 requires this function to be declared here.  In other
Packit 6c4009
   standards it is in <pthread.h>.  */
Packit 6c4009
#if defined __USE_UNIX98 && !defined __USE_XOPEN2K
Packit 6c4009
extern int pthread_atfork (void (*__prepare) (void),
Packit 6c4009
			   void (*__parent) (void),
Packit 6c4009
			   void (*__child) (void)) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Write LENGTH bytes of randomness starting at BUFFER.  Return 0 on
Packit 6c4009
   success or -1 on error.  */
Packit 6c4009
int getentropy (void *__buffer, size_t __length) __wur;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Define some macros helping to catch buffer overflows.  */
Packit 6c4009
#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
Packit 6c4009
# include <bits/unistd.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* unistd.h  */