File: test-proc

package info (click to toggle)
libpar-packer-perl 1.006-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,276 kB
  • ctags: 655
  • sloc: perl: 14,808; ansic: 944; makefile: 30
file content (19 lines) | stat: -rwxr-xr-x 409 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl -w

use strict;

my $proc;
if( $^O =~ /linux/i ) {
    $proc = "/proc/$$/exe";
} else {
    $proc = "/proc/$$/file";
}

print "0 = $0\n";
$ENV{PAR_PROGNAME} ||= '';
print "PAR_PROGNAME = $ENV{PAR_PROGNAME}\n";
$ENV{PAR_TEMP} ||= '';
print "PAR_TEMP = $ENV{PAR_TEMP}\n";
if( $proc && $^O ne 'freebsd') { # /proc/$$/file is unreliable on FreeBSD
    print "exec = ", readlink( $proc  ), "\n";
}