xref: /minix3/lib/libc/sys/pathconf.2 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: pathconf.2,v 1.28 2014/06/09 09:15:48 njoly Exp $
22fe8fb19SBen Gras.\"
32fe8fb19SBen Gras.\" Copyright (c) 1993
42fe8fb19SBen Gras.\"	The Regents of the University of California.  All rights reserved.
52fe8fb19SBen Gras.\"
62fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without
72fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions
82fe8fb19SBen Gras.\" are met:
92fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright
102fe8fb19SBen Gras.\"    notice, this list of conditions and the following disclaimer.
112fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
122fe8fb19SBen Gras.\"    notice, this list of conditions and the following disclaimer in the
132fe8fb19SBen Gras.\"    documentation and/or other materials provided with the distribution.
142fe8fb19SBen Gras.\" 3. Neither the name of the University nor the names of its contributors
152fe8fb19SBen Gras.\"    may be used to endorse or promote products derived from this software
162fe8fb19SBen Gras.\"    without specific prior written permission.
172fe8fb19SBen Gras.\"
182fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
192fe8fb19SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
202fe8fb19SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
212fe8fb19SBen Gras.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
222fe8fb19SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
232fe8fb19SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
242fe8fb19SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
252fe8fb19SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
262fe8fb19SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
272fe8fb19SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
282fe8fb19SBen Gras.\" SUCH DAMAGE.
292fe8fb19SBen Gras.\"
302fe8fb19SBen Gras.\"	@(#)pathconf.2	8.1 (Berkeley) 6/4/93
312fe8fb19SBen Gras.\"
322fe8fb19SBen Gras.Dd July 26, 2010
332fe8fb19SBen Gras.Dt PATHCONF 2
342fe8fb19SBen Gras.Os
352fe8fb19SBen Gras.Sh NAME
362fe8fb19SBen Gras.Nm pathconf ,
372fe8fb19SBen Gras.Nm fpathconf
382fe8fb19SBen Gras.Nd get configurable pathname variables
392fe8fb19SBen Gras.Sh LIBRARY
402fe8fb19SBen Gras.Lb libc
412fe8fb19SBen Gras.Sh SYNOPSIS
422fe8fb19SBen Gras.In unistd.h
432fe8fb19SBen Gras.Ft long
442fe8fb19SBen Gras.Fn pathconf "const char *path" "int name"
452fe8fb19SBen Gras.Ft long
462fe8fb19SBen Gras.Fn fpathconf "int fd" "int name"
472fe8fb19SBen Gras.Sh DESCRIPTION
482fe8fb19SBen GrasThe
492fe8fb19SBen Gras.Fn pathconf
502fe8fb19SBen Grasand
512fe8fb19SBen Gras.Fn fpathconf
522fe8fb19SBen Grasfunctions provide a method for applications to determine the current
532fe8fb19SBen Grasvalue of a configurable system limit or option variable associated
542fe8fb19SBen Graswith a pathname or file descriptor.
552fe8fb19SBen Gras.Pp
562fe8fb19SBen GrasFor
572fe8fb19SBen Gras.Nm pathconf ,
582fe8fb19SBen Grasthe
592fe8fb19SBen Gras.Fa path
602fe8fb19SBen Grasargument is the name of a file or directory.
612fe8fb19SBen GrasFor
622fe8fb19SBen Gras.Nm fpathconf ,
632fe8fb19SBen Grasthe
642fe8fb19SBen Gras.Fa fd
652fe8fb19SBen Grasargument is an open file descriptor.
662fe8fb19SBen GrasThe
672fe8fb19SBen Gras.Fa name
682fe8fb19SBen Grasargument specifies the system variable to be queried.
692fe8fb19SBen GrasSymbolic constants for each name value are found in the
702fe8fb19SBen Gras.In unistd.h
712fe8fb19SBen Grasheader.
722fe8fb19SBen Gras.Pp
732fe8fb19SBen GrasThe available values are as follows:
742fe8fb19SBen Gras.Bl -tag -width "123456"
752fe8fb19SBen Gras.It Li _PC_LINK_MAX
762fe8fb19SBen GrasThe maximum file link count.
772fe8fb19SBen Gras.It Li _PC_MAX_CANON
782fe8fb19SBen GrasThe maximum number of bytes in terminal canonical input line.
792fe8fb19SBen Gras.It Li _PC_MAX_INPUT
802fe8fb19SBen GrasThe minimum maximum number of bytes for which space is available in
812fe8fb19SBen Grasa terminal input queue.
822fe8fb19SBen Gras.It Li _PC_NAME_MAX
832fe8fb19SBen GrasThe maximum number of bytes in a filename,
842fe8fb19SBen Grasnot including a terminating null character.
852fe8fb19SBen Gras.It Li _PC_PATH_MAX
862fe8fb19SBen GrasThe maximum number of bytes in a pathname,
872fe8fb19SBen Grasincluding the terminating null character.
882fe8fb19SBen Gras.It Li _PC_PIPE_BUF
892fe8fb19SBen GrasThe maximum number of bytes which will be written atomically to a pipe.
902fe8fb19SBen Gras.It Li _PC_CHOWN_RESTRICTED
912fe8fb19SBen GrasReturn 1 if appropriate privileges are required for the
922fe8fb19SBen Gras.Xr chown 2
932fe8fb19SBen Grassystem call, otherwise 0.
942fe8fb19SBen Gras.It Li _PC_NO_TRUNC
952fe8fb19SBen GrasReturn 0 if filenames longer than
962fe8fb19SBen Gras.Brq Dv NAME_MAX
972fe8fb19SBen Grasare silently truncated, or non-zero if an error is generated when
982fe8fb19SBen Gras.Brq Dv NAME_MAX
992fe8fb19SBen Grasis exceeded.
1002fe8fb19SBen Gras.It Li _PC_VDISABLE
1012fe8fb19SBen GrasReturns the terminal character disabling value.
1022fe8fb19SBen Gras.It Li _PC_SYNC_IO
1032fe8fb19SBen GrasReturns 1 if synchronized I/O is supported, otherwise 0.
1042fe8fb19SBen Gras.It Li _PC_FILESIZEBITS
1052fe8fb19SBen GrasIf the maximum size file that could ever exist on the mounted file system is
1062fe8fb19SBen Gras.Dv maxsize ,
1072fe8fb19SBen Grasthen the returned value is 2 plus the floor of the base 2 logarithm of
1082fe8fb19SBen Gras.Dv maxsize .
1092fe8fb19SBen Gras.It Li _PC_SYMLINK_MAX
1102fe8fb19SBen GrasThe maximum number of bytes in a symbolic link.
1112fe8fb19SBen Gras.It Li _PC_2_SYMLINKS
1122fe8fb19SBen GrasWhen referring to a directory the system supports the creation of symbolic
1132fe8fb19SBen Graslinks within that directory; for nondirectory files, the meaning of
1142fe8fb19SBen Gras.Dv {_PC_2_SYMLINKS}
1152fe8fb19SBen Grasis undefined.
1162fe8fb19SBen Gras.El
1172fe8fb19SBen Gras.Sh RETURN VALUES
1182fe8fb19SBen GrasIf the call to
1192fe8fb19SBen Gras.Nm pathconf
1202fe8fb19SBen Grasor
1212fe8fb19SBen Gras.Nm fpathconf
1222fe8fb19SBen Grasis not successful, \-1 is returned and
1232fe8fb19SBen Gras.Va errno
1242fe8fb19SBen Grasis set appropriately.
1252fe8fb19SBen GrasOtherwise, if the variable is associated with functionality that does
1262fe8fb19SBen Grasnot have a limit in the system, \-1 is returned and
1272fe8fb19SBen Gras.Va errno
1282fe8fb19SBen Grasis not modified.
1292fe8fb19SBen GrasOtherwise, the current variable value is returned.
1302fe8fb19SBen Gras.Sh ERRORS
1312fe8fb19SBen GrasIf any of the following conditions occur, the
1322fe8fb19SBen Gras.Nm pathconf
1332fe8fb19SBen Grasand
1342fe8fb19SBen Gras.Nm fpathconf
1352fe8fb19SBen Grasfunctions shall return \-1 and set
1362fe8fb19SBen Gras.Va errno
1372fe8fb19SBen Grasto the corresponding value.
1382fe8fb19SBen Gras.Bl -tag -width Er
1392fe8fb19SBen Gras.It Bq Er EINVAL
1402fe8fb19SBen GrasThe value of the
1412fe8fb19SBen Gras.Fa name
1422fe8fb19SBen Grasargument is invalid, or
1432fe8fb19SBen Grasthe implementation does not support an association of the variable
1442fe8fb19SBen Grasname with the associated file.
1452fe8fb19SBen Gras.El
1462fe8fb19SBen Gras.Pp
1472fe8fb19SBen Gras.Fn pathconf
1482fe8fb19SBen Graswill fail if:
1492fe8fb19SBen Gras.Bl -tag -width ENAMETOOLONGAA
1502fe8fb19SBen Gras.It Bq Er EACCES
1512fe8fb19SBen GrasSearch permission is denied for a component of the path prefix.
1522fe8fb19SBen Gras.It Bq Er EIO
1532fe8fb19SBen GrasAn I/O error occurred while reading from or writing to the file system.
1542fe8fb19SBen Gras.It Bq Er ELOOP
1552fe8fb19SBen GrasToo many symbolic links were encountered in translating the pathname.
1562fe8fb19SBen Gras.It Bq Er ENAMETOOLONG
157*0a6a1f1dSLionel SambucA component of a pathname exceeded
158*0a6a1f1dSLionel Sambuc.Brq Dv NAME_MAX
159*0a6a1f1dSLionel Sambuccharacters, or an entire path name exceeded
160*0a6a1f1dSLionel Sambuc.Brq Dv PATH_MAX
161*0a6a1f1dSLionel Sambuccharacters.
1622fe8fb19SBen Gras.It Bq Er ENOENT
1632fe8fb19SBen GrasThe named file does not exist.
1642fe8fb19SBen Gras.It Bq Er ENOTDIR
1652fe8fb19SBen GrasA component of the path prefix is not a directory.
1662fe8fb19SBen Gras.El
1672fe8fb19SBen Gras.Pp
1682fe8fb19SBen Gras.Fn fpathconf
1692fe8fb19SBen Graswill fail if:
1702fe8fb19SBen Gras.Bl -tag -width [EFAULT]
1712fe8fb19SBen Gras.It Bq Er EBADF
1722fe8fb19SBen Gras.Fa fd
1732fe8fb19SBen Grasis not a valid open file descriptor.
1742fe8fb19SBen Gras.It Bq Er EIO
1752fe8fb19SBen GrasAn I/O error occurred while reading from or writing to the file system.
1762fe8fb19SBen Gras.El
1772fe8fb19SBen Gras.Sh SEE ALSO
1782fe8fb19SBen Gras.Xr sysctl 3
1792fe8fb19SBen Gras.Sh STANDARDS
1802fe8fb19SBen GrasThe
1812fe8fb19SBen Gras.Fn pathconf
1822fe8fb19SBen Grasand
1832fe8fb19SBen Gras.Fn fpathconf
1842fe8fb19SBen Grasfunctions conform to
1852fe8fb19SBen Gras.St -p1003.1-90 .
1862fe8fb19SBen Gras.Sh HISTORY
1872fe8fb19SBen GrasThe
1882fe8fb19SBen Gras.Nm pathconf
1892fe8fb19SBen Grasand
1902fe8fb19SBen Gras.Nm fpathconf
1912fe8fb19SBen Grasfunctions first appeared in
1922fe8fb19SBen Gras.Bx 4.4 .
193