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.
 
 
 
 

34 lines
1.0 KiB

  1. .TH iom_add 3
  2. .SH NAME
  3. iom_add \- add event to I/O multiplexer
  4. .SH SYNTAX
  5. .B #include <libowfat/io.h>
  6. int \fBiom_add\fP(iomux_t* c, int64 fd, unsigned int events);
  7. .SH DESCRIPTION
  8. iom_add adds an event you are interested in to an I/O multiplexer.
  9. \fIfd\fR is the file descriptor (usually a socket) you are interested
  10. in, and \fIevents\fR is the operation you want to do. It can be IOM_READ
  11. or IOM_WRITE.
  12. If that operation becomes possible on that descriptor, and some thread
  13. is calling \fIiom_wait\fR at the time, it will return and tell you the
  14. fd and the event.
  15. Note that the event registration is removed from the iomux_t context if
  16. it occurs. You will have to call \fIiom_wait\fR again after you handled
  17. the event, if you are still interested in it.
  18. Closing a file descriptor with registered events will discard the event
  19. registration.
  20. .SH "LINKING"
  21. You may have to add \fI-lpthread\fR to the command line in the linking
  22. step.
  23. .SH "RETURN VALUE"
  24. iom_add returns 0 on success and -1 on error, setting errno.
  25. .SH "SEE ALSO"
  26. iom_init, iom_wait, iom_abort