2005-06-03 01:55:40 +08:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
#generate a process with large argv for proc_args testing
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
if (@ARGV) {
|
|
|
|
print "pid=$$\n";
|
|
|
|
<STDIN>;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
my(@argv);
|
2005-11-17 10:50:37 +08:00
|
|
|
my $nargs = 26;
|
|
|
|
my $arglen = 4256;
|
2005-06-03 01:55:40 +08:00
|
|
|
my $arg = 'a';
|
|
|
|
for (my $i=0; $i<$nargs; $i++) {
|
|
|
|
push @argv, $arg++ x $arglen;
|
|
|
|
}
|
2005-11-17 10:50:37 +08:00
|
|
|
print "$^X $0\n";
|
|
|
|
exec $^X, $0, @argv or die $!;
|
2005-06-03 01:55:40 +08:00
|
|
|
}
|