-
-
Save tonistiigi/9721405 to your computer and use it in GitHub Desktop.
spawn with closed stdin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spawn = require('child_process').spawn | |
function run() { | |
var cat = spawn('cat') | |
cat.stdin.end('foo') | |
} | |
// process.stdin.resume() | |
// process.stdin.on('end', run) | |
process.stdin.end() | |
run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[pid 4907] set_robust_list(0x7f356884da20, 0x18 <unfinished ...> | |
[pid 4905] <... close resumed> ) = 0 | |
[pid 4907] <... set_robust_list resumed> ) = 0 | |
[pid 4905] read(15, <unfinished ...> | |
[pid 4907] dup2(10, 0) = 0 | |
[pid 4907] ioctl(0, FIONBIO, [0]) = 0 | |
[pid 4907] close(0) = 0 | |
[pid 4907] dup2(12, 1) = 1 | |
[pid 4907] ioctl(1, FIONBIO, [0]) = 0 | |
[pid 4907] close(11) = 0 | |
[pid 4907] dup2(14, 2) = 2 | |
[pid 4907] ioctl(2, FIONBIO, [0]) = 0 | |
[pid 4907] close(13) = 0 | |
[pid 4907] close(10) = 0 | |
[pid 4907] close(12) = 0 | |
[pid 4907] close(14) = 0 | |
[pid 4907] execve("/usr/local/sbin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4907] execve("/usr/local/bin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4907] execve("/usr/sbin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4907] execve("/usr/bin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4907] execve("/sbin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4907] execve("/bin/cat", ["cat"], [/* 8 vars */]) = 0 | |
[pid 4905] <... read resumed> "", 4) = 0 | |
[pid 4905] close(15) = 0 | |
[pid 4905] close(10 <unfinished ...> | |
[pid 4907] brk(0 <unfinished ...> | |
[pid 4905] <... close resumed> ) = 0 | |
[pid 4905] ioctl(0, FIONBIO <unfinished ...> | |
[pid 4907] <... brk resumed> ) = 0x967000 | |
[pid 4905] <... ioctl resumed> , [1]) = 0 | |
[pid 4905] close(12) = 0 | |
[pid 4907] access("/etc/ld.so.nohwcap", F_OK <unfinished ...> | |
[pid 4905] ioctl(11, FIONBIO, [1]) = 0 | |
[pid 4905] close(14 <unfinished ...> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[pid 4911] set_robust_list(0x7f1f4f4ada20, 0x18 <unfinished ...> | |
[pid 4909] <... close resumed> ) = 0 | |
[pid 4911] <... set_robust_list resumed> ) = 0 | |
[pid 4909] read(15, <unfinished ...> | |
[pid 4911] close(0) = 0 | |
[pid 4911] dup2(10, 0) = 0 | |
[pid 4911] close(10) = 0 | |
[pid 4911] ioctl(0, FIONBIO, [0]) = 0 | |
[pid 4911] close(11) = 0 | |
[pid 4911] dup2(12, 1) = 1 | |
[pid 4911] close(12) = 0 | |
[pid 4911] ioctl(1, FIONBIO, [0]) = 0 | |
[pid 4911] close(13) = 0 | |
[pid 4911] dup2(14, 2) = 2 | |
[pid 4911] close(14) = 0 | |
[pid 4911] ioctl(2, FIONBIO, [0]) = 0 | |
[pid 4911] execve("/usr/local/sbin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4911] execve("/usr/local/bin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4911] execve("/usr/sbin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4911] execve("/usr/bin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4911] execve("/sbin/cat", ["cat"], [/* 8 vars */]) = -1 ENOENT (No such file or directory) | |
[pid 4911] execve("/bin/cat", ["cat"], [/* 8 vars */]) = 0 | |
[pid 4911] brk(0 <unfinished ...> | |
[pid 4909] <... read resumed> "", 4) = 0 | |
[pid 4911] <... brk resumed> ) = 0x12ba000 | |
[pid 4909] close(15 <unfinished ...> | |
[pid 4911] access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
[pid 4909] <... close resumed> ) = 0 | |
[pid 4911] mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...> | |
[pid 4909] close(10) = 0 | |
[pid 4909] ioctl(0, FIONBIO <unfinished ...> | |
[pid 4911] <... mmap resumed> ) = 0x7f0db321c000 | |
[pid 4909] <... ioctl resumed> , [1]) = 0 | |
[pid 4909] close(12 <unfinished ...> | |
[pid 4911] access("/etc/ld.so.preload", R_OK <unfinished ...> | |
[pid 4909] <... close resumed> ) = 0 | |
[pid 4909] ioctl(11, FIONBIO, [1]) = 0 | |
[pid 4911] <... access resumed> ) = -1 ENOENT (No such file or directory) | |
[pid 4909] close(14) = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment