NAME
pathconf, fpathconf - Retrieves file implementation charac-
teristics
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <unistd.h>
long pathconf(
const char *path,
int name );
long fpathconf(
int filedes,
int name );
PARAMETERS
path Specifies the pathname. If the final component of
path is a symbolic link, it will be traversed and
filename resolution will continue.
filedes Specifies an open file descriptor.
name Specifies the configuration attribute to be
queried. If this attribute is not applicable to
the file specified by the path or filedes parame-
ter, the pathconf() function returns an error.
DESCRIPTION
The pathconf() function allows an application to determine
the characteristics of operations supported by the file sys-
tem underlying the file named by the path parameter. Read,
write, or execute permission of the named file is not
required, but all directories in the path leading to the
file must be searchable.
The fpathconf() function allows an application to retrieve
the same information for an open file.
Symbolic values for the name parameter are defined in the
unistd.h header file, as follows:
_PC_LINK_MAX
The maximum number of links to the file. If the
path or filedes parameter refers to a directory,
the value returned applies to the directory
itself.
_PC_MAX_CANON
The maximum number of bytes in a canonical input
line. This is applicable only to terminal dev-
ices.
_PC_MAX_INPUT
The maximum number of bytes an application may
require as input before that input is read. This
is applicable only to terminal devices.
_PC_NAME_MAX
Maximum number of bytes in a filename (not includ-
ing a terminating null). This may be as small as
13, but is never larger than 255. This is appli-
cable only to a directory file. The value
returned applies to filenames within the direc-
tory.
_PC_PATH_MAX
Maximum number of bytes in a pathname (not includ-
ing a terminating null). This is never larger than
65,535. This is applicable only to a directory
file. The value returned is the maximum length of
a relative pathname when the specified directory
is the working directory.
_PC_PIPE_BUF
Maximum number of bytes guaranteed to be written
atomically. This is applicable only to a FIFO.
The value returned applies to the referenced
object. If the path or filedes parameter refers
to a directory, the value returned applies to any
FIFO that exists or can be created within the
directory.
_PC_CHOWN_RESTRICTED
This is applicable only to a directory file. The
value returned applies to any files (other than
directories) that exist or can be created within
the directory.
_PC_NO_TRUNC
Returns 1 if supplying a component name longer
than allowed by NAME_MAX will cause an error.
Returns 0 (zero) if long component names are trun-
cated. This is applicable only to a directory
file.
_PC_VDISABLE
This is always 0 (zero); no disabling character is
defined. This is applicable only to a terminal
device.
So that applications can control their locales, only the
above name values corresponding to the following list of
numeric-valued configuration values are required.
o {LINK_MAX}
o {MAX_CANON}
o {MAX_INPUT}
o {NAME_MAX}
o {PATH_MAX}
o {PIPE_BUF}
o {_POSIX_CHOWN_RESTRICTED}
o {_POSIX_NO_TRUNC}
o {_POSIX_VDISABLE_}
NOTES
AES Support Level:
Full use
RETURN VALUES
Upon successful completion, the pathconf() or fpathconf()
function returns the specified parameter. Otherwise, a value
of -1 is returned and errno is set to indicate the error.
ERRORS
If the pathconf() function fails, errno may be set to the
following value:
[EACCES] Search permission is denied for a component of the
path prefix.
[ELOOP] Too many links were encountered in translating a
pathname.
[EINVAL] The name parameter specifies an unknown or inap-
plicable characteristic.
[EFAULT] The path argument is an invalid address.
[ENAMETOOLONG]
The length of the path string exceeds {PATH_MAX}
or a pathname component is longer than {NAME_MAX}.
[ENOENT] The named file does not exist or the path argument
points to an empty strng.
[ENOTDIR] A component of the path prefix is not a directory.
If the fpathconf() function fails, errno may be set to the
following value:
[ELOOP] Too many links were encountered in translating a
pathname.
[EINVAL] The name parameter specifies an unknown or inap-
plicable characteristic.
[EBADF] The fildes argument is not a valid file descrip-
tor.
Acknowledgement and Disclaimer