para_write: Return proper error code.
[paraslash.git] / fd.h
1 /*
2 * Copyright (C) 2006-2011 Andre Noll <maan@systemlinux.org>
3 *
4 * Licensed under the GPL v2. For licencing details see COPYING.
5 */
6
7 /** \file fd.h exported symbols from fd.c */
8
9 int write_all(int fd, const char *buf, size_t *len);
10 int file_exists(const char *);
11 int para_select(int n, fd_set *readfds, fd_set *writefds,
12 struct timeval *timeout_tv);
13 __must_check int mark_fd_nonblocking(int fd);
14 __must_check int mark_fd_blocking(int fd);
15 void para_fd_set(int fd, fd_set *fds, int *max_fileno);
16 __must_check int para_fgets(char *line, int size, FILE *f);
17 int para_mmap(size_t length, int prot, int flags, int fd, off_t offset,
18 void *map);
19 int para_open(const char *path, int flags, mode_t mode);
20 int para_mkdir(const char *path, mode_t mode);
21 int para_chdir(const char *path);
22 int mmap_full_file(const char *filename, int open_mode, void **map,
23 size_t *size, int *fd_ptr);
24 int para_munmap(void *start, size_t length);
25 int write_ok(int fd);
26 void valid_fd_012(void);
27 int readv_nonblock(int fd, struct iovec *iov, int iovcnt, fd_set *rfds,
28 size_t *num_bytes);
29 int read_nonblock(int fd, void *buf, size_t sz, fd_set *rfds, size_t *num_bytes);
30 int read_pattern(int fd, const char *pattern, size_t bufsize, fd_set *rfds);
31 int write_nonblock(int fd, const char *buf, size_t len);
32 int for_each_file_in_dir(const char *dirname,
33 int (*func)(const char *, void *), void *private_data);