Changeset 389c3e9 in rtems


Ignore:
Timestamp:
Sep 26, 1998, 7:33:58 PM (21 years ago)
Author:
Wade A Smith <warm38@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
e21f7d8
Parents:
64183e20
Message:

Documented the following routines in this file: rewinddir, pathconf,
fpathconf, fchmod, fstat, mkfifo, and telldir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/new_chapters/files.t

    r64183e20 r389c3e9  
    1919@item @code{readdir} - Reads a directory
    2020@item @code{readdir_r} -
    21 @item @code{rewinddir} -
     21@item @code{rewinddir} - Resets the @code{readdir()} pointer
    2222@item @code{scandir} - Scan a directory for matching entries
    23 @item @code{telldir} -
    24 @item @code{closedir} -
    25 @item @code{getdents}
     23@item @code{telldir} - Return current location in directory stream
     24@item @code{closedir} - Ends directory read operation
     25@item @code{getdents} - Get directory entries
    2626@item @code{chdir} - Changes the current working directory
    2727@item @code{getcwd} - Gets current working directory
     
    3131@item @code{link} - Creates a link to a file
    3232@item @code{mkdir} - Makes a directory
    33 @item @code{mkfifo} -
     33@item @code{mkfifo} - Makes a FIFO special file
    3434@item @code{unlink} - Removes a directory entry
    3535@item @code{rmdir} - Delete a directory
    3636@item @code{rename} - Renames a file
    3737@item @code{stat} - Gets information about a file.
    38 @item @code{fstat} -
     38@item @code{fstat} - Gets file status
    3939@item @code{access} - Check user's permissions for a file.
    4040@item @code{chmod} - Changes file mode
    41 @item @code{fchmod} -
     41@item @code{fchmod} - Changes permissions of a file
    4242@item @code{chown} - Changes the owner and/ or group of a file
    4343@item @code{utime} - Change access and/or modification times of an inode
    4444@item @code{ftrunctate} -
    45 @item @code{pathconf} -
    46 @item @code{fpathconf} -
     45@item @code{pathconf} - Gets configuration values for files
     46@item @code{fpathconf} - Get configuration values for files
    4747@end itemize
    4848
     
    178178
    179179@page
    180 @subsection rewinddir -
    181 
    182 @subheading CALLING SEQUENCE:
    183 
    184 @ifset is-C
    185 @example
    186 int rewinddir(
    187 );
    188 @end example
    189 @end ifset
    190 
    191 @ifset is-Ada
    192 @end ifset
    193 
    194 @subheading STATUS CODES:
    195 
    196 @table @b
    197 @item E
    198 The
    199 
    200 @end table
    201 
    202 @subheading DESCRIPTION:
    203 
    204 @subheading NOTES:
     180@subsection rewinddir - Resets the @code{readdir()} pointer
     181
     182@subheading CALLING SEQUENCE:
     183
     184@ifset is-C
     185@example
     186#include <sys/types.h>
     187#include <dirent.h>
     188
     189void rewinddir(DIR *dirp
     190);
     191@end example
     192@end ifset
     193
     194@ifset is-Ada
     195@end ifset
     196
     197@subheading STATUS CODES: No value is returned.
     198
     199@subheading DESCRIPTION:
     200
     201The @code{rewinddir()} function resets the position associated with
     202the directory stream pointed to by @code{dirp}.  It also causes the
     203directory stream to refer to the current state of the directory.
     204
     205@subheading NOTES:
     206
     207If @code{dirp} is not a pointer by @code{opendir()}, the results are
     208undefined.
    205209
    206210The routine is implemented in Cygnus newlib.
     
    248252
    249253@page
    250 @subsection telldir -
    251 
    252 @subheading CALLING SEQUENCE:
    253 
    254 @ifset is-C
    255 @example
    256 int telldir(
    257 );
    258 @end example
    259 @end ifset
    260 
    261 @ifset is-Ada
    262 @end ifset
    263 
    264 @subheading STATUS CODES:
    265 
    266 @table @b
    267 @item E
    268 The
    269 
    270 @end table
    271 
    272 @subheading DESCRIPTION:
     254@subsection telldir - Return current location in directory stream
     255
     256@subheading CALLING SEQUENCE:
     257
     258@ifset is-C
     259@example
     260#include <dirent.h>
     261
     262off_t telldir( DIR *dir
     263);
     264@end example
     265@end ifset
     266
     267@ifset is-Ada
     268@end ifset
     269
     270@subheading STATUS CODES:
     271
     272@table @b
     273@item EBADF
     274Invalid directory stream descriptor @code{dir}.
     275
     276@end table
     277
     278@subheading DESCRIPTION:
     279
     280The @code{telldir()} function returns the current location associated with the
     281directory stream @code{dir}.
    273282
    274283@subheading NOTES:
     
    278287
    279288@page
    280 @subsection closedir -
    281 
    282 @subheading CALLING SEQUENCE:
    283 
    284 @ifset is-C
    285 @example
    286 int closedir(
    287 );
    288 @end example
    289 @end ifset
    290 
    291 @ifset is-Ada
    292 @end ifset
    293 
    294 @subheading STATUS CODES:
    295 
    296 @table @b
    297 @item E
    298 The
    299 
    300 @end table
    301 
    302 @subheading DESCRIPTION:
    303 
    304 @subheading NOTES:
     289@subsection closedir - Ends directory read operation
     290
     291@subheading CALLING SEQUENCE:
     292
     293@ifset is-C
     294@example
     295#include <sys/types.h>
     296#include <dirent.h>
     297
     298int closedir(DIR *dirp
     299);
     300@end example
     301@end ifset
     302
     303@ifset is-Ada
     304@end ifset
     305
     306@subheading STATUS CODES:
     307
     308@table @b
     309@item EBADF
     310Invalid file descriptor
     311
     312@end table
     313
     314@subheading DESCRIPTION:
     315
     316The directory stream associated with @code{dirp} is closed.
     317The value in @code{dirp} may not be usable after a call to
     318@code{closedir()}.
     319
     320@subheading NOTES:
     321
     322The argument to @code{closedir()} must be a pointer returned by
     323@code{opendir()}.  If it is not, the results are not portable and
     324most likely unpleasant.
    305325
    306326The routine is implemented in Cygnus newlib.
     
    740760
    741761@page
    742 @subsection mkfifo -
    743 
    744 @subheading CALLING SEQUENCE:
    745 
    746 @ifset is-C
    747 @example
    748 int mkfifo(
    749 );
    750 @end example
    751 @end ifset
    752 
    753 @ifset is-Ada
    754 @end ifset
    755 
    756 @subheading STATUS CODES:
    757 
    758 @table @b
    759 @item E
    760 The
    761 
    762 @end table
    763 
    764 @subheading DESCRIPTION:
    765 
    766 @subheading NOTES:
     762@subsection mkfifo - Makes a FIFO special file
     763
     764@subheading CALLING SEQUENCE:
     765
     766@ifset is-C
     767@example
     768#include <sys/types.h>
     769#include <sys/stat.h>
     770
     771
     772int mkfifo(const char *path,
     773           mode_t      mode
     774);
     775@end example
     776@end ifset
     777
     778@ifset is-Ada
     779@end ifset
     780
     781@subheading STATUS CODES:
     782
     783@table @b
     784@item EACCES
     785Search permission is denied for a directory in a file's path prefix
     786@item EEXIST
     787The named file already exists.
     788@item ENOENT
     789A file or directory does not exist.
     790@item ENOSPC
     791No space left on disk.
     792@item ENOTDIR
     793A component of the specified @code{path} was not a directory when a directory
     794was expected.
     795@item EROFS
     796Read-only file system.
     797
     798@end table
     799
     800@subheading DESCRIPTION:
     801
     802The @code{mkfifo()} function creates a new FIFO special file named @code{path}.
     803The permission bits (modified by the file creation mask) are set from
     804@code{mode}.  The owner and group IDs for the FIFO are set from the efective
     805user ID and group ID.
     806
     807@subheading NOTES: None
    767808
    768809@page
     
    797838A file or directory does not exist.
    798839@item ENOTDIR
    799 A component of the specified pathname was not a directory when a directory
     840A component of the specified @code{path} was not a directory when a directory
    800841was expected.
    801842@item EPERM
     
    10031044
    10041045@page
    1005 @subsection fstat -
    1006 
    1007 @subheading CALLING SEQUENCE:
    1008 
    1009 @ifset is-C
    1010 @example
    1011 int fstat(
    1012 );
    1013 @end example
    1014 @end ifset
    1015 
    1016 @ifset is-Ada
    1017 @end ifset
    1018 
    1019 @subheading STATUS CODES:
    1020 
    1021 @table @b
    1022 @item E
    1023 The
    1024 
    1025 @end table
    1026 
    1027 @subheading DESCRIPTION:
     1046@subsection fstat - Gets file status
     1047
     1048@subheading CALLING SEQUENCE:
     1049
     1050@ifset is-C
     1051@example
     1052#include <sys/types.h>
     1053#include <sys/stat.h>
     1054
     1055int fstat(int fildes,
     1056          struct stat *buf
     1057);
     1058@end example
     1059@end ifset
     1060
     1061@ifset is-Ada
     1062@end ifset
     1063
     1064@subheading STATUS CODES:
     1065
     1066@table @b
     1067@item EBADF
     1068Invalid file descriptor
     1069
     1070@end table
     1071
     1072@subheading DESCRIPTION:
     1073
     1074The @code{fstat()} function obtains information about the file
     1075associated with @code{fildes} and writes it to the area pointed
     1076to by the @code{buf} argument.
    10281077
    10291078@subheading NOTES:
     
    11331182
    11341183@page
    1135 @subsection fchmod -
    1136 
    1137 @subheading CALLING SEQUENCE:
    1138 
    1139 @ifset is-C
    1140 @example
    1141 int fchmod(
     1184@subsection fchmod - Changes permissions of a file
     1185
     1186@subheading CALLING SEQUENCE:
     1187
     1188@ifset is-C
     1189@example
     1190#include <sys/types.h>
     1191#include <sys/stat.h>
     1192
     1193int fchmod(int    fildes,
     1194           mote_t mode
     1195);
     1196@end example
     1197@end ifset
     1198
     1199@ifset is-Ada
     1200@end ifset
     1201
     1202@subheading STATUS CODES:
     1203
     1204@table @b
     1205@item EACCES
     1206Search permission is denied for a directory in a file's path prefix.
     1207@item EBADF
     1208The descriptor is not valid.
     1209@item EFAULT
     1210@code{Path} points outside your accessible address space.
     1211@item EIO
     1212A low-level I/o error occurred while modifying the inode.
     1213@item ELOOP
     1214@code{Path} contains a circular reference
     1215@item ENAMETOOLONG
     1216Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is
     1217in effect.
     1218@item ENOENT
     1219A file or directory does no exist.
     1220@item ENOMEM
     1221Insufficient kernel memory was avaliable.
     1222@item ENOTDIR
     1223A component of the specified pathname was not a directory when a
     1224directory was expected.
     1225@item EPERM
     1226The effective UID does not match the owner of the file, and is not
     1227zero
     1228@item EROFS
     1229Read-only file system
     1230@end table
     1231
     1232@subheading DESCRIPTION:
     1233
     1234The mode of the file given by @code{path} or referenced by
     1235@code{filedes} is changed.
     1236
     1237@subheading NOTES: None
     1238
     1239@page
     1240@subsection getdents - Get directory entries
     1241
     1242@subheading CALLING SEQUENCE:
     1243
     1244@ifset is-C
     1245@example
     1246#include <unistd.h>
     1247#include <linux/dirent.h>
     1248#include <linux/unistd.h>
     1249
     1250long getdents(int   dd_fd,
     1251              char *dd_buf,
     1252              int   dd_len
    11421253);
    11431254@end example
     
    12891400
    12901401@page
    1291 @subsection pathconf -
    1292 
    1293 @subheading CALLING SEQUENCE:
    1294 
    1295 @ifset is-C
    1296 @example
    1297 int pathconf(
    1298 );
    1299 @end example
    1300 @end ifset
    1301 
    1302 @ifset is-Ada
    1303 @end ifset
    1304 
    1305 @subheading STATUS CODES:
    1306 
    1307 @table @b
    1308 @item E
    1309 The
    1310 
    1311 @end table
    1312 
    1313 @subheading DESCRIPTION:
    1314 
    1315 @subheading NOTES:
    1316 
    1317 @page
    1318 @subsection fpathconf -
    1319 
    1320 @subheading CALLING SEQUENCE:
    1321 
    1322 @ifset is-C
    1323 @example
    1324 int fpathconf(
    1325 );
    1326 @end example
    1327 @end ifset
    1328 
    1329 @ifset is-Ada
    1330 @end ifset
    1331 
    1332 @subheading STATUS CODES:
    1333 
    1334 @table @b
    1335 @item E
    1336 The
    1337 
    1338 @end table
    1339 
    1340 @subheading DESCRIPTION:
    1341 
    1342 @subheading NOTES:
    1343 
     1402@subsection pathconf - Gets configuration values for files
     1403
     1404@subheading CALLING SEQUENCE:
     1405
     1406@ifset is-C
     1407@example
     1408#include <unistd.h>
     1409
     1410int pathconf(const char *path,
     1411             int         name
     1412);
     1413@end example
     1414@end ifset
     1415
     1416@ifset is-Ada
     1417@end ifset
     1418
     1419@subheading STATUS CODES:
     1420
     1421@table @b
     1422@item EINVAL
     1423Invalid argument
     1424@item EACCES
     1425Permission to write the file is denied
     1426@item ENAMETOOLONG
     1427Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
     1428is in effect.
     1429@item ENOENT
     1430A file or directory does not exist
     1431@item ENOTDIR
     1432A component of the specified @code{path} was not a directory whan a
     1433directory was expected.
     1434
     1435@end table
     1436
     1437@subheading DESCRIPTION:
     1438
     1439@code{pathconf()} gets a value for the configuration option @code{name}
     1440for the open file descriptor @code{filedes}.
     1441
     1442The possible values for name are:
     1443
     1444@table @b
     1445@item_PC_LINK_MAX
     1446returns the maximum number of links to the file.  If @code{filedes} or
     1447@code{path} refer to a directory, then the value applies to the whole
     1448directory.  The corresponding macro is _POSIX_LINK_MAX.
     1449
     1450@item_PC_MAX_CANON
     1451returns  the maximum length of a formatted input line, where @code{filedes}
     1452or @code{path} must refer to a terminal.  The corresponding macro is
     1453_POSIX_MAX_CANON.
     1454
     1455@item_PC_MAX_INPUT
     1456returns the maximum length of an input line, where @code{filedes} or
     1457@code{path} must refer to a terminal.  The corresponding macro is
     1458_POSIX_MAX_INPUT.
     1459
     1460@item_PC_NAME_MAX
     1461returns the maximum length of a filename in the directory @code{path} or
     1462@code{filedes}.  The process is allowed to create. The corresponding macro
     1463is _POSIX_NAME_MAX.
     1464
     1465@item_PC_PATH_MAX
     1466returns the maximum length of a relative pathname when @code{path} or
     1467@code{filedes} is the current working directory.  The corresponding macro
     1468is _POSIX_PATH_MAX.
     1469
     1470@item_PC_PIPE_BUF
     1471returns the size of the pipe buffer, where @code{filedes} must refer to a
     1472pipe or FIFO and @code{path} must refer to a FIFO.  The corresponding macro
     1473is _POSIX_PIPE_BUF.
     1474
     1475@item_PC_CHOWN_RESTRICTED
     1476returns nonzero if the chown(2) call may not be used on this file.  If
     1477@code{filedes} or @code{path} refer to a directory, then this applies to all
     1478files in that directory.  The corresponding macro is _POSIX_CHOWN_RESTRICTED.
     1479
     1480@end table
     1481
     1482@subheading NOTES:
     1483
     1484Files with name lengths longer than the value returned for @code{name} equal
     1485_PC_NAME_MAX may exist in the given directory.
     1486
     1487@page
     1488@subsection fpathconf - Gets configuration values for files
     1489
     1490@subheading CALLING SEQUENCE:
     1491
     1492@ifset is-C
     1493@example
     1494#include <unistd.h>
     1495
     1496int fpathconf(int filedes,
     1497              int name
     1498);
     1499@end example
     1500@end ifset
     1501
     1502@ifset is-Ada
     1503@end ifset
     1504
     1505@subheading STATUS CODES:
     1506
     1507@table @b
     1508@item EINVAL
     1509Invalid argument
     1510@item EACCES
     1511Permission to write the file is denied
     1512@item ENAMETOOLONG
     1513Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
     1514is in effect.
     1515@item ENOENT
     1516A file or directory does not exist
     1517@item ENOTDIR
     1518A component of the specified @code{path} was not a directory whan a
     1519directory was expected.
     1520@end table
     1521
     1522
     1523@subheading DESCRIPTION:
     1524
     1525@code{pathconf()} gets a value for the configuration option @code{name}
     1526for the open file descriptor @code{filedes}.
     1527
     1528The possible values for name are:
     1529
     1530@table @b
     1531@item_PC_LINK_MAX
     1532returns the maximum number of links to the file.  If @code{filedes} or
     1533@code{path} refer to a directory, then the value applies to the whole
     1534directory.  The corresponding macro is _POSIX_LINK_MAX.
     1535
     1536@item_PC_MAX_CANON
     1537returns  the maximum length of a formatted input line, where @code{filedes}
     1538or @code{path} must refer to a terminal.  The corresponding macro is
     1539_POSIX_MAX_CANON.
     1540
     1541@item_PC_MAX_INPUT
     1542returns the maximum length of an input line, where @code{filedes} or
     1543@code{path} must refer to a terminal.  The corresponding macro is
     1544_POSIX_MAX_INPUT.
     1545
     1546@item_PC_NAME_MAX
     1547returns the maximum length of a filename in the directory @code{path} or
     1548@code{filedes}.  The process is allowed to create. The corresponding macro
     1549is _POSIX_NAME_MAX.
     1550
     1551@item_PC_PATH_MAX
     1552returns the maximum length of a relative pathname when @code{path} or
     1553@code{filedes} is the current working directory.  The corresponding macro
     1554is _POSIX_PATH_MAX.
     1555
     1556@item_PC_PIPE_BUF
     1557returns the size of the pipe buffer, where @code{filedes} must refer to a
     1558pipe or FIFO and @code{path} must refer to a FIFO.  The corresponding macro
     1559is _POSIX_PIPE_BUF.
     1560
     1561@item_PC_CHOWN_RESTRICTED
     1562returns nonzero if the chown(2) call may not be used on this file.  If
     1563@code{filedes} or @code{path} refer to a directory, then this applies to all
     1564files in that directory.  The corresponding macro is _POSIX_CHOWN_RESTRICTED.
     1565
     1566@end table
     1567
     1568
     1569@subheading NOTES:
     1570
Note: See TracChangeset for help on using the changeset viewer.