libosmocore  UNKNOWN
Osmocom core library
Select loop abstraction

Files

file  select.h
 select loop abstraction
 
file  select.c
 select loop abstraction
 

Data Structures

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

Macros

#define BSC_FD_READ   0x0001
 Indicate interest in reading from the file descriptor.
 
#define BSC_FD_WRITE   0x0002
 Indicate interest in writing to the file descriptor.
 
#define BSC_FD_EXCEPT   0x0004
 Indicate interest in exceptions from the file descriptor.
 

Functions

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

Variables

static int maxfd = 0
 
static int unregistered_count
 

Detailed Description

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_fd_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 BSC_FD_EXCEPT, BSC_FD_READ, BSC_FD_WRITE, osmo_fd::cb, osmo_fd::fd, osmo_timers_nearest(), osmo_timers_prepare(), osmo_timers_update(), and osmo_fd::when.