Back to index

glibc  2.9
Defines | Functions | Variables
unistd.h File Reference
#include <posix/unistd.h>

Go to the source code of this file.

Defines

#define __have_pipe2   __have_sock_cloexec

Functions

 libc_hidden_proto (_exit, __noreturn__) libc_hidden_proto(alarm) libc_hidden_proto(confstr) libc_hidden_proto(execl) libc_hidden_proto(execle) libc_hidden_proto(execlp) libc_hidden_proto(execvp) libc_hidden_proto(getpid) libc_hidden_proto(getsid) libc_hidden_proto(getdomainname) libc_hidden_proto(getlogin_r) libc_hidden_proto(seteuid) libc_hidden_proto(setegid) libc_hidden_proto(tcgetpgrp) libc_hidden_proto(readlinkat) extern int __access(__const char *__name
int __euidaccess (__const char *__name, int __type)
__off64_t __lseek64 (int __fd, __off64_t __offset, int __whence)
__off_t __lseek (int __fd, __off_t __offset, int __whence)
 libc_hidden_proto (__lseek) extern __off_t __libc_lseek(int __fd
__off64_t __libc_lseek64 (int __fd, __off64_t __offset, int __whence)
ssize_t __pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
ssize_t __libc_pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
ssize_t __pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
ssize_t __libc_pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
ssize_t __pwrite (int __fd, __const void *__buf, size_t __n, __off_t __offset)
ssize_t __libc_pwrite (int __fd, __const void *__buf, size_t __n, __off_t __offset)
ssize_t __pwrite64 (int __fd, __const void *__buf, size_t __n, __off64_t __offset)
 libc_hidden_proto (__pwrite64) extern ssize_t __libc_pwrite64(int __fd
ssize_t __libc_read (int __fd, void *__buf, size_t __n)
 libc_hidden_proto (__libc_read) extern ssize_t __libc_write(int __fd
 libc_hidden_proto (__libc_write) extern int __pipe(int __pipedes[2])
 libc_hidden_proto (__pipe) extern int __pipe2(int __pipedes[2]
unsigned int __sleep (unsigned int __seconds)
int __chown (__const char *__file, __uid_t __owner, __gid_t __group)
 libc_hidden_proto (__chown) extern int __fchown(int __fd
int __lchown (__const char *__file, __uid_t __owner, __gid_t __group)
int __chdir (__const char *__path)
int __fchdir (int __fd)
char * __getcwd (char *__buf, size_t __size)
int __rmdir (const char *__path)
char * __canonicalize_directory_name_internal (__const char *__thisdir, char *__buf, size_t __size) attribute_hidden
int __dup (int __fd)
int __dup2 (int __fd, int __fd2)
 libc_hidden_proto (__dup2) extern int __execve(__const char *__path
long int __pathconf (__const char *__path, int __name)
long int __fpathconf (int __fd, int __name)
long int __sysconf (int __name)
 libc_hidden_proto (__sysconf) extern __pid_t __getpid(void)
 libc_hidden_proto (__getpid) extern __pid_t __getppid(void)
__pid_t __setsid (void)
__uid_t __getuid (void)
__uid_t __geteuid (void)
__gid_t __getgid (void)
__gid_t __getegid (void)
int __getgroups (int __size, __gid_t __list[])
 libc_hidden_proto (__getpgid) extern int __group_member(__gid_t __gid)
int __setuid (__uid_t __uid)
int __setreuid (__uid_t __ruid, __uid_t __euid)
int __setgid (__gid_t __gid)
int __setpgid (__pid_t __pid, __pid_t __pgid)
 libc_hidden_proto (__setpgid) extern int __setregid(__gid_t __rgid
int __getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid)
int __getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
int __setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
int __setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
 libc_hidden_proto (__getresuid) libc_hidden_proto(__getresgid) libc_hidden_proto(__setresuid) libc_hidden_proto(__setresgid) extern __pid_t __vfork(void)
 libc_hidden_proto (__vfork) extern int __ttyname_r(int __fd
int __isatty (int __fd)
int __link (__const char *__from, __const char *__to)
int __symlink (__const char *__from, __const char *__to)
int __readlink (__const char *__path, char *__buf, size_t __len)
int __unlink (__const char *__name)
int __gethostname (char *__name, size_t __len)
int __profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale)
int __getdtablesize (void)
int __brk (void *__addr)
int __close (int __fd)
 libc_hidden_proto (__close) extern int __libc_close(int __fd)
ssize_t __read (int __fd, void *__buf, size_t __nbytes)
 libc_hidden_proto (__read) extern ssize_t __write(int __fd
 libc_hidden_proto (__write) extern __pid_t __fork(void)
 libc_hidden_proto (__fork) extern int __getpagesize(void) __attribute__((__const__))
 libc_hidden_proto (__getpagesize) extern int __ftruncate(int __fd
int __ftruncate64 (int __fd, __off64_t __length)
int __truncate (const char *path, __off_t __length)
void * __sbrk (intptr_t __delta)
 libc_hidden_proto (__sbrk) extern int __libc_enable_secure attribute_relro
void __libc_check_standard_fds (void)
void __exit_thread (int val) __attribute__((noreturn))
__pid_t __libc_fork (void)
int __libc_pause (void)
int __pause_nocancel (void) attribute_hidden

Variables

int __type
__off_t __offset
__off_t int __whence
__const void * __buf
__const void size_t __n
int __flags
__uid_t __owner
__uid_t __gid_t __group
char *__const __argv []
char *__const char *__const __envp []
__gid_t __egid
char size_t __buflen
__off_t __length
int __libc_enable_secure_decided
int __have_sock_cloexec

Define Documentation

Definition at line 173 of file unistd.h.


Function Documentation

int __brk ( void *  __addr)

Definition at line 28 of file brk.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the caller graph for this function:

char* __canonicalize_directory_name_internal ( __const char *  __thisdir,
char *  __buf,
size_t  __size 
)
int __chdir ( __const char *  __path)
int __chown ( __const char *  __file,
__uid_t  __owner,
__gid_t  __group 
)

Here is the caller graph for this function:

int __close ( int  __fd)

Definition at line 24 of file close.c.

{
  if (fd < 0)
    {
      __set_errno (EBADF);
      return -1;
    }

  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

int __dup ( int  __fd)

Definition at line 25 of file dup.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __dup2 ( int  __fd,
int  __fd2 
)

Definition at line 27 of file dup2.c.

{
  if (fd < 0 || fd2 < 0)
    {
      __set_errno (EBADF);
      return -1;
    }

  if (fd == fd2)
    /* No way to check that they are valid.  */
    return fd2;

  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __euidaccess ( __const char *  __name,
int  __type 
)
void __exit_thread ( int  val)

Here is the caller graph for this function:

int __fchdir ( int  __fd)

Definition at line 22 of file fchdir.c.

{
   return fchdir (fd);
}

Here is the call graph for this function:

long int __fpathconf ( int  __fd,
int  __name 
)

Definition at line 28 of file fpathconf.c.

{
  return __syssgi (SGI_PATHCONF, FPATHCONF, fd, name);
}

Here is the call graph for this function:

int __ftruncate64 ( int  __fd,
__off64_t  __length 
)

Here is the caller graph for this function:

char* __getcwd ( char *  __buf,
size_t  __size 
)

Definition at line 31 of file getcwd.c.

{
  __set_errno (ENOSYS);
  return NULL;
}

Here is the call graph for this function:

int __getdtablesize ( void  )

Definition at line 25 of file getdtsz.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

__gid_t __getegid ( void  )

Definition at line 25 of file getegid.c.

{
  return getgidx (ID_EFFECTIVE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

__uid_t __geteuid ( void  )

Definition at line 25 of file geteuid.c.

{
  return getuidx (ID_EFFECTIVE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

__gid_t __getgid ( void  )

Definition at line 26 of file getgid.c.

{
  return getgidx (ID_REAL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __getgroups ( int  __size,
__gid_t  __list[] 
)

Definition at line 22 of file getgroups.c.

{
  return getgroups (size, list);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __gethostname ( char *  __name,
size_t  __len 
)

Definition at line 26 of file gethostname.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __getresgid ( __gid_t __rgid,
__gid_t __egid,
__gid_t __sgid 
)

Definition at line 26 of file getresgid.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

int __getresuid ( __uid_t __ruid,
__uid_t __euid,
__uid_t __suid 
)

Definition at line 26 of file getresuid.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

__uid_t __getuid ( void  )

Definition at line 26 of file getuid.c.

{
  return getuidx (ID_REAL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __isatty ( int  __fd)

Definition at line 24 of file isatty.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __lchown ( __const char *  __file,
__uid_t  __owner,
__gid_t  __group 
)

Here is the caller graph for this function:

void __libc_check_standard_fds ( void  )

Definition at line 89 of file check_fds.c.

{
  /* This is really paranoid but some people actually are.  If /dev/null
     should happen to be a symlink to somewhere else and not the device
     commonly known as "/dev/null" we bail out.  We can detect this with
     the O_NOFOLLOW flag for open() but only on some system.  */
#ifndef O_NOFOLLOW
# define O_NOFOLLOW  0
#endif
  /* Check all three standard file descriptors.  */
  check_one_fd (STDIN_FILENO, O_WRONLY | O_NOFOLLOW);
  check_one_fd (STDOUT_FILENO, O_RDONLY | O_NOFOLLOW);
  check_one_fd (STDERR_FILENO, O_RDONLY | O_NOFOLLOW);
}

Here is the call graph for this function:

Here is the caller graph for this function:

__pid_t __libc_fork ( void  )

Definition at line 37 of file fork.c.

{
  return __libc_maybe_call2 (pthread_fork, (&__fork_block), ARCH_FORK ());
}

Here is the caller graph for this function:

__off64_t __libc_lseek64 ( int  __fd,
__off64_t  __offset,
int  __whence 
)

Here is the caller graph for this function:

int __libc_pause ( void  )

Definition at line 28 of file pause.c.

{
  sigset_t set;

  __sigemptyset (&set);
  __sigprocmask (SIG_BLOCK, NULL, &set);

  /* pause is a cancellation point, but so is sigsuspend.
     So no need for anything special here.  */

  return __sigsuspend (&set);
}

Here is the call graph for this function:

ssize_t __libc_pread ( int  __fd,
void *  __buf,
size_t  __nbytes,
__off_t  __offset 
)

Definition at line 30 of file pread.c.

{
  ssize_t result;

  if (SINGLE_THREAD_P)
    {
      /* In the ARM EABI, 64-bit values are aligned to even/odd register
        pairs for syscalls.  */
      result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
                            __LONG_LONG_PAIR (offset >> 31, offset));

      return result;
    }

  int oldtype = LIBC_CANCEL_ASYNC ();

  /* In the ARM EABI, 64-bit values are aligned to even/odd register
     pairs for syscalls.  */
  result = INLINE_SYSCALL (pread64, 6, fd, CHECK_N (buf, count), count, 0,
                        __LONG_LONG_PAIR (offset >> 31, offset));

  LIBC_CANCEL_RESET (oldtype);

  return result;
}

Here is the call graph for this function:

ssize_t __libc_pread64 ( int  __fd,
void *  __buf,
size_t  __nbytes,
__off64_t  __offset 
)

Here is the caller graph for this function:

ssize_t __libc_pwrite ( int  __fd,
__const void *  __buf,
size_t  __n,
__off_t  __offset 
)

Here is the caller graph for this function:

ssize_t __libc_read ( int  __fd,
void *  __buf,
size_t  __n 
)

Definition at line 25 of file read.c.

{
  if (nbytes == 0)
    return 0;
  if (fd < 0)
    {
      __set_errno (EBADF);
      return -1;
    }
  if (buf == NULL)
    {
      __set_errno (EINVAL);
      return -1;
    }

  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __link ( __const char *  __from,
__const char *  __to 
)

Here is the caller graph for this function:

__off_t __lseek ( int  __fd,
__off_t  __offset,
int  __whence 
)

Definition at line 25 of file lseek.c.

{
  if (fd < 0)
    {
      __set_errno (EBADF);
      return -1;
    }
  switch (whence)
    {
    case SEEK_SET:
    case SEEK_CUR:
    case SEEK_END:
      break;
    default:
      __set_errno (EINVAL);
      return -1;
    }

  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

__off64_t __lseek64 ( int  __fd,
__off64_t  __offset,
int  __whence 
)

Here is the caller graph for this function:

long int __pathconf ( __const char *  __path,
int  __name 
)
int __pause_nocancel ( void  )
ssize_t __pread ( int  __fd,
void *  __buf,
size_t  __nbytes,
__off_t  __offset 
)

Definition at line 24 of file pread.c.

{
  return kpread (fd, buf, len, off);
}

Here is the call graph for this function:

Here is the caller graph for this function:

ssize_t __pread64 ( int  __fd,
void *  __buf,
size_t  __nbytes,
__off64_t  __offset 
)

Here is the caller graph for this function:

int __profil ( unsigned short int __sample_buffer,
size_t  __size,
size_t  __offset,
unsigned int  __scale 
)

Definition at line 31 of file profil.c.

{
  if (scale == 0)
    /* Disable profiling.  */
    return 0;

  __set_errno (ENOSYS);
  return -1;
}

Here is the caller graph for this function:

ssize_t __pwrite ( int  __fd,
__const void *  __buf,
size_t  __n,
__off_t  __offset 
)

Here is the caller graph for this function:

ssize_t __pwrite64 ( int  __fd,
__const void *  __buf,
size_t  __n,
__off64_t  __offset 
)

Here is the caller graph for this function:

ssize_t __read ( int  __fd,
void *  __buf,
size_t  __nbytes 
)

Here is the caller graph for this function:

int __readlink ( __const char *  __path,
char *  __buf,
size_t  __len 
)

Here is the caller graph for this function:

int __rmdir ( const char *  __path)

Definition at line 22 of file rmdir.c.

{
  return rmdir (name);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* __sbrk ( intptr_t  __delta)

Definition at line 33 of file sbrk.c.

{
  void *oldbrk;

  /* If this is not part of the dynamic library or the library is used
     via dynamic loading in a statically linked program update
     __curbrk from the kernel's brk value.  That way two separate
     instances of __brk and __sbrk can share the heap, returning
     interleaved pieces of it.  */
  if (__curbrk == NULL || __libc_multiple_libcs)
    if (__brk (0) < 0)             /* Initialize the break.  */
      return (void *) -1;

  if (increment == 0)
    return __curbrk;

  oldbrk = __curbrk;
  if (__brk (oldbrk + increment) < 0)
    return (void *) -1;

  return oldbrk;
}

Here is the call graph for this function:

int __setgid ( __gid_t  __gid)

Definition at line 27 of file setgid.c.

{
  return setgidx (ID_REAL, gid);
}

Here is the call graph for this function:

int __setpgid ( __pid_t  __pid,
__pid_t  __pgid 
)

Definition at line 22 of file setpgid.c.

{
  return setpgid (pid, pgid);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __setresgid ( __gid_t  __rgid,
__gid_t  __egid,
__gid_t  __sgid 
)

Definition at line 26 of file setresgid.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

int __setresuid ( __uid_t  __ruid,
__uid_t  __euid,
__uid_t  __suid 
)

Definition at line 26 of file setresuid.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

int __setreuid ( __uid_t  __ruid,
__uid_t  __euid 
)

Definition at line 26 of file setreuid.c.

{
  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

__pid_t __setsid ( void  )

Definition at line 22 of file setsid.c.

{
  return setsid ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __setuid ( __uid_t  __uid)

Definition at line 27 of file setuid.c.

{
  return setuidx (ID_REAL, uid);
}

Here is the call graph for this function:

unsigned int __sleep ( unsigned int  __seconds)

Definition at line 27 of file sleep.c.

{
  struct timespec ts ={.tv_sec = (long int)seconds, .tv_nsec = 0};
  __libc_nanosleep(&ts,&ts);
  return 0;
}

Here is the call graph for this function:

int __symlink ( __const char *  __from,
__const char *  __to 
)
long int __sysconf ( int  __name)

Definition at line 35 of file sysconf.c.

{
  if (name == _SC_CHILD_MAX)
    {
      int save = errno;
      int start = 0;
      int ret;

      /* getsysinfo returns the number of values it put into the
        buffer, or 0 if not available, or -1 on error.  */
      if (__getsysinfo (GSI_MAX_UPROCS, &ret, sizeof (ret), &start,
                     (void *) 0) > 0)
       {
         __set_errno (save);
         return ret;
       }

      __set_errno (save);
    }

  return __default_sysconf (name);
}

Here is the call graph for this function:

int __truncate ( const char *  path,
__off_t  __length 
)

Definition at line 24 of file truncate.c.

{
  return ktruncate (name, length);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __unlink ( __const char *  __name)

Here is the caller graph for this function:

libc_hidden_proto ( _exit  ,
__noreturn__   
)

Definition at line 25 of file bsd-getpgrp.c.

{
  return __getpgid (pid);
}

Here is the call graph for this function:


Variable Documentation

char* __const __argv[]

Definition at line 78 of file unistd.h.

__const void* __buf

Definition at line 43 of file unistd.h.

Definition at line 111 of file unistd.h.

Definition at line 100 of file unistd.h.

char* __const char* __const __envp[]

Definition at line 78 of file unistd.h.

Definition at line 51 of file unistd.h.

Definition at line 57 of file unistd.h.

Definition at line 133 of file unistd.h.

Definition at line 27 of file enbl-secure.c.

Definition at line 43 of file unistd.h.

Definition at line 26 of file unistd.h.

Definition at line 57 of file unistd.h.

Definition at line 21 of file unistd.h.

Definition at line 26 of file unistd.h.