Changeset 8dd54b6 in rtems
- Timestamp:
- 09/30/98 20:21:45 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- f65b0903
- Parents:
- b931d05a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/new_chapters/confspace.t
rb931d05a r8dd54b6 86 86 @subheading STATUS CODES: 87 87 88 A successful call to @code{cfg_mount()} returns a value of zero 89 and an unsuccessful call returns the @code{errno}. 90 88 91 @table @b 89 92 @item EPERM … … 94 97 95 98 @item EEXIST 96 The file specified by the fileargument does not exist99 The file specified by the @code{file} argument does not exist 97 100 98 101 @item ENAMETOOLONG … … 105 108 106 109 @item ENOTDIR 107 A component of the filepath prefix is not a directory.110 A component of the @code{file} path prefix is not a directory. 108 111 109 112 @item EBUSY 110 The configuration space defined by fileis already mounted.113 The configuration space defined by @code{file} is already mounted. 111 114 112 115 @item EINVAL … … 158 161 @subheading STATUS CODES: 159 162 163 A successful call to @code{cfg_umount()} returns a value of zero 164 and an unsuccessful call returns the @code{errno}. 165 160 166 @table @b 161 167 @item EPERM … … 166 172 167 173 @item ENOENT 168 A component of cfgpathdoes not exist.174 A component of @code{cfgpath} does not exist. 169 175 170 176 @item ENAMETOOLONG … … 184 190 @item ELOOP 185 191 A node appears more than once in the path specified by the 186 @code{cfg _path} argument192 @code{cfgpath} argument 187 193 188 194 @item ELOOP … … 226 232 @subheading STATUS CODES: 227 233 234 A successful call to @code{cfg_mknod()} returns a value of zero 235 and an unsuccessful call returns the @code{errno}. 236 228 237 @table @b 229 238 @item ENAMETOOLONG … … 238 247 Search permission is denied for a component of the path prefix. 239 248 240 @item ELOOP241 Too many symbolic links were encountered in translating the242 pathname.243 249 244 250 @item EPERM … … 256 262 @item ELOOP 257 263 A node appears more than once in the path specified by the 258 @c doe{cfg_path} argument264 @code{cfg_path} argument 259 265 260 266 @item ELOOP 261 267 More than @code{SYMLOOP_MAX} symbolic links were encountered during 262 resolution of the cfgpathargument.268 resolution of the @code{cfgpath} argument. 263 269 264 270 @item EROFS … … 301 307 @subheading STATUS CODES: 302 308 309 A successful call to @code{cfg_get()} returns a value of zero 310 and an unsuccessful call returns the @code{errno}. 311 303 312 @table @b 304 313 @item ENAMETOOLONG … … 308 317 309 318 @item ENOENT 310 A component of cfgpathdoes not exist.319 A component of @code{cfgpath} does not exist. 311 320 312 321 @item EACCES … … 318 327 @item ELOOP 319 328 A node appears more than once in the path specified by the 320 cfg_pathargument329 @code{cfgpath} argument 321 330 322 331 @item ELOOP 323 332 More than @code{SYMLOOP_MAX} symbolic links were encountered during 324 resolution of the cfgpathargument.325 326 @end table 327 328 @subheading DESCRIPTION: 329 330 The @code{cfg_get } function stores the value attribute of the333 resolution of the @code{cfgpath} argument. 334 335 @end table 336 337 @subheading DESCRIPTION: 338 339 The @code{cfg_get()} function stores the value attribute of the 331 340 configuration node identified by @code{cfgpath}, into the buffer 332 341 described by the @code{value} pointer. … … 357 366 358 367 @subheading STATUS CODES: 368 369 A successful call to @code{cfg_set()} returns a value of zero 370 and an unsuccessful call returns the @code{errno}. 359 371 360 372 @table @b … … 365 377 366 378 @item ENOENT 367 A component of cfgpathdoes not exist379 A component of @code{cfgpath} does not exist 368 380 369 381 @item EACCES … … 375 387 @item ELOOP 376 388 A node appears more than once in the path specified by the 377 cfg-pathargument.389 @code{cfgpath} argument. 378 390 379 391 @item ELOOP … … 385 397 @subheading DESCRIPTION: 386 398 387 The @code{cfg_set } function stores the value specified by the399 The @code{cfg_set()} function stores the value specified by the 388 400 @code{value} argument in the configuration node defined by the 389 401 @code{cfgpath} argument. … … 414 426 415 427 @subheading STATUS CODES: 428 429 A successful call to @code{cfg_link()} returns a value of zero 430 and an unsuccessful call returns the @code{errno}. 416 431 417 432 @table @b … … 432 447 433 448 @item ENOENT 434 The node named by srcdoes not exist.449 The node named by @code{src} does not exist. 435 450 436 451 @item EEXIST 437 The node named by destdoes exist.452 The node named by @code{dest} does exist. 438 453 439 454 @item EPERM 440 455 The calling process does not have the appropriate privilege to 441 modify the node indicated by the srcargument.456 modify the node indicated by the @code{src} argument. 442 457 443 458 @item EXDEV 444 The link named by dest and the node named by srcare from different459 The link named by @code{dest} and the node named by @code{src} are from different 445 460 configuration spaces. 446 461 … … 458 473 configuration space. 459 474 460 @item ELOOP 461 A node appears more than once in the path specified by the 462 cfg-path argument. 463 464 @item ELOOP 465 More than @code{SYMLOOP_MAX} symbolic links were encountered during 466 resolution of the cfgpath argument. 467 468 @end table 469 470 @subheading DESCRIPTION: 471 472 The @code{src} and @code{dest}arguments point to pathnames which 473 name existing nodes. The @code{cfg_link} function atomically creates 475 @end table 476 477 @subheading DESCRIPTION: 478 479 The @code{src} and @code{dest} arguments point to pathnames which 480 name existing nodes. The @code{cfg_link()} function atomically creates 474 481 a link between specified nodes, and increment by one the link count 475 482 of the node specified by the @code{src} argument. 476 483 477 If the @code{cfg_link } function fails, no link is created, and the484 If the @code{cfg_link()} function fails, no link is created, and the 478 485 link count of the node remains unchanged by this function call. 479 486 480 This implementation may require that the calling process has permission481 to access the specified nodes.482 487 483 488 @subheading NOTES: … … 505 510 506 511 @subheading STATUS CODES: 512 513 A successful call to @code{cfg_unlink()} returns a value of zero 514 and an unsuccessful call returns the @code{errno}. 507 515 508 516 @table @b … … 511 519 or an entire path name exceed @code{PATH_MAX} characters. 512 520 513 @item ENOENT514 The named node does not exist.515 516 521 @item EACCES 517 522 Search permission is denied on the node containing the link to … … 523 528 524 529 @item ENOENT 525 A component of cfgpathdoes not exist.530 A component of @code{cfgpath} does not exist. 526 531 527 532 @item EPERM 528 533 The calling process does not have the appropriate privilege to 529 modify the node indicated by the path prefix of the cfgpath534 modify the node indicated by the path prefix of the @code{cfgpath} 530 535 argument. 531 536 … … 543 548 @item ELOOP 544 549 A node appears more than once in the path specified by the 545 cfg-pathargument.550 @code{cfgpath} argument. 546 551 547 552 @item ELOOP … … 553 558 @subheading DESCRIPTION: 554 559 555 The @code{cfg_unlink } function removes the link between the node560 The @code{cfg_unlink()} function removes the link between the node 556 561 specified by the @code{cfgpath} path prefix and the parent node 557 562 specified by @code{cfgpath}, and decrements the link count … … 589 594 @subheading STATUS CODES: 590 595 596 A successful call to @code{cfg_open()} returns a value of zero 597 and an unsuccessful call returns the @code{errno}. 598 591 599 @table @b 592 600 @item EACCES … … 606 614 607 615 @item EINVAL 608 Either both or neither of CFG_LOGICAL and CFG_PHYSICALare609 specified by the optionsargument616 Either both or neither of @code{CFG_LOGICAL} and @code{CFG_PHYSICAL} are 617 specified by the @code{options} argument 610 618 611 619 @item ENOMEM … … 614 622 @item ELOOP 615 623 More than @code{SYMLOOP_MAX} symbolic links were encountered during 616 resolution of the pathnamesargument.624 resolution of the @code{pathnames} argument. 617 625 618 626 @item ENAMETOOLONG 619 627 As a result of encountering a symbolic link in resolution of the 620 pathname specified by the pathnamesargument, the length of628 pathname specified by the @code{pathnames} argument, the length of 621 629 the substituted pathname string exceeded @code{PATH_MAX}. 622 630 … … 625 633 @subheading DESCRIPTION: 626 634 627 The @code{cfg_open } function opens a configuration traversal stream635 The @code{cfg_open()} function opens a configuration traversal stream 628 636 rooted in the configuration nodes name by the @code{pathnames} argument. 629 637 It stores a pointer to a CFG object that represents that stream at … … 670 678 pre-order return, followed by the return of structures 671 679 referencing all its descendants, followed by a post-order 672 return, shall bedone.680 return, is done. 673 681 674 682 @item CFG_XDEV … … 680 688 @end table 681 689 682 The @code{cfg_open } argument @code{compar} is either a NULL or point690 The @code{cfg_open()} argument @code{compar} is either a NULL or point 683 691 to a function that is called with two pointers to pointers to CFGENT 684 692 structures that returns less than, equal to , or greater than zero if … … 692 700 directories encountered during the traversal are returned, and the order 693 701 of traversal when more than one node is specified in the @code{pathnames} 694 argument to @code{cfg_open }. If a comparison routine is specified, the702 argument to @code{cfg_open()}. If a comparison routine is specified, the 695 703 order of traversal is from the least to the greatest. If the @code{compar} 696 argument is NULL, the order of traversal shall be as listed in the704 argument is NULL, the order of traversal shall is listed in the 697 705 @code{pathnames} argument. 698 706 … … 723 731 @subheading STATUS CODES: 724 732 733 A successful call to @code{cfg_read()} returns a value of zero 734 and an unsuccessful call returns the @code{errno}. 735 725 736 @table @b 726 737 @item EACCES … … 728 739 729 740 @item EBADF 730 The cfgpargument does not refer to an open configuration741 The @code{cfgp} argument does not refer to an open configuration 731 742 space. 732 743 … … 736 747 737 748 @item ENOENT 738 A named nodedoes not exist.749 A named @code{node} does not exist. 739 750 740 751 @item ENOMEM … … 754 765 @subheading DESCRIPTION: 755 766 756 The @code{cfg_read } function returns a pointer to a CFGENT structure767 The @code{cfg_read()} function returns a pointer to a CFGENT structure 757 768 representing a node in the configuration space to which @code{cfgp} 758 769 refers. The returned pointer is stored at the location indicated … … 760 771 761 772 The child nodes of each node in the configuration tree is returned 762 by @code{cfg_read }. If a comparison routine is specified to the763 @code{cfg_open } function, the order of return of the child nodes is764 as specified by the routine, from least to greatest. Otherwise765 the order of return is unspecified.773 by @code{cfg_read()}. If a comparison routine was specified to the 774 @code{cfg_open()} function, the order of return of the child nodes is 775 as specified by the @code{compar} routine, from least to greatest. 776 Otherwise, the order of return is unspecified. 766 777 767 778 Structures referencing nodes with children is returned by the 768 function @code{cfg_read } at least twice [unless the application769 specifies otherwise with @code{cfg_mark }]-once immediately before779 function @code{cfg_read()} at least twice [unless the application 780 specifies otherwise with @code{cfg_mark()}]-once immediately before 770 781 the structures representing their descendants, are returned 771 782 (pre-order), and once immediately after structures representing all … … 783 794 @item cfg_parent 784 795 A pointer to the structure returned by the 785 @code{cfg_read } function for the node that contains796 @code{cfg_read()} function for the node that contains 786 797 the entry for the current node. A @code{cfg_parent} 787 798 structure is provided for the node(s) specified by 788 the @code{pathnames} argument to the @code{cfg_open }799 the @code{pathnames} argument to the @code{cfg_open()} 789 800 function, but the contents of other than its 790 801 @code{cfg_number}, @code{cfg_pointer}, @code{cfg_parent}, … … 793 804 794 805 @item cfg_link 795 Upon return from the @code{cfg_children } function, the806 Upon return from the @code{cfg_children()} function, the 796 807 @code{cfg_link} field points to the next CFGENT structure 797 808 in a NULL-terminated linked list of CFGENT structures. … … 800 811 801 812 @item cfg_cycle 802 If the structure being returned by @code{cfg_read }813 If the structure being returned by @code{cfg_read()} 803 814 represents a node that appears in the @code{cfg_parent} 804 815 linked list tree, the @code{cfg_cycle} field shall point … … 810 821 The @code{cfg_number} field is provided for use by the 811 822 application program. It is initialized to zero for 812 each new node returned by the @code{cfg_read } function,823 each new node returned by the @code{cfg_read()} function, 813 824 but is not further modified by the configuration space 814 825 routines. … … 817 828 The @code{cfg_pointer} field is provided for use by the 818 829 application program. It is initialized to NULL for 819 each new node returned by the @code{cfg_read } function,830 each new node returned by the @code{cfg_read()} function, 820 831 but is not further modified by the configuration 821 832 space routines. … … 823 834 @item cfg_path 824 835 A pathname for the node including and relative to the 825 argument supplied to the @code{cfg_open } routine for this836 argument supplied to the @code{cfg_open()} routine for this 826 837 configuration space. This pathname may be longer than 827 838 @code{PATH_MAX} bytes. This pathname is NULL-terminated. … … 832 843 @item cfg_pathlen 833 844 The length of the string pointed at by the @code{cfg_path} 834 field when returned by @code{cfg_read }.845 field when returned by @code{cfg_read()}. 835 846 836 847 @item cfg_namelen … … 842 853 The @code{cfg_level} field of the @code{cfg_parent} 843 854 structure for each of the node(s) specified in the 844 @code{pathnames} argument to the @code{cfg_open } function855 @code{pathnames} argument to the @code{cfg_open()} function 845 856 is set to 0, and this number is incremented for each 846 857 node level descendant. … … 859 870 @item CFG_DC 860 871 The structure represents a node that is a parent 861 of the node most recently returned by @code{cfg_read }.872 of the node most recently returned by @code{cfg_read()}. 862 873 The @code{cfg_cycle} field references the structure 863 874 previously returned by @code{cfg_read} that is the … … 898 909 @end table 899 910 900 Structures returned by @code{cfg_read } with a @code{cfg_info} field equal911 Structures returned by @code{cfg_read()} with a @code{cfg_info} field equal 901 912 to CFG_D is accessible until a subsequent call, on the same 902 configuration traversal stream, to @code{cfg_close }, or to @code{cfg_read}913 configuration traversal stream, to @code{cfg_close()}, or to @code{cfg_read()} 903 914 after they have been returned by the @code{cfg_read} function in 904 post-order. Structures returned by @code{cfg_read } with an915 post-order. Structures returned by @code{cfg_read()} with an 905 916 @code{cfg_info} field not equal to CFG_D is accessible until a subsequent 906 call, on the same configuration traversal stream, to @code{cfg_close }907 or @code{cfg_read }.917 call, on the same configuration traversal stream, to @code{cfg_close()} 918 or @code{cfg_read()}. 908 919 909 920 The content of the @code{cfg_path} field is specified only for the 910 structure most recently returned by @code{cfg_read }.921 structure most recently returned by @code{cfg_read()}. 911 922 912 923 The specified fields in structures in the list representing nodes for 913 which structures have previously been returned by @code{cfg_children },914 is identical to those returned by @code{cfg_children }, except that924 which structures have previously been returned by @code{cfg_children()}, 925 is identical to those returned by @code{cfg_children()}, except that 915 926 the contents of the @code{cfg_path} and @code{cfg_pathlen} fields are 916 927 unspecified. … … 943 954 @subheading STATUS CODES: 944 955 956 A successful call to @code{cfg_children()} returns a value of zero 957 and an unsuccessful call returns the @code{errno}. 958 945 959 @table @b 946 960 @item EACCES … … 948 962 949 963 @item EBADF 950 The cfgpargument does not refer to an open configuration space.964 The @code{cfgp} argument does not refer to an open configuration space. 951 965 952 966 @item ELOOP … … 960 974 961 975 @item EINVAL 962 The specified value of the optionsargument is invalid.976 The specified value of the @code{options} argument is invalid. 963 977 964 978 @item ENOENT … … 972 986 @subheading DESCRIPTION: 973 987 974 The first @code{cfg_children } call after a @code{cfg_read} returns988 The first @code{cfg_children()} call after a @code{cfg_read()} returns 975 989 information about the first node without children under the node 976 returned by @code{cfg_read }. Subsequent calls to @code{cfg_children}977 without the intervening @code{cfg_read } shall return information990 returned by @code{cfg_read()}. Subsequent calls to @code{cfg_children()} 991 without the intervening @code{cfg_read()} shall return information 978 992 about the remaining nodes without children under that same node. 979 993 980 If @code{cfg_read } has not yet been called for the configuration981 traversal stream represented by @code{cfgp}, @code{cfg_children }994 If @code{cfg_read()} has not yet been called for the configuration 995 traversal stream represented by @code{cfgp}, @code{cfg_children()} 982 996 returns a pointer to the first entry in a list of the nodes 983 represented by the @code{pathnames} argument to @code{cfg_open }.997 represented by the @code{pathnames} argument to @code{cfg_open()}. 984 998 985 999 In either case, the list is NULL-terminated, ordered by the 986 1000 user-specified comparison function, if any, and linked through the 987 cfg_linkfield.1001 @code{cfg_link} field. 988 1002 989 1003 @subheading NOTES: … … 1014 1028 @subheading STATUS CODES: 1015 1029 1030 A successful call to @code{cfg_mark()} returns a value of zero 1031 and an unsuccessful call returns the @code{errno}. 1032 1016 1033 @table @b 1017 1034 @item EINVAL 1018 The specified combination of the cfgp and farguments is not1035 The specified combination of the @code{cfgp} and @code{f} arguments is not 1019 1036 supported by the implementation. 1020 1037 1021 1038 @item EINVAL 1022 The specified value of the optionsargument is invalid.1023 1024 @end table 1025 1026 @subheading DESCRIPTION: 1027 1028 The @code{cfg_mark } function modifies the subsequent behavior of1029 the cfgfunctions with regard to the node referenced by the structure1039 The specified value of the @code{options} argument is invalid. 1040 1041 @end table 1042 1043 @subheading DESCRIPTION: 1044 1045 The @code{cfg_mark()} function modifies the subsequent behavior of 1046 the @code{cfg} functions with regard to the node referenced by the structure 1030 1047 pointed to by the argument @code{f} or the configuration space referenced 1031 1048 by the structure pointed to by the argument @code{cfgp}. … … 1041 1058 If the @code{cfgp} argument is non-NULL, or the @code{f} 1042 1059 argument is NULL, or the structure referenced by @code{f} 1043 is not the one most recently returned by @code{cfg_read },1044 @code{cfg_mark } returns an error. Otherwise, the next1045 call to the @code{cfg_read } function returns the structure1060 is not the one most recently returned by @code{cfg_read()}, 1061 @code{cfg_mark()} returns an error. Otherwise, the next 1062 call to the @code{cfg_read()} function returns the structure 1046 1063 referenced by @code{f} with the @code{cfg_info} field 1047 1064 reinitialized. Subsequent behavior of the @code{cfg} … … 1054 1071 is not one of those specified as accessible, or the structure 1055 1072 referenced by @code{f} is not for a node of type pre-order 1056 node, @code{cfg_mark } returns an error. Otherwise, no1073 node, @code{cfg_mark()} returns an error. Otherwise, no 1057 1074 more structures for the node referenced by @code{f} or its 1058 descendants are returned by the @code{cfg_read } function.1075 descendants are returned by the @code{cfg_read()} function. 1059 1076 1060 1077 @item CFG_FOLLOW … … 1063 1080 is not one of those specified as accessible, or the structure 1064 1081 referenced by @code{f} is not for a node of type symbolic link, 1065 @code{cfg_mark } returns an error. Otherwise, the next1066 call to the @code{cfg_read } function returns the structure1082 @code{cfg_mark()} returns an error. Otherwise, the next 1083 call to the @code{cfg_read()} function returns the structure 1067 1084 referenced by @code{f} with the @code{cfg_info} field reset 1068 1085 to reflect the target of the symbolic link instead of the … … 1075 1092 1076 1093 If the target of the symbolic link does not exist, the fields 1077 of the structure by @code{cfg_read } shall be unmodified, except1094 of the structure by @code{cfg_read()} shall be unmodified, except 1078 1095 that the @code{cfg_info} field shall be reset to @code{CFG_SLNONE}. 1079 1096 … … 1103 1120 @subheading STATUS CODES: 1104 1121 1122 A successful call to @code{cfg_close()} returns a value of zero 1123 and an unsuccessful call returns the @code{errno}. 1124 1105 1125 @table @b 1106 1126 @item EBADF 1107 The cfgpargument does not refer to an open configuration space1127 The @code{cfgp} argument does not refer to an open configuration space 1108 1128 traversal stream. 1109 1129 … … 1112 1132 @subheading DESCRIPTION: 1113 1133 1114 The @code{cfg_close } function closes a configuration space transversal1134 The @code{cfg_close()} function closes a configuration space transversal 1115 1135 stream represented by the CFG structure pointed at by the @code{cfgp} 1116 1136 argument. All system resources allocated for this configuration space … … 1152 1172 @subheading DESCRIPTION: 1153 1173 1154 The @code{cfg_readdir } function returns a pointer to a structure @code{dirent}1174 The @code{cfg_readdir()} function returns a pointer to a structure @code{dirent} 1155 1175 representing the next directory entry from the directory stream pointed to 1156 1176 by @code{dirp}. On end-of-file, NULL is returned. 1157 1177 1158 The @code{cfg_readdir } function may (or may not) return entries for . or .. Your1178 The @code{cfg_readdir()} function may (or may not) return entries for . or .. Your 1159 1179 program should tolerate reading dot and dot-dot but not require them. 1160 1180 1161 The data pointed to be @code{cfg_readdir } may be overwritten by another call to1162 @code{readdir } for the same directory stream. It will not be overwritten by1181 The data pointed to be @code{cfg_readdir()} may be overwritten by another call to 1182 @code{readdir()} for the same directory stream. It will not be overwritten by 1163 1183 a call for another directory. 1164 1184 1165 1185 @subheading NOTES: 1166 1186 1167 If ptr is not a pointer returned by @code{malloc}, @code{calloc}, or1168 @code{realloc } or has been deallocated with @code{free} or @code{realloc},1187 If @code{ptr} is not a pointer returned by @code{malloc()}, @code{calloc()}, or 1188 @code{realloc()} or has been deallocated with @code{free()} or @code{realloc()}, 1169 1189 the results are not portable and are probably disastrous. 1170 1190 1171 @page 1172 @subsection open - Opens a file 1191 This function is not defined in the POSIX specification. It is an extension 1192 provided by this implementation. 1193 1194 @page 1195 @subsection cfg_umask - Sets a file creation mask. 1173 1196 1174 1197 @subheading CALLING SEQUENCE: … … 1178 1201 #include <sys/types.h> 1179 1202 #include <sys/stat.h> 1180 #include <fcntl.h>1181 1182 int open(1183 const char *path,1184 int oflag,1185 mode_t mode1186 );1187 @end example1188 @end ifset1189 1190 @ifset is-Ada1191 @end ifset1192 1193 @subheading STATUS CODES:1194 1195 @table @b1196 @item EACCES1197 Search permission is denied for a directory in a file's path prefix1198 @item EEXIST1199 The named file already exists.1200 @item EINTR1201 Function was interrupted by a signal.1202 @item EISDIR1203 Attempt to open a directory for writing or to rename a file to be a1204 directory.1205 @item EMFILE1206 Too many file descriptors are in use by this process.1207 @item ENAMETOOLONG1208 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in1209 effect.1210 @item ENFILE1211 Too many files are currently open in the system.1212 @item ENOENT1213 A file or directory does not exist.1214 @item ENOSPC1215 No space left on disk.1216 @item ENOTDIR1217 A component of the specified pathname was not a directory when a directory1218 was expected.1219 @item ENXIO1220 No such device. This error may also occur when a device is not ready, for1221 example, a tape drive is off-line.1222 @item EROFS1223 Read-only file system.1224 @end table1225 1226 @subheading DESCRIPTION:1227 1228 The @code{open} function establishes a connection between a file and a file1229 descriptor. The file descriptor is a small integer that is used by I/O1230 functions to reference the file. The @code{path} argument points to the1231 pathname for the file.1232 1233 The @code{oflag} argument is the bitwise inclusive OR of the values of1234 symbolic constants. The programmer must specify exactly one of the following1235 three symbols:1236 1237 @table @b1238 @item O_RDONLY1239 Open for reading only.1240 1241 @item O_WRONLY1242 Open for writing only.1243 1244 @item O_RDWR1245 Open for reading and writing.1246 1247 @end table1248 1249 Any combination of the following symbols may also be used.1250 1251 @table @b1252 @item O_APPEND1253 Set the file offset to the end-of-file prior to each write.1254 1255 @item O_CREAT1256 If the file does not exist, allow it to be created. This flag indicates1257 that the @code{mode} argument is present in the call to @code{open}.1258 1259 @item O_EXCL1260 This flag may be used only if O_CREAT is also set. It causes the call1261 to @code{open} to fail if the file already exists.1262 1263 @item O_NOCTTY1264 If @code{path} identifies a terminal, this flag prevents that teminal from1265 becoming the controlling terminal for thi9s process. See Chapter 8 for a1266 description of terminal I/O.1267 1268 @item O_NONBLOCK1269 Do no wait for the device or file to be ready or available. After the file1270 is open, the @code{read} and @code{write} calls return immediately. If the1271 process would be delayed in the read or write opermation, -1 is returned and1272 @code{errno} is set to @code{EAGAIN} instead of blocking the caller.1273 1274 @item O_TRUNC1275 This flag should be used only on ordinary files opened for writing. It1276 causes the file to be tuncated to zero length..1277 1278 @end table1279 1280 Upon successful completion, @code{open} returns a non-negative file1281 descriptor.1282 1283 @subheading NOTES:1284 1285 @page1286 @subsection cfg_umask - Sets a file creation mask.1287 1288 @subheading CALLING SEQUENCE:1289 1290 @ifset is-C1291 @example1292 #include <sys/types.h>1293 #include <sys/stat.h>1294 1203 1295 1204 mode_t cfg_umask( … … 1306 1215 @subheading DESCRIPTION: 1307 1216 1308 The @code{cfg_umask } function sets the process file creation mask to @code{cmask}.1309 The file creation mask is used during @code{open }, @code{creat}, @code{mkdir},1310 @code{mkfifo } calls to turn off permission bits in the @code{mode} argument.1217 The @code{cfg_umask()} function sets the process node creation mask to @code{cmask}. 1218 The file creation mask is used during @code{open()}, @code{creat()}, @code{mkdir()}, 1219 @code{mkfifo()} calls to turn off permission bits in the @code{mode} argument. 1311 1220 Bit positions that are set in @code{cmask} are cleared in the mode of the 1312 1221 created file. 1313 1222 1314 The file creation mask is inherited across @code{fork } and @code{exec} calls.1223 The file creation mask is inherited across @code{fork()} and @code{exec()} calls. 1315 1224 This makes it possible to alter the default permission bits of created files. 1316 1225 1317 @subheading NOTES: 1226 @subheading NOTES: None 1318 1227 1319 1228 The @code{cmask} argument should have only permission bits set. All other 1320 1229 bits should be zero. 1321 1322 @page1323 @subsection link - Creates a link to a file1324 1325 @subheading CALLING SEQUENCE:1326 1327 @ifset is-C1328 @example1329 #include <unistd.h>1330 1331 int link(1332 const char *existing,1333 const char *new1334 );1335 @end example1336 @end ifset1337 1338 @ifset is-Ada1339 @end ifset1340 1341 @subheading STATUS CODES:1342 1343 @table @b1344 @item EACCES1345 Search permission is denied for a directory in a file's path prefix1346 @item EEXIST1347 The named file already exists.1348 @item EMLINK1349 The number of links would exceed @code{LINK_MAX}.1350 @item ENAMETOOLONG1351 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in1352 effect.1353 @item ENOENT1354 A file or directory does not exist.1355 @item ENOSPC1356 No space left on disk.1357 @item ENOTDIR1358 A component of the specified pathname was not a directory when a directory1359 was expected.1360 @item EPERM1361 Operation is not permitted. Process does not have the appropriate priviledges1362 or permissions to perform the requested operations.1363 @item EROFS1364 Read-only file system.1365 @item EXDEV1366 Attempt to link a file to another file system.1367 1368 @end table1369 1370 @subheading DESCRIPTION:1371 1372 The @code{link} function atomically creates a new link for an existing file1373 and increments the link count for the file.1374 1375 If the @code{link} function fails, no directories are modified.1376 1377 The @code{existing} argument should not be a directory.1378 1379 The callder may (or may not) need permission to access the existing file.1380 1381 @subheading NOTES:1382 1383 @page1384 @subsection unlink - Removes a directory entry1385 1386 @subheading CALLING SEQUENCE:1387 1388 @ifset is-C1389 @example1390 #include <unistd.h>1391 1392 int unlink(1393 const char path1394 );1395 @end example1396 @end ifset1397 1398 @ifset is-Ada1399 @end ifset1400 1401 @subheading STATUS CODES:1402 1403 @table @b1404 @item EACCES1405 Search permission is denied for a directory in a file's path prefix1406 @item EBUSY1407 The directory is in use.1408 @item ENAMETOOLONG1409 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in1410 effect.1411 @item ENOENT1412 A file or directory does not exist.1413 @item ENOTDIR1414 A component of the specified pathname was not a directory when a directory1415 was expected.1416 @item EPERM1417 Operation is not permitted. Process does not have the appropriate priviledges1418 or permissions to perform the requested operations.1419 @item EROFS1420 Read-only file system.1421 1422 @end table1423 1424 @subheading DESCRIPTION:1425 1426 The @code{unlink} function removes the link named by @{code} and decrements the1427 link count of the file referenced by the link. When the link count goes to zero1428 and no process has the file open, the space occupied by the file is freed and the1429 file is no longer accessible.1430 1431 @subheading NOTES:1432 1433 @page1434 @subsection cfg_mkdir - Makes a directory1435 1436 @subheading CALLING SEQUENCE:1437 1438 @ifset is-C1439 @example1440 #include <sys/types.h>1441 #include <sys/stat.h>1442 1443 int cfg_mkdir(1444 const char *path,1445 mode_t mode1446 );1447 @end example1448 @end ifset1449 1450 @ifset is-Ada1451 @end ifset1452 1453 @subheading STATUS CODES:1454 1455 @table @b1456 @item EACCES1457 Search permission is denied for a directory in a file's path prefix1458 @item EEXIST1459 The name file already exist.1460 @item EMLINK1461 The number of links would exceed LINK_MAX1462 @item ENAMETOOLONG1463 Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is in1464 effect.1465 @item ENOENT1466 A file or directory does not exist.1467 @item ENOSPC1468 No space left on disk.1469 @item ENOTDIR1470 A component of the specified pathname was not a directory when a directory1471 was expected.1472 @item EROFS1473 Read-only file system.1474 1475 @end table1476 1477 @subheading DESCRIPTION:1478 1479 The @code{cfg_mkdir} function creates a new diectory named @code{path}. The1480 permission bits (modified by the file creation mask) are set from @code{mode}.1481 The owner and group IDs for the directory are set from the effective user ID1482 and group ID.1483 1484 The new directory may (or may not) contain entries for. and .. but is otherwise1485 empty.1486 1487 @subheading NOTES:1488 1230 1489 1231 @page … … 1508 1250 1509 1251 @subheading STATUS CODES: 1252 1253 A successful call to @code{cfg_chmod()} returns a value of zero 1254 and an unsuccessful call returns the @code{errno}. 1510 1255 1511 1256 @table @b … … 1532 1277 Set the file permission bits, the set user ID bit, and the set group ID bit 1533 1278 for the file named by @code{path} to @code{mode}. If the effective user ID 1534 does not match the owner of the file and the calling process does not have1535 the appropriate privileges, @code{cfg_chmod } returns -1 and sets @code{errno} to1279 does not match the owner of the node and the calling process does not have 1280 the appropriate privileges, @code{cfg_chmod()} returns -1 and sets @code{errno} to 1536 1281 @code{EPERM}. 1537 1282 … … 1560 1305 1561 1306 @subheading STATUS CODES: 1307 1308 A successful call to @code{cfg_chown()} returns a value of zero 1309 and an unsuccessful call returns the @code{errno}. 1562 1310 1563 1311 @table @b … … 1592 1340 Some systems consider it a security violation to allow the owner of a file to 1593 1341 be changed, If users are billed for disk space usage, loaning a file to 1594 another user could result in incorrect billing. The @code{cfg_chown } function1342 another user could result in incorrect billing. The @code{cfg_chown()} function 1595 1343 may be restricted to privileged users for some or all files. The group ID can 1596 1344 still be changed to one of the supplementary group IDs.
Note: See TracChangeset
for help on using the changeset viewer.