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.

25 lines
475 B

  1. #include <unistd.h>
  2. #include <fcntl.h>
  3. #include <errno.h>
  4. #include "io_internal.h"
  5. #ifdef __MINGW32__
  6. #include <winsock2.h>
  7. #include "windoze.h"
  8. #endif
  9. #ifndef O_NDELAY
  10. #define O_NDELAY O_NONBLOCK
  11. #endif
  12. void io_nonblock(int64 d) {
  13. io_entry* e=iarray_get(&io_fds,d);
  14. #ifdef __MINGW32__
  15. unsigned long i=1;
  16. if (ioctlsocket( d, FIONBIO, &i)==0)
  17. if (e) e->nonblock=1;
  18. #else
  19. if (fcntl(d,F_SETFL,fcntl(d,F_GETFL,0) | O_NDELAY)==0)
  20. if (e) e->nonblock=1;
  21. #endif
  22. }