[comp.os.vms] Querry on interactive /batch users .

MICHAL@UKANVAX.BITNET (04/20/88)

EASY QUESTION:

 Does any one know of a fucntion, system service, or anything that may be
called from a high level langauge (Pascal, C) that would do the same as
VMS's $ SHOW USERS <user_name> ?
 I would like to check if a user is signed on (interactive or batch)
without doing LIB$SPAWN('$ SHOW USERS auser')
 Is there a simpler  way??

+-----------------------------------------------------------------------------+
|   Michal Chmielewski                           K   K    U     U             |
|   Academic Computing Services                  K  K     U     U      1988   |
|   University of Kansas                         K K      U     U      NCAA   |
|   Lawrence, KS 66045                           KK       U     U     CHAMPS  |
|   Audio : 1-(913)-864-0443                     K K      U     U             |
|   BitNet: michal@ukanvax.bitnet                K  K     U     U   JAYHAWKS !|
|           michal@ukanvm.bitnet                 K   K     UUUUU              |
+-----------------------------------------------------------------------------+

rstpierr@hawk.ulowell.edu (Pete St.Pierre) (05/04/88)

In article <8804260602.AA21680@ucbvax.Berkeley.EDU> MICHAL@UKANVAX.BITNET writes:
>EASY QUESTION:
>
> Does any one know of a fucntion, system service, or anything that may be
>called from a high level langauge (Pascal, C) that would do the same as
>VMS's $ SHOW USERS <user_name> ?
> I would like to check if a user is signed on (interactive or batch)
>without doing LIB$SPAWN('$ SHOW USERS auser')
> Is there a simpler  way??
>

	The $GETJPI system service has an item called JPI$_JOBTYPE that
	can be specified.  It returns the excecution mode of the process.
	(DETACHED, NETWORK, BATCH, LOCAL, DIALUP, REMOTE).  SEE PAGE SYS-215
	of the system service manual.

					...Pete
------------------------------------------------------------------------------
| Bob (Pete) St.Pierre          |                                            |
| rstpierr@falcon.ulowell.edu   |                                            |
| University of Lowell          |                                            |
| 1 University Ave              |                                            |
| Lowell, Mass 01854            |                                            |
------------------------------------------------------------------------------

ACSCCRA@UBVMSC.CC.BUFFALO.EDU ("Curtis R. Anderson") (05/23/88)

>EASY QUESTION:
> 
> Does any one know of a fucntion, system service, or anything that may be
>called from a high level langauge (Pascal, C) that would do the same as
>VMS's $ SHOW USERS <user_name> ?
> I would like to check if a user is signed on (interactive or batch)
>without doing LIB$SPAWN('$ SHOW USERS auser')
> Is there a simpler  way??

Sure.  Use LIB$GETJPI, passing JPI$_USERNAME as the first parameter, and -1 for
the initial PID.  Make sure the PID is in a variable so the call can change it.
Insure you have a descriptor ready to receive at least 12 characters.  Don't
forget turning on WORLD privilege. 

See the entry for LIB$GETJPI in the Run-time Library Routines reference
for exact order of parameters.  I think you need three or four parameters.

  --Curtis

Batteries not included.