select.h
Go to the documentation of this file.
#pragma once
#include <osmocom/core/linuxlist.h>
#define BSC_FD_READ 0x0001
#define BSC_FD_WRITE 0x0002
#define BSC_FD_EXCEPT 0x0004
struct osmo_fd {
struct llist_head list;
int fd;
unsigned int when;
int (*cb)(struct osmo_fd *fd, unsigned int what);
void *data;
unsigned int priv_nr;
};
int osmo_fd_register(struct osmo_fd *fd);
void osmo_fd_unregister(struct osmo_fd *fd);
int osmo_select_main(int polling);
osmo_fd::data
void * data
Definition: select.h:33
osmo_fd_register
int osmo_fd_register(struct osmo_fd *fd)
Register a new file descriptor with select loop abstraction.
Definition: select.c:50
osmo_fd_unregister
void osmo_fd_unregister(struct osmo_fd *fd)
Unregister a file descriptor from select loop abstraction.
Definition: select.c:94
osmo_fd::list
struct llist_head list
Definition: select.h:23
osmo_fd::priv_nr
unsigned int priv_nr
Definition: select.h:35
osmo_select_main
int osmo_select_main(int polling)
select main loop integration
Definition: select.c:103
llist_head
Definition: linuxlist.h:42
osmo_fd
Structure representing a file dsecriptor.
Definition: select.h:21
osmo_fd::cb
int(* cb)(struct osmo_fd *fd, unsigned int what)
Definition: select.h:31
osmo_fd::when
unsigned int when
Definition: select.h:28
osmo_fd::fd
int fd
Definition: select.h:25