Changeset 487c5d58 in rtems


Ignore:
Timestamp:
Sep 28, 1998, 10:08:41 PM (21 years ago)
Author:
Wade A Smith <warm38@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
0f58ab42
Parents:
cb646cb9
Message:

Documented the ftruncate and opendir routines. Removed reference to the
readdir_r routine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/new_chapters/files.t

    rcb646cb9 r487c5d58  
    1818@item @code{opendir} - Open a Directory
    1919@item @code{readdir} - Reads a directory
    20 @item @code{readdir_r} -
    2120@item @code{rewinddir} - Resets the @code{readdir()} pointer
    2221@item @code{scandir} - Scan a directory for matching entries
     
    4241@item @code{chown} - Changes the owner and/ or group of a file
    4342@item @code{utime} - Change access and/or modification times of an inode
    44 @item @code{ftrunctate} -
     43@item @code{ftruncate} - Truncate a file to a specified length
    4544@item @code{pathconf} - Gets configuration values for files
    4645@item @code{fpathconf} - Get configuration values for files
     
    8382Search permission was denied on a component of the path
    8483prefix of @code{dirname}, or read permission is denied
    85 for the directory itself.
    86 
    87 @item E
    88 The
     84
     85@item EMFILE
     86Too many file descriptors in use by process
     87
     88@item ENFILE
     89Too many files are currently open in the system.
     90
     91@item ENOENT
     92Directory does not exist, or @code{name} is an empty string.
     93
     94@item ENOMEM
     95Insufficient memory to complete the operation.
     96
     97@item ENOTDIR
     98@item{Name} is not a directory.
    8999
    90100@end table
     
    149159
    150160@page
    151 @subsection readdir_r -
    152 
    153 @subheading CALLING SEQUENCE:
    154 
    155 @ifset is-C
    156 @example
    157 int readdir_r(
    158 );
    159 @end example
    160 @end ifset
    161 
    162 @ifset is-Ada
    163 @end ifset
    164 
    165 @subheading STATUS CODES:
    166 
    167 @table @b
    168 @item E
    169 The
    170 
    171 @end table
    172 
    173 @subheading DESCRIPTION:
    174 
    175 @subheading NOTES:
    176 
    177 XXX must be implemented in RTEMS.
    178 
    179 @page
    180 @subsection rewinddir - Resets the @code{readdir()} pointer
     161@subsection rewinddir - Resets the readdir() pointer
    181162
    182163@subheading CALLING SEQUENCE:
     
    187168#include <dirent.h>
    188169
    189 void rewinddir(DIR *dirp
     170void rewinddir(
     171  DIR *dirp
    190172);
    191173@end example
     
    219201#include <dirent.h>
    220202
    221 int scandir(const char      *dir,
    222             struct direct ***namelist,
    223             int (*select)(const struct dirent *),
    224             int (*compar)(const struct dirent **, const struct dirent **)
     203int scandir(
     204  const char      *dir,
     205  struct direct ***namelist,
     206  int (*select)(const struct dirent *),
     207  int (*compar)(const struct dirent **, const struct dirent **)
    225208);
    226209@end example
     
    260243#include <dirent.h>
    261244
    262 off_t telldir( DIR *dir
     245off_t telldir(
     246  DIR *dir
    263247);
    264248@end example
     
    296280#include <dirent.h>
    297281
    298 int closedir(DIR *dirp
     282int closedir(
     283  DIR *dirp
    299284);
    300285@end example
     
    335320#include <unistd.h>
    336321
    337 int chdir( const char  *path
     322int chdir(
     323  const char  *path
    338324);
    339325@end example
     
    371357changed.
    372358
    373 @subheading NOTES: None
     359@subheading NOTES:
     360
     361None
    374362
    375363@page
     
    382370#include <unistd.h>
    383371
    384 int getcwd(
    385 );
     372int getcwd( void );
    386373@end example
    387374@end ifset
     
    548535#include <fcntl.h>
    549536
    550 int creat(const char *path,
    551           mode_t      mode
     537int creat(
     538  const char *path,
     539  mode_t      mode
    552540);
    553541@end example
     
    561549@table @b
    562550@item EEXIST
    563 @code{Path} already exists and O_CREAT and O_EXCL were used.
     551@code{path} already exists and O_CREAT and O_EXCL were used.
    564552@item EISDIR
    565 @code{Path} refers to a directory and the access requested involved
     553@code{path} refers to a directory and the access requested involved
    566554writing
    567555@item ETXTBSY
    568 @code{Path} refers to an executable image which is currently being
     556@code{path} refers to an executable image which is currently being
    569557executed and write access was requested
    570558@item EFAULT
    571 @code{Path} points outside your accessible address space
     559@code{path} points outside your accessible address space
    572560@item EACCES
    573561The requested access to the file is not allowed, or one of the
    574562directories in @code{path} did not allow search (execute) permission.
    575563@item ENAMETOOLONG
    576 @code{Path} was too long.
     564@code{path} was too long.
    577565@item ENOENT
    578566A directory component in @code{path} does not exist or is a dangling
     
    589577Insufficient kernel memory was available.
    590578@item EROFS
    591 @code{Path} refers to a file on a read-only filesystem and write access
     579@code{path} refers to a file on a read-only filesystem and write access
    592580was requested
    593581
     
    599587use in read, write, etc.
    600588
    601 @subheading NOTES: None
     589@subheading NOTES:
     590
     591None
    602592
    603593The routine is implemented in Cygnus newlib.
     
    632622created file.
    633623
    634 @subheading NOTES: None
     624@subheading NOTES:
     625
     626None
    635627
    636628The @code{cmask} argument should have only permission bits set.  All other
     
    701693The callder may (or may not) need permission to access the existing file.
    702694
    703 @subheading NOTES: None
     695@subheading NOTES:
     696
     697None
    704698
    705699@page
     
    757751empty.
    758752
    759 @subheading NOTES: None
     753@subheading NOTES:
     754
     755None
    760756
    761757@page
     
    770766
    771767
    772 int mkfifo(const char *path,
    773            mode_t      mode
     768int mkfifo(
     769  const char *path,
     770  mode_t      mode
    774771);
    775772@end example
     
    805802user ID and group ID.
    806803
    807 @subheading NOTES: None
     804@subheading NOTES:
     805
     806None
    808807
    809808@page
     
    855854file is no longer accessible.
    856855
    857 @subheading NOTES: None
     856@subheading NOTES:
     857
     858None
    858859
    859860@page
     
    866867#include <unistd.h>
    867868
    868 int rmdir(const char *pathname
     869int rmdir(
     870  const char *pathname
    869871);
    870872@end example
     
    881883of directories.
    882884@item EFAULT
    883 @cdoe{Pathname} points ouside your accessible address space.
     885@code{pathname} points ouside your accessible address space.
    884886@item EACCES
    885887Write access to the directory containing @code{pathname} was not
     
    891893be delected nor that of the director containing it.
    892894@item ENAMETOOLONG
    893 @code{Pathname} was too long.
     895@code{pathname} was too long.
    894896@item ENOENT
    895897A dirctory component in @code{pathname} does not exist or is a
    896898dangling sybolic link.
    897899@item ENOTDIR
    898 @code{Pathname}, or a component used as a directory in @code{pathname},
     900@code{pathname}, or a component used as a directory in @code{pathname},
    899901is not, in fact, a directory.
    900902@item ENOTEMPTY
    901 @code{Pathname} contains entries other than . and .. .
     903@code{pathname} contains entries other than . and .. .
    902904@item EBUSY
    903 @code{Pathname} is the current working directory or root directory of
     905@code{pathname} is the current working directory or root directory of
    904906some process
    905907@item EBUSY
    906 @code{Pathname} is the current directory or root directory of some
     908@code{pathname} is the current directory or root directory of some
    907909process.
    908910@item ENOMEM
    909911Insufficient kernel memory was available
    910912@item EROGS
    911 @code{Pathname} refers to a file on a read-only filesystem.
    912 @itemELOOP
    913 @code{Pathname} contains a reference to a circular symbolic link
     913@code{pathname} refers to a file on a read-only filesystem.
     914@item ELOOP
     915@code{pathname} contains a reference to a circular symbolic link
    914916
    915917@end table
     
    920922
    921923
    922 @subheading NOTES: None
     924@subheading NOTES:
     925
     926None
    923927
    924928@page
     
    931935#include <unistd.h>
    932936
    933 int rename(const char *old,
    934            const char *new
     937int rename(
     938  const char *old,
     939  const char *new
    935940);
    936941@end example
     
    10061011#include <sys/stat.h>
    10071012
    1008 int stat(const char  *path,
    1009          struct stat *buf
     1013int stat(
     1014  const char  *path,
     1015  struct stat *buf
    10101016);
    10111017@end example
     
    10411047@code{but}.
    10421048
    1043 @subheading NOTES: None
     1049@subheading NOTES:
     1050
     1051None
    10441052
    10451053@page
     
    10531061#include <sys/stat.h>
    10541062
    1055 int fstat(int fildes,
    1056           struct stat *buf
     1063int fstat(
     1064  int fildes,
     1065  struct stat *buf
    10571066);
    10581067@end example
     
    10871096#include <unistd.h>
    10881097
    1089 int access(const char *pathname,
    1090            int         mode
     1098int access(
     1099  const char *pathname,
     1100  int         mode
    10911101);
    10921102@end example
     
    11031113one of the directories in @code{pathname}.
    11041114@item EFAULT
    1105 @code{Pathname} points outside your accessible address space.
     1115@code{pathname} points outside your accessible address space.
    11061116@item EINVAL
    11071117@code{Mode} was incorrectly specified.
    11081118@item ENAMETOOLONG
    1109 @code{Pathname} is too long.
     1119@code{pathname} is too long.
    11101120@item ENOENT
    11111121A directory component in @code{pathname} would have been accessible but
     
    11281138@code{Mode} is a mask consisting of one or more of R_OK, W_OK, X_OK and F_OK.
    11291139
    1130 @subheading NOTES: None
     1140@subheading NOTES:
     1141
     1142None
    11311143
    11321144@page
     
    11911203#include <sys/stat.h>
    11921204
    1193 int fchmod(int    fildes,
    1194            mote_t mode
     1205int fchmod(
     1206  int    fildes,
     1207  mode_t mode
    11951208);
    11961209@end example
     
    12081221The descriptor is not valid.
    12091222@item EFAULT
    1210 @code{Path} points outside your accessible address space.
     1223@code{path} points outside your accessible address space.
    12111224@item EIO
    12121225A low-level I/o error occurred while modifying the inode.
    12131226@item ELOOP
    1214 @code{Path} contains a circular reference
     1227@code{path} contains a circular reference
    12151228@item ENAMETOOLONG
    12161229Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is
     
    12351248@code{filedes} is changed.
    12361249
    1237 @subheading NOTES: None
     1250@subheading NOTES:
     1251
     1252None
    12381253
    12391254@page
     
    12481263#include <linux/unistd.h>
    12491264
    1250 long getdents(int   dd_fd,
    1251               char *dd_buf,
    1252               int   dd_len
     1265long getdents(
     1266  int   dd_fd,
     1267  char *dd_buf,
     1268  int   dd_len
    12531269);
    12541270@end example
     
    13311347
    13321348This function may be restricted for some file.  The @code{pathconf} function
    1333 can be used to test the _PC_CHOWN_RESTRICTED flag.
     1349can be used to test the @code{_PC_CHOWN_RESTRICTED} flag.
    13341350
    13351351
     
    13441360#include <sys/types.h>
    13451361
    1346 int utime(const char     *filename,
    1347           struct utimbuf *buf
     1362int utime(
     1363  const char     *filename,
     1364  struct utimbuf *buf
    13481365);
    13491366@end example
     
    13701387access and modification times of the file are set to the current time. 
    13711388
    1372 @subheading NOTES:
    1373 
    1374 @page
    1375 @subsection ftrunctate -
    1376 
    1377 @subheading CALLING SEQUENCE:
    1378 
    1379 @ifset is-C
    1380 @example
     1389@subheading NOTES: None
     1390
     1391@page
     1392@subsection ftruncate - truncate a file to a specified length
     1393
     1394@subheading CALLING SEQUENCE:
     1395
     1396@ifset is-C
     1397@example
     1398#include <unistd.h>
     1399
    13811400int ftrunctate(
    1382 );
    1383 @end example
    1384 @end ifset
    1385 
    1386 @ifset is-Ada
    1387 @end ifset
    1388 
    1389 @subheading STATUS CODES:
    1390 
    1391 @table @b
    1392 @item E
    1393 The
    1394 
    1395 @end table
    1396 
    1397 @subheading DESCRIPTION:
    1398 
    1399 @subheading NOTES:
     1401  const char *path,
     1402  size_t      length
     1403);
     1404@end example
     1405@end ifset
     1406
     1407@ifset is-Ada
     1408@end ifset
     1409
     1410@subheading STATUS CODES:
     1411
     1412@table @b
     1413@item ENOTDIR
     1414A component of the path prefix is not a directory.
     1415
     1416@item EINVAL
     1417The pathname contains a character with the high-order bit set.
     1418
     1419@item ENAMETOOLONG
     1420A component of a pathname exceeded 255 characters, or an entire
     1421path name exceeded 1023 characters.
     1422
     1423@item ENOENT
     1424The named file does not exist.
     1425
     1426@item EACCES
     1427The named file is not writable by the user.
     1428
     1429@item EACCES
     1430Search permission is denied for a component of the path prefix.
     1431
     1432@item ELOOP
     1433Too many symbolic links were encountered in translating the
     1434pathname
     1435
     1436@item EISDIR
     1437The named file is a directory.
     1438
     1439@item EROFS
     1440The named file resides on a read-only file system
     1441
     1442@item ETXTBSY
     1443The file is a pure procedure (shared text) file that is being
     1444executed
     1445
     1446@item EIO
     1447An I/O error occurred updating the inode.
     1448
     1449@item EFAULT
     1450@code{Path} points outside the process's allocated address space.
     1451
     1452@item EBADF
     1453The @code{fd} is not a valid descriptor.
     1454
     1455@end table
     1456
     1457@subheading DESCRIPTION:
     1458
     14592code{Truncate} causes the file named by @code{path} or referenced by
     1460@code{fd} to be truncated to at most @code{length} bytes in size.  If the 
     1461file 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
    14001465
    14011466@page
     
    14081473#include <unistd.h>
    14091474
    1410 int pathconf(const char *path,
    1411              int         name
     1475int pathconf(
     1476  const char *path,
     1477  int         name
    14121478);
    14131479@end example
     
    14221488@item EINVAL
    14231489Invalid argument
     1490
    14241491@item EACCES
    14251492Permission to write the file is denied
     1493
    14261494@item ENAMETOOLONG
    14271495Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
    14281496is in effect.
     1497
    14291498@item ENOENT
    14301499A file or directory does not exist
     1500
    14311501@item ENOTDIR
    14321502A component of the specified @code{path} was not a directory whan a
     
    14431513
    14441514@table @b
    1445 @item_PC_LINK_MAX
     1515@item _PC_LINK_MAX
    14461516returns the maximum number of links to the file.  If @code{filedes} or
    14471517@code{path} refer to a directory, then the value applies to the whole
    14481518directory.  The corresponding macro is _POSIX_LINK_MAX.
    14491519
    1450 @item_PC_MAX_CANON
     1520@item _PC_MAX_CANON
    14511521returns  the maximum length of a formatted input line, where @code{filedes}
    14521522or @code{path} must refer to a terminal.  The corresponding macro is
    14531523_POSIX_MAX_CANON.
    14541524
    1455 @item_PC_MAX_INPUT
     1525@item _PC_MAX_INPUT
    14561526returns the maximum length of an input line, where @code{filedes} or
    14571527@code{path} must refer to a terminal.  The corresponding macro is
    14581528_POSIX_MAX_INPUT.
    14591529
    1460 @item_PC_NAME_MAX
     1530@item _PC_NAME_MAX
    14611531returns the maximum length of a filename in the directory @code{path} or
    14621532@code{filedes}.  The process is allowed to create. The corresponding macro
    14631533is _POSIX_NAME_MAX.
    14641534
    1465 @item_PC_PATH_MAX
     1535@item _PC_PATH_MAX
    14661536returns the maximum length of a relative pathname when @code{path} or
    14671537@code{filedes} is the current working directory.  The corresponding macro
    14681538is _POSIX_PATH_MAX.
    14691539
    1470 @item_PC_PIPE_BUF
     1540@item _PC_PIPE_BUF
    14711541returns the size of the pipe buffer, where @code{filedes} must refer to a
    14721542pipe or FIFO and @code{path} must refer to a FIFO.  The corresponding macro
    14731543is _POSIX_PIPE_BUF.
    14741544
    1475 @item_PC_CHOWN_RESTRICTED
     1545@item _PC_CHOWN_RESTRICTED
    14761546returns nonzero if the chown(2) call may not be used on this file.  If
    14771547@code{filedes} or @code{path} refer to a directory, then this applies to all
     
    14941564#include <unistd.h>
    14951565
    1496 int fpathconf(int filedes,
    1497               int name
     1566int fpathconf(
     1567  int filedes,
     1568  int name
    14981569);
    14991570@end example
     
    15081579@item EINVAL
    15091580Invalid argument
     1581
    15101582@item EACCES
    15111583Permission to write the file is denied
    15121584@item ENAMETOOLONG
     1585
    15131586Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
    15141587is in effect.
     1588
    15151589@item ENOENT
    15161590A file or directory does not exist
     1591
    15171592@item ENOTDIR
    15181593A component of the specified @code{path} was not a directory whan a
    15191594directory was expected.
     1595
    15201596@end table
    15211597
     
    15291605
    15301606@table @b
    1531 @item_PC_LINK_MAX
     1607@item _PC_LINK_MAX
    15321608returns the maximum number of links to the file.  If @code{filedes} or
    15331609@code{path} refer to a directory, then the value applies to the whole
    15341610directory.  The corresponding macro is _POSIX_LINK_MAX.
    15351611
    1536 @item_PC_MAX_CANON
     1612@item _PC_MAX_CANON
    15371613returns  the maximum length of a formatted input line, where @code{filedes}
    15381614or @code{path} must refer to a terminal.  The corresponding macro is
    15391615_POSIX_MAX_CANON.
    15401616
    1541 @item_PC_MAX_INPUT
     1617@item _PC_MAX_INPUT
    15421618returns the maximum length of an input line, where @code{filedes} or
    15431619@code{path} must refer to a terminal.  The corresponding macro is
    15441620_POSIX_MAX_INPUT.
    15451621
    1546 @item_PC_NAME_MAX
     1622@item _PC_NAME_MAX
    15471623returns the maximum length of a filename in the directory @code{path} or
    15481624@code{filedes}.  The process is allowed to create. The corresponding macro
    15491625is _POSIX_NAME_MAX.
    15501626
    1551 @item_PC_PATH_MAX
     1627@item _PC_PATH_MAX
    15521628returns the maximum length of a relative pathname when @code{path} or
    15531629@code{filedes} is the current working directory.  The corresponding macro
    15541630is _POSIX_PATH_MAX.
    15551631
    1556 @item_PC_PIPE_BUF
     1632@item _PC_PIPE_BUF
    15571633returns the size of the pipe buffer, where @code{filedes} must refer to a
    15581634pipe or FIFO and @code{path} must refer to a FIFO.  The corresponding macro
    15591635is _POSIX_PIPE_BUF.
    15601636
    1561 @item_PC_CHOWN_RESTRICTED
    1562 returns nonzero if the chown(2) call may not be used on this file.  If
     1637@item _PC_CHOWN_RESTRICTED
     1638returns nonzero if the @code{chown()} call may not be used on this file.  If
    15631639@code{filedes} or @code{path} refer to a directory, then this applies to all
    15641640files in that directory.  The corresponding macro is _POSIX_CHOWN_RESTRICTED.
     
    15661642@end table
    15671643
    1568 
    1569 @subheading NOTES:
    1570 
     1644@subheading NOTES:
     1645
     1646NONE
Note: See TracChangeset for help on using the changeset viewer.