ACU6 Device API
Macros | Functions
utility

Utility functions. More...

Macros

#define a_membersof(arr)
 Get the number of elements in an array. More...
 

Functions

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...
 

Detailed Description

Utility functions.

Macro Definition Documentation

◆ a_membersof

#define a_membersof (   arr)

Get the number of elements in an array.

Parameters
arrAn array
Returns
Number of elements in the array

Function Documentation

◆ 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
epfdepoll file descriptor
fdThe file descriptor to add
eventsThe 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
epfdepoll file descriptor
fdThe 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
epfdepoll file descriptor
fdThe file descriptor to update
eventsThe 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
tsTimer specification, as per timerfd documentation
Returns
The timer file descriptor, or negative value on error.