Runtime Info
2001-11-11 01:57:41
Category: perl:runtime
Description: Displays some runtime information like the PID and the current priority level.
Author: detour
Viewed: 1838
Rating: (2 votes)


#!/usr/bin/perl
#
# Runtime Info written by detour@metalshell.com
#
# Displays the PID, UID, GID, EUID, EGID, and the runtime priority
#
# http://www.metalshell.com
#
 
 
 
print "\nDisplay Runtime Info for $0\n";
print "----------------------------------\n";
print "PID           # ( $$ )\n";
print "REAL UID      # ( $< )\n";
print "EFFECTIVE UID # ( $> )\n";
print "REAL GID      # ( $( )\n";
print "EFFECTIVE GID # ( $) )\n";
 
# getpriority(WHICH, WHO)
#
# WHICH = 0, 1 or 2 for process priority, process group, and user priority.
# WHO = 0 for current user
#
# getpriority may not work on all systems.
#
 
$priority = getpriority(0,0);
 
print "Priority      # ( $priority )\n\n";