Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

finding the job of a process

119 views
Skip to first unread message

Phillip Helbig (undress to reply)

unread,
Jun 30, 2020, 1:00:05 PM6/30/20
to
Given a PID, can I find out which job it belongs to? In particular,
which job-logical-name table it sees?

Arne Vajhøj

unread,
Jun 30, 2020, 1:22:45 PM6/30/20
to
On 6/30/2020 1:00 PM, Phillip Helbig (undress to reply) wrote:
> Given a PID, can I find out which job it belongs to? In particular,
> which job-logical-name table it sees?

If I remember correctly then the job table is:

LNM$JOB_jibaddress

so if you are willing/able to traverse S0 space then
JIB address should be in PCB$L_JIB(pcbaddress).

Arne



Phillip Helbig (undress to reply)

unread,
Jun 30, 2020, 1:40:02 PM6/30/20
to
In article <rdfscs$kp5$1...@gioia.aioe.org>, =?UTF-8?Q?Arne_Vajh=c3=b8j?=
But nothing in F$GETJPI or similar?

Arne Vajhøj

unread,
Jun 30, 2020, 2:06:02 PM6/30/20
to
Not that I am aware of.

Of course I could have missed something.

Arne


VAXman-

unread,
Jun 30, 2020, 2:14:56 PM6/30/20
to
In article <rdfr2h$1tqi$1...@gioia.aioe.org>, hel...@asclothestro.multivax.de (Phillip Helbig (undress to reply)) writes:
>Given a PID, can I find out which job it belongs to? In particular,
>which job-logical-name table it sees?

Language?

--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.

Phillip Helbig (undress to reply)

unread,
Jun 30, 2020, 2:30:20 PM6/30/20
to
In article <00B53271...@SendSpamHere.ORG>, VAXman-
@SendSpamHere.ORG writes:

> In article <rdfr2h$1tqi$1...@gioia.aioe.org>, hel...@asclothestro.multivax.de (Phillip Helbig (undress to reply)) writes:
> >Given a PID, can I find out which job it belongs to? In particular,
> >which job-logical-name table it sees?
>
> Language?

I was thinking of DCL or whatever. The information is of course there
and can be retrieved, but I was wondering if there is a quick solution
with DCL or perhaps ANALYZE/SYSTEM.

erga...@gmail.com

unread,
Jun 30, 2020, 4:04:35 PM6/30/20
to
On Tuesday, 30 June 2020 19:30:20 UTC+1, Phillip Helbig (undress to reply) wrote:

> I was thinking of DCL or whatever. The information is of course there
> and can be retrieved, but I was wondering if there is a quick solution
> with DCL or perhaps ANALYZE/SYSTEM.

If SDA is fine, then the JIB address is right at the top of the
information SHOW PROCESS provides.

Phillip Helbig (undress to reply)

unread,
Jun 30, 2020, 5:01:54 PM6/30/20
to
In article <00B53282...@SendSpamHere.ORG>, VAXman-
@SendSpamHere.ORG writes:

> The PCB is in system space protected ERKW. You'd need to get to EXEC mode.
>
> Pass EPID to EXE{_STD}$CVT_EPID_TO PCB to get the PCB address. The JIB, Job
> Information Block, address is in PCB$L_JIB. This is the valu you see in the
> LNM$JOB_xxxxxxxx table name.
>
> You'd probably want to write such code as a protected shareable which could
> grant controlled access to EXEC to any process not possessing the privilege.
>
> You can do this using SDA too but it's not really geared to use in a program.
>
> SDA> READ SYSDEF
> SDA> SHOW PROCESS/INDEX=<epid>
> SDA> EXAMIN PCB+PCB$L_JIB

That's fine for what I need. In fact, just SDA> SHOW PROCE <name> is
enough; it's at the top right.

Phillip Helbig (undress to reply)

unread,
Jun 30, 2020, 5:22:07 PM6/30/20
to
In article <e262f784-e722-4326...@googlegroups.com>,
Great; the table is just LNM$JOB_ before the address.

hb

unread,
Jun 30, 2020, 5:41:26 PM6/30/20
to
DCL?

$ pipe write sys$output "show proc/id=''pid'" | analyze/sys | (write
sys$output "x:==-" ; search sys$pipe jib) | (@sys$pipe ; write
sys$output "show log /table=LNM$JOB_",f$extract(33,20,x)) | @sys$pipe

VAXman-

unread,
Jun 30, 2020, 6:30:35 PM6/30/20
to

VAXman-

unread,
Jun 30, 2020, 6:49:54 PM6/30/20
to
The PCB is in system space protected ERKW. You'd need to get to EXEC mode.

Pass EPID to EXE{_STD}$CVT_EPID_TO PCB to get the PCB address. The JIB, Job
Information Block, address is in PCB$L_JIB. This is the valu you see in the
LNM$JOB_xxxxxxxx table name.

You'd probably want to write such code as a protected shareable which could
grant controlled access to EXEC to any process not possessing the privilege.

You can do this using SDA too but it's not really geared to use in a program.

SDA> READ SYSDEF
SDA> SHOW PROCESS/INDEX=<epid>
SDA> EXAMIN PCB+PCB$L_JIB


George Cornelius

unread,
Jul 2, 2020, 6:13:42 PM7/2/20
to
In article <00B53282...@SendSpamHere.ORG>, VAXman- @SendSpamHere.ORG writes:
[...]
> The PCB is in system space protected ERKW. You'd need to get to EXEC mode.
>
> Pass EPID to EXE{_STD}$CVT_EPID_TO PCB to get the PCB address. The JIB, Job
> Information Block, address is in PCB$L_JIB. This is the valu you see in the
> LNM$JOB_xxxxxxxx table name.
>
> You'd probably want to write such code as a protected shareable which could
> grant controlled access to EXEC to any process not possessing the privilege.
>
> You can do this using SDA too but it's not really geared to use in a program.
>
> SDA> READ SYSDEF
> SDA> SHOW PROCESS/INDEX=<epid>
> SDA> EXAMIN PCB+PCB$L_JIB
>

Well, you can do this:

EISNER_111> pip (say "read sysdef" ;say "show proc")|anal/sys -
|gawk "/JIB addr/{system(""show logi/tab=LNM$JOB_""$NF);exit}" "-"

(LNM$JOB_82078A00)

"DCL$ATTACH_00009CF3" = "MBA49346:"
"DCL$ATTACH_00009F41" = "MBA49438:"
[...]

EISNER_111> sho sym gawk
GAWK == "$SYS$TOOLS:GAWK.EXE"
EISNER_111> sho sym say
SAY == "WRITE SYS$OUTPUT"

Substitute your own code if you like for the GAWK invocation.

George

VAXman-

unread,
Jul 2, 2020, 7:01:48 PM7/2/20
to
You do realize that requires privileges. ;)
0 new messages