We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

libvpoll: create synthetic events for poll, select and friends

Formale Metadaten

Titel
libvpoll: create synthetic events for poll, select and friends
Serientitel
Anzahl der Teile
779
Autor
Lizenz
CC-Namensnennung 2.0 Belgien:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen.
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
Many programs use poll/select system calls to wait for events that are triggered by file descriptor I/O events. For instance, to write a library able to behave like a network stack (e.g. lwip and picoTCP) or a device, it's possible to implement functions like my_socket, my_accept, my_open and my_ioctl, as drop-in replacement of the system call counterparts. Additionally, it's possible to use dynamic library magic to rename/divert the system call requests to use their virtual implementation provided by the library. Unfortunately this approach cannot be applied to poll/select system calls because Linux doesn't have a system call that permits to generate synthetic generic events for a file descriptor, so it is not possible for libraries to provide file descriptors suitable for select/poll system calls. libvpoll permits to define file descriptors whose I/O events can be generated at user level. This permits to generate synthetic events for poll, select, ppoll, pselect, epoll, etc. The libvpoll library can use two different supports: a module that provides a virtual device and a kernel patch extending the eventfd system call. When neither are availables, a feature-limited emulation is provided as a fallback: based on pipe it manages only POLLIN and POLLOUT. This approach allows mixing real file descriptors with others provided by libraries as parameters of poll/select system calls. For example libvpoll has been used in picoxnet, a user-level network stack implemented as a library for the Internet of Threads. libvpoll, as well as the kernel device module, are already available in Debian.