[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

433.0. "Help with f$lex for uniqueness" by PARITY::ORNSTEIN (Ian Ornstein DTN 247-2492) Fri Mar 27 1987 16:18

    I was looking for a unique string associated with a user's terminal
    session.  The user environment is many users sharing a single
    captive account.
    
    I have looked at f$pid and I haven't figured out how to get the
    process id of the process that is invoking the f$pid and know
    which one is which!  F$pid gets pids from a list, not just the *ONE*
    I wanted.
    
    So far the best I've got is the process name.
    
    Any ideas on uniqueness out there?
    
    					- Ian -
T.RTitleUserPersonal
Name
DateLines
433.1f$getjpi()VAXUUM::DYERAdventures in SuccessFri Mar 27 1987 16:383
Use f$getjpi(); f$getjpi(0,"pid") is your current PID.  You can then use that
 PID to get other information with f$getjpi().
  <_Jym_>
433.2just use "" in lieu of pidVIDEO::OSMANtype video::user$7:[osman]eric.sixFri Mar 27 1987 19:056
If you're only interrogating your own job, there's no need to get your
pid first.  Just do this:

	f$getjpi ("","whatever-item-you-want")

/Eric
433.30 or "" - Same DifferenceVAXUUM::DYERAdventures in SuccessMon Mar 30 1987 13:120
433.4you missed my pointVIDEO::OSMANtype video::user$7:[osman]eric.sixMon Mar 30 1987 20:0310
    You missed my point.
    
    I was pointing out that .1's suggestion about getting your own
    pid and THEN using it to get other info is not necessary.
    
    You can get the other info directly.
    
    I wasn't talking about 0 vs. "".
    
    /Eric
433.5need more info...then maybe...LASSEN::GERMANOMon Mar 30 1987 21:435
I think I have some ideas (& hacks) for you but not sure what
your end goal is.  Do you have the users cooperation or do you
want to do this surreptitiously or as a manager?  Are the users
remote logins, locals, or a mixed bag? 
John
433.6Maybe Process name good enough?DLO05::BEATTIEBliss is NOT ignorance (is it?)Thu Apr 02 1987 16:0916
    If I understand the question in .0, I believe that your own suggestion
    of using the process name will be good enough.  VAX VMS guarantees
    that on a given VMS system, and within the SAME group, the process
    name for each process must be unique.
    
    Since all users are using the same captive account, they all have
    the same UIC, and are therefore all in the same group, and must
    therefore all have unique process names [intended as a rhetorical
    question] ??
    
    Of course, in order for you to specify a process by name [for process
    control funtions, for instance], your process must also be in the 
    same group...
    
    Hope this helps.
						-- Brian
433.7TLE::BRETTThu Apr 02 1987 20:0110
    Last time I checked VAX VMS made no such guarantee!
    
    The simplest way to get two processes in the same group
    with the same name is
    
    		$ SET UIC [some other group]
    		$ SET PROCESS/NAME="Same name"
    		$ SET UIC [same group]
    
    /Bevin
433.8I don't think that ? was rhetoricalIDLEWD::LENZMEIERChuck, DECwest EngineeringFri Apr 03 1987 01:1810
Re:  .6, .7

.7 is correct that it is possible to have two processes in the
same group with the same name.

However, if all of the processes in question are running under 
the same captive account, and the captive procedure doesn't allow 
the user to change the process's UIC (we can only hope that the 
account doesn't have CMEXEC or CMKRNL!), then none of the processes
will have the same name.
433.9you can get dup. names even WITHOUT set uicVIDEO::OSMANtype video::user$7:[osman]eric.sixFri Apr 03 1987 13:228
No, you are *not* guaranteed unique process names.

You don't even need SET UIC privileges to create multiple names.

My favorite method is with SET HOST.  I've described how to do this
in other notes and will repeat if needed.

/Eric
433.10Users Can Get Quite CuteCLOSET::DYERI Park at Mrs. Nelson's Candy HouseTue Apr 07 1987 19:382
Also bear in mind that users can change process names, but not PIDs.
 <_Jym_>