Messages in this thread | | | From | "Hua Zhong" <> | Subject | RE: [PATCH 2.6.9] fork: add a hook in do_fork() | Date | Tue, 23 Nov 2004 01:59:20 -0800 |
| |
> + static int fork_hook_id = 0; > + > + /* We can set the hook if it's not already used */ > + if ((func != NULL) && (fork_hook_id == 0)) { > + fork_hook = func; > + fork_hook_id = id; > + return 0; > + }
What happens if two modules are calling the same function at the same time?
> + > + if (fork_hook != NULL) > + fork_hook(current->pid, pid); > + > return pid;
What happens if the module is unloaded between the test and the call to fork_hook?
Hua
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |