Lines Matching refs:handle
8 #include <sys/handle.h>
36 Handle *handle, *handle_tmp;
39 TAILQ_FOREACH_SAFE(handle, &proc->handles[i], handleList, handle_tmp) {
40 TAILQ_REMOVE(&proc->handles[i], handle, handleList);
41 (handle->close)(handle);
47 Handle_Add(Process *proc, Handle *handle)
51 handle->fd = proc->nextFD;
53 handle->processId = proc->pid;
55 slot = handle->fd % PROCESS_HANDLE_SLOTS;
57 TAILQ_INSERT_HEAD(&proc->handles[slot], handle, handleList);
59 return handle->fd;
63 Handle_Remove(Process *proc, Handle *handle)
65 int slot = handle->fd % PROCESS_HANDLE_SLOTS;
67 TAILQ_REMOVE(&proc->handles[slot], handle, handleList);
74 Handle *handle;
76 TAILQ_FOREACH(handle, &proc->handles[slot], handleList) {
77 if (handle->fd == fd)
78 return handle;