1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/* SPDX-License-Identifier: GPL-2.0 */
/** \file fd.h exported symbols from fd.c */
int write_all(int fd, const void *buf, size_t len);
__printf_2_3 int write_va_buffer(int fd, const char *fmt, ...);
int xpoll(struct pollfd *fds, nfds_t nfds, int timeout);
__must_check int mark_fd_nonblocking(int fd);
__must_check int mark_fd_blocking(int fd);
int para_mmap(size_t length, int prot, int flags, int fd, void **map);
int para_open(const char *path, int flags, mode_t mode);
char *create_dot_paraslash(void);
int mmap_full_file(const char *filename, int open_mode, void **map,
size_t *size, int *fd_ptr);
int para_munmap(void *start, size_t length);
int read_ok(int fd);
int write_ok(int fd);
void valid_fd_012(void);
int readv_nonblock(int fd, struct iovec *iov, int iovcnt, size_t *num_bytes);
int read_nonblock(int fd, void *buf, size_t sz, size_t *num_bytes);
int read_and_compare(int fd, const char *expectation);
int xwrite(int fd, const void *buf, size_t len);
int xwritev(int fd, struct iovec *iov, int iovcnt);
/**
* Write a \p NULL-terminated buffer.
*
* \param fd The file descriptor.
* \param buf The null-terminated buffer to be send.
*
* This is equivalent to write_all(fd, buf, strlen(buf)).
*
* \return Standard.
*/
_static_inline_ int write_buffer(int fd, const char *buf)
{
return write_all(fd, buf, strlen(buf));
}
|