libosmocore 0.3.6
Osmocom core library
Select loop abstraction

Data Structures

struct  osmo_fd
 Structure representing a file dsecriptor. More...

Files

file  select.h
 

select loop abstraction


file  select.c
 

select loop abstraction


Functions

int osmo_fd_register (struct osmo_fd *fd)
 Register a new file descriptor with select loop abstraction.
void osmo_fd_unregister (struct osmo_fd *fd)
 Unregister a file descriptor from select loop abstraction.
int osmo_select_main (int polling)
 select main loop integration
static LLIST_HEAD (osmo_fds)

Variables

int osmo_fd::fd
unsigned int osmo_fd::when
int(* osmo_fd::cb )(struct osmo_fd *fd, unsigned int what)
void * osmo_fd::data
unsigned int osmo_fd::priv_nr
static int maxfd = 0
static int unregistered_count

Function Documentation

int osmo_fd_register ( struct osmo_fd fd)

Register a new file descriptor with select loop abstraction.

Parameters:
[in]fdosmocom file descriptor to be registered

References osmo_fd::fd, and osmo_fd::list.

Referenced by gsmtap_source_add_sink(), gsmtap_source_init(), and osmo_sock_init_ofd().

void osmo_fd_unregister ( struct osmo_fd fd)

Unregister a file descriptor from select loop abstraction.

Parameters:
[in]fdosmocom file descriptor to be unregistered

References osmo_fd::list.

int osmo_select_main ( int  polling)

select main loop integration

Parameters:
[in]pollingshould we pollonly (1) or block on select (0)

References osmo_fd::cb, osmo_fd::fd, and osmo_fd::when.


Variable Documentation

int(* osmo_fd::cb)(struct osmo_fd *fd, unsigned int what)

call-back function to be called once file descriptor becomes available

Referenced by gsmtap_source_add_sink(), osmo_select_main(), and osmo_wqueue_init().

data pointer passed through to call-back function

unsigned int osmo_fd::priv_nr

private number, extending data

unsigned int osmo_fd::when

bit-mask or of BSC_FD_READ, BSC_FD_WRITE and/or BSC_FD_EXCEPT

Referenced by gsmtap_source_add_sink(), osmo_select_main(), osmo_sock_init_ofd(), osmo_wqueue_bfd_cb(), osmo_wqueue_clear(), and osmo_wqueue_enqueue().