* fd.c -> fd.cpp
* Reworked the select support:
- The io_context additionally stores a table of lists of select_infos,
which enables it to deselect events of a pending select() when
closing a FD. This prevents a race condition potentially causing a
write to stale memory.
- The opaque selectsync* passed to FSs is now actually a select_info*.
This was necessary, since the FDs deselect() hook (unlike the
select() hook) doesn't take a "ref" argument and deselecting a
single info (e.g. caused by a premature close()) was not possible.
The select() hook's "ref" argument has become superfluous.
- It should now be relatively easy to implement a poll_on_steroids()
that can also wait for objects other than FDs (e.g. semaphores,
ports, threads etc.).
* Set/reset the signal mask in common_select(). This makes pselect()
work as required.
* Reorganized vfs_resize_fd_table().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22391 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,6 +30,7 @@ struct kernel_args;
|
||||
struct vm_cache;
|
||||
struct file_descriptor;
|
||||
struct selectsync;
|
||||
struct select_info;
|
||||
struct pollfd;
|
||||
struct vnode;
|
||||
|
||||
@@ -41,6 +42,7 @@ typedef struct io_context {
|
||||
uint32 table_size;
|
||||
uint32 num_used_fds;
|
||||
struct file_descriptor **fds;
|
||||
struct select_info **select_infos;
|
||||
uint8 *fds_close_on_exec;
|
||||
struct list node_monitors;
|
||||
uint32 num_monitors;
|
||||
|
||||
Reference in New Issue
Block a user