|
35 | 35 | *
|
36 | 36 | * This function changes the current file position. For documentation
|
37 | 37 | * on file position behaviors and gotchas, see the lseek() function.
|
| 38 | + * This function may be used on socket file descriptors, including on |
| 39 | + * Windows. |
38 | 40 | *
|
39 | 41 | * @param fd is something open()'d earlier
|
40 | 42 | * @param buf is copied into, cf. copy_file_range(), sendfile(), etc.
|
41 | 43 | * @param size in range [1..0x7ffff000] is reasonable
|
42 | 44 | * @return [1..size] bytes on success, 0 on EOF, or -1 w/ errno; with
|
43 | 45 | * exception of size==0, in which case return zero means no error
|
| 46 | + * @raise EBADF if `fd` is negative or not an open file descriptor |
| 47 | + * @raise EBADF if `fd` is open in `O_WRONLY` mode |
| 48 | + * @raise EFAULT if `size` is nonzero and `buf` points to bad memory |
| 49 | + * @raise EPERM if pledge() is in play without the stdio promise |
| 50 | + * @raise EIO if low-level i/o error happened |
| 51 | + * @raise EINTR if signal was delivered instead |
| 52 | + * @raise ENOTCONN if `fd` is a socket and it isn't connected |
| 53 | + * @raise ECONNRESET if socket peer forcibly closed connection |
| 54 | + * @raise ETIMEDOUT if socket transmission timeout occurred |
| 55 | + * @raise EAGAIN if `O_NONBLOCK` is in play and read needs to block, |
| 56 | + * or `SO_RCVTIMEO` is in play and the time interval elapsed |
| 57 | + * @raise ENOBUFS is specified by POSIX |
| 58 | + * @raise ENXIO is specified by POSIX |
44 | 59 | * @asyncsignalsafe
|
45 | 60 | * @restartable
|
46 | 61 | * @vforksafe
|
|
0 commit comments