From 914792726f9e452ad9b805ed49cd023c05d83a9d Mon Sep 17 00:00:00 2001
From: Zachary Lebold
#include <unistd.h>
-void,
+void
_exit(int exitcode);
ssize_t
write(int fd, const void *buf,
-size_t nbytes);
+size_t buflen);
lseek alters the current seek position of the file handle -filehandle, seeking to a new position based on pos -and whence. +identified by file descriptor fd, seeking to a new position +based on pos and whence.
@@ -122,7 +122,7 @@ mentioned here.
-open returns a file handle suitable for passing to +open returns a file descriptor suitable for passing to read, write, close, -etc. This file handle must be greater than or equal to zero. Note -that file handles 0 (STDIN_FILENO), 1 (STDOUT_FILENO), and 2 +etc. This file descriptor must be greater than or equal to zero. Note +that file descriptors 0 (STDIN_FILENO), 1 (STDOUT_FILENO), and 2 (STDERR_FILENO) are used in special ways and are typically assumed by user-level code to always be open.
@@ -128,9 +128,9 @@ contain .. is usually not quite atomic.-On success, open returns a nonnegative file handle. On error, --1 is returned, and errno is set according to -the error encountered. +On success, open returns a nonnegative file descriptor. On +error, -1 is returned, and errno is set +according to the error encountered.
-The file handle fd is closed. The same file handle may then -be returned again from open, +The file handle identified by file descriptor fd is closed. +The same file handle may then be returned again from open, dup2, pipe, or similar calls.
@@ -87,7 +87,7 @@ mentioned here.EBADF | -fd is not a valid file handle. | fd is not a valid file descriptor. |
EIO | A hard I/O error occurred. |
-dup2 clones the file handle oldfd onto the file -handle newfd. If newfd names an already-open file, -that file is closed. +dup2 clones the file handle identifed by file descriptor oldfd +onto the file handle identified by newfd. If newfd +names an already-open file, that file is closed.
@@ -74,8 +74,8 @@ dup2 is most commonly used to relocate opened files onto
-Both filehandles must be non-negative, and, if applicable, smaller -than the maximum allowed file handle number. +Both file descriptors must be non-negative, and, if applicable, +smaller than the maximum allowed file handle number.
@@ -116,9 +116,9 @@ here.
fstat retrieves status information about the file referred to -by the file handle fd and stores it in the stat structure +by the file descriptor fd and stores it in the stat structure pointed to by statbuf.
From 414122655bba1d8d68ec44fee583714ed1592ea3 Mon Sep 17 00:00:00 2001 From: Zachary LeboldEBADF | -fd is not a valid file handle, or - it is not open for writing. | fd is not a valid file descriptor, + or it is not open for writing. |
EIO | A hard I/O error occurred. | |
EFAULT | buf points to an invalid address. |