Operating System - OpenVMS
1830503 Members
2537 Online
110006 Solutions
New Discussion

Re: $GETJPI can't retrieve JTQUOTA?

 
Galen Tackett
Valued Contributor

$GETJPI can't retrieve JTQUOTA?

This question arises from curiosity and not from any important need to know, but it might be interesting to hear what some of you have to say.

I'd like to do something like this in a command procedure running unprivileged:

$ JTQ = F$GETJPI("","JTQUOTA")

or else, from C or another language, call a system service to do the same thing.

Unfortunately there doesn't appear to be an item code for sys$getjpi() (the underlying system service) that returns that quota's value. It looks like there are such item codes for every other process quota except naturally for PBYTLM and QUEPRI, which are "reserved" (and likely to remain so) even though you can set them in SYSUAF.

I wonder if it's just an oversight that there isn't one for JTQUOTA, or if maybe the developers figured it was unlikely that anyone would want to do this.

Again, I'm asking this out of sheer curiosity.

Thanks for any comments,

Galen
6 REPLIES 6
labadie_1
Honored Contributor

Re: $GETJPI can't retrieve JTQUOTA?

$ sh log/job/fu will show the allocated and remaining quota for jtquota if memory serves me
Ian Miller.
Honored Contributor

Re: $GETJPI can't retrieve JTQUOTA?

$ SHOW LOGICAL/JOB/FULL does display remaining and total quota but there does not appear to be a system service to get this information.

____________________
Purely Personal Opinion
John Gillings
Honored Contributor

Re: $GETJPI can't retrieve JTQUOTA?

Galen,

Good question. I guess the reason is that JTQUOTA isn't like other quotas, in that it's only used once - when the process is created - to set quota on the job logical name table. Management of the quota is then handled by the logical name subsystem, just like it is for any other shared logical name table.

Although there is a JIB$L_JTQUOTA field in the JIB, it doesn't look like it's written. (If it was, you could figure out the JIB address from the translation of LNM$PROCESS, then calculate the cell address with offset JIB$L_JTQUOTA and access the location directly using F$FAO)

If you're confident that the process was created through the UAF, you could use $GETUAI with item UAI$_JTQUOTA to look at the UAF record (no privilege required to read the record of the username of the requestor).

There is no public API to get at the quota fields in logical name table structures. Looks like the best you can do is parse the output of SHOW LOGICAL/FULL Perhaps it should be an item in $TRNLNM?
A crucible of informative mistakes
Galen Tackett
Valued Contributor

Re: $GETJPI can't retrieve JTQUOTA?

Labadie, Ian, and John,

Thanks for your replies to my question.

John, yours is especially interesting in that you provide plenty of detail from an "insider's" vantage point. However for my [admittedly trivial] purpose, an item code JPI$_JTQUOTA for $GETJPI would be more directly helpful (and perhaps easier for HP to implement?) than the $TRNLNM route.

I had thought about $GETUAI. I could go that route, and in the foreseeable future would probably do so. $GETJPI has the advantage of a corresponding lexical in DCL, of course...

Thanks again. Further comments or insight continue to be welcome.

Galen
Jan van den Ende
Honored Contributor

Re: $GETJPI can't retrieve JTQUOTA?

Galen,

it seems to me that one remark by John deserves some extra attention:

If you're confident that the process was created through the UAF,


This implies, that any value retrieved (by any means) from SYSUAF is void for processes that do NOT meet that criterion.

$GETJPI & $TRNLNM would be more generic. And your added advantage for $GETJPI to trickle down to DCL is valid for $TRNLNM as well, of course.

just my EUR 0.02

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Galen Tackett
Valued Contributor

Re: $GETJPI can't retrieve JTQUOTA?

Jan,

You make a good point about $GETUAI only being useful for processes created via SYSUAF. But for my [imagined] uses this wouldn't be a concern.

As for how to make the value of JTQUOTA available--

I was thinking in terms of process-related information, so as you'd expect $GETJPI naturally came to mind. I wouldn't automatically have associated logical names or logical name tables with finding the value of a process quota. But clearly either way would do the trick.

Thanks,

Galen