YAZ  5.23.1
Data Structures | Macros | Enumerations | Functions
poll.h File Reference

Poll, select wrappers. More...

#include <stddef.h>
#include <yaz/yconfig.h>

Go to the source code of this file.

Data Structures

struct  yaz_poll_fd
 select/poll fd info More...
 

Macros

#define yaz_poll_add(var, value)   var = (enum yaz_poll_mask ) ((int) var | value)
 

Enumerations

enum  yaz_poll_mask {
  yaz_poll_none = 0, yaz_poll_read = 1, yaz_poll_write = 2, yaz_poll_except = 4,
  yaz_poll_timeout = 8
}
 select/poll masks .. timeout is "output" only More...
 

Functions

int yaz_poll (struct yaz_poll_fd *fds, int num_fds, int sec, int nsec)
 poll wrapper for poll or select More...
 

Detailed Description

Poll, select wrappers.

Definition in file poll.h.

Macro Definition Documentation

#define yaz_poll_add (   var,
  value 
)    var = (enum yaz_poll_mask ) ((int) var | value)

Definition at line 76 of file poll.h.

Referenced by iochan_event_loop(), yaz_poll_select(), yaz_url_exec(), and ZOOM_event_sys_yaz_poll().

Enumeration Type Documentation

select/poll masks .. timeout is "output" only

Enumerator
yaz_poll_none 
yaz_poll_read 
yaz_poll_write 
yaz_poll_except 
yaz_poll_timeout 

Definition at line 41 of file poll.h.

Function Documentation

int yaz_poll ( struct yaz_poll_fd fds,
int  num_fds,
int  sec,
int  nsec 
)

poll wrapper for poll or select

Parameters
fdsarray of sockets to be polled
num_fdssize of fds array (number of sockets)
secnumber of seconds to wait (-1 for no timeout)
nsecnano seconds to wait
Return values
-1error
0timeout
>0event occur on one or more sockets

This functions calls yaz_poll_poll on systems where poll is available and yaz_poll_select where it it unavailable.

Definition at line 161 of file poll.c.

References yaz_poll_select().

Referenced by iochan_event_loop(), iochan_is_alive(), yaz_url_exec(), and ZOOM_event_sys_yaz_poll().