generate a process with large argv for proc_args testing
This commit is contained in:
1 parent
b8acea2adb
commit
2642e5ff3b
1 file changed
+21
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
#generate a process with large argv for proc_args testing
|
||||
|
||||
use strict;
|
||||
|
||||
if (@ARGV) {
|
||||
print "pid=$$\n";
|
||||
<STDIN>;
|
||||
}
|
||||
else {
|
||||
my(@argv);
|
||||
my $nargs = 126;
|
||||
my $arglen = 256;
|
||||
my $arg = 'a';
|
||||
for (my $i=0; $i<$nargs; $i++) {
|
||||
push @argv, $arg++ x $arglen;
|
||||
}
|
||||
|
||||
exec $^X, $0, @argv;
|
||||
}
|
||||
Reference in new issue
Block a user