mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 19:28:29 +00:00
Improve system call wrappers
This change improves copy_file_range(), sendfile(), splice(), openpty(), closefrom(), close_range(), fadvise() and posix_fadvise() in addition to writing tests that confirm things like errno and seeking behavior across platforms. We now less aggressively polyfill behavior with some of these functions when the platform support isn't available. Please see: https://justine.lol/cosmopolitan/functions.html
This commit is contained in:
parent
224c12f54d
commit
c7a8cd21e9
89 changed files with 1151 additions and 414 deletions
|
@ -25,17 +25,6 @@
|
|||
/**
|
||||
* Copies data between fds the old fashioned way.
|
||||
*
|
||||
* Even though Cosmopolitan polyfills copy_file_range() to fallback to
|
||||
* doing this, it's useful to call this function in cases where you know
|
||||
* it'd be more helpful to get the larger buffer size with read/write.
|
||||
*
|
||||
* Reads are allowed to be interrupted. Writes are uninterruptible. If
|
||||
* we get an interrupt when partial data was written, we return the
|
||||
* partial amount. Therefore the file descriptors are guaranteed to
|
||||
* remain in a consistent state, provided EINTR is the only error.
|
||||
*
|
||||
* If n is 0 then 0 is returned and no i/o operations are performed.
|
||||
*
|
||||
* @return bytes successfully exchanged
|
||||
*/
|
||||
ssize_t _copyfd(int infd, int outfd, size_t n) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue