IOPoll Linuximpl

Implements IOPoll.

Summary
IOPoll LinuximplImplements IOPoll.
CopyrightThis program is free software.
Files
C-kern/api/io/iopoll.hHeader file IOPoll.
C-kern/platform/Linux/io/iopoll.cImplementation file IOPoll Linuximpl.
iopoll_t
helper
convert2ioeventbits_iopollConverts Linux specific epoll_event->events into ioevent_e.
convert2epolleventbitsConverts ioevent_e into Linux epoll event bits.
convert2epollevent_iopollConverts ioevent_t into Linux struct epoll_event.
lifetime
init_iopollCreates epoll event notification facility.
free_iopollFrees Linux epoll object.
query
change
registerfd_iopollAdds file descriptor to Linux epoll object.
updatefd_iopollUpdates event mask/value of sys_iochannel_t registered at Linux epoll object.
updatefd_iopollUnregisteres sys_iochannel_t at Linux epoll object.
test

Copyright

This program is free software.  You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Author

© 2012 Jörg Seebohn

Files

C-kern/api/io/iopoll.h

Header file IOPoll.

C-kern/platform/Linux/io/iopoll.c

Implementation file IOPoll Linuximpl.

iopoll_t

Uses Linux epollI/O event notification facility.  See: man 4 epoll.
Summary
helper
convert2ioeventbits_iopollConverts Linux specific epoll_event->events into ioevent_e.
convert2epolleventbitsConverts ioevent_e into Linux epoll event bits.
convert2epollevent_iopollConverts ioevent_t into Linux struct epoll_event.
lifetime
init_iopollCreates epoll event notification facility.
free_iopollFrees Linux epoll object.
query
change
registerfd_iopollAdds file descriptor to Linux epoll object.
updatefd_iopollUpdates event mask/value of sys_iochannel_t registered at Linux epoll object.
updatefd_iopollUnregisteres sys_iochannel_t at Linux epoll object.
test

helper

convert2ioeventbits_iopoll

static inline uint32_t convert2ioeventbits_iopoll(uint32_t events)

Converts Linux specific epoll_event->events into ioevent_e.

convert2epolleventbits

static inline uint32_t convert2epolleventbits_iopoll(uint32_t ioevents)

Converts ioevent_e into Linux epoll event bits.

convert2epollevent_iopoll

static inline void convert2epollevent_iopoll(
   /*out*/struct epoll_event *epevent,
   const ioevent_t *ioevent
)

Converts ioevent_t into Linux struct epoll_event.

lifetime

init_iopoll

int init_iopoll(/*out*/iopoll_t *iopoll)

Creates epoll event notification facility.

free_iopoll

int free_iopoll(iopoll_t *iopoll)

Frees Linux epoll object.

query

change

registerfd_iopoll

int registerfd_iopoll(iopoll_t *iopoll,
sys_iochannel_t fd,
const struct ioevent_t *for_event)

Adds file descriptor to Linux epoll object.

updatefd_iopoll

int updatefd_iopoll(iopoll_t *iopoll,
sys_iochannel_t fd,
const struct ioevent_t *updated_event)

Updates event mask/value of sys_iochannel_t registered at Linux epoll object.

updatefd_iopoll

Unregisteres sys_iochannel_t at Linux epoll object.

test

Facility to manage a set of sys_iochannel_t and to wait and query for IO events of type ioevent_t.
Implements IOPoll.
static inline uint32_t convert2ioeventbits_iopoll(uint32_t events)
Converts Linux specific epoll_event->events into ioevent_e.
Defines list of IO events.
static inline uint32_t convert2epolleventbits_iopoll(uint32_t ioevents)
Converts ioevent_e into Linux epoll event bits.
static inline void convert2epollevent_iopoll(
   /*out*/struct epoll_event *epevent,
   const ioevent_t *ioevent
)
Converts ioevent_t into Linux struct epoll_event.
struct ioevent_t
Associates one or more ioevent_e with an ioevent_id_t.
int init_iopoll(/*out*/iopoll_t *iopoll)
Creates epoll event notification facility.
int free_iopoll(iopoll_t *iopoll)
Frees Linux epoll object.
int registerfd_iopoll(iopoll_t *iopoll,
sys_iochannel_t fd,
const struct ioevent_t *for_event)
Adds file descriptor to Linux epoll object.
int updatefd_iopoll(iopoll_t *iopoll,
sys_iochannel_t fd,
const struct ioevent_t *updated_event)
Updates event mask/value of sys_iochannel_t registered at Linux epoll object.
#define sys_iochannel_t int
Choose Posix file descriptor type.
Close