.TH pathconf() "" "" "System Call (libc)"
.PC "Get a file variable by path name"
.B "#include <unistd.h>"
\fBlong pathconf(\fIpath\^\fB, \fIname\^\fB)\fR
\fBconst char *\fIpath\^\fB; int \fIname\^\fB;\fR
.PP
.B pathconf()
returns the value of a limit or option associated with the file
.IR path .
.I name
is a symbolic constant
(defined in
.BR <unistd.h> )
that represents the limit or option to be returned.
The value that
.B pathconf()
returns depends upon the type of file that
.I path
names.
.PP
.B pathconf()
can return information about the following constants:
.IP \fB_PC_LINK_MAX\fR
The maximum value of a file's link count.
If
.I path
names a directory, the value returned applies to the directory itself.
.IP \fB_PC_MAX_CANON\fR
The number of bytes in a terminal's canonical input queue.
Behavior is undefined if
.I path
does not name a terminal file.
.IP \fB_PC_MAX_INPUT\fR
The number of bytes for which space will be available in a terminal's input
queue.
Behavior is undefined if
.I path
does not name a terminal file.
.IP \fB_PC_NAME_MAX\fR
The number of bytes in a file name.
The behavior is refined if
.I path
does not name a directory.
The value returned applies to the file names within the directory.
.IP \fB_PC_PATH_MAX\fR
The number of bytes in a path name.
Behavior is undefined if
.I path
does not refer to a directory.
If
.I path
names the current working directory,
.B pathconf()
returns the maximum length of a relative path name.
.IP \fB_PC_PIPE_BUF\fR
The number of bytes that can be written atomically when writing to a pipe.
If
.I path
names a pipe or FIFO,
the value returned applies to the FIFO itself.
If
.I path
names a directory, the value returned applies to any FIFOs that exist or
can be created within that directory.
If
.I path
names any other type of file, behavior is undefined.
.IP \fB_PC_CHOWN_RESTRICTED\fR
.B 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
.I path
names a directory, the value returned applies to any file,
other than a directory, that exists or can be created within the directory.
.IP \fB_PC_NO_TRUNC\fR
Path-name components longer than
.B NAME_MAX
generate an error.
The behavior is	undefined if
.I path
does not refer to a directory.
The value returned applies to the file names within the directory.
.IP \fB_PC_VDISABLE\fR
If this value is defined,
terminal-special characters can be disabled.
Behavior is undefined if
.I path
does not name a terminal file.
.PP
The value of the system limit or option that
.I name
specifies does not change during the lifetime of the calling process.
.PP
.B pathconf()
fails and returns \-1 if
.I name
is not set to a recognized constant.
It fails, returns \-1, and sets
.B errno
to an appropriate value if any of the following is true:
.IP \(bu 0.3i
The process that calls
.B pathconf()
lacks permission to search a directory named in
.IR path .
.B pathconf()
sets
.B errno
to
.BR EACCES .
.IP \(bu
.I path
is needed for the command specified and it
either points to an empty string or names a file that does not exist.
.B pathconf()
sets
.B errno
to
.BR ENOENT .
.IP \(bu 0.3i
A component of
.IR path 's
prefix is not a directory.
.B pathconf()
sets
.B errno
to
.BR ENOTDIR .
.IP \(bu 0.3i
.I name
is an invalid value.
.B pathconf()
sets
.B errno
to
.BR EINVAL .
.SH "See Also"
.Xr "fpathconf()," fpathconf()
.Xr "libc" libc
.br
\*(PX Standard, \(sc5.7.1
