Changeset 982ed3f8 in rtems
- Timestamp:
- 09/29/98 21:53:08 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 17408b90
- Parents:
- 6e62b72e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/new_chapters/files.t
r6e62b72e r982ed3f8 42 42 @item @code{utime} - Change access and/or modification times of an inode 43 43 @item @code{ftruncate} - Truncate a file to a specified length 44 @itme @code{truncate} - Truncate a file to a specified length 44 45 @item @code{pathconf} - Gets configuration values for files 45 46 @item @code{fpathconf} - Get configuration values for files 47 @itme @code{mknod} - Create a directory 46 48 @end itemize 47 49 48 50 @section Background 49 51 52 There is currently no text in this section. 53 50 54 @section Operations 55 56 There is currently no text in this section. 51 57 52 58 @section Directives … … 96 102 97 103 @item ENOTDIR 98 @ item{Name} is not a directory.104 @code{name} is not a directory. 99 105 100 106 @end table … … 150 156 a call for another directory. 151 157 152 @subheading NOTES: 158 @subheading NOTES: 153 159 154 160 If @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. 157 163 158 164 The routine is implemented in Cygnus newlib. … … 177 183 @end ifset 178 184 179 @subheading STATUS CODES: No value is returned. 185 @subheading STATUS CODES: 186 187 No value is returned. 180 188 181 189 @subheading DESCRIPTION: … … 185 193 directory stream to refer to the current state of the directory. 186 194 187 @subheading NOTES: 195 @subheading NOTES: 196 197 NONE 188 198 189 199 If @code{dirp} is not a pointer by @code{opendir()}, the results are … … 265 275 directory stream @code{dir}. 266 276 267 @subheading NOTES: 277 @subheading NOTES: 268 278 269 279 The routine is implemented in Cygnus newlib. 270 271 280 272 281 @page … … 303 312 @code{closedir()}. 304 313 305 @subheading NOTES: 314 @subheading NOTES: 315 316 NONE 306 317 307 318 The argument to @code{closedir()} must be a pointer returned by … … 359 370 @subheading NOTES: 360 371 361 N one372 NONE 362 373 363 374 @page … … 434 445 435 446 @table @b 447 436 448 @item EACCES 437 449 Search permission is denied for a directory in a file's path prefix. 450 438 451 @item EEXIST 439 452 The named file already exists. 453 440 454 @item EINTR 441 455 Function was interrupted by a signal. 456 442 457 @item EISDIR 443 458 Attempt to open a directory for writing or to rename a file to be a 444 459 directory. 460 445 461 @item EMFILE 446 462 Too many file descriptors are in use by this process. 463 447 464 @item ENAMETOOLONG 448 465 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in 449 466 effect. 467 450 468 @item ENFILE 451 469 Too many files are currently open in the system. 470 452 471 @item ENOENT 453 472 A file or directory does not exist. 473 454 474 @item ENOSPC 455 475 No space left on disk. 476 456 477 @item ENOTDIR 457 478 A component of the specified pathname was not a directory when a directory 458 479 was expected. 480 459 481 @item ENXIO 460 482 No such device. This error may also occur when a device is not ready, for 461 483 example, a tape drive is off-line. 484 462 485 @item EROFS 463 486 Read-only file system. … … 521 544 descriptor. 522 545 523 @subheading NOTES: 524 546 @subheading NOTES: 547 548 NONE 525 549 526 550 @page … … 550 574 @item EEXIST 551 575 @code{path} already exists and O_CREAT and O_EXCL were used. 576 552 577 @item EISDIR 553 578 @code{path} refers to a directory and the access requested involved 554 579 writing 580 555 581 @item ETXTBSY 556 582 @code{path} refers to an executable image which is currently being 557 583 executed and write access was requested 584 558 585 @item EFAULT 559 586 @code{path} points outside your accessible address space 587 560 588 @item EACCES 561 589 The requested access to the file is not allowed, or one of the 562 590 directories in @code{path} did not allow search (execute) permission. 591 563 592 @item ENAMETOOLONG 564 593 @code{path} was too long. 594 565 595 @item ENOENT 566 596 A directory component in @code{path} does not exist or is a dangling 567 597 symbolic link. 598 568 599 @item ENOTDIR 569 600 A component used as a directory in @code{path} is not, in fact, a 570 601 directory. 602 571 603 @item EMFILE 572 604 The process alreadyh has the maximum number of files open. 605 573 606 @item ENFILE 574 607 The limit on the total number of files open on the system has been 575 608 reached. 609 576 610 @item ENOMEM 577 611 Insufficient kernel memory was available. 612 578 613 @item EROFS 579 614 @code{path} refers to a file on a read-only filesystem and write access … … 589 624 @subheading NOTES: 590 625 591 N one626 NONE 592 627 593 628 The routine is implemented in Cygnus newlib. … … 622 657 created file. 623 658 624 @subheading NOTES: 625 626 N one659 @subheading NOTES: 660 661 NONE 627 662 628 663 The @code{cmask} argument should have only permission bits set. All other … … 656 691 657 692 @table @b 693 658 694 @item EACCES 659 695 Search permission is denied for a directory in a file's path prefix 696 660 697 @item EEXIST 661 698 The named file already exists. 699 662 700 @item EMLINK 663 701 The number of links would exceed @code{LINK_MAX}. 702 664 703 @item ENAMETOOLONG 665 704 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in 666 705 effect. 706 667 707 @item ENOENT 668 708 A file or directory does not exist. 669 709 @item ENOSPC 670 710 No space left on disk. 711 671 712 @item ENOTDIR 672 713 A component of the specified pathname was not a directory when a directory 673 714 was expected. 715 674 716 @item EPERM 675 717 Operation is not permitted. Process does not have the appropriate priviledges 676 718 or permissions to perform the requested operations. 719 677 720 @item EROFS 678 721 Read-only file system. 722 679 723 @item EXDEV 680 724 Attempt to link a file to another file system. … … 684 728 @subheading DESCRIPTION: 685 729 686 The @code{link } function atomically creates a new link for an existing file730 The @code{link()} function atomically creates a new link for an existing file 687 731 and increments the link count for the file. 688 732 689 If the @code{link } function fails, no directories are modified.733 If the @code{link()} function fails, no directories are modified. 690 734 691 735 The @code{existing} argument should not be a directory. … … 695 739 @subheading NOTES: 696 740 697 N one741 NONE 698 742 699 743 @page … … 722 766 @item EACCES 723 767 Search permission is denied for a directory in a file's path prefix 768 724 769 @item EEXIST 725 770 The name file already exist. 771 726 772 @item EMLINK 727 773 The number of links would exceed LINK_MAX 774 728 775 @item ENAMETOOLONG 729 776 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in 730 777 effect. 778 731 779 @item ENOENT 732 780 A file or directory does not exist. 781 733 782 @item ENOSPC 734 783 No space left on disk. 784 735 785 @item ENOTDIR 736 786 A component of the specified pathname was not a directory when a directory 737 787 was expected. 788 738 789 @item EROFS 739 790 Read-only file system. … … 753 804 @subheading NOTES: 754 805 755 N one806 NONE 756 807 757 808 @page … … 781 832 @item EACCES 782 833 Search permission is denied for a directory in a file's path prefix 834 783 835 @item EEXIST 784 836 The named file already exists. 837 785 838 @item ENOENT 786 839 A file or directory does not exist. 840 787 841 @item ENOSPC 788 842 No space left on disk. 843 789 844 @item ENOTDIR 790 845 A component of the specified @code{path} was not a directory when a directory 791 846 was expected. 847 792 848 @item EROFS 793 849 Read-only file system. … … 804 860 @subheading NOTES: 805 861 806 N one862 NONE 807 863 808 864 @page … … 829 885 @item EACCES 830 886 Search permission is denied for a directory in a file's path prefix 887 831 888 @item EBUSY 832 889 The directory is in use. 890 833 891 @item ENAMETOOLONG 834 892 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in 835 893 effect. 894 836 895 @item ENOENT 837 896 A file or directory does not exist. 897 838 898 @item ENOTDIR 839 899 A component of the specified @code{path} was not a directory when a directory 840 900 was expected. 901 841 902 @item EPERM 842 903 Operation is not permitted. Process does not have the appropriate priviledges 843 904 or permissions to perform the requested operations. 905 844 906 @item EROFS 845 907 Read-only file system. … … 856 918 @subheading NOTES: 857 919 858 N one920 NONE 859 921 860 922 @page … … 882 944 The filesystem containing @code{pathname} does not support the removal 883 945 of directories. 946 884 947 @item EFAULT 885 948 @code{pathname} points ouside your accessible address space. 949 886 950 @item EACCES 887 951 Write access to the directory containing @code{pathname} was not 888 952 allowed for the process's effective uid, or one of the directories in 889 953 @code{pathname} did not allow search (execute) permission. 954 890 955 @item EPERM 891 956 The directory containing @code{pathname} has the stickybit (S_ISVTX) 892 957 set and the process's effective uid is neither the uid of the file to 893 958 be delected nor that of the director containing it. 959 894 960 @item ENAMETOOLONG 895 961 @code{pathname} was too long. 962 896 963 @item ENOENT 897 964 A dirctory component in @code{pathname} does not exist or is a 898 965 dangling sybolic link. 966 899 967 @item ENOTDIR 900 968 @code{pathname}, or a component used as a directory in @code{pathname}, 901 969 is not, in fact, a directory. 970 902 971 @item ENOTEMPTY 903 972 @code{pathname} contains entries other than . and .. . 973 904 974 @item EBUSY 905 975 @code{pathname} is the current working directory or root directory of 906 976 some process 977 907 978 @item EBUSY 908 979 @code{pathname} is the current directory or root directory of some 909 980 process. 981 910 982 @item ENOMEM 911 983 Insufficient kernel memory was available 984 912 985 @item EROGS 913 986 @code{pathname} refers to a file on a read-only filesystem. 987 914 988 @item ELOOP 915 989 @code{pathname} contains a reference to a circular symbolic link … … 924 998 @subheading NOTES: 925 999 926 N one1000 NONE 927 1001 928 1002 @page … … 950 1024 @item EACCES 951 1025 Search permission is denied for a directory in a file's path prefix. 1026 952 1027 @item EBUSY 953 1028 The directory is in use. 1029 954 1030 @item EEXIST 955 1031 The named file already exists. 1032 956 1033 @item EINVAL 957 1034 Invalid argument. 1035 958 1036 @item EISDIR 959 1037 Attempt to open a directory for writing or to rename a file to be a 960 1038 directory. 1039 961 1040 @item EMLINK 962 1041 The number of links would exceed LINK_MAX. 1042 963 1043 @item ENAMETOOLONG 964 1044 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is 965 1045 in effect. 1046 966 1047 @item ENOENT 967 1048 A file or directory does no exist. 1049 968 1050 @item ENOSPC 969 1051 No space left on disk. 1052 970 1053 @item ENOTDIR 971 1054 A component of the specified pathname was not a directory when a 972 1055 directory was expected. 1056 973 1057 @item ENOTEMPTY 974 1058 Attempt to delete or rename a non-empty directory. 1059 975 1060 @item EROFS 976 1061 Read-only file system 1062 977 1063 @item EXDEV 978 1064 Attempt to link a file to another file system. … … 1026 1112 @item EACCES 1027 1113 Search permission is denied for a directory in a file's path prefix. 1114 1028 1115 @item EBADF 1029 1116 Invalid file descriptor. 1117 1030 1118 @item ENAMETOOLONG 1031 1119 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is 1032 1120 in effect. 1121 1033 1122 @item ENOENT 1034 1123 A file or directory does not exist. 1124 1035 1125 @item ENOTDIR 1036 1126 A component of the specified pathname was not a directory when a … … 1049 1139 @subheading NOTES: 1050 1140 1051 N one1141 NONE 1052 1142 1053 1143 @page … … 1087 1177 @subheading NOTES: 1088 1178 1179 NONE 1180 1089 1181 @page 1090 1182 @subsection access - Check user's permissions for a file … … 1112 1204 The requested access would be denied, either to the file itself or 1113 1205 one of the directories in @code{pathname}. 1206 1114 1207 @item EFAULT 1115 1208 @code{pathname} points outside your accessible address space. 1209 1116 1210 @item EINVAL 1117 1211 @code{Mode} was incorrectly specified. 1212 1118 1213 @item ENAMETOOLONG 1119 1214 @code{pathname} is too long. 1215 1120 1216 @item ENOENT 1121 1217 A directory component in @code{pathname} would have been accessible but 1122 1218 does not exist or was a dangling symbolic link. 1219 1123 1220 @item ENOTDIR 1124 1221 A component used as a directory in @code{pathname} is not, in fact, 1125 1222 a directory. 1223 1126 1224 @item ENOMEM 1127 1225 Insufficient kernel memory was available. … … 1140 1238 @subheading NOTES: 1141 1239 1142 N one1240 NONE 1143 1241 1144 1242 @page … … 1167 1265 @item EACCES 1168 1266 Search permission is denied for a directory in a file's path prefix 1267 1169 1268 @item ENAMETOOLONG 1170 1269 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in 1171 1270 effect. 1271 1172 1272 @item ENOENT 1173 1273 A file or directory does not exist. 1274 1174 1275 @item ENOTDIR 1175 1276 A component of the specified pathname was not a directory when a directory 1176 1277 was expected. 1278 1177 1279 @item EPERM 1178 1280 Operation is not permitted. Process does not have the appropriate priviledges 1179 1281 or permissions to perform the requested operations. 1282 1180 1283 @item EROFS 1181 1284 Read-only file system. … … 1193 1296 @subheading NOTES: 1194 1297 1298 NONE 1299 1195 1300 @page 1196 1301 @subsection fchmod - Changes permissions of a file … … 1218 1323 @item EACCES 1219 1324 Search permission is denied for a directory in a file's path prefix. 1325 1220 1326 @item EBADF 1221 1327 The descriptor is not valid. 1328 1222 1329 @item EFAULT 1223 1330 @code{path} points outside your accessible address space. 1331 1224 1332 @item EIO 1225 1333 A low-level I/o error occurred while modifying the inode. 1334 1226 1335 @item ELOOP 1227 1336 @code{path} contains a circular reference 1337 1228 1338 @item ENAMETOOLONG 1229 1339 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is 1230 1340 in effect. 1341 1231 1342 @item ENOENT 1232 1343 A file or directory does no exist. 1344 1233 1345 @item ENOMEM 1234 1346 Insufficient kernel memory was avaliable. 1347 1235 1348 @item ENOTDIR 1236 1349 A component of the specified pathname was not a directory when a 1237 1350 directory was expected. 1351 1238 1352 @item EPERM 1239 1353 The effective UID does not match the owner of the file, and is not 1240 1354 zero 1355 1241 1356 @item EROFS 1242 1357 Read-only file system … … 1250 1365 @subheading NOTES: 1251 1366 1252 N one1367 NONE 1253 1368 1254 1369 @page … … 1286 1401 @subheading NOTES: 1287 1402 1403 NONE 1404 1288 1405 @page 1289 1406 @subsection chown - Changes the owner and/or group of a file. … … 1312 1429 @item EACCES 1313 1430 Search permission is denied for a directory in a file's path prefix 1431 1314 1432 @item EINVAL 1315 1433 Invalid argument 1434 1316 1435 @item ENAMETOOLONG 1317 1436 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in 1318 1437 effect. 1438 1319 1439 @item ENOENT 1320 1440 A file or directory does not exist. 1441 1321 1442 @item ENOTDIR 1322 1443 A component of the specified pathname was not a directory when a directory 1323 1444 was expected. 1445 1324 1446 @item EPERM 1325 1447 Operation is not permitted. Process does not have the appropriate priviledges 1326 1448 or permissions to perform the requested operations. 1449 1327 1450 @item EROFS 1328 1451 Read-only file system. … … 1375 1498 @item EACCES 1376 1499 Permission to write the file is denied 1500 1377 1501 @item ENOENT 1378 1502 @code{Filename} does not exist … … 1387 1511 access and modification times of the file are set to the current time. 1388 1512 1389 @subheading NOTES: None 1513 @subheading NOTES: 1514 1515 NONE 1390 1516 1391 1517 @page … … 1399 1525 1400 1526 int ftrunctate( 1401 const char *path,1402 size_t 1527 int fd, 1528 size_t length 1403 1529 ); 1404 1530 @end example … … 1457 1583 @subheading DESCRIPTION: 1458 1584 1459 2code{Truncate} causes the file named by @code{path} or referenced by1585 @code{truncate()} causes the file named by @code{path} or referenced by 1460 1586 @code{fd} to be truncated to at most @code{length} bytes in size. If the 1461 1587 file 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 1592 NONE 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 1603 int 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 1617 A component of the path prefix is not a directory. 1618 1619 @item EINVAL 1620 The pathname contains a character with the high-order bit set. 1621 1622 @item ENAMETOOLONG 1623 A component of a pathname exceeded 255 characters, or an entire 1624 path name exceeded 1023 characters. 1625 1626 @item ENOENT 1627 The named file does not exist. 1628 1629 @item EACCES 1630 The named file is not writable by the user. 1631 1632 @item EACCES 1633 Search permission is denied for a component of the path prefix. 1634 1635 @item ELOOP 1636 Too many symbolic links were encountered in translating the 1637 pathname 1638 1639 @item EISDIR 1640 The named file is a directory. 1641 1642 @item EROFS 1643 The named file resides on a read-only file system 1644 1645 @item ETXTBSY 1646 The file is a pure procedure (shared text) file that is being 1647 executed 1648 1649 @item EIO 1650 An 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 1656 The @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 1664 file 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 1669 NONE 1465 1670 1466 1671 @page … … 1504 1709 1505 1710 @end table 1711 1712 @subheading DESCRIPTION: 1713 1714 @code{pathconf()} gets a value for the configuration option @code{name} 1715 for the open file descriptor @code{filedes}. 1716 1717 The possible values for @code{name} are: 1718 1719 @table @b 1720 @item _PC_LINK_MAX 1721 returns 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 1723 directory. The corresponding macro is @code{_POSIX_LINK_MAX}. 1724 1725 @item _PC_MAX_CANON 1726 returns the maximum length of a formatted input line, where @code{filedes} 1727 or @code{path} must refer to a terminal. The corresponding macro is 1728 @code{_POSIX_MAX_CANON}. 1729 1730 @item _PC_MAX_INPUT 1731 returns 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 1736 returns the maximum length of a filename in the directory @code{path} or 1737 @code{filedes}. The process is allowed to create. The corresponding macro 1738 is @code{_POSIX_NAME_MAX}. 1739 1740 @item _PC_PATH_MAX 1741 returns the maximum length of a relative pathname when @code{path} or 1742 @code{filedes} is the current working directory. The corresponding macro 1743 is @code{_POSIX_PATH_MAX}. 1744 1745 @item _PC_PIPE_BUF 1746 returns the size of the pipe buffer, where @code{filedes} must refer to a 1747 pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro 1748 is @code{_POSIX_PIPE_BUF}. 1749 1750 @item _PC_CHOWN_RESTRICTED 1751 returns 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 1753 files in that directory. The corresponding macro is 1754 @code{_POSIX_CHOWN_RESTRICTED}. 1755 1756 @end table 1757 1758 @subheading NOTES: 1759 1760 Files 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 1772 int 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 1786 Invalid argument 1787 1788 @item EACCES 1789 Permission to write the file is denied 1790 @item ENAMETOOLONG 1791 1792 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC 1793 is in effect. 1794 1795 @item ENOENT 1796 A file or directory does not exist 1797 1798 @item ENOTDIR 1799 A component of the specified @code{path} was not a directory whan a 1800 directory was expected. 1801 1802 @end table 1803 1506 1804 1507 1805 @subheading DESCRIPTION: … … 1521 1819 returns the maximum length of a formatted input line, where @code{filedes} 1522 1820 or @code{path} must refer to a terminal. The corresponding macro is 1523 _POSIX_MAX_CANON.1821 @code{_POSIX_MAX_CANON}. 1524 1822 1525 1823 @item _PC_MAX_INPUT 1526 1824 returns the maximum length of an input line, where @code{filedes} or 1527 1825 @code{path} must refer to a terminal. The corresponding macro is 1528 _POSIX_MAX_INPUT.1826 @code{_POSIX_MAX_INPUT}. 1529 1827 1530 1828 @item _PC_NAME_MAX 1531 1829 returns the maximum length of a filename in the directory @code{path} or 1532 1830 @code{filedes}. The process is allowed to create. The corresponding macro 1533 is _POSIX_NAME_MAX.1831 is @code{_POSIX_NAME_MAX}. 1534 1832 1535 1833 @item _PC_PATH_MAX 1536 1834 returns the maximum length of a relative pathname when @code{path} or 1537 1835 @code{filedes} is the current working directory. The corresponding macro 1538 is _POSIX_PATH_MAX.1836 is @code{_POSIX_PATH_MAX}. 1539 1837 1540 1838 @item _PC_PIPE_BUF 1541 1839 returns the size of the pipe buffer, where @code{filedes} must refer to a 1542 1840 pipe 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. 1841 is @code{_POSIX_PIPE_BUF}. 1636 1842 1637 1843 @item _PC_CHOWN_RESTRICTED 1638 1844 returns nonzero if the @code{chown()} call may not be used on this file. If 1639 1845 @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 1846 files in that directory. The corresponding macro is 1847 @code{_POSIX_CHOWN_RESTRICTED}. 1848 1849 @end table 1850 1851 @subheading NOTES: 1852 1853 NONE 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 1867 long 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, 1881 errno is set appropriately). 1882 1883 @table @b 1884 @item ENAMETOOLONG 1885 @code{pathname} was too long. 1886 1887 @item ENOENT 1888 A directory component in @code{pathname} does not exist or is a dangling symbolic 1889 link. 1890 1891 @item ENOTDIR 1892 A component used in the directory @code{pathname} is not, in fact, a directory. 1893 1894 @item ENOMEM 1895 Insufficient 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 1902 link whose expansion contains a reference to itself. 1903 1904 @item ENOSPC 1905 The 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 1912 named 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 1916 It should be a combination (using bitwise OR) of one of the file types listed 1917 below and the permissions for the new node. 1918 1919 The permissions are modified by the process's @code{umask} in the usual way: the 1920 permissions of the created node are @code{(mode & ~umask)}. 1921 1922 The 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 1924 special file, block special file or FIFO (named pipe), respectively, or zero, which 1925 will create a normal file. 1926 1927 If the file type is @code{S_IFCHR} or @code{S_IFBLK} then @code{dev} specifies the major 1928 and minor numbers of the newly created device special file; otherwise it is ignored. 1929 1930 The newly created node will be owned by the effective uid of the process. If the 1931 directory containing the node has the set group id bit set, or if the filesystem 1932 is mounted with BSD group semantics, the new node will inherit the group ownership 1933 from its parent directory; otherwise it will be owned by the effective gid of the 1934 process. 1935 1936 1937 @subheading NOTES: 1938 1939 NONE
Note: See TracChangeset
for help on using the changeset viewer.