generate a process with large argv for proc_args testing
This commit is contained in:
parent
b8acea2adb
commit
2642e5ff3b
21
exp/argv.pl
Normal file
21
exp/argv.pl
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user