1 /* Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
3 /** \file fd.h exported symbols from fd.c */
5 int xrename(const char *oldpath, const char *newpath);
6 int write_all(int fd, const char *buf, size_t len);
7 __printf_2_3 int write_va_buffer(int fd, const char *fmt, ...);
8 int xpoll(struct pollfd *fds, nfds_t nfds, int timeout);
9 __must_check int mark_fd_nonblocking(int fd);
10 __must_check int mark_fd_blocking(int fd);
11 int para_mmap(size_t length, int prot, int flags, int fd, void *map);
12 int para_open(const char *path, int flags, mode_t mode);
13 int para_mkdir(const char *path);
14 int mmap_full_file(const char *filename, int open_mode, void **map,
15 size_t *size, int *fd_ptr);
16 int para_munmap(void *start, size_t length);
19 void valid_fd_012(void);
20 int readv_nonblock(int fd, struct iovec *iov, int iovcnt, size_t *num_bytes);
21 int read_nonblock(int fd, void *buf, size_t sz, size_t *num_bytes);
22 int read_and_compare(int fd, const char *expectation);
23 int xwrite(int fd, const char *buf, size_t len);
24 int xwritev(int fd, struct iovec *iov, int iovcnt);
27 * Write a \p NULL-terminated buffer.
29 * \param fd The file descriptor.
30 * \param buf The null-terminated buffer to be send.
32 * This is equivalent to write_all(fd, buf, strlen(buf)).
36 _static_inline_ int write_buffer(int fd, const char *buf)
38 return write_all(fd, buf, strlen(buf));