Cross-platform asynchronous I/O
The race condition in a nutshell:
if ((pid = fork()) > 0) {
kill(pid, SIGTERM);
}
else if (pid == 0) {
execve("/bin/cat", argp, envp);
}
The parent sends a signal immediately after forking.
Since the child may not have called `execve()` yet,
there is no telling what process receives the signal,
our fork or /bin/cat.
To avoid ambiguity, we create a pipe with both ends
marked close-on-exec. Then, after the call to `fork()`,
the parent polls the read end until it sees POLLHUP.
|
||
|---|---|---|
| doc | ||
| include | ||
| msvs | ||
| src | ||
| test | ||
| .gitignore | ||
| AUTHORS | ||
| config-mingw.mk | ||
| config-unix.mk | ||
| LICENSE | ||
| Makefile | ||
| README | ||
This is the new networking layer for Node. Its purpose is to abstract IOCP on windows and libev on Unix systems. We intend to eventually contain all platform differences in this library. http://nodejs.org/ (This was previously called liboio) Supported Platforms: Microsoft Windows operating systems since Windows XP sp2. It can be built with either Visual Studio or MinGW. Linux 2.6 and MacOS using the GCC toolchain. Solaris 121 and later using GCC toolchain.