YAZ  5.34.0
Functions
poll.c File Reference

Select, poll wrapper. More...

#include <assert.h>
#include <string.h>
#include <errno.h>
#include <yaz/log.h>
#include <yaz/xmalloc.h>
#include <yaz/poll.h>

Go to the source code of this file.

Functions

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

Detailed Description

Select, poll wrapper.

Definition in file poll.c.

Function Documentation

◆ yaz_poll()

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().

◆ yaz_poll_select()

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