167 lines
4.8 KiB
Groff
167 lines
4.8 KiB
Groff
'\"! tbl | mmdoc
|
|
'\"macro stdmacro
|
|
.if n .pH g2.fpathconf @(#)fpathconf 41.4 of 5/26/91
|
|
.\" Copyright 1991 UNIX System Laboratories, Inc.
|
|
.\" Copyright 1989, 1990 AT&T
|
|
.nr X
|
|
.if \nX=0 .ds x} fpathconf 2 "" "\&"
|
|
.if \nX=1 .ds x} fpathconf 2 ""
|
|
.if \nX=2 .ds x} fpathconf 2 "" "\&"
|
|
.if \nX=3 .ds x} fpathconf "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f4fpathconf\f1, \f4pathconf\f1 \- get configurable pathname variables
|
|
.SH SYNOPSIS
|
|
.nf
|
|
\f4#include <unistd.h>\f1
|
|
.PP
|
|
\f4long fpathconf (int fildes, int name);\f1
|
|
.PP
|
|
\f4long pathconf (const char *path, int name);\f1
|
|
.fi
|
|
.SH DESCRIPTION
|
|
The functions \f4fpathconf\fP and \f4pathconf\fP
|
|
return the current
|
|
value of a configurable limit or option associated with a file
|
|
or directory.
|
|
The \f2path\fP argument points to the pathname of a file or directory;
|
|
\f2fildes\fP is an open file descriptor; and \f2name\fP is the
|
|
symbolic constant (defined in \f4<sys/unistd.h>\fP) representing the
|
|
configurable system limit or option to be returned.
|
|
.PP
|
|
The values returned by \f4pathconf\fP and \f4fpathconf\fP
|
|
depend on the type of file specified by \f2path\fP
|
|
or \f2fildes\fP.
|
|
The following table contains the
|
|
symbolic constants supported by \f4pathconf\fP and \f4fpathconf\fP.
|
|
The return value is based on the type of file
|
|
specified by \f2path\fP or \f2fildes\fP.
|
|
.PP
|
|
.vs +2
|
|
.TS
|
|
center allbox tab(:);
|
|
c c
|
|
lf4 | c .
|
|
Value of \f2name\fP : See Note
|
|
_
|
|
_PC_LINK_MAX : 1
|
|
_PC_MAX_CANNON : 2
|
|
_PC_MAX_INPUT : 2
|
|
_PC_NAME_MAX : 3,4
|
|
_PC_PATH_MAX : 4,5
|
|
_PC_PIPE_BUF : 6
|
|
_PC_CHOWN_RESTRICTED : 7
|
|
_PC_NO_TRUNC : 3,4
|
|
_PC_VDISABLE : 2
|
|
_PC_ASYNC_IO : 8
|
|
_PC_ABI_ASYNC_IO : 8
|
|
_PC_ABI_AIO_XFER_MAX : 8
|
|
_PC_SYNC_IO : 8
|
|
_PC_PRIO_IO : 8
|
|
.TE
|
|
.vs -2
|
|
.PP
|
|
Notes:
|
|
.sp .5
|
|
.de No
|
|
.IP "\\$1"
|
|
..
|
|
.No "1"
|
|
If \f2path\fP or \f2fildes\fP refers to a directory, the value returned applies
|
|
to the directory itself.
|
|
.No "2"
|
|
The behavior is undefined if \f2path\fP or \f2fildes\fP does not refer to a
|
|
terminal file.
|
|
.No "3"
|
|
If \f2path\fP or \f2fildes\fP refers to a directory, the value returned
|
|
applies to the filenames within the directory.
|
|
.No "4"
|
|
The behavior is undefined if \f2path\fP or \f2fildes\fP does not refer to a
|
|
directory.
|
|
.No "5"
|
|
If \f2path\fP or \f2fildes\fP refers to a directory, the value returned is
|
|
the maximum length of a relative pathname when the specified directory
|
|
is the working directory.
|
|
.No "6"
|
|
If \f2path\fP or \f2fildes\fP refers to a pipe or FIFO, the value returned
|
|
applies to the FIFO itself.
|
|
If \f2path\fP or \f2fildes\fP refers to a
|
|
directory, the value returned applies to any FIFOs that exist or
|
|
can be created within the directory.
|
|
If \f2path\fP or \f2fildes\fP
|
|
refer to any other type of file, the behavior is undefined.
|
|
.No "7"
|
|
If \f2path\fP or \f2fildes\fP refers to a directory, the value returned
|
|
applies to any files, other than directories,
|
|
that exist or can be created within the directory.
|
|
.No "8"
|
|
The behavior is undefined if \f2path\fP or \f2fildes\fP
|
|
refers to a directory.
|
|
.PP
|
|
The value of the configurable system limit or option
|
|
specified by \f2name\fP does not change during
|
|
the lifetime of the calling process.
|
|
.PP
|
|
\f4fpathconf\fP fails if the following is true:
|
|
.TP .75i
|
|
\f4EACCES\fP
|
|
Read permission is denied on the named file.
|
|
.TP .75i
|
|
\f4EBADF\fP
|
|
\f2fildes\fP is not a valid file descriptor.
|
|
.PP
|
|
\f4pathconf\fP fails if one or more of the following are true:
|
|
.TP .75i
|
|
\f4EACCES\fP
|
|
search permission is denied for a component of the path prefix.
|
|
.TP .75i
|
|
\f4ELOOP\fP
|
|
too many symbolic links are encountered while translating
|
|
\f2path\fP.
|
|
.TP .75i
|
|
\f4EMULTIHOP\fP
|
|
components of \f2path\fP require hopping to multiple remote machines
|
|
and file system type does not allow it.
|
|
.TP .75i
|
|
\f4ENAMETOOLONG\fP
|
|
the length of a pathname exceeds \f4{PATH_MAX}\fP, or pathname
|
|
component is longer than \f4{NAME_MAX}\fP while
|
|
\f4(_POSIX_NO_TRUNC)\fP is in effect.
|
|
.TP .75i
|
|
\f4ENOENT\fP
|
|
\f2path\fP is needed for the command specified and the named file
|
|
does not exist or if the \f2path\fP argument points to an empty string.
|
|
.TP .75i
|
|
\f4ENOLINK\fP
|
|
\f2path\fP points to a remote machine and the link to that machine is no
|
|
longer active.
|
|
.TP .75i
|
|
\f4ETIMEDOUT\fP
|
|
A component of \f2path\fP resides on a remote system
|
|
which is not available [see \f4intro\fP(2)].
|
|
.TP .75i
|
|
\f4ENOTDIR\fP
|
|
a component of the path prefix is not a directory.
|
|
.PP
|
|
Both \f4fpathconf\fP and \f4pathconf\fP fail if the following is true:
|
|
.TP .75i
|
|
\f4EINVAL\fP
|
|
if \f2name\fP is an invalid value.
|
|
.SH SEE ALSO
|
|
\f4sysconf\fP(3c),
|
|
\f4ulimit\fP(2),
|
|
\f4limits\fP(4).
|
|
.SH DIAGNOSTICS
|
|
If \f4fpathconf\fP or \f4pathconf\fP are invoked with an
|
|
invalid symbolic constant or
|
|
the symbolic constant corresponds to a configurable system limit
|
|
or option not supported on the system,
|
|
a value of -1 is returned
|
|
to the invoking process.
|
|
If the function fails because the configurable system limit or option
|
|
corresponding to \f2name\fP is
|
|
not supported on the system
|
|
the value of \f4errno\fP is not changed.
|
|
.\" @(#)fpathconf.3c 1 of 3/1/89
|
|
.Ee
|