* 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:
Ingo Weinhold
2007-10-01 01:37:28 +00:00
parent f5ede4ec02
commit 66c03dc3a9
7 changed files with 394 additions and 246 deletions
+2
View File
@@ -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;