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