|
Packit |
7cfc04 |
'\" et
|
|
Packit |
7cfc04 |
.TH FPATHCONF "3P" 2013 "IEEE/The Open Group" "POSIX Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH PROLOG
|
|
Packit |
7cfc04 |
This manual page is part of the POSIX Programmer's Manual.
|
|
Packit |
7cfc04 |
The Linux implementation of this interface may differ (consult
|
|
Packit |
7cfc04 |
the corresponding Linux manual page for details of Linux behavior),
|
|
Packit |
7cfc04 |
or the interface may not be implemented on Linux.
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
fpathconf,
|
|
Packit |
7cfc04 |
pathconf
|
|
Packit |
7cfc04 |
\(em get configurable pathname variables
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.LP
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
#include <unistd.h>
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
long fpathconf(int \fIfildes\fP, int \fIname\fP);
|
|
Packit |
7cfc04 |
long pathconf(const char *\fIpath\fP, int \fIname\fP);
|
|
Packit |
7cfc04 |
.fi
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
functions shall determine the current value of a configurable limit or
|
|
Packit |
7cfc04 |
option (\fIvariable\fP) that is associated with a file or directory.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
For
|
|
Packit |
7cfc04 |
\fIpathconf\fR(),
|
|
Packit |
7cfc04 |
the
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
argument points to the pathname of a file or directory.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
For
|
|
Packit |
7cfc04 |
\fIfpathconf\fR(),
|
|
Packit |
7cfc04 |
the
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
argument is an open file descriptor.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
argument represents the variable to be queried relative to that file or
|
|
Packit |
7cfc04 |
directory. Implementations shall support all of the variables listed in
|
|
Packit |
7cfc04 |
the following table and may support others. The variables in the
|
|
Packit |
7cfc04 |
following table come from
|
|
Packit |
7cfc04 |
.IR <limits.h>
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR <unistd.h>
|
|
Packit |
7cfc04 |
and the symbolic constants, defined in
|
|
Packit |
7cfc04 |
.IR <unistd.h> ,
|
|
Packit |
7cfc04 |
are the corresponding values used for
|
|
Packit |
7cfc04 |
.IR name .
|
|
Packit |
7cfc04 |
.TS
|
|
Packit |
7cfc04 |
center box tab(!);
|
|
Packit |
7cfc04 |
cB | cB | cB
|
|
Packit |
7cfc04 |
l | l | l.
|
|
Packit |
7cfc04 |
Variable!Value of \fIname\fP!Requirements
|
|
Packit |
7cfc04 |
_
|
|
Packit |
7cfc04 |
{FILESIZEBITS}!_PC_FILESIZEBITS!4,\|7
|
|
Packit |
7cfc04 |
{LINK_MAX}!_PC_LINK_MAX!1
|
|
Packit |
7cfc04 |
{MAX_CANON}!_PC_MAX_CANON!2
|
|
Packit |
7cfc04 |
{MAX_INPUT}!_PC_MAX_INPUT!2
|
|
Packit |
7cfc04 |
{NAME_MAX}!_PC_NAME_MAX!3,\|4
|
|
Packit |
7cfc04 |
{PATH_MAX}!_PC_PATH_MAX!4,\|5
|
|
Packit |
7cfc04 |
{PIPE_BUF}!_PC_PIPE_BUF!6
|
|
Packit |
7cfc04 |
{POSIX2_SYMLINKS}!_PC_2_SYMLINKS!4
|
|
Packit |
7cfc04 |
{POSIX_ALLOC_SIZE_MIN}!_PC_ALLOC_SIZE_MIN!10
|
|
Packit |
7cfc04 |
{POSIX_REC_INCR_XFER_SIZE}!_PC_REC_INCR_XFER_SIZE!10
|
|
Packit |
7cfc04 |
{POSIX_REC_MAX_XFER_SIZE}!_PC_REC_MAX_XFER_SIZE!10
|
|
Packit |
7cfc04 |
{POSIX_REC_MIN_XFER_SIZE}!_PC_REC_MIN_XFER_SIZE!10
|
|
Packit |
7cfc04 |
{POSIX_REC_XFER_ALIGN}!_PC_REC_XFER_ALIGN!10
|
|
Packit |
7cfc04 |
{SYMLINK_MAX}!_PC_SYMLINK_MAX!4,\|9
|
|
Packit |
7cfc04 |
_POSIX_CHOWN_RESTRICTED!_PC_CHOWN_RESTRICTED!7
|
|
Packit |
7cfc04 |
_POSIX_NO_TRUNC!_PC_NO_TRUNC!3,\|4
|
|
Packit |
7cfc04 |
_POSIX_VDISABLE!_PC_VDISABLE!2
|
|
Packit |
7cfc04 |
_POSIX_ASYNC_IO!_PC_ASYNC_IO!8
|
|
Packit |
7cfc04 |
_POSIX_PRIO_IO!_PC_PRIO_IO!8
|
|
Packit |
7cfc04 |
_POSIX_SYNC_IO!_PC_SYNC_IO!8
|
|
Packit |
7cfc04 |
_POSIX_TIMESTAMP_RESOLUTION!_PC_TIMESTAMP_RESOLUTION!1
|
|
Packit |
7cfc04 |
.TE
|
|
Packit |
7cfc04 |
.SS "Requirements"
|
|
Packit |
7cfc04 |
.IP " 1." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to a directory, the value returned shall apply to the directory
|
|
Packit |
7cfc04 |
itself.
|
|
Packit |
7cfc04 |
.IP " 2." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
does not refer to a terminal file, it is unspecified whether an
|
|
Packit |
7cfc04 |
implementation supports an association of the variable name with the
|
|
Packit |
7cfc04 |
specified file.
|
|
Packit |
7cfc04 |
.IP " 3." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to a directory, the value returned shall apply to filenames
|
|
Packit |
7cfc04 |
within the directory.
|
|
Packit |
7cfc04 |
.IP " 4." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
does not refer to a directory, it is unspecified whether an
|
|
Packit |
7cfc04 |
implementation supports an association of the variable name with the
|
|
Packit |
7cfc04 |
specified file.
|
|
Packit |
7cfc04 |
.IP " 5." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to a directory, the value returned shall be the maximum length
|
|
Packit |
7cfc04 |
of a relative pathname that would not cross any mount points when the
|
|
Packit |
7cfc04 |
specified directory is the working directory.
|
|
Packit |
7cfc04 |
.IP " 6." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
refers to a FIFO, or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to a pipe or FIFO, the value returned shall apply to the
|
|
Packit |
7cfc04 |
referenced object. If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to a directory, the value returned shall apply to any FIFO that
|
|
Packit |
7cfc04 |
exists or can be created within the directory. If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to any other type of file, it is unspecified whether an
|
|
Packit |
7cfc04 |
implementation supports an association of the variable name with the
|
|
Packit |
7cfc04 |
specified file.
|
|
Packit |
7cfc04 |
.IP " 7." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to a directory, the value returned shall apply to any files,
|
|
Packit |
7cfc04 |
other than directories, that exist or can be created within the
|
|
Packit |
7cfc04 |
directory.
|
|
Packit |
7cfc04 |
.IP " 8." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to a directory, it is unspecified whether an implementation
|
|
Packit |
7cfc04 |
supports an association of the variable name with the specified file.
|
|
Packit |
7cfc04 |
.IP " 9." 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
refers to a directory, the value returned shall be the maximum length
|
|
Packit |
7cfc04 |
of the string that a symbolic link in that directory can contain.
|
|
Packit |
7cfc04 |
.IP 10. 4
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
des does not refer to a regular file, it is unspecified whether an
|
|
Packit |
7cfc04 |
implementation supports an association of the variable name with the
|
|
Packit |
7cfc04 |
specified file. If an implementation supports such an association for
|
|
Packit |
7cfc04 |
other than a regular file, the value returned is unspecified.
|
|
Packit |
7cfc04 |
.SH "RETURN VALUE"
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
is an invalid value, both
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
shall return \(mi1 and set
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
to indicate the error.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If the variable corresponding to
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
is described in
|
|
Packit |
7cfc04 |
.IR <limits.h>
|
|
Packit |
7cfc04 |
as a maximum or minimum value and the variable has no limit for the
|
|
Packit |
7cfc04 |
path or file descriptor, both
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
shall return \(mi1 without changing
|
|
Packit |
7cfc04 |
.IR errno .
|
|
Packit |
7cfc04 |
Note that indefinite limits do not imply infinite limits; see
|
|
Packit |
7cfc04 |
.IR <limits.h> .
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If the implementation needs to use
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
to determine the value of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
and the implementation does not support the association of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
with the file specified by
|
|
Packit |
7cfc04 |
.IR path ,
|
|
Packit |
7cfc04 |
or if the process did not have appropriate privileges to query the
|
|
Packit |
7cfc04 |
file specified by
|
|
Packit |
7cfc04 |
.IR path ,
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
does not exist,
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
shall return \(mi1 and set
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
to indicate the error.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If the implementation needs to use
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
to determine the value of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
and the implementation does not support the association of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
with the file specified by
|
|
Packit |
7cfc04 |
.IR fildes ,
|
|
Packit |
7cfc04 |
or if
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
is an invalid file descriptor,
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
shall return \(mi1 and set
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
to indicate the error.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Otherwise,
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
shall return the current variable value for the file or directory
|
|
Packit |
7cfc04 |
without changing
|
|
Packit |
7cfc04 |
.IR errno .
|
|
Packit |
7cfc04 |
The value returned shall not be more restrictive than the corresponding
|
|
Packit |
7cfc04 |
value available to the application when it was compiled with the
|
|
Packit |
7cfc04 |
implementation's
|
|
Packit |
7cfc04 |
.IR <limits.h>
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR <unistd.h> .
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If the variable corresponding to
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
is dependent on an unsupported option, the results are unspecified.
|
|
Packit |
7cfc04 |
.SH ERRORS
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
function shall fail if:
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR EINVAL
|
|
Packit |
7cfc04 |
The value of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
is not valid.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR ELOOP
|
|
Packit |
7cfc04 |
A loop exists in symbolic links encountered during resolution of the
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
argument.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR EOVERFLOW
|
|
Packit |
7cfc04 |
The value of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
is _PC_TIMESTAMP_RESOLUTION and the resolution is larger than
|
|
Packit |
7cfc04 |
{LONG_MAX}.
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
function may fail if:
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR EACCES
|
|
Packit |
7cfc04 |
Search permission is denied for a component of the path prefix.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR EINVAL
|
|
Packit |
7cfc04 |
The implementation does not support an association of the variable
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
with the specified file.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR ELOOP
|
|
Packit |
7cfc04 |
More than
|
|
Packit |
7cfc04 |
{SYMLOOP_MAX}
|
|
Packit |
7cfc04 |
symbolic links were encountered during resolution of the
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
argument.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR ENAMETOOLONG
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
The length of a component of a pathname is longer than
|
|
Packit |
7cfc04 |
{NAME_MAX}.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR ENAMETOOLONG
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
The length of a pathname exceeds
|
|
Packit |
7cfc04 |
{PATH_MAX},
|
|
Packit |
7cfc04 |
or pathname resolution of a symbolic link produced an intermediate
|
|
Packit |
7cfc04 |
result with a length that exceeds
|
|
Packit |
7cfc04 |
{PATH_MAX}.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR ENOENT
|
|
Packit |
7cfc04 |
A component of
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
does not name an existing file or
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
is an empty string.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR ENOTDIR
|
|
Packit |
7cfc04 |
A component of the path prefix names an existing file that is neither
|
|
Packit |
7cfc04 |
a directory nor a symbolic link to a directory, or the
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
argument contains at least one non-\c
|
|
Packit |
7cfc04 |
<slash>
|
|
Packit |
7cfc04 |
character and ends with one or more trailing
|
|
Packit |
7cfc04 |
<slash>
|
|
Packit |
7cfc04 |
characters and the last pathname component names an existing file
|
|
Packit |
7cfc04 |
that is neither a directory nor a symbolic link to a directory.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
function shall fail if:
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR EINVAL
|
|
Packit |
7cfc04 |
The value of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
is not valid.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR EOVERFLOW
|
|
Packit |
7cfc04 |
The value of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
is _PC_TIMESTAMP_RESOLUTION and the resolution is larger than
|
|
Packit |
7cfc04 |
{LONG_MAX}.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
function may fail if:
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR EBADF
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
argument is not a valid file descriptor.
|
|
Packit |
7cfc04 |
.TP
|
|
Packit |
7cfc04 |
.BR EINVAL
|
|
Packit |
7cfc04 |
The implementation does not support an association of the variable
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
with the specified file.
|
|
Packit |
7cfc04 |
.LP
|
|
Packit |
7cfc04 |
.IR "The following sections are informative."
|
|
Packit |
7cfc04 |
.SH EXAMPLES
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "APPLICATION USAGE"
|
|
Packit |
7cfc04 |
Application developers should check whether an option, such as
|
|
Packit |
7cfc04 |
_POSIX_ADVISORY_INFO, is supported prior to obtaining and using values
|
|
Packit |
7cfc04 |
for related variables such as
|
|
Packit |
7cfc04 |
{POSIX_ALLOC_SIZE_MIN}.
|
|
Packit |
7cfc04 |
.SH RATIONALE
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
function was proposed immediately after the
|
|
Packit |
7cfc04 |
\fIsysconf\fR()
|
|
Packit |
7cfc04 |
function when it was realized that some configurable values may differ
|
|
Packit |
7cfc04 |
across file system, directory, or device boundaries.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
For example,
|
|
Packit |
7cfc04 |
{NAME_MAX}
|
|
Packit |
7cfc04 |
frequently changes between System V and
|
|
Packit |
7cfc04 |
BSD-based file systems; System V uses a maximum of 14, BSD 255. On an
|
|
Packit |
7cfc04 |
implementation that provides both types of file systems, an application
|
|
Packit |
7cfc04 |
would be forced to limit all pathname components to 14 bytes, as this
|
|
Packit |
7cfc04 |
would be the value specified in
|
|
Packit |
7cfc04 |
.IR <limits.h>
|
|
Packit |
7cfc04 |
on such a system.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Therefore, various useful values can be queried on any pathname or file
|
|
Packit |
7cfc04 |
descriptor, assuming that appropriate privileges
|
|
Packit |
7cfc04 |
are in place.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The value returned for the variable
|
|
Packit |
7cfc04 |
{PATH_MAX}
|
|
Packit |
7cfc04 |
indicates the longest relative pathname that could be given if the
|
|
Packit |
7cfc04 |
specified directory is the current working directory of the process. A
|
|
Packit |
7cfc04 |
process may not always be able to generate a name that long and use it
|
|
Packit |
7cfc04 |
if a subdirectory in the pathname crosses into a more restrictive file
|
|
Packit |
7cfc04 |
system. Note that implementations are allowed to accept pathnames
|
|
Packit |
7cfc04 |
longer than
|
|
Packit |
7cfc04 |
{PATH_MAX}
|
|
Packit |
7cfc04 |
bytes long, but are not allowed to return pathnames longer than this
|
|
Packit |
7cfc04 |
unless the user specifies a larger buffer using a function that provides
|
|
Packit |
7cfc04 |
a buffer size argument.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The value returned for the variable _POSIX_CHOWN_RESTRICTED
|
|
Packit |
7cfc04 |
also applies to directories that do not have file systems mounted on
|
|
Packit |
7cfc04 |
them. The value may change when crossing a mount point, so
|
|
Packit |
7cfc04 |
applications that need to know should check for each directory. (An
|
|
Packit |
7cfc04 |
even easier check is to try the
|
|
Packit |
7cfc04 |
\fIchown\fR()
|
|
Packit |
7cfc04 |
function and look for an error in case it happens.)
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Unlike the values returned by
|
|
Packit |
7cfc04 |
\fIsysconf\fR(),
|
|
Packit |
7cfc04 |
the pathname-oriented variables are potentially more volatile and are
|
|
Packit |
7cfc04 |
not guaranteed to remain constant throughout the lifetime of the process.
|
|
Packit |
7cfc04 |
For example, in between two calls to
|
|
Packit |
7cfc04 |
\fIpathconf\fR(),
|
|
Packit |
7cfc04 |
the file system in question may have been unmounted and remounted with
|
|
Packit |
7cfc04 |
different characteristics.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Also note that most of the errors are optional. If one of the
|
|
Packit |
7cfc04 |
variables always has the same value on an implementation, the
|
|
Packit |
7cfc04 |
implementation need not look at
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
to return that value and is, therefore, not required to detect any of
|
|
Packit |
7cfc04 |
the errors except the meaning of
|
|
Packit |
7cfc04 |
.BR [EINVAL]
|
|
Packit |
7cfc04 |
that indicates that the value of
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
is not valid for that variable.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If the value of any of the limits is unspecified (logically
|
|
Packit |
7cfc04 |
infinite), they will not be defined in
|
|
Packit |
7cfc04 |
.IR <limits.h>
|
|
Packit |
7cfc04 |
and the
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
functions return \(mi1 without changing
|
|
Packit |
7cfc04 |
.IR errno .
|
|
Packit |
7cfc04 |
This can be distinguished from the case of giving an unrecognized
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
argument because
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
is set to
|
|
Packit |
7cfc04 |
.BR [EINVAL]
|
|
Packit |
7cfc04 |
in this case.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Since \(mi1 is a valid return value for the
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
\fIfpathconf\fR()
|
|
Packit |
7cfc04 |
functions, applications should set
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
to zero before calling them and check
|
|
Packit |
7cfc04 |
.IR errno
|
|
Packit |
7cfc04 |
only if the return value is \(mi1.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
For the case of
|
|
Packit |
7cfc04 |
{SYMLINK_MAX},
|
|
Packit |
7cfc04 |
since both
|
|
Packit |
7cfc04 |
\fIpathconf\fR()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
\fIopen\fR()
|
|
Packit |
7cfc04 |
follow symbolic links, there is no way that
|
|
Packit |
7cfc04 |
.IR path
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.IR fildes
|
|
Packit |
7cfc04 |
could refer to a symbolic link.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
It was the intention of IEEE\ Std 1003.1d\(hy1999 that the following variables:
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS
|
|
Packit |
7cfc04 |
{POSIX_ALLOC_SIZE_MIN}
|
|
Packit |
7cfc04 |
{POSIX_REC_INCR_XFER_SIZE}
|
|
Packit |
7cfc04 |
{POSIX_REC_MAX_XFER_SIZE}
|
|
Packit |
7cfc04 |
{POSIX_REC_MIN_XFER_SIZE}
|
|
Packit |
7cfc04 |
{POSIX_REC_XFER_ALIGN}
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
only applied to regular files, but Note 10 also permits implementation
|
|
Packit |
7cfc04 |
of the advisory semantics on other file types unique to an
|
|
Packit |
7cfc04 |
implementation (for example, a character special device).
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.BR [EOVERFLOW]
|
|
Packit |
7cfc04 |
error for _PC_TIMESTAMP_RESOLUTION cannot occur on POSIX-compliant
|
|
Packit |
7cfc04 |
file systems because POSIX requires a timestamp resolution no
|
|
Packit |
7cfc04 |
larger than one second. Even on 32-bit systems, this can be
|
|
Packit |
7cfc04 |
represented without overflow.
|
|
Packit |
7cfc04 |
.SH "FUTURE DIRECTIONS"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "SEE ALSO"
|
|
Packit |
7cfc04 |
.IR "\fIchown\fR\^(\|)",
|
|
Packit |
7cfc04 |
.IR "\fIconfstr\fR\^(\|)",
|
|
Packit |
7cfc04 |
.IR "\fIsysconf\fR\^(\|)"
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The Base Definitions volume of POSIX.1\(hy2008,
|
|
Packit |
7cfc04 |
.IR "\fB<limits.h>\fP",
|
|
Packit |
7cfc04 |
.IR "\fB<unistd.h>\fP"
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The Shell and Utilities volume of POSIX.1\(hy2008,
|
|
Packit |
7cfc04 |
.IR "\fIgetconf\fR\^"
|
|
Packit |
7cfc04 |
.SH COPYRIGHT
|
|
Packit |
7cfc04 |
Portions of this text are reprinted and reproduced in electronic form
|
|
Packit |
7cfc04 |
from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
|
|
Packit |
7cfc04 |
-- Portable Operating System Interface (POSIX), The Open Group Base
|
|
Packit |
7cfc04 |
Specifications Issue 7, Copyright (C) 2013 by the Institute of
|
|
Packit |
7cfc04 |
Electrical and Electronics Engineers, Inc and The Open Group.
|
|
Packit |
7cfc04 |
(This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
|
|
Packit |
7cfc04 |
event of any discrepancy between this version and the original IEEE and
|
|
Packit |
7cfc04 |
The Open Group Standard, the original IEEE and The Open Group Standard
|
|
Packit |
7cfc04 |
is the referee document. The original Standard can be obtained online at
|
|
Packit |
7cfc04 |
http://www.unix.org/online.html .
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
Any typographical or formatting errors that appear
|
|
Packit |
7cfc04 |
in this page are most likely
|
|
Packit |
7cfc04 |
to have been introduced during the conversion of the source files to
|
|
Packit |
7cfc04 |
man page format. To report such errors, see
|
|
Packit |
7cfc04 |
https://www.kernel.org/doc/man-pages/reporting_bugs.html .
|