diff options
author | Jose Bollo <jose.bollo@iot.bzh> | 2019-09-30 17:40:04 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2019-10-03 12:35:01 +0200 |
commit | f161cd8b8b83a29f42c275fe31a96825a8d27d86 (patch) | |
tree | f13aaf40ea67fe0c4459a283dd0773a00752c740 /src/pollitem.c | |
parent | 6bf1b8c3a8af299c04d9be0d59b42c3a6d7c9127 (diff) |
Improve comments
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/pollitem.c')
-rw-r--r-- | src/pollitem.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/pollitem.c b/src/pollitem.c index d183594..22d2505 100644 --- a/src/pollitem.c +++ b/src/pollitem.c @@ -14,27 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/******************************************************************************/ +/******************************************************************************/ +/* IMPLEMENTATION OF EPOLL HELPER */ +/******************************************************************************/ +/******************************************************************************/ #include <stdint.h> #include <sys/epoll.h> -/* -#include <stddef.h> -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <string.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> -#include <poll.h> -#include <limits.h> -#include <sys/types.h> -#include <sys/socket.h> -*/ - #include "pollitem.h" +/** + * Wraps the call to epoll_ctl for operation 'op' + * + * @param pollitem the pollitem to process + * @param events the expected events + * @param pollfd the file descriptor for epoll + * @param op the operation to perform + * @return 0 on success or -1 with errno set accordingly to epoll_ctl + */ static int pollitem_do( @@ -47,6 +46,7 @@ pollitem_do( return epoll_ctl(pollfd, op, pollitem->fd, &ev); } +/* see pollitem.h */ int pollitem_add( pollitem_t *pollitem, @@ -56,6 +56,7 @@ pollitem_add( return pollitem_do(pollitem, events, pollfd, EPOLL_CTL_ADD); } +/* see pollitem.h */ int pollitem_mod( pollitem_t *pollitem, @@ -65,6 +66,7 @@ pollitem_mod( return pollitem_do(pollitem, events, pollfd, EPOLL_CTL_MOD); } +/* see pollitem.h */ int pollitem_del( pollitem_t *pollitem, @@ -73,6 +75,7 @@ pollitem_del( return pollitem_do(pollitem, 0, pollfd, EPOLL_CTL_DEL); } +/* see pollitem.h */ int pollitem_wait_dispatch( int pollfd, |