mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Improve docs of more system calls
This change also found a few POSIX compliance bugs with errnos. Another bug was discovered where, on Windows, pread() and pwrite() could modify the file position in cases where ReadFile() returned an error e.g. when seeking past the end of file. We also have more tests!
This commit is contained in:
parent
af24c19db3
commit
ccbae7799e
39 changed files with 589 additions and 175 deletions
|
@ -29,7 +29,9 @@
|
|||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
/**
|
||||
* Writes to file at offset, thus avoiding superfluous lseek().
|
||||
* Writes to file at offset.
|
||||
*
|
||||
* This function never changes the current position of `fd`.
|
||||
*
|
||||
* @param fd is something open()'d earlier, noting pipes might not work
|
||||
* @param buf is copied from, cf. copy_file_range(), sendfile(), etc.
|
||||
|
@ -41,6 +43,7 @@
|
|||
* impossible unless size was passed as zero to do an error check
|
||||
* @see pread(), write()
|
||||
* @asyncsignalsafe
|
||||
* @threadsafe
|
||||
* @vforksafe
|
||||
*/
|
||||
ssize_t pwrite(int fd, const void *buf, size_t size, int64_t offset) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue