*Mview management of select/poll/pselect/ppoll
*Mview implements partial virtualization. It means that system calls are executed by the *Mview hypervisor (umview or kmview) when referring to virtualized entities, or by the kernel otherwise.
This is (quite) simple for calls referring to the file system (like open) or to file descriptors (read). The absolute pathname or the file descriptor is the key value to decide whether the call refers to a virtualized entity or not.
Unfortunately the select/poll set of system calls works on sets of file descriptors, maybe some referring to virtualized files and others to real files.
The metod used to manage these calls is an evolution of that used in the Alpine project and then in our former Ale4Net project. When a system call need to define a new file descriptor (open, creat, socket) for a virtualized file, it returns a (valid) file descriptor of a named pipe opened in read_only mode. The other end is opened (twice) by the *mview hypervisor.
A select or poll system call get changed to wait from the real files and something to read from the virtual files. If data on real file unblock the syscall the hypervisor gets informed by ptrace/utrace. If the hypervisor needs to unblock the process (as the state of virtual files change), it sends a char on the named pipe. The process syscall unblocks, the hypervisor gets informed, it rewrites the arguments to merge the events notification on real and virtualized files and finally it reads the char from the named pipe. This latter action is necessary for the next select/poll call block on the virtual file.