Operating System - OpenVMS
1831185 Members
2863 Online
110021 Solutions
New Discussion

F$GETJPI using BYTLM item returns BYTCNT

 
SOLVED
Go to solution
Chris Warne_1
Advisor

F$GETJPI using BYTLM item returns BYTCNT

I would expect the following to return the process BYTLM as defined in the UAF (or the PQL_MBYTLM SYSGEN value if greater)

$ PID = F$GETJPI("","PID")
$ BYTLM = F$GETJPI("''PID'","BYTLM")

However, it appears to return the BYTCNT.
All other items (such as FILLM, ENQLM etc) work as expected.
Is this a bug, or am I missing something?!
Chris
9 REPLIES 9
Ian Miller.
Honored Contributor

Re: F$GETJPI using BYTLM item returns BYTCNT

For some operations the limit BYTLM is decremented as well as the BYTCNT. This may explain why you see these being the same.

$ BYTLM = F$GETJPI("''PID'","BYTLM")
$ BYTCNT = F$GETJPI("''PID'","BYTCNT")
____________________
Purely Personal Opinion
Ian Miller.
Honored Contributor

Re: F$GETJPI using BYTLM item returns BYTCNT

for example when a mailbox is created the process BYTLM and BYTCNT are decremented to account for the non-paged pool occupied by the mailbox UCB.
____________________
Purely Personal Opinion
Kris Clippeleyr
Honored Contributor

Re: F$GETJPI using BYTLM item returns BYTCNT

Hi Chris,

This is AFAIK a long standing bug in not only F$GETJPI, but also in SYS$GETJPI.
The original value of BYTLM is stored in the JIB (Job Information Block) at offset JIB$L_ORG_BYTLM. The information stored at offset JIB$L_BYTLM is AFAIK always the same as that stored at offset JIB$L_BYTCNT, and that's where F$GETJPI gets the info.

Hope this helps,

Kris.

PS: There is no item code for F$GETJPI to retrieve the original value of BYTLM.

I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Chris Warne_1
Advisor

Re: F$GETJPI using BYTLM item returns BYTCNT

I see! Thanks for the reply.

It's a bit irritating though - what I was hoping to do is use GETJPI in a DCL script to save certain UAF values before temporarily increasing them for a software install, then resetting them back to the original values. Guess I'll have to use a less "elegant" method involving output files!

Cheers,

Chris

Chris
Ian Miller.
Honored Contributor

Re: F$GETJPI using BYTLM item returns BYTCNT

BYTLM and BYTCNT are not always the same. As I said for some operations both are decremented (where a long lived data structure is created in pool such as mailbox ucb or a WCB) and for some only BYTCNT is decremented (e.g for buffers created in pool for buffered I/O) operations).

____________________
Purely Personal Opinion
labadie_1
Honored Contributor
Solution

Re: F$GETJPI using BYTLM item returns BYTCNT

for the process with the pid 76A9, this will display the original BYTLM

pipe (wr sys$output "read sysdef" ; wr sys$output "set proc/id=76A9" ; wr sys$output "for jib" ) | ana/sys | sea sys$pipe JIB$L_OR
G_BYTLM
labadie_1
Honored Contributor

Re: F$GETJPI using BYTLM item returns BYTCNT

for use in a Dcl procedure

$ pipe (wr sys$output "read sysdef" ; wr sys$output "set proc/id=76A9" ; wr sys$output "for jib" ) | ana/sys | sea sys$pipe JIB$L_OR
G_BYTLM | (read sys$pipe tmp1 ; def/job tmp1 &tmp1)

then translate the logical and extract, here, with my Vms version

$ wr sys$output f$extract(52,20,f$trn("tmp1"))
00061A80
$ bytorg = f$extract(52,20,f$trn("tmp1"))

but this can change a little depending on the Vms versions, patches applied...


Chris Warne_1
Advisor

Re: F$GETJPI using BYTLM item returns BYTCNT

Thanks for the help, guys.....

A little more complex than a single GETJPI call, but it gets the job done!
Chris
Chris Warne_1
Advisor

Re: F$GETJPI using BYTLM item returns BYTCNT

Problem explained and solved!
Chris