Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
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.

19 lines
400 B

  1. #include <unistd.h>
  2. #include <sys/time.h>
  3. #include <poll.h>
  4. #include <errno.h>
  5. #include "io_internal.h"
  6. int64 io_trywritetimeout(int64 d,const char* buf,int64 len) {
  7. int64 r=io_trywrite(d,buf,len);
  8. if (r==-1) {
  9. tai6464 x;
  10. io_entry* e=array_get(&io_fds,sizeof(io_entry),d);
  11. taia_now(&x);
  12. if (taia_less(&x,&e->timeout)) {
  13. errno=ETIMEDOUT;
  14. r=-2;
  15. }
  16. }
  17. return r;
  18. }