COHERENT manpages

This page displays the COHERENT manpage for fpathconf() [Get a file variable by file descriptor].

List of available manpages
Index


fpathconf() -- System Call (libc)

Get a file variable by file descriptor
#include <unistd.h>
long fpathconf(fd, fd)
int fd, name;

fpathconf() returns the value of a limit or option associated with the open
file  whose  the file  descriptor  is  fd. name  is  the symbolic  constant
(defined in  <unistd.h>) that  represents the  limit or option  to be
returned.  The value that fpathconf() returns depends upon the type of file
that fd identifies.

fpathconf() can return information about the following constants:

_PC_LINK_MAX
     The  maximum  value  of a  file's  link  count.   If  fd identifies  a
     directory, the value returned applies to the directory itself.

_PC_MAX_CANON
     The number  of bytes in a terminal's  canonical input queue.  Behavior
     is undefined if fd does not identify a terminal file.

_PC_MAX_INPUT
     The number of bytes for which  space will be available in a terminal's
     input queue.  Behavior is undefined if fd does not identify a terminal
     file.

_PC_NAME_MAX
     The number  of bytes in  a file name.   The behavior is  refined if fd
     does not identify a directory.  The value returned applies to the file
     names within the directory.

_PC_PATH_MAX
     The number of bytes in a  path name.  Behavior is undefined if fd does
     not  identify  a  directory.  If  fd  identifies  the current  working
     directory, fpathconf()  returns the maximum length  of a relative path
     name.

_PC_PIPE_BUF
     The number of  bytes that can be written atomically  when writing to a
     pipe.  If fd identifies a pipe  or FIFO, the value returned applies to
     the FIFO  itself.  If  fd identifies  a directory, the  value returned
     applies  to  any  FIFOs that  exist  or  can  be  created within  that
     directory.   If fd  identifies  any other  type of  file, behavior  is
     undefined.

_PC_CHOWN_RESTRICTED
     chown() can be used only by a process with appropriate privileges, and
     only  to change  the  group ID  of  a file  to  either that  process's
     effective  group ID  or one  of  its supplementary  group IDs.   If fd
     identifies a directory, the  value returned applies to any file, other
     than a directory, that exists or can be created within the directory.

_PC_NO_TRUNC
     Path-name  components longer  than  NAME_MAX generate  an error.   The
     behavior is undefined if fd  does not identify a directory.  The value
     returned applies to the file names within the directory.

_PC_VDISABLE
     If this value is defined, terminal-special characters can be disabled.
     Behavior is undefined if fd does not identify a terminal file.

The value of the system limit or option that name specifies does not change
during the lifetime of the calling process.

fpathconf()  fails and  returns  -1 if  name  is not  set  to a  recognized
constant.  It fails, returns -1, and  sets errno to an appropriate value if
either of the following is true:

-> fd is not a valid file descriptor.  fpathconf() sets errno to EBADF.

-> name is an invalid value.  fpathconf() sets errno to EINVAL.

See Also

libc,
pathconf(),
unistd.h
POSIX Standard, §5.7.1