.TH fpathconf() "" "" "System Call (libc)"
.PC "Get a file variable by file descriptor"
.B "#include <unistd.h>"
\fBlong fpathconf(\fIfd\^\fB, \fIfd\^\fB)\fR
\fBint \fIfd\^\fB, \fIname\^\fB;\fR
.PP
.B fpathconf()
returns the value of a limit or option associated with the open file
whose the file descriptor is
.IR fd .
.I name
is the symbolic constant
(defined in
.BR <unistd.h> )
that represents the limit or option to be returned.
The value that
.B fpathconf()
returns depends upon the type of file that
.I fd
identifies.
.PP
.B fpathconf()
can return information about the following constants:
.IP \fB_PC_LINK_MAX\fR
The maximum value of a file's link count.
If
.I fd
identifies 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 fd
does not identify 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 fd
does not identify a terminal file.
.IP \fB_PC_NAME_MAX\fR
The number of bytes in a file name.
The behavior is refined if
.I fd
does not identify 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 fd
does not identify a directory.
If
.I fd
identifies the current working directory,
.B fpathconf()
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 fd
identifies a pipe or FIFO, the value returned applies to the FIFO itself.
If
.I fd
identifies a directory, the value returned applies to any FIFOs that exist or
can be created within that directory.
If
.I fd
identifies 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 fd
identifies 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 fd
does not identify 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 fd
does not identify 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 fpathconf()
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 either of the following is true:
.IP \(bu 0.3i
.I fd
is not a valid file descriptor.
.B fpathconf()
sets
.B errno
to
.BR EBADF .
.IP \(bu
.I name
is an invalid value.
.B fpathconf()
sets
.B errno
to
.BR EINVAL .
.SH "See Also"
.Xr "libc," libc
.Xr "pathconf()," pathconf
.Xr "unistd.h" unistd.h
.br
\*(PX Standard, \(sc5.7.1
