Changeset 982ed3f8 in rtems


Ignore:
Timestamp:
09/29/98 21:53:08 (25 years ago)
Author:
Wade A Smith <warm38@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
17408b90
Parents:
6e62b72e
Message:

Made cosmetic changes and documented routines in this file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/new_chapters/files.t

    r6e62b72e r982ed3f8  
    4242@item @code{utime} - Change access and/or modification times of an inode
    4343@item @code{ftruncate} - Truncate a file to a specified length
     44@itme @code{truncate} - Truncate a file to a specified length
    4445@item @code{pathconf} - Gets configuration values for files
    4546@item @code{fpathconf} - Get configuration values for files
     47@itme @code{mknod} - Create a directory
    4648@end itemize
    4749
    4850@section Background
    4951
     52There is currently no text in this section.
     53
    5054@section Operations
     55
     56There is currently no text in this section.
    5157
    5258@section Directives
     
    96102
    97103@item ENOTDIR
    98 @item{Name} is not a directory.
     104@code{name} is not a directory.
    99105
    100106@end table
     
    150156a call for another directory.
    151157
    152 @subheading NOTES:
     158@subheading NOTES: 
    153159
    154160If @code{ptr} is not a pointer returned by @code{malloc()}, @code{calloc()}, or
    155 @code{realloc()} or has been deallocated with @code{free()} or @code{realloc()},
    156 the results are not portable and are probably disastrous.
     161@code{realloc()} or has been deallocated with @code{free()} or
     162@code{realloc()}, the results are not portable and are probably disastrous.
    157163
    158164The routine is implemented in Cygnus newlib.
     
    177183@end ifset
    178184
    179 @subheading STATUS CODES: No value is returned.
     185@subheading STATUS CODES:
     186
     187No value is returned.
    180188
    181189@subheading DESCRIPTION:
     
    185193directory stream to refer to the current state of the directory.
    186194
    187 @subheading NOTES:
     195@subheading NOTES:
     196
     197NONE
    188198
    189199If @code{dirp} is not a pointer by @code{opendir()}, the results are
     
    265275directory stream @code{dir}.
    266276
    267 @subheading NOTES:
     277@subheading NOTES: 
    268278
    269279The routine is implemented in Cygnus newlib.
    270 
    271280
    272281@page
     
    303312@code{closedir()}.
    304313
    305 @subheading NOTES:
     314@subheading NOTES:
     315
     316NONE
    306317
    307318The argument to @code{closedir()} must be a pointer returned by
     
    359370@subheading NOTES:
    360371
    361 None
     372NONE
    362373
    363374@page
     
    434445
    435446@table @b
     447
    436448@item EACCES
    437449Search permission is denied for a directory in a file's path prefix.
     450
    438451@item EEXIST
    439452The named file already exists.
     453
    440454@item EINTR
    441455Function was interrupted by a signal.
     456
    442457@item EISDIR
    443458Attempt to open a directory for writing or to rename a file to be a
    444459directory.
     460
    445461@item EMFILE
    446462Too many file descriptors are in use by this process.
     463
    447464@item ENAMETOOLONG
    448465Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in
    449466effect.
     467
    450468@item ENFILE
    451469Too many files are currently open in the system.
     470
    452471@item ENOENT
    453472A file or directory does not exist.
     473
    454474@item ENOSPC
    455475No space left on disk.
     476
    456477@item ENOTDIR
    457478A component of the specified pathname was not a directory when a directory
    458479was expected.
     480
    459481@item ENXIO
    460482No such device.  This error may also occur when a device is not ready, for
    461483example, a tape drive is off-line.
     484
    462485@item EROFS
    463486Read-only file system.
     
    521544descriptor.
    522545
    523 @subheading NOTES:
    524 
     546@subheading NOTES:
     547
     548NONE
    525549
    526550@page
     
    550574@item EEXIST
    551575@code{path} already exists and O_CREAT and O_EXCL were used.
     576
    552577@item EISDIR
    553578@code{path} refers to a directory and the access requested involved
    554579writing
     580
    555581@item ETXTBSY
    556582@code{path} refers to an executable image which is currently being
    557583executed and write access was requested
     584
    558585@item EFAULT
    559586@code{path} points outside your accessible address space
     587
    560588@item EACCES
    561589The requested access to the file is not allowed, or one of the
    562590directories in @code{path} did not allow search (execute) permission.
     591
    563592@item ENAMETOOLONG
    564593@code{path} was too long.
     594
    565595@item ENOENT
    566596A directory component in @code{path} does not exist or is a dangling
    567597symbolic link.
     598
    568599@item ENOTDIR
    569600A component used as a directory in @code{path} is not, in fact, a
    570601directory.
     602
    571603@item EMFILE
    572604The process alreadyh has the maximum number of files open.
     605
    573606@item ENFILE
    574607The limit on the total number of files open on the system has been
    575608reached.
     609
    576610@item ENOMEM
    577611Insufficient kernel memory was available.
     612
    578613@item EROFS
    579614@code{path} refers to a file on a read-only filesystem and write access
     
    589624@subheading NOTES:
    590625
    591 None
     626NONE
    592627
    593628The routine is implemented in Cygnus newlib.
     
    622657created file.
    623658
    624 @subheading NOTES:
    625 
    626 None
     659@subheading NOTES: 
     660
     661NONE
    627662
    628663The @code{cmask} argument should have only permission bits set.  All other
     
    656691
    657692@table @b
     693
    658694@item EACCES
    659695Search permission is denied for a directory in a file's path prefix
     696
    660697@item EEXIST
    661698The named file already exists.
     699
    662700@item EMLINK
    663701The number of links would exceed @code{LINK_MAX}.
     702
    664703@item ENAMETOOLONG
    665704Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in
    666705effect.
     706
    667707@item ENOENT
    668708A file or directory does not exist.
    669709@item ENOSPC
    670710No space left on disk.
     711
    671712@item ENOTDIR
    672713A component of the specified pathname was not a directory when a directory
    673714was expected.
     715
    674716@item EPERM
    675717Operation is not permitted.  Process does not have the appropriate priviledges
    676718or permissions to perform the requested operations.
     719
    677720@item EROFS
    678721Read-only file system.
     722
    679723@item EXDEV
    680724Attempt to link a file to another file system.
     
    684728@subheading DESCRIPTION:
    685729
    686 The @code{link} function atomically creates a new link for an existing file
     730The @code{link()} function atomically creates a new link for an existing file
    687731and increments the link count for the file.
    688732
    689 If the @code{link} function fails, no directories are modified.
     733If the @code{link()} function fails, no directories are modified.
    690734
    691735The @code{existing} argument should not be a directory.
     
    695739@subheading NOTES:
    696740
    697 None
     741NONE
    698742
    699743@page
     
    722766@item EACCES
    723767Search permission is denied for a directory in a file's path prefix
     768
    724769@item EEXIST
    725770The name file already exist. 
     771
    726772@item EMLINK
    727773The number of links would exceed LINK_MAX
     774
    728775@item ENAMETOOLONG
    729776Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in
    730777effect.
     778
    731779@item ENOENT
    732780A file or directory does not exist.
     781
    733782@item ENOSPC
    734783No space left on disk.
     784
    735785@item ENOTDIR
    736786A component of the specified pathname was not a directory when a directory
    737787was expected.
     788
    738789@item EROFS
    739790Read-only file system.
     
    753804@subheading NOTES:
    754805
    755 None
     806NONE
    756807
    757808@page
     
    781832@item EACCES
    782833Search permission is denied for a directory in a file's path prefix
     834
    783835@item EEXIST
    784836The named file already exists.
     837
    785838@item ENOENT
    786839A file or directory does not exist.
     840
    787841@item ENOSPC
    788842No space left on disk.
     843
    789844@item ENOTDIR
    790845A component of the specified @code{path} was not a directory when a directory
    791846was expected.
     847
    792848@item EROFS
    793849Read-only file system.
     
    804860@subheading NOTES:
    805861
    806 None
     862NONE
    807863
    808864@page
     
    829885@item EACCES
    830886Search permission is denied for a directory in a file's path prefix
     887
    831888@item EBUSY
    832889The directory is in use.
     890
    833891@item ENAMETOOLONG
    834892Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in
    835893effect.
     894
    836895@item ENOENT
    837896A file or directory does not exist.
     897
    838898@item ENOTDIR
    839899A component of the specified @code{path} was not a directory when a directory
    840900was expected.
     901
    841902@item EPERM
    842903Operation is not permitted.  Process does not have the appropriate priviledges
    843904or permissions to perform the requested operations.
     905
    844906@item EROFS
    845907Read-only file system.
     
    856918@subheading NOTES:
    857919
    858 None
     920NONE
    859921
    860922@page
     
    882944The filesystem containing @code{pathname} does not support the removal
    883945of directories.
     946
    884947@item EFAULT
    885948@code{pathname} points ouside your accessible address space.
     949
    886950@item EACCES
    887951Write access to the directory containing @code{pathname} was not
    888952allowed for the process's effective uid, or one of the directories in
    889953@code{pathname} did not allow search (execute) permission.
     954
    890955@item EPERM
    891956The directory containing @code{pathname} has the stickybit (S_ISVTX)
    892957set and the process's effective uid is neither the uid of the file to
    893958be delected nor that of the director containing it.
     959
    894960@item ENAMETOOLONG
    895961@code{pathname} was too long.
     962
    896963@item ENOENT
    897964A dirctory component in @code{pathname} does not exist or is a
    898965dangling sybolic link.
     966
    899967@item ENOTDIR
    900968@code{pathname}, or a component used as a directory in @code{pathname},
    901969is not, in fact, a directory.
     970
    902971@item ENOTEMPTY
    903972@code{pathname} contains entries other than . and .. .
     973
    904974@item EBUSY
    905975@code{pathname} is the current working directory or root directory of
    906976some process
     977
    907978@item EBUSY
    908979@code{pathname} is the current directory or root directory of some
    909980process.
     981
    910982@item ENOMEM
    911983Insufficient kernel memory was available
     984
    912985@item EROGS
    913986@code{pathname} refers to a file on a read-only filesystem.
     987
    914988@item ELOOP
    915989@code{pathname} contains a reference to a circular symbolic link
     
    924998@subheading NOTES:
    925999
    926 None
     1000NONE
    9271001
    9281002@page
     
    9501024@item EACCES
    9511025Search permission is denied for a directory in a file's path prefix.
     1026
    9521027@item EBUSY
    9531028The directory is in use.
     1029
    9541030@item EEXIST
    9551031The named file already exists.
     1032
    9561033@item EINVAL
    9571034Invalid argument.
     1035
    9581036@item EISDIR
    9591037Attempt to open a directory for writing or to rename a file to be a
    9601038directory.
     1039
    9611040@item EMLINK
    9621041The number of links would exceed LINK_MAX.
     1042
    9631043@item ENAMETOOLONG
    9641044Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is
    9651045in effect.
     1046
    9661047@item ENOENT
    9671048A file or directory does no exist.
     1049
    9681050@item ENOSPC
    9691051No space left on disk.
     1052
    9701053@item ENOTDIR
    9711054A component of the specified pathname was not a directory when a
    9721055directory was expected.
     1056
    9731057@item ENOTEMPTY
    9741058Attempt to delete or rename a non-empty directory.
     1059
    9751060@item EROFS
    9761061Read-only file system
     1062
    9771063@item EXDEV
    9781064Attempt to link a file to another file system.
     
    10261112@item EACCES
    10271113Search permission is denied for a directory in a file's path prefix.
     1114
    10281115@item EBADF
    10291116Invalid file descriptor.
     1117
    10301118@item ENAMETOOLONG
    10311119Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is
    10321120in effect.
     1121
    10331122@item ENOENT
    10341123A file or directory does not exist.
     1124
    10351125@item ENOTDIR
    10361126A component of the specified pathname was not a directory when a
     
    10491139@subheading NOTES:
    10501140
    1051 None
     1141NONE
    10521142
    10531143@page
     
    10871177@subheading NOTES:
    10881178
     1179NONE
     1180
    10891181@page
    10901182@subsection access - Check user's permissions for a file
     
    11121204The requested access would be denied, either to the file itself or
    11131205one of the directories in @code{pathname}.
     1206
    11141207@item EFAULT
    11151208@code{pathname} points outside your accessible address space.
     1209
    11161210@item EINVAL
    11171211@code{Mode} was incorrectly specified.
     1212
    11181213@item ENAMETOOLONG
    11191214@code{pathname} is too long.
     1215
    11201216@item ENOENT
    11211217A directory component in @code{pathname} would have been accessible but
    11221218does not exist or was a dangling symbolic link.
     1219
    11231220@item ENOTDIR
    11241221A component used as a directory in @code{pathname} is not, in fact,
    11251222a directory.
     1223
    11261224@item ENOMEM
    11271225Insufficient kernel memory was available.
     
    11401238@subheading NOTES:
    11411239
    1142 None
     1240NONE
    11431241
    11441242@page
     
    11671265@item EACCES
    11681266Search permission is denied for a directory in a file's path prefix
     1267
    11691268@item ENAMETOOLONG
    11701269Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in
    11711270effect.
     1271
    11721272@item ENOENT
    11731273A file or directory does not exist.
     1274
    11741275@item ENOTDIR
    11751276A component of the specified pathname was not a directory when a directory
    11761277was expected.
     1278
    11771279@item EPERM
    11781280Operation is not permitted.  Process does not have the appropriate priviledges
    11791281or permissions to perform the requested operations.
     1282
    11801283@item EROFS
    11811284Read-only file system.
     
    11931296@subheading NOTES:
    11941297
     1298NONE
     1299
    11951300@page
    11961301@subsection fchmod - Changes permissions of a file
     
    12181323@item EACCES
    12191324Search permission is denied for a directory in a file's path prefix.
     1325
    12201326@item EBADF
    12211327The descriptor is not valid.
     1328
    12221329@item EFAULT
    12231330@code{path} points outside your accessible address space.
     1331
    12241332@item EIO
    12251333A low-level I/o error occurred while modifying the inode.
     1334
    12261335@item ELOOP
    12271336@code{path} contains a circular reference
     1337
    12281338@item ENAMETOOLONG
    12291339Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is
    12301340in effect.
     1341
    12311342@item ENOENT
    12321343A file or directory does no exist.
     1344
    12331345@item ENOMEM
    12341346Insufficient kernel memory was avaliable.
     1347
    12351348@item ENOTDIR
    12361349A component of the specified pathname was not a directory when a
    12371350directory was expected.
     1351
    12381352@item EPERM
    12391353The effective UID does not match the owner of the file, and is not
    12401354zero
     1355
    12411356@item EROFS
    12421357Read-only file system
     
    12501365@subheading NOTES:
    12511366
    1252 None
     1367NONE
    12531368
    12541369@page
     
    12861401@subheading NOTES:
    12871402
     1403NONE
     1404
    12881405@page
    12891406@subsection chown - Changes the owner and/or group of a file.
     
    13121429@item EACCES
    13131430Search permission is denied for a directory in a file's path prefix
     1431
    13141432@item EINVAL
    13151433Invalid argument
     1434
    13161435@item ENAMETOOLONG
    13171436Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in
    13181437effect.
     1438
    13191439@item ENOENT
    13201440A file or directory does not exist.
     1441
    13211442@item ENOTDIR
    13221443A component of the specified pathname was not a directory when a directory
    13231444was expected.
     1445
    13241446@item EPERM
    13251447Operation is not permitted.  Process does not have the appropriate priviledges
    13261448or permissions to perform the requested operations.
     1449
    13271450@item EROFS
    13281451Read-only file system.
     
    13751498@item EACCES
    13761499Permission to write the file is denied
     1500
    13771501@item ENOENT
    13781502@code{Filename} does not exist
     
    13871511access and modification times of the file are set to the current time. 
    13881512
    1389 @subheading NOTES: None
     1513@subheading NOTES:
     1514
     1515NONE
    13901516
    13911517@page
     
    13991525
    14001526int ftrunctate(
    1401   const char *path,
    1402   size_t      length
     1527  int     fd,
     1528  size_t  length
    14031529);
    14041530@end example
     
    14571583@subheading DESCRIPTION:
    14581584
    1459 2code{Truncate} causes the file named by @code{path} or referenced by
     1585@code{truncate()} causes the file named by @code{path} or referenced by
    14601586@code{fd} to be truncated to at most @code{length} bytes in size.  If the 
    14611587file previously was larger than this size, the extra data is lost.  With
    1462 @code{ftruncate}, the file must be open for writing.
    1463 
    1464 @subheading NOTES: None
     1588@code{ftruncate()}, the file must be open for writing.
     1589
     1590@subheading NOTES:
     1591
     1592NONE
     1593
     1594@page
     1595@subsection truncate - truncate a file to a specified length
     1596
     1597@subheading CALLING SEQUENCE:
     1598
     1599@ifset is-C
     1600@example
     1601#include <unistd.h>
     1602
     1603int trunctate(
     1604  const char *path,
     1605  size_t      length
     1606);
     1607@end example
     1608@end ifset
     1609
     1610@ifset is-Ada
     1611@end ifset
     1612
     1613@subheading STATUS CODES:
     1614
     1615@table @b
     1616@item ENOTDIR
     1617A component of the path prefix is not a directory.
     1618
     1619@item EINVAL
     1620The pathname contains a character with the high-order bit set.
     1621
     1622@item ENAMETOOLONG
     1623A component of a pathname exceeded 255 characters, or an entire
     1624path name exceeded 1023 characters.
     1625
     1626@item ENOENT
     1627The named file does not exist.
     1628
     1629@item EACCES
     1630The named file is not writable by the user.
     1631
     1632@item EACCES
     1633Search permission is denied for a component of the path prefix.
     1634
     1635@item ELOOP
     1636Too many symbolic links were encountered in translating the
     1637pathname
     1638
     1639@item EISDIR
     1640The named file is a directory.
     1641
     1642@item EROFS
     1643The named file resides on a read-only file system
     1644
     1645@item ETXTBSY
     1646The file is a pure procedure (shared text) file that is being
     1647executed
     1648
     1649@item EIO
     1650An I/O error occurred updating the inode.
     1651
     1652@item EFAULT
     1653@code{Path} points outside the process's allocated address space.
     1654
     1655@item EBADF
     1656The @code{fd} is not a valid descriptor.
     1657
     1658@end table
     1659
     1660@subheading DESCRIPTION:
     1661
     1662@code{truncate()} causes the file named by @code{path} or referenced by
     1663@code{fd} to be truncated to at most @code{length} bytes in size.  If the 
     1664file previously was larger than this size, the extra data is lost.  With
     1665@code{ftruncate()}, the file must be open for writing.
     1666
     1667@subheading NOTES:
     1668
     1669NONE
    14651670
    14661671@page
     
    15041709
    15051710@end table
     1711
     1712@subheading DESCRIPTION:
     1713
     1714@code{pathconf()} gets a value for the configuration option @code{name}
     1715for the open file descriptor @code{filedes}.
     1716
     1717The possible values for @code{name} are:
     1718
     1719@table @b
     1720@item _PC_LINK_MAX
     1721returns the maximum number of links to the file.  If @code{filedes} or
     1722@code{path} refer to a directory, then the value applies to the whole
     1723directory.  The corresponding macro is @code{_POSIX_LINK_MAX}.
     1724
     1725@item _PC_MAX_CANON
     1726returns  the maximum length of a formatted input line, where @code{filedes}
     1727or @code{path} must refer to a terminal.  The corresponding macro is
     1728@code{_POSIX_MAX_CANON}.
     1729
     1730@item _PC_MAX_INPUT
     1731returns the maximum length of an input line, where @code{filedes} or
     1732@code{path} must refer to a terminal.  The corresponding macro is
     1733@code{_POSIX_MAX_INPUT}.
     1734
     1735@item _PC_NAME_MAX
     1736returns the maximum length of a filename in the directory @code{path} or
     1737@code{filedes}.  The process is allowed to create. The corresponding macro
     1738is @code{_POSIX_NAME_MAX}.
     1739
     1740@item _PC_PATH_MAX
     1741returns the maximum length of a relative pathname when @code{path} or
     1742@code{filedes} is the current working directory.  The corresponding macro
     1743is @code{_POSIX_PATH_MAX}.
     1744
     1745@item _PC_PIPE_BUF
     1746returns the size of the pipe buffer, where @code{filedes} must refer to a
     1747pipe or FIFO and @code{path} must refer to a FIFO.  The corresponding macro
     1748is @code{_POSIX_PIPE_BUF}.
     1749
     1750@item _PC_CHOWN_RESTRICTED
     1751returns nonzero if the chown(2) call may not be used on this file.  If
     1752@code{filedes} or @code{path} refer to a directory, then this applies to all
     1753files in that directory.  The corresponding macro is
     1754@code{_POSIX_CHOWN_RESTRICTED}.
     1755
     1756@end table
     1757
     1758@subheading NOTES:
     1759
     1760Files with name lengths longer than the value returned for @code{name} equal
     1761@code{_PC_NAME_MAX} may exist in the given directory.
     1762
     1763@page
     1764@subsection fpathconf - Gets configuration values for files
     1765
     1766@subheading CALLING SEQUENCE:
     1767
     1768@ifset is-C
     1769@example
     1770#include <unistd.h>
     1771
     1772int fpathconf(
     1773  int filedes,
     1774  int name
     1775);
     1776@end example
     1777@end ifset
     1778
     1779@ifset is-Ada
     1780@end ifset
     1781
     1782@subheading STATUS CODES:
     1783
     1784@table @b
     1785@item EINVAL
     1786Invalid argument
     1787
     1788@item EACCES
     1789Permission to write the file is denied
     1790@item ENAMETOOLONG
     1791
     1792Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
     1793is in effect.
     1794
     1795@item ENOENT
     1796A file or directory does not exist
     1797
     1798@item ENOTDIR
     1799A component of the specified @code{path} was not a directory whan a
     1800directory was expected.
     1801
     1802@end table
     1803
    15061804
    15071805@subheading DESCRIPTION:
     
    15211819returns  the maximum length of a formatted input line, where @code{filedes}
    15221820or @code{path} must refer to a terminal.  The corresponding macro is
    1523 _POSIX_MAX_CANON.
     1821@code{_POSIX_MAX_CANON}.
    15241822
    15251823@item _PC_MAX_INPUT
    15261824returns the maximum length of an input line, where @code{filedes} or
    15271825@code{path} must refer to a terminal.  The corresponding macro is
    1528 _POSIX_MAX_INPUT.
     1826@code{_POSIX_MAX_INPUT}.
    15291827
    15301828@item _PC_NAME_MAX
    15311829returns the maximum length of a filename in the directory @code{path} or
    15321830@code{filedes}.  The process is allowed to create. The corresponding macro
    1533 is _POSIX_NAME_MAX.
     1831is @code{_POSIX_NAME_MAX}.
    15341832
    15351833@item _PC_PATH_MAX
    15361834returns the maximum length of a relative pathname when @code{path} or
    15371835@code{filedes} is the current working directory.  The corresponding macro
    1538 is _POSIX_PATH_MAX.
     1836is @code{_POSIX_PATH_MAX}.
    15391837
    15401838@item _PC_PIPE_BUF
    15411839returns the size of the pipe buffer, where @code{filedes} must refer to a
    15421840pipe or FIFO and @code{path} must refer to a FIFO.  The corresponding macro
    1543 is _POSIX_PIPE_BUF.
    1544 
    1545 @item _PC_CHOWN_RESTRICTED
    1546 returns nonzero if the chown(2) call may not be used on this file.  If
    1547 @code{filedes} or @code{path} refer to a directory, then this applies to all
    1548 files in that directory.  The corresponding macro is _POSIX_CHOWN_RESTRICTED.
    1549 
    1550 @end table
    1551 
    1552 @subheading NOTES:
    1553 
    1554 Files with name lengths longer than the value returned for @code{name} equal
    1555 _PC_NAME_MAX may exist in the given directory.
    1556 
    1557 @page
    1558 @subsection fpathconf - Gets configuration values for files
    1559 
    1560 @subheading CALLING SEQUENCE:
    1561 
    1562 @ifset is-C
    1563 @example
    1564 #include <unistd.h>
    1565 
    1566 int fpathconf(
    1567   int filedes,
    1568   int name
    1569 );
    1570 @end example
    1571 @end ifset
    1572 
    1573 @ifset is-Ada
    1574 @end ifset
    1575 
    1576 @subheading STATUS CODES:
    1577 
    1578 @table @b
    1579 @item EINVAL
    1580 Invalid argument
    1581 
    1582 @item EACCES
    1583 Permission to write the file is denied
    1584 @item ENAMETOOLONG
    1585 
    1586 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
    1587 is in effect.
    1588 
    1589 @item ENOENT
    1590 A file or directory does not exist
    1591 
    1592 @item ENOTDIR
    1593 A component of the specified @code{path} was not a directory whan a
    1594 directory was expected.
    1595 
    1596 @end table
    1597 
    1598 
    1599 @subheading DESCRIPTION:
    1600 
    1601 @code{pathconf()} gets a value for the configuration option @code{name}
    1602 for the open file descriptor @code{filedes}.
    1603 
    1604 The possible values for name are:
    1605 
    1606 @table @b
    1607 @item _PC_LINK_MAX
    1608 returns the maximum number of links to the file.  If @code{filedes} or
    1609 @code{path} refer to a directory, then the value applies to the whole
    1610 directory.  The corresponding macro is _POSIX_LINK_MAX.
    1611 
    1612 @item _PC_MAX_CANON
    1613 returns  the maximum length of a formatted input line, where @code{filedes}
    1614 or @code{path} must refer to a terminal.  The corresponding macro is
    1615 _POSIX_MAX_CANON.
    1616 
    1617 @item _PC_MAX_INPUT
    1618 returns the maximum length of an input line, where @code{filedes} or
    1619 @code{path} must refer to a terminal.  The corresponding macro is
    1620 _POSIX_MAX_INPUT.
    1621 
    1622 @item _PC_NAME_MAX
    1623 returns the maximum length of a filename in the directory @code{path} or
    1624 @code{filedes}.  The process is allowed to create. The corresponding macro
    1625 is _POSIX_NAME_MAX.
    1626 
    1627 @item _PC_PATH_MAX
    1628 returns the maximum length of a relative pathname when @code{path} or
    1629 @code{filedes} is the current working directory.  The corresponding macro
    1630 is _POSIX_PATH_MAX.
    1631 
    1632 @item _PC_PIPE_BUF
    1633 returns the size of the pipe buffer, where @code{filedes} must refer to a
    1634 pipe or FIFO and @code{path} must refer to a FIFO.  The corresponding macro
    1635 is _POSIX_PIPE_BUF.
     1841is @code{_POSIX_PIPE_BUF}.
    16361842
    16371843@item _PC_CHOWN_RESTRICTED
    16381844returns nonzero if the @code{chown()} call may not be used on this file.  If
    16391845@code{filedes} or @code{path} refer to a directory, then this applies to all
    1640 files in that directory.  The corresponding macro is _POSIX_CHOWN_RESTRICTED.
    1641 
    1642 @end table
    1643 
    1644 @subheading NOTES:
    1645 
    1646 NONE
     1846files in that directory.  The corresponding macro is
     1847@code{_POSIX_CHOWN_RESTRICTED}.
     1848
     1849@end table
     1850
     1851@subheading NOTES:
     1852
     1853NONE
     1854
     1855@page
     1856@subsection mknod - create a directory
     1857
     1858@subheading CALLING SEQUENCE:
     1859
     1860@ifset is-C
     1861@example
     1862#include <unistd.h>
     1863#include <fcntl.h>
     1864#include <sys/types.h>
     1865#include <sys/stat.h>
     1866
     1867long mknod(
     1868  const char *pathname,
     1869  mode_t      mode,
     1870  dev_t       dev
     1871);
     1872@end example
     1873@end ifset
     1874
     1875@ifset is-Ada
     1876@end ifset
     1877
     1878@subheading STATUS CODES:
     1879
     1880@code{mknod} returns zero on success, or -1 if an error occurred (in which case,
     1881errno is set appropriately).
     1882
     1883@table @b
     1884@item ENAMETOOLONG
     1885@code{pathname} was too long.
     1886
     1887@item ENOENT
     1888A directory component in @code{pathname} does not exist or is a dangling symbolic
     1889link.
     1890
     1891@item ENOTDIR
     1892A component used in the directory @code{pathname} is not, in fact, a directory.
     1893
     1894@item ENOMEM
     1895Insufficient kernel memory was available
     1896
     1897@item EROFS
     1898@code{pathname} refers to a file on a read-only filesystem.
     1899
     1900@item ELOOP
     1901@code{pathname} contains a reference to a circular symbolic link, ie a symbolic
     1902link whose expansion contains a reference to itself.
     1903
     1904@item ENOSPC
     1905The device containing @code{pathname} has no room for the new node.
     1906
     1907@end table
     1908
     1909@subheading DESCRIPTION:
     1910
     1911@code{mknod} attempts to create a filesystem node (file, device special file or
     1912named pipe) named @code{pathname}, specified by @code{mode} and @code{dev}.
     1913
     1914@code{mode} specifies both the permissions to use and the type of node to be created.
     1915
     1916It should be a combination (using bitwise OR) of one of the file types listed
     1917below and the permissions for the new node.
     1918
     1919The permissions are modified by the process's @code{umask} in the usual way: the
     1920permissions of the created node are @code{(mode & ~umask)}.
     1921
     1922The file type should be one of @code{S_IFREG}, @code{S_IFCHR}, @code{S_IFBLK} and
     1923@code{S_IFIFO} to specify a normal file (which will be created empty), character
     1924special file, block special file or FIFO (named pipe), respectively, or zero, which
     1925will create a normal file.
     1926
     1927If the file type is @code{S_IFCHR} or @code{S_IFBLK} then @code{dev} specifies the major 
     1928and minor numbers of the newly created device special file; otherwise it is ignored.
     1929
     1930The newly created node will be owned by the effective uid of the process.  If the
     1931directory containing the node has the set group id bit set, or if the filesystem
     1932is mounted with BSD group semantics, the new node will inherit the group ownership
     1933from its parent directory; otherwise it will be owned by the effective gid of the
     1934process.
     1935
     1936
     1937@subheading NOTES:
     1938
     1939NONE
Note: See TracChangeset for help on using the changeset viewer.