forked from Imagelibrary/rtems
Documented the ftruncate and opendir routines. Removed reference to the
readdir_r routine.
This commit is contained in:
@@ -17,7 +17,6 @@ The directives provided by the files and directories manager are:
|
|||||||
@itemize @bullet
|
@itemize @bullet
|
||||||
@item @code{opendir} - Open a Directory
|
@item @code{opendir} - Open a Directory
|
||||||
@item @code{readdir} - Reads a directory
|
@item @code{readdir} - Reads a directory
|
||||||
@item @code{readdir_r} -
|
|
||||||
@item @code{rewinddir} - Resets the @code{readdir()} pointer
|
@item @code{rewinddir} - Resets the @code{readdir()} pointer
|
||||||
@item @code{scandir} - Scan a directory for matching entries
|
@item @code{scandir} - Scan a directory for matching entries
|
||||||
@item @code{telldir} - Return current location in directory stream
|
@item @code{telldir} - Return current location in directory stream
|
||||||
@@ -41,7 +40,7 @@ The directives provided by the files and directories manager are:
|
|||||||
@item @code{fchmod} - Changes permissions of a file
|
@item @code{fchmod} - Changes permissions of a file
|
||||||
@item @code{chown} - Changes the owner and/ or group of a file
|
@item @code{chown} - Changes the owner and/ or group of a file
|
||||||
@item @code{utime} - Change access and/or modification times of an inode
|
@item @code{utime} - Change access and/or modification times of an inode
|
||||||
@item @code{ftrunctate} -
|
@item @code{ftruncate} - Truncate a file to a specified length
|
||||||
@item @code{pathconf} - Gets configuration values for files
|
@item @code{pathconf} - Gets configuration values for files
|
||||||
@item @code{fpathconf} - Get configuration values for files
|
@item @code{fpathconf} - Get configuration values for files
|
||||||
@end itemize
|
@end itemize
|
||||||
@@ -82,10 +81,21 @@ int opendir(
|
|||||||
@item EACCES
|
@item EACCES
|
||||||
Search permission was denied on a component of the path
|
Search permission was denied on a component of the path
|
||||||
prefix of @code{dirname}, or read permission is denied
|
prefix of @code{dirname}, or read permission is denied
|
||||||
for the directory itself.
|
|
||||||
|
|
||||||
@item E
|
@item EMFILE
|
||||||
The
|
Too many file descriptors in use by process
|
||||||
|
|
||||||
|
@item ENFILE
|
||||||
|
Too many files are currently open in the system.
|
||||||
|
|
||||||
|
@item ENOENT
|
||||||
|
Directory does not exist, or @code{name} is an empty string.
|
||||||
|
|
||||||
|
@item ENOMEM
|
||||||
|
Insufficient memory to complete the operation.
|
||||||
|
|
||||||
|
@item ENOTDIR
|
||||||
|
@item{Name} is not a directory.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@@ -148,36 +158,7 @@ the results are not portable and are probably disastrous.
|
|||||||
The routine is implemented in Cygnus newlib.
|
The routine is implemented in Cygnus newlib.
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection readdir_r -
|
@subsection rewinddir - Resets the readdir() pointer
|
||||||
|
|
||||||
@subheading CALLING SEQUENCE:
|
|
||||||
|
|
||||||
@ifset is-C
|
|
||||||
@example
|
|
||||||
int readdir_r(
|
|
||||||
);
|
|
||||||
@end example
|
|
||||||
@end ifset
|
|
||||||
|
|
||||||
@ifset is-Ada
|
|
||||||
@end ifset
|
|
||||||
|
|
||||||
@subheading STATUS CODES:
|
|
||||||
|
|
||||||
@table @b
|
|
||||||
@item E
|
|
||||||
The
|
|
||||||
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@subheading DESCRIPTION:
|
|
||||||
|
|
||||||
@subheading NOTES:
|
|
||||||
|
|
||||||
XXX must be implemented in RTEMS.
|
|
||||||
|
|
||||||
@page
|
|
||||||
@subsection rewinddir - Resets the @code{readdir()} pointer
|
|
||||||
|
|
||||||
@subheading CALLING SEQUENCE:
|
@subheading CALLING SEQUENCE:
|
||||||
|
|
||||||
@@ -186,7 +167,8 @@ XXX must be implemented in RTEMS.
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
void rewinddir(DIR *dirp
|
void rewinddir(
|
||||||
|
DIR *dirp
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@end ifset
|
@end ifset
|
||||||
@@ -218,7 +200,8 @@ The routine is implemented in Cygnus newlib.
|
|||||||
@example
|
@example
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
int scandir(const char *dir,
|
int scandir(
|
||||||
|
const char *dir,
|
||||||
struct direct ***namelist,
|
struct direct ***namelist,
|
||||||
int (*select)(const struct dirent *),
|
int (*select)(const struct dirent *),
|
||||||
int (*compar)(const struct dirent **, const struct dirent **)
|
int (*compar)(const struct dirent **, const struct dirent **)
|
||||||
@@ -259,7 +242,8 @@ The routine is implemented in Cygnus newlib.
|
|||||||
@example
|
@example
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
off_t telldir( DIR *dir
|
off_t telldir(
|
||||||
|
DIR *dir
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@end ifset
|
@end ifset
|
||||||
@@ -295,7 +279,8 @@ The routine is implemented in Cygnus newlib.
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
int closedir(DIR *dirp
|
int closedir(
|
||||||
|
DIR *dirp
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@end ifset
|
@end ifset
|
||||||
@@ -334,7 +319,8 @@ The routine is implemented in Cygnus newlib.
|
|||||||
@example
|
@example
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int chdir( const char *path
|
int chdir(
|
||||||
|
const char *path
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@end ifset
|
@end ifset
|
||||||
@@ -370,7 +356,9 @@ searches of pathnames not beginning with a slash.
|
|||||||
If @code{chdir()} detects an error, the current working directory is not
|
If @code{chdir()} detects an error, the current working directory is not
|
||||||
changed.
|
changed.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection getcwd - Gets current working directory
|
@subsection getcwd - Gets current working directory
|
||||||
@@ -381,8 +369,7 @@ changed.
|
|||||||
@example
|
@example
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int getcwd(
|
int getcwd( void );
|
||||||
);
|
|
||||||
@end example
|
@end example
|
||||||
@end ifset
|
@end ifset
|
||||||
|
|
||||||
@@ -547,7 +534,8 @@ descriptor.
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
int creat(const char *path,
|
int creat(
|
||||||
|
const char *path,
|
||||||
mode_t mode
|
mode_t mode
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -560,20 +548,20 @@ int creat(const char *path,
|
|||||||
|
|
||||||
@table @b
|
@table @b
|
||||||
@item EEXIST
|
@item EEXIST
|
||||||
@code{Path} already exists and O_CREAT and O_EXCL were used.
|
@code{path} already exists and O_CREAT and O_EXCL were used.
|
||||||
@item EISDIR
|
@item EISDIR
|
||||||
@code{Path} refers to a directory and the access requested involved
|
@code{path} refers to a directory and the access requested involved
|
||||||
writing
|
writing
|
||||||
@item ETXTBSY
|
@item ETXTBSY
|
||||||
@code{Path} refers to an executable image which is currently being
|
@code{path} refers to an executable image which is currently being
|
||||||
executed and write access was requested
|
executed and write access was requested
|
||||||
@item EFAULT
|
@item EFAULT
|
||||||
@code{Path} points outside your accessible address space
|
@code{path} points outside your accessible address space
|
||||||
@item EACCES
|
@item EACCES
|
||||||
The requested access to the file is not allowed, or one of the
|
The requested access to the file is not allowed, or one of the
|
||||||
directories in @code{path} did not allow search (execute) permission.
|
directories in @code{path} did not allow search (execute) permission.
|
||||||
@item ENAMETOOLONG
|
@item ENAMETOOLONG
|
||||||
@code{Path} was too long.
|
@code{path} was too long.
|
||||||
@item ENOENT
|
@item ENOENT
|
||||||
A directory component in @code{path} does not exist or is a dangling
|
A directory component in @code{path} does not exist or is a dangling
|
||||||
symbolic link.
|
symbolic link.
|
||||||
@@ -588,7 +576,7 @@ reached.
|
|||||||
@item ENOMEM
|
@item ENOMEM
|
||||||
Insufficient kernel memory was available.
|
Insufficient kernel memory was available.
|
||||||
@item EROFS
|
@item EROFS
|
||||||
@code{Path} refers to a file on a read-only filesystem and write access
|
@code{path} refers to a file on a read-only filesystem and write access
|
||||||
was requested
|
was requested
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
@@ -598,7 +586,9 @@ was requested
|
|||||||
@code{creat} attempts to create a file and return a file descriptor for
|
@code{creat} attempts to create a file and return a file descriptor for
|
||||||
use in read, write, etc.
|
use in read, write, etc.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
The routine is implemented in Cygnus newlib.
|
The routine is implemented in Cygnus newlib.
|
||||||
|
|
||||||
@@ -631,7 +621,9 @@ The file creation mask is used during @code{open()}, @code{creat()}, @code{mkdir
|
|||||||
Bit positions that are set in @code{cmask} are cleared in the mode of the
|
Bit positions that are set in @code{cmask} are cleared in the mode of the
|
||||||
created file.
|
created file.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
The @code{cmask} argument should have only permission bits set. All other
|
The @code{cmask} argument should have only permission bits set. All other
|
||||||
bits should be zero.
|
bits should be zero.
|
||||||
@@ -700,7 +692,9 @@ The @code{existing} argument should not be a directory.
|
|||||||
|
|
||||||
The callder may (or may not) need permission to access the existing file.
|
The callder may (or may not) need permission to access the existing file.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection mkdir - Makes a directory
|
@subsection mkdir - Makes a directory
|
||||||
@@ -756,7 +750,9 @@ and group ID.
|
|||||||
The new directory may (or may not) contain entries for.. and .. but is otherwise
|
The new directory may (or may not) contain entries for.. and .. but is otherwise
|
||||||
empty.
|
empty.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection mkfifo - Makes a FIFO special file
|
@subsection mkfifo - Makes a FIFO special file
|
||||||
@@ -769,7 +765,8 @@ empty.
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
|
||||||
int mkfifo(const char *path,
|
int mkfifo(
|
||||||
|
const char *path,
|
||||||
mode_t mode
|
mode_t mode
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -804,7 +801,9 @@ The permission bits (modified by the file creation mask) are set from
|
|||||||
@code{mode}. The owner and group IDs for the FIFO are set from the efective
|
@code{mode}. The owner and group IDs for the FIFO are set from the efective
|
||||||
user ID and group ID.
|
user ID and group ID.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection unlink - Removes a directory entry
|
@subsection unlink - Removes a directory entry
|
||||||
@@ -854,7 +853,9 @@ link count of the file referenced by the link. When the link count goes to zero
|
|||||||
and no process has the file open, the space occupied by the file is freed and the
|
and no process has the file open, the space occupied by the file is freed and the
|
||||||
file is no longer accessible.
|
file is no longer accessible.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection rmdir - Delete a directory
|
@subsection rmdir - Delete a directory
|
||||||
@@ -865,7 +866,8 @@ file is no longer accessible.
|
|||||||
@example
|
@example
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int rmdir(const char *pathname
|
int rmdir(
|
||||||
|
const char *pathname
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@end ifset
|
@end ifset
|
||||||
@@ -880,7 +882,7 @@ int rmdir(const char *pathname
|
|||||||
The filesystem containing @code{pathname} does not support the removal
|
The filesystem containing @code{pathname} does not support the removal
|
||||||
of directories.
|
of directories.
|
||||||
@item EFAULT
|
@item EFAULT
|
||||||
@cdoe{Pathname} points ouside your accessible address space.
|
@code{pathname} points ouside your accessible address space.
|
||||||
@item EACCES
|
@item EACCES
|
||||||
Write access to the directory containing @code{pathname} was not
|
Write access to the directory containing @code{pathname} was not
|
||||||
allowed for the process's effective uid, or one of the directories in
|
allowed for the process's effective uid, or one of the directories in
|
||||||
@@ -890,27 +892,27 @@ The directory containing @code{pathname} has the stickybit (S_ISVTX)
|
|||||||
set and the process's effective uid is neither the uid of the file to
|
set and the process's effective uid is neither the uid of the file to
|
||||||
be delected nor that of the director containing it.
|
be delected nor that of the director containing it.
|
||||||
@item ENAMETOOLONG
|
@item ENAMETOOLONG
|
||||||
@code{Pathname} was too long.
|
@code{pathname} was too long.
|
||||||
@item ENOENT
|
@item ENOENT
|
||||||
A dirctory component in @code{pathname} does not exist or is a
|
A dirctory component in @code{pathname} does not exist or is a
|
||||||
dangling sybolic link.
|
dangling sybolic link.
|
||||||
@item ENOTDIR
|
@item ENOTDIR
|
||||||
@code{Pathname}, or a component used as a directory in @code{pathname},
|
@code{pathname}, or a component used as a directory in @code{pathname},
|
||||||
is not, in fact, a directory.
|
is not, in fact, a directory.
|
||||||
@item ENOTEMPTY
|
@item ENOTEMPTY
|
||||||
@code{Pathname} contains entries other than . and .. .
|
@code{pathname} contains entries other than . and .. .
|
||||||
@item EBUSY
|
@item EBUSY
|
||||||
@code{Pathname} is the current working directory or root directory of
|
@code{pathname} is the current working directory or root directory of
|
||||||
some process
|
some process
|
||||||
@item EBUSY
|
@item EBUSY
|
||||||
@code{Pathname} is the current directory or root directory of some
|
@code{pathname} is the current directory or root directory of some
|
||||||
process.
|
process.
|
||||||
@item ENOMEM
|
@item ENOMEM
|
||||||
Insufficient kernel memory was available
|
Insufficient kernel memory was available
|
||||||
@item EROGS
|
@item EROGS
|
||||||
@code{Pathname} refers to a file on a read-only filesystem.
|
@code{pathname} refers to a file on a read-only filesystem.
|
||||||
@itemELOOP
|
@item ELOOP
|
||||||
@code{Pathname} contains a reference to a circular symbolic link
|
@code{pathname} contains a reference to a circular symbolic link
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@@ -919,7 +921,9 @@ Insufficient kernel memory was available
|
|||||||
@code{rmdir} deletes a directory, whic must be empty
|
@code{rmdir} deletes a directory, whic must be empty
|
||||||
|
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection rename - Renames a file
|
@subsection rename - Renames a file
|
||||||
@@ -930,7 +934,8 @@ Insufficient kernel memory was available
|
|||||||
@example
|
@example
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int rename(const char *old,
|
int rename(
|
||||||
|
const char *old,
|
||||||
const char *new
|
const char *new
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -1005,7 +1010,8 @@ The routine is implemented in Cygnus newlib using @code{link()} and
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
int stat(const char *path,
|
int stat(
|
||||||
|
const char *path,
|
||||||
struct stat *buf
|
struct stat *buf
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -1040,7 +1046,9 @@ in @code{path} must be searchable. The @code{stat()} function obtains
|
|||||||
information about the named file and writes it to the area pointed to by
|
information about the named file and writes it to the area pointed to by
|
||||||
@code{but}.
|
@code{but}.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection fstat - Gets file status
|
@subsection fstat - Gets file status
|
||||||
@@ -1052,7 +1060,8 @@ information about the named file and writes it to the area pointed to by
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
int fstat(int fildes,
|
int fstat(
|
||||||
|
int fildes,
|
||||||
struct stat *buf
|
struct stat *buf
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -1086,7 +1095,8 @@ to by the @code{buf} argument.
|
|||||||
@example
|
@example
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int access(const char *pathname,
|
int access(
|
||||||
|
const char *pathname,
|
||||||
int mode
|
int mode
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -1102,11 +1112,11 @@ int access(const char *pathname,
|
|||||||
The requested access would be denied, either to the file itself or
|
The requested access would be denied, either to the file itself or
|
||||||
one of the directories in @code{pathname}.
|
one of the directories in @code{pathname}.
|
||||||
@item EFAULT
|
@item EFAULT
|
||||||
@code{Pathname} points outside your accessible address space.
|
@code{pathname} points outside your accessible address space.
|
||||||
@item EINVAL
|
@item EINVAL
|
||||||
@code{Mode} was incorrectly specified.
|
@code{Mode} was incorrectly specified.
|
||||||
@item ENAMETOOLONG
|
@item ENAMETOOLONG
|
||||||
@code{Pathname} is too long.
|
@code{pathname} is too long.
|
||||||
@item ENOENT
|
@item ENOENT
|
||||||
A directory component in @code{pathname} would have been accessible but
|
A directory component in @code{pathname} would have been accessible but
|
||||||
does not exist or was a dangling symbolic link.
|
does not exist or was a dangling symbolic link.
|
||||||
@@ -1127,7 +1137,9 @@ file referred by this symbolic link are tested.
|
|||||||
|
|
||||||
@code{Mode} is a mask consisting of one or more of R_OK, W_OK, X_OK and F_OK.
|
@code{Mode} is a mask consisting of one or more of R_OK, W_OK, X_OK and F_OK.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection chmod - Changes file mode.
|
@subsection chmod - Changes file mode.
|
||||||
@@ -1190,8 +1202,9 @@ the appropriate privileges, @code{chmod()} returns -1 and sets @code{errno} to
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
int fchmod(int fildes,
|
int fchmod(
|
||||||
mote_t mode
|
int fildes,
|
||||||
|
mode_t mode
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@end ifset
|
@end ifset
|
||||||
@@ -1207,11 +1220,11 @@ Search permission is denied for a directory in a file's path prefix.
|
|||||||
@item EBADF
|
@item EBADF
|
||||||
The descriptor is not valid.
|
The descriptor is not valid.
|
||||||
@item EFAULT
|
@item EFAULT
|
||||||
@code{Path} points outside your accessible address space.
|
@code{path} points outside your accessible address space.
|
||||||
@item EIO
|
@item EIO
|
||||||
A low-level I/o error occurred while modifying the inode.
|
A low-level I/o error occurred while modifying the inode.
|
||||||
@item ELOOP
|
@item ELOOP
|
||||||
@code{Path} contains a circular reference
|
@code{path} contains a circular reference
|
||||||
@item ENAMETOOLONG
|
@item ENAMETOOLONG
|
||||||
Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is
|
Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC is
|
||||||
in effect.
|
in effect.
|
||||||
@@ -1234,7 +1247,9 @@ Read-only file system
|
|||||||
The mode of the file given by @code{path} or referenced by
|
The mode of the file given by @code{path} or referenced by
|
||||||
@code{filedes} is changed.
|
@code{filedes} is changed.
|
||||||
|
|
||||||
@subheading NOTES: None
|
@subheading NOTES:
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection getdents - Get directory entries
|
@subsection getdents - Get directory entries
|
||||||
@@ -1247,7 +1262,8 @@ The mode of the file given by @code{path} or referenced by
|
|||||||
#include <linux/dirent.h>
|
#include <linux/dirent.h>
|
||||||
#include <linux/unistd.h>
|
#include <linux/unistd.h>
|
||||||
|
|
||||||
long getdents(int dd_fd,
|
long getdents(
|
||||||
|
int dd_fd,
|
||||||
char *dd_buf,
|
char *dd_buf,
|
||||||
int dd_len
|
int dd_len
|
||||||
);
|
);
|
||||||
@@ -1330,7 +1346,7 @@ still be changed to one of the supplementary group IDs.
|
|||||||
@subheading NOTES:
|
@subheading NOTES:
|
||||||
|
|
||||||
This function may be restricted for some file. The @code{pathconf} function
|
This function may be restricted for some file. The @code{pathconf} function
|
||||||
can be used to test the _PC_CHOWN_RESTRICTED flag.
|
can be used to test the @code{_PC_CHOWN_RESTRICTED} flag.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1343,7 +1359,8 @@ can be used to test the _PC_CHOWN_RESTRICTED flag.
|
|||||||
@example
|
@example
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
int utime(const char *filename,
|
int utime(
|
||||||
|
const char *filename,
|
||||||
struct utimbuf *buf
|
struct utimbuf *buf
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -1369,16 +1386,20 @@ specified by @code{filename} to the @code{actime} and @code{modtime}
|
|||||||
fields of @code{buf} respectively. If @code{buf} is NULL, then the
|
fields of @code{buf} respectively. If @code{buf} is NULL, then the
|
||||||
access and modification times of the file are set to the current time.
|
access and modification times of the file are set to the current time.
|
||||||
|
|
||||||
@subheading NOTES:
|
@subheading NOTES: None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection ftrunctate -
|
@subsection ftruncate - truncate a file to a specified length
|
||||||
|
|
||||||
@subheading CALLING SEQUENCE:
|
@subheading CALLING SEQUENCE:
|
||||||
|
|
||||||
@ifset is-C
|
@ifset is-C
|
||||||
@example
|
@example
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int ftrunctate(
|
int ftrunctate(
|
||||||
|
const char *path,
|
||||||
|
size_t length
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@end ifset
|
@end ifset
|
||||||
@@ -1389,14 +1410,58 @@ int ftrunctate(
|
|||||||
@subheading STATUS CODES:
|
@subheading STATUS CODES:
|
||||||
|
|
||||||
@table @b
|
@table @b
|
||||||
@item E
|
@item ENOTDIR
|
||||||
The
|
A component of the path prefix is not a directory.
|
||||||
|
|
||||||
|
@item EINVAL
|
||||||
|
The pathname contains a character with the high-order bit set.
|
||||||
|
|
||||||
|
@item ENAMETOOLONG
|
||||||
|
A component of a pathname exceeded 255 characters, or an entire
|
||||||
|
path name exceeded 1023 characters.
|
||||||
|
|
||||||
|
@item ENOENT
|
||||||
|
The named file does not exist.
|
||||||
|
|
||||||
|
@item EACCES
|
||||||
|
The named file is not writable by the user.
|
||||||
|
|
||||||
|
@item EACCES
|
||||||
|
Search permission is denied for a component of the path prefix.
|
||||||
|
|
||||||
|
@item ELOOP
|
||||||
|
Too many symbolic links were encountered in translating the
|
||||||
|
pathname
|
||||||
|
|
||||||
|
@item EISDIR
|
||||||
|
The named file is a directory.
|
||||||
|
|
||||||
|
@item EROFS
|
||||||
|
The named file resides on a read-only file system
|
||||||
|
|
||||||
|
@item ETXTBSY
|
||||||
|
The file is a pure procedure (shared text) file that is being
|
||||||
|
executed
|
||||||
|
|
||||||
|
@item EIO
|
||||||
|
An I/O error occurred updating the inode.
|
||||||
|
|
||||||
|
@item EFAULT
|
||||||
|
@code{Path} points outside the process's allocated address space.
|
||||||
|
|
||||||
|
@item EBADF
|
||||||
|
The @code{fd} is not a valid descriptor.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@subheading DESCRIPTION:
|
@subheading DESCRIPTION:
|
||||||
|
|
||||||
@subheading NOTES:
|
2code{Truncate} causes the file named by @code{path} or referenced by
|
||||||
|
@code{fd} to be truncated to at most @code{length} bytes in size. If the
|
||||||
|
file previously was larger than this size, the extra data is lost. With
|
||||||
|
@code{ftruncate}, the file must be open for writing.
|
||||||
|
|
||||||
|
@subheading NOTES: None
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@subsection pathconf - Gets configuration values for files
|
@subsection pathconf - Gets configuration values for files
|
||||||
@@ -1407,7 +1472,8 @@ The
|
|||||||
@example
|
@example
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int pathconf(const char *path,
|
int pathconf(
|
||||||
|
const char *path,
|
||||||
int name
|
int name
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -1421,13 +1487,17 @@ int pathconf(const char *path,
|
|||||||
@table @b
|
@table @b
|
||||||
@item EINVAL
|
@item EINVAL
|
||||||
Invalid argument
|
Invalid argument
|
||||||
|
|
||||||
@item EACCES
|
@item EACCES
|
||||||
Permission to write the file is denied
|
Permission to write the file is denied
|
||||||
|
|
||||||
@item ENAMETOOLONG
|
@item ENAMETOOLONG
|
||||||
Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
|
Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
|
||||||
is in effect.
|
is in effect.
|
||||||
|
|
||||||
@item ENOENT
|
@item ENOENT
|
||||||
A file or directory does not exist
|
A file or directory does not exist
|
||||||
|
|
||||||
@item ENOTDIR
|
@item ENOTDIR
|
||||||
A component of the specified @code{path} was not a directory whan a
|
A component of the specified @code{path} was not a directory whan a
|
||||||
directory was expected.
|
directory was expected.
|
||||||
@@ -1442,37 +1512,37 @@ for the open file descriptor @code{filedes}.
|
|||||||
The possible values for name are:
|
The possible values for name are:
|
||||||
|
|
||||||
@table @b
|
@table @b
|
||||||
@item_PC_LINK_MAX
|
@item _PC_LINK_MAX
|
||||||
returns the maximum number of links to the file. If @code{filedes} or
|
returns the maximum number of links to the file. If @code{filedes} or
|
||||||
@code{path} refer to a directory, then the value applies to the whole
|
@code{path} refer to a directory, then the value applies to the whole
|
||||||
directory. The corresponding macro is _POSIX_LINK_MAX.
|
directory. The corresponding macro is _POSIX_LINK_MAX.
|
||||||
|
|
||||||
@item_PC_MAX_CANON
|
@item _PC_MAX_CANON
|
||||||
returns the maximum length of a formatted input line, where @code{filedes}
|
returns the maximum length of a formatted input line, where @code{filedes}
|
||||||
or @code{path} must refer to a terminal. The corresponding macro is
|
or @code{path} must refer to a terminal. The corresponding macro is
|
||||||
_POSIX_MAX_CANON.
|
_POSIX_MAX_CANON.
|
||||||
|
|
||||||
@item_PC_MAX_INPUT
|
@item _PC_MAX_INPUT
|
||||||
returns the maximum length of an input line, where @code{filedes} or
|
returns the maximum length of an input line, where @code{filedes} or
|
||||||
@code{path} must refer to a terminal. The corresponding macro is
|
@code{path} must refer to a terminal. The corresponding macro is
|
||||||
_POSIX_MAX_INPUT.
|
_POSIX_MAX_INPUT.
|
||||||
|
|
||||||
@item_PC_NAME_MAX
|
@item _PC_NAME_MAX
|
||||||
returns the maximum length of a filename in the directory @code{path} or
|
returns the maximum length of a filename in the directory @code{path} or
|
||||||
@code{filedes}. The process is allowed to create. The corresponding macro
|
@code{filedes}. The process is allowed to create. The corresponding macro
|
||||||
is _POSIX_NAME_MAX.
|
is _POSIX_NAME_MAX.
|
||||||
|
|
||||||
@item_PC_PATH_MAX
|
@item _PC_PATH_MAX
|
||||||
returns the maximum length of a relative pathname when @code{path} or
|
returns the maximum length of a relative pathname when @code{path} or
|
||||||
@code{filedes} is the current working directory. The corresponding macro
|
@code{filedes} is the current working directory. The corresponding macro
|
||||||
is _POSIX_PATH_MAX.
|
is _POSIX_PATH_MAX.
|
||||||
|
|
||||||
@item_PC_PIPE_BUF
|
@item _PC_PIPE_BUF
|
||||||
returns the size of the pipe buffer, where @code{filedes} must refer to a
|
returns the size of the pipe buffer, where @code{filedes} must refer to a
|
||||||
pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro
|
pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro
|
||||||
is _POSIX_PIPE_BUF.
|
is _POSIX_PIPE_BUF.
|
||||||
|
|
||||||
@item_PC_CHOWN_RESTRICTED
|
@item _PC_CHOWN_RESTRICTED
|
||||||
returns nonzero if the chown(2) call may not be used on this file. If
|
returns nonzero if the chown(2) call may not be used on this file. If
|
||||||
@code{filedes} or @code{path} refer to a directory, then this applies to all
|
@code{filedes} or @code{path} refer to a directory, then this applies to all
|
||||||
files in that directory. The corresponding macro is _POSIX_CHOWN_RESTRICTED.
|
files in that directory. The corresponding macro is _POSIX_CHOWN_RESTRICTED.
|
||||||
@@ -1493,7 +1563,8 @@ _PC_NAME_MAX may exist in the given directory.
|
|||||||
@example
|
@example
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int fpathconf(int filedes,
|
int fpathconf(
|
||||||
|
int filedes,
|
||||||
int name
|
int name
|
||||||
);
|
);
|
||||||
@end example
|
@end example
|
||||||
@@ -1507,16 +1578,21 @@ int fpathconf(int filedes,
|
|||||||
@table @b
|
@table @b
|
||||||
@item EINVAL
|
@item EINVAL
|
||||||
Invalid argument
|
Invalid argument
|
||||||
|
|
||||||
@item EACCES
|
@item EACCES
|
||||||
Permission to write the file is denied
|
Permission to write the file is denied
|
||||||
@item ENAMETOOLONG
|
@item ENAMETOOLONG
|
||||||
|
|
||||||
Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
|
Length of a filename string exceeds PATH_MAX and _POSIX_NO_TRUNC
|
||||||
is in effect.
|
is in effect.
|
||||||
|
|
||||||
@item ENOENT
|
@item ENOENT
|
||||||
A file or directory does not exist
|
A file or directory does not exist
|
||||||
|
|
||||||
@item ENOTDIR
|
@item ENOTDIR
|
||||||
A component of the specified @code{path} was not a directory whan a
|
A component of the specified @code{path} was not a directory whan a
|
||||||
directory was expected.
|
directory was expected.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
|
||||||
@@ -1528,43 +1604,43 @@ for the open file descriptor @code{filedes}.
|
|||||||
The possible values for name are:
|
The possible values for name are:
|
||||||
|
|
||||||
@table @b
|
@table @b
|
||||||
@item_PC_LINK_MAX
|
@item _PC_LINK_MAX
|
||||||
returns the maximum number of links to the file. If @code{filedes} or
|
returns the maximum number of links to the file. If @code{filedes} or
|
||||||
@code{path} refer to a directory, then the value applies to the whole
|
@code{path} refer to a directory, then the value applies to the whole
|
||||||
directory. The corresponding macro is _POSIX_LINK_MAX.
|
directory. The corresponding macro is _POSIX_LINK_MAX.
|
||||||
|
|
||||||
@item_PC_MAX_CANON
|
@item _PC_MAX_CANON
|
||||||
returns the maximum length of a formatted input line, where @code{filedes}
|
returns the maximum length of a formatted input line, where @code{filedes}
|
||||||
or @code{path} must refer to a terminal. The corresponding macro is
|
or @code{path} must refer to a terminal. The corresponding macro is
|
||||||
_POSIX_MAX_CANON.
|
_POSIX_MAX_CANON.
|
||||||
|
|
||||||
@item_PC_MAX_INPUT
|
@item _PC_MAX_INPUT
|
||||||
returns the maximum length of an input line, where @code{filedes} or
|
returns the maximum length of an input line, where @code{filedes} or
|
||||||
@code{path} must refer to a terminal. The corresponding macro is
|
@code{path} must refer to a terminal. The corresponding macro is
|
||||||
_POSIX_MAX_INPUT.
|
_POSIX_MAX_INPUT.
|
||||||
|
|
||||||
@item_PC_NAME_MAX
|
@item _PC_NAME_MAX
|
||||||
returns the maximum length of a filename in the directory @code{path} or
|
returns the maximum length of a filename in the directory @code{path} or
|
||||||
@code{filedes}. The process is allowed to create. The corresponding macro
|
@code{filedes}. The process is allowed to create. The corresponding macro
|
||||||
is _POSIX_NAME_MAX.
|
is _POSIX_NAME_MAX.
|
||||||
|
|
||||||
@item_PC_PATH_MAX
|
@item _PC_PATH_MAX
|
||||||
returns the maximum length of a relative pathname when @code{path} or
|
returns the maximum length of a relative pathname when @code{path} or
|
||||||
@code{filedes} is the current working directory. The corresponding macro
|
@code{filedes} is the current working directory. The corresponding macro
|
||||||
is _POSIX_PATH_MAX.
|
is _POSIX_PATH_MAX.
|
||||||
|
|
||||||
@item_PC_PIPE_BUF
|
@item _PC_PIPE_BUF
|
||||||
returns the size of the pipe buffer, where @code{filedes} must refer to a
|
returns the size of the pipe buffer, where @code{filedes} must refer to a
|
||||||
pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro
|
pipe or FIFO and @code{path} must refer to a FIFO. The corresponding macro
|
||||||
is _POSIX_PIPE_BUF.
|
is _POSIX_PIPE_BUF.
|
||||||
|
|
||||||
@item_PC_CHOWN_RESTRICTED
|
@item _PC_CHOWN_RESTRICTED
|
||||||
returns nonzero if the chown(2) call may not be used on this file. If
|
returns nonzero if the @code{chown()} call may not be used on this file. If
|
||||||
@code{filedes} or @code{path} refer to a directory, then this applies to all
|
@code{filedes} or @code{path} refer to a directory, then this applies to all
|
||||||
files in that directory. The corresponding macro is _POSIX_CHOWN_RESTRICTED.
|
files in that directory. The corresponding macro is _POSIX_CHOWN_RESTRICTED.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
|
||||||
@subheading NOTES:
|
@subheading NOTES:
|
||||||
|
|
||||||
|
NONE
|
||||||
|
|||||||
Reference in New Issue
Block a user