# POSIX* Library Routines

This section contains descriptions of the POSIX* library routines. They are listed in alphabetical order.

To access the POSIX library, you must specify a USE IFPOSIX statement in your program.

Certain POSIX* routines are restricted to Linux* and macOS systems. If a routine is restricted, it will show labels "(L*X, M*X)" in the routine title.

Parent topic: A to Z Reference

- IPXFARGC
  POSIX Function: Returns the index of the last command-line argument.
- IPXFCONST
  POSIX Function: Returns the value associated with a constant defined in the C POSIX standard.
- IPXFLENTRIM
  POSIX Function: Returns the index of the last non-blank character in an input string.
- IPXFWEXITSTATUS (L*X, M*X)
  POSIX Function: Returns the exit code of a child process.
- IPXFWSTOPSIG (L*X, M*X)
  POSIX Function: Returns the number of the signal that caused a child process to stop.
- IPXFWTERMSIG (L*X, M*X)
  POSIX Function: Returns the number of the signal that caused a child process to terminate.
- PXF(type)GET
  POSIX Subroutine: Gets the value stored in a component (or field) of a structure.
- PXF(type)SET
  POSIX Subroutine: Sets the value of a component (or field) of a structure.
- PXFA(type)GET
  POSIX Subroutine: Gets the array values stored in a component (or field) of a structure.
- PXFA(type)SET
  POSIX Subroutine: Sets the value of an array component (or field) of a structure.
- PXFACCESS
  POSIX Subroutine: Determines the accessibility of a file.
- PXFALARM
  POSIX Subroutine: Schedules an alarm.
- PXFCALLSUBHANDLE
  POSIX Subroutine: Calls the associated subroutine.
- PXFCFGETISPEED (L*X, M*X)
  POSIX Subroutine: Returns the input baud rate from a termios structure.
- PXFCFGETOSPEED (L*X, M*X)
  POSIX Subroutine: Returns the output baud rate from a termios structure.
- PXFCFSETISPEED (L*X, M*X)
  POSIX Subroutine: Sets the input baud rate in a termios structure.
- PXFCFSETOSPEED (L*X, M*X)
  POSIX Subroutine: Sets the output baud rate in a termios structure.
- PXFCHDIR
  POSIX Subroutine: Changes the current working directory.
- PXFCHMOD
  POSIX Subroutine: Changes the ownership mode of the file.
- PXFCHOWN (L*X, M*X)
  POSIX Subroutine: Changes the owner and group of a file.
- PXFCLEARENV
  POSIX Subroutine: Clears the process environment.
- PXFCLOSE
  POSIX Subroutine: Closes the file associated with the descriptor.
- PXFCLOSEDIR
  POSIX Subroutine: Closes the directory stream.
- PXFCONST
  POSIX Subroutine: Returns the value associated with a constant.
- PXFCREAT
  POSIX Subroutine: Creates a new file or rewrites an existing file.
- PXFCTERMID (L*X, M*X)
  POSIX Subroutine: Generates a terminal pathname.
- PXFDUP, PXFDUP2
  POSIX Subroutine: Duplicates an existing file descriptor.
- PXFE(type)GET
  POSIX Subroutine: Gets the value stored in an array element component (or field) of a structure.
- PXFE(type)SET
  POSIX Subroutine: Sets the value of an array element component (or field) of a structure.
- PXFEXECV
  POSIX Subroutine: Executes a new process by passing command-line arguments.
- PXFEXECVE
  POSIX Subroutine: Executes a new process by passing command-line arguments.
- PXFEXECVP
  POSIX Subroutine: Executes a new process by passing command-line arguments.
- PXFEXIT, PXFFASTEXIT
  POSIX Subroutine: Exits from a process.
- PXFFCNTL (L*X, M*X)
  POSIX Subroutine: Manipulates an open file descriptor.
- PXFFDOPEN
  POSIX Subroutine: Opens an external unit.
- PXFFFLUSH
  POSIX Subroutine: Flushes a file directly to disk.
- PXFFGETC
  POSIX Subroutine: Reads a character from a file.
- PXFFILENO
  POSIX Subroutine: Returns the file descriptor associated with a specified unit.
- PXFFORK (L*X, M*X)
  POSIX Subroutine: Creates a child process that differs from the parent process only in its PID.
- PXFFPATHCONF
  POSIX Subroutine: Gets the value for a configuration option of an opened file.
- PXFFPUTC
  POSIX Subroutine: Writes a character to a file.
- PXFFSEEK
  POSIX Subroutine: Modifies a file position.
- PXFFSTAT
  POSIX Subroutine: Gets a file's status information.
- PXFFTELL
  POSIX Subroutine: Returns the relative position in bytes from the beginning of the file.
- PXFGETARG
  POSIX Subroutine: Gets the specified command-line argument.
- PXFGETC
  POSIX Subroutine: Reads a character from standard input unit 5.
- PXFGETCWD
  POSIX Subroutine: Returns the path of the current working directory.
- PXFGETEGID (L*X, M*X)
  POSIX Subroutine: Gets the effective group ID of the current process.
- PXFGETENV
  POSIX Subroutine: Gets the setting of an environment variable.
- PXFGETEUID (L*X, M*X)
  POSIX Subroutine: Gets the effective user ID of the current process.
- PXFGETGID (L*X, M*X)
  POSIX Subroutine: Gets the real group ID of the current process.
- PXFGETGRGID (L*X, M*X)
  POSIX Subroutine: Gets group information for the specified GID.
- PXFGETGRNAM (L*X, M*X)
  POSIX Subroutine: Gets group information for the named group.
- PXFGETGROUPS (L*X, M*X)
  POSIX Subroutine: Gets supplementary group IDs.
- PXFGETLOGIN
  POSIX Subroutine: Gets the name of the user.
- PXFGETPGRP (L*X, M*X)
  POSIX Subroutine: Gets the process group ID of the calling process.
- PXFGETPID
  POSIX Subroutine: Gets the process ID of the calling process.
- PXFGETPPID
  POSIX Subroutine: Gets the process ID of the parent of the calling process.
- PXFGETPWNAM (L*X, M*X)
  POSIX Subroutine: Gets password information for a specified name.
- PXFGETPWUID (L*X, M*X)
  POSIX Subroutine: Gets password information for a specified UID.
- PXFGETSUBHANDLE
  POSIX Subroutine: Returns a handle for a subroutine.
- PXFGETUID (L*X, M*X)
  POSIX Subroutine: Gets the real user ID of the current process.
- PXFISATTY (L*X, M*X)
  POSIX Subroutine: Tests whether a file descriptor is connected to a terminal.
- PXFISBLK
  POSIX Function: Tests for a block special file.
- PXFISCHR
  POSIX Function: Tests for a character file.
- PXFISCONST
  POSIX Function: Tests whether a string is a valid constant name.
- PXFISDIR
  POSIX Function: Tests whether a file is a directory.
- PXFISFIFO
  POSIX Function: Tests whether a file is a special FIFO file.
- PXFISREG
  POSIX Function: Tests whether a file is a regular file.
- PXFKILL
  POSIX Subroutine: Sends a signal to a specified process.
- PXFLINK (L*X, M*X)
  POSIX Subroutine: Creates a link to a file or a directory.
- PXFLOCALTIME
  POSIX Subroutine: Converts a given elapsed time in seconds to local time.
- PXFLSEEK
  POSIX Subroutine: Positions a file a specified distance in bytes.
- PXFMKDIR
  POSIX Subroutine: Creates a new directory.
- PXFMKFIFO (L*X, M*X)
  POSIX Subroutine: Creates a new FIFO.
- PXFOPEN
  POSIX Subroutine: Opens or creates a file.
- PXFOPENDIR
  POSIX Subroutine: Opens a directory and associates a stream with it.
- PXFPATHCONF
  POSIX Subroutine: Gets the value for a configuration option of an opened file.
- PXFPAUSE
  POSIX Subroutine: Suspends process execution.
- PXFPIPE (L*X, M*X)
  POSIX Subroutine: Creates a communications pipe between two processes.
- PXFPOSIXIO
  POSIX Subroutine: Sets the current value of the POSIX I/O flag.
- PXFPUTC
  POSIX Subroutine: Outputs a character to logical unit 6 (stdout).
- PXFREAD
  POSIX Subroutine: Reads from a file.
- PXFREADDIR
  POSIX Subroutine: Reads the current directory entry.
- PXFRENAME
  POSIX Subroutine: Changes the name of a file.
- PXFREWINDDIR
  POSIX Subroutine: Resets the position of the stream to the beginning of the directory.
- PXFRMDIR
  POSIX Subroutine: Removes a directory.
- PXFSETENV
  POSIX Subroutine: Adds a new environment variable or sets the value of an environment variable.
- PXFSETGID (L*X, M*X)
  POSIX Subroutine: Sets the effective group ID of the current process.
- PXFSETPGID (L*X, M*X)
  POSIX Subroutine: Sets the process group ID.
- PXFSETSID (L*X, M*X)
  POSIX Subroutine: Creates a session and sets the process group ID.
- PXFSETUID (L*X, M*X)
  POSIX Subroutine: Sets the effective user ID of the current process.
- PXFSIGACTION (L*X, M*X)
  POSIX Subroutine: Changes the action associated with a specific signal. It can also be used to examine the action of a signal.
- PXFSIGADDSET (L*X, M*X)
  POSIX Subroutine: Adds a signal to the signal set.
- PXFSIGDELSET (L*X, M*X)
  POSIX Subroutine: Deletes a signal from the signal set.
- PXFSIGEMPTYSET (L*X, M*X)
  POSIX Subroutine: Empties a signal set.
- PXFSIGFILLSET (L*X, M*X)
  POSIX Subroutine: Fills a signal set.
- PXFSIGISMEMBER (L*X, M*X)
  POSIX Subroutine: Tests whether a signal is a member of a signal set.
- PXFSIGPENDING (L*X, M*X)
  POSIX Subroutine: Examines pending signals.
- PXFSIGPROCMASK (L*X, M*X)
  POSIX Subroutine: Changes the list of currently blocked signals.
- PXFSIGSUSPEND (L*X, M*X)
  POSIX Subroutine: Suspends the process until a signal is received.
- PXFSLEEP
  POSIX Subroutine: Forces the process to sleep.
- PXFSTAT
  POSIX Subroutine: Gets a file's status information.
- PXFSTRUCTCOPY
  POSIX Subroutine: Copies the contents of one structure to another.
- PXFSTRUCTCREATE
  POSIX Subroutine: Creates an instance of the specified structure.
- PXFSTRUCTFREE
  POSIX Subroutine: Deletes the instance of a structure.
- PXFSYSCONF
  POSIX Subroutine: Gets values for system limits or options.
- PXFTCDRAIN (L*X, M*X)
  POSIX Subroutine: Waits until all output written has been transmitted.
- PXFTCFLOW (L*X, M*X)
  POSIX Subroutine: Suspends the transmission or reception of data.
- PXFTCFLUSH (L*X, M*X)
  POSIX Subroutine: Discards terminal input data, output data, or both.
- PXFTCGETATTR (L*X, M*X)
  POSIX Subroutine: Reads current terminal settings.
- PXFTCGETPGRP (L*X, M*X)
  POSIX Subroutine: Gets the foreground process group ID associated with the terminal.
- PXFTCSENDBREAK (L*X, M*X)
  POSIX Subroutine: Sends a break to the terminal.
- PXFTCSETATTR (L*X, M*X)
  POSIX Subroutine: Writes new terminal settings.
- PXFTCSETPGRP (L*X, M*X)
  POSIX Subroutine: Sets the foreground process group ID associated with the terminal.
- PXFTIME
  POSIX Subroutine: Returns the current system time.
- PXFTIMES
  POSIX Subroutine: Returns process times.
- PXFTTYNAME (L*X, M*X)
  POSIX Subroutine: Gets the terminal pathname.
- PXFUCOMPARE
  POSIX Subroutine: Compares two unsigned integers.
- PXFUMASK
  POSIX Subroutine: Sets a new file creation mask and gets the previous one.
- PXFUNAME
  POSIX Subroutine: Gets the operation system name.
- PXFUNLINK
  POSIX Subroutine: Removes a directory entry.
- PXFUTIME
  POSIX Subroutine: Sets file access and modification times.
- PXFWAIT (L*X, M*X)
  POSIX Subroutine: Waits for a child process.
- PXFWAITPID (L*X, M*X)
  POSIX Subroutine: Waits for a specific PID.
- PXFWIFEXITED (L*X, M*X)
  POSIX Function: Determines if a child process has exited.
- PXFWIFSIGNALED (L*X, M*X)
  POSIX Function: Determines if a child process has exited because of a signal.
- PXFWIFSTOPPED (L*X, M*X)
  POSIX Function: Determines if a child process has stopped.
- PXFWRITE
  POSIX Subroutine: Writes to a file.