Utility functions.
More...
|
int | a_timer_create (struct itimerspec ts) |
| Create a timerfd with a given time specification. More...
|
|
void | a_loop_add_fd (int epfd, int fd, uint32_t events) |
| Add a file descriptor to an epoll file descriptor. More...
|
|
void | a_loop_del_fd (int epfd, int fd) |
| Remove a file descriptor from an epoll file descriptor. More...
|
|
void | a_loop_mod_fd (int epfd, int fd, uint32_t events) |
| Change the events listened for on a file descriptor added to epoll. More...
|
|
Utility functions.
◆ a_membersof
#define a_membersof |
( |
|
arr | ) |
|
Get the number of elements in an array.
- Parameters
-
- Returns
- Number of elements in the array
◆ a_loop_add_fd()
void a_loop_add_fd |
( |
int |
epfd, |
|
|
int |
fd, |
|
|
uint32_t |
events |
|
) |
| |
Add a file descriptor to an epoll file descriptor.
This is a helper for epoll_ctl
.
- Deprecated:
- [DEPR0001] This API is deprecated because it does not indicate errors while being able to fail. Please use epoll_ctl directly instead.
- Parameters
-
epfd | epoll file descriptor |
fd | The file descriptor to add |
events | The events to listen for, according to epoll_ctl documentation. |
◆ a_loop_del_fd()
void a_loop_del_fd |
( |
int |
epfd, |
|
|
int |
fd |
|
) |
| |
Remove a file descriptor from an epoll file descriptor.
This is a helper for epoll_ctl
.
- Deprecated:
- [DEPR0001] This API is deprecated because it does not indicate errors while being able to fail. Please use epoll_ctl directly instead.
- Parameters
-
epfd | epoll file descriptor |
fd | The file descriptor to remove |
◆ a_loop_mod_fd()
void a_loop_mod_fd |
( |
int |
epfd, |
|
|
int |
fd, |
|
|
uint32_t |
events |
|
) |
| |
Change the events listened for on a file descriptor added to epoll.
This is a helper for epoll_ctl
.
- Deprecated:
- [DEPR0001] This API is deprecated because it does not indicate errors while being able to fail. Please use epoll_ctl directly instead.
- Parameters
-
epfd | epoll file descriptor |
fd | The file descriptor to update |
events | The events to listen for, according to epoll_ctl documentation. |
◆ a_timer_create()
int a_timer_create |
( |
struct itimerspec |
ts | ) |
|
Create a timerfd
with a given time specification.
- Deprecated:
- [DEPR0001] This API is deprecated due to clobbering errno and taking a structure as an argument. Please use timerfd_create and timerfd_settime directly instead.
- Parameters
-
ts | Timer specification, as per timerfd documentation |
- Returns
- The timer file descriptor, or negative value on error.