Add creat function call. Fix direntry iteration in EXT2. Fix open of directories in EXT2. Fix re-utilization of unlinked direntries in EXT2.
This commit is contained in:
+9
-1
@@ -32,4 +32,12 @@ int mkdir(const char *path, mode_t mode);
|
||||
/// @brief Removes the given directory.
|
||||
/// @param path The path to the directory to remove.
|
||||
/// @return Returns a negative value on failure.
|
||||
int rmdir(const char *path);
|
||||
int rmdir(const char *path);
|
||||
|
||||
/// @brief Creates a new file or rewrite an existing one.
|
||||
/// @param path path to the file.
|
||||
/// @param mode mode for file creation.
|
||||
/// @return file descriptor number, -1 otherwise and errno is set to indicate the error.
|
||||
/// @details
|
||||
/// It is equivalent to: open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)
|
||||
int creat(const char *path, mode_t mode);
|
||||
@@ -28,14 +28,11 @@ ssize_t read(int fd, void *buf, size_t nbytes);
|
||||
/// @return The number of written bytes.
|
||||
ssize_t write(int fd, void *buf, size_t nbytes);
|
||||
|
||||
/// @brief Opens the file specified by pathname.
|
||||
/// @brief Opens the file specified by pathname.
|
||||
/// @param pathname A pathname for a file.
|
||||
/// @param flags Used to set the file status flags and file access modes
|
||||
/// of the open file description.
|
||||
/// @param mode Specifies the file mode bits be applied when a new file
|
||||
/// is created.
|
||||
/// @return Returns a file descriptor, a small, nonnegative integer for
|
||||
/// use in subsequent system calls.
|
||||
/// @param flags file status flags and file access modes of the open file description.
|
||||
/// @param mode the file mode bits be applied when a new file is created.
|
||||
/// @return file descriptor number, -1 otherwise and errno is set to indicate the error.
|
||||
int open(const char *pathname, int flags, mode_t mode);
|
||||
|
||||
/// @brief Close a file descriptor.
|
||||
|
||||
Reference in New Issue
Block a user