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.

39 lines
1.3 KiB

  1. .TH iom_wait 3
  2. .SH NAME
  3. iom_wait \- wait for event from I/O multiplexer
  5. .B #include <libowfat/io.h>
  6. int \fBiom_wait\fP(iomux_t* c,
  7. int64* fd, unsigned int* events,
  8. unsigned long timeout);
  10. iom_wait will wait for events registered to the I/O multiplexer with
  11. \fIiom_add\fR. It will wait \fItimeout\fR milliseconds.
  12. If during that time any of the registered events occur, \fIiom_wait\fR
  13. will set \fIfd\fR to the file descriptor the event happened on, and
  14. \fIevents\fR to the sum of IOM_READ, IOM_WRITE and IOM_ERROR, depending
  15. on what event actually happened, and return 1.
  16. If nothing happens during that time, it will return 0 and leave \fIfd\fR
  17. and \fIevents\fR alone.
  18. Note that the event registration is removed from the iomux_t context if
  19. it occurs. You will have to call \fIiom_wait\fR again after you handled
  20. the event, if you are still interested in it.
  21. Closing a file descriptor with registered events will discard the event
  22. registration.
  23. .SH "LINKING"
  24. You may have to add \fI-lpthread\fR to the command line in the linking
  25. step.
  27. iom_wait returns 1 on success, 0 if there was a timeout, and -1 on
  28. error, setting errno. If \fIiom_abort\fR was called on the I/O
  29. multiplexer context, it will return -2.
  30. .SH "SEE ALSO"
  31. iom_init, iom_add, iom_abort