libfuncs is collection of code (list, queue, circular buffer, io, logging, etc.). https://georgi.unixsol.org/programs/libfuncs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

io.h 953B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * UX IO functions header file
  3. * Copyright (C) 2006-2009 Unix Solutions Ltd.
  4. */
  5. #ifndef IO_H
  6. # define IO_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #include <sys/socket.h>
  11. #include <sys/types.h>
  12. char * chomp(char *x);
  13. ssize_t safe_read(int fd, void *buf, size_t len);
  14. ssize_t safe_write(int fd, const void *buf, size_t len);
  15. void shutdown_fd(int *in_fd);
  16. ssize_t fdgetline(int fd, char *buf, size_t buf_size);
  17. ssize_t fdread_ex(int fd, char *buf, size_t buf_size, int timeout, int retries, int waitfull);
  18. ssize_t fdread(int fd, char *buf, size_t buf_size);
  19. ssize_t fdread_nowaitfull(int fd, char *buf, size_t buf_size);
  20. ssize_t fdwrite(int fd, char *buf, size_t buf_size);
  21. int fdputs(int fd, char *msg);
  22. int fdputsf(int fd, char *fmt, ...);
  23. void set_sock_nonblock(int sockfd);
  24. void set_sock_block(int sockfd);
  25. int do_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen, int timeout);
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif