-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve internal error checking of dup2, pipe
- Loading branch information
1 parent
b5868af
commit c93522a
Showing
8 changed files
with
137 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#$test($ignored = 'cygwin|msys') | ||
|
||
# set file descriptor limit | ||
var ex = 435 as Any | ||
|
||
ulimit -S -n 6 | ||
try { | ||
ls | grep '*' | grep '*' | grep '*' | grep '*' | grep '*' | ||
} catch e { $ex = $e; } # too many open pipe | ||
assert ($ex as SystemError).message() =~ $/pipe opend failed, caused by.*many.*file.*/ | ||
|
||
{ | ||
var fds : [FD] | ||
for(var i = 0; $i < 10; $i++) { | ||
$fds.add(try{ $STDIN.dup(); } catch _ { break; }) | ||
} # open fd up to limit | ||
if !$fds.empty() { | ||
$fds.pop() # close one fd | ||
} | ||
$ex = 34 | ||
try { | ||
echo &> /dev/null | ||
} catch e { $ex = $e; } | ||
assert ($ex as SystemError).message() =~ $/.*cannot save file descriptors, caused by.*argument.*/ | ||
} | ||
|
||
true |