[comp.sys.apollo] process priority system calls

etb@milton.u.washington.edu (Eric Bushnell) (03/26/91)

Yes, I'm still frogging around with this stuff 
(some of you may recall an earlier thread about renice et al).
I have two (2) questions.

I'm trying to write a program that gives users control
over their process priorities without allowing them to
block system processes and without relying on Domain to
make up its own priority mapping. I want it to have the
fine granularity and upper/lower bounds of /com/ppri and
the user id checking of normal /etc/renice.

1) Can anybody tell me about proc2_$set_priority(),
which is what /com/ppri uses? Some call that converts unix 
process IDs to apollo uid's would be handy, too.

For now, I'm using a wrapper around /com/pst and /com/ppri for process
info and manipulation. I thought I could use the
error codes returned by set/getpriority() to test
for process ownership, but I haven't gotten that to work.

2) Have set/getpriority() been modified so that they don't
return the ownership errors?

Has anybody else messed with this stuff, and wanna compare
notes? (OK, so it's three questions)

Thanks, everybody.

Eric Bushnell
Univ of Washington Civil Engineering
etb@zeus.ce.washington.edu
etb@milton.u.washington.edu

mmitchel@digi.lonestar.org (Mitch Mitchell) (03/28/91)

In article <19041@milton.u.washington.edu> etb@milton.u.washington.edu (Eric Bushnell) writes:
>1) Can anybody tell me about proc2_$set_priority(),
>which is what /com/ppri uses?

Here is a program I wrote when playing (uh... testing) the 
proc2_$set_priority system call.

#include <apollo/base.h>
#include <apollo/proc2.h>
#include <stdio.h>

void proc2_$set_priority(
        uid_$t          &puid,
        unsigned short  &lpri,
        unsigned short  &hpri,
        status_$t       *sts);

int main(argc, argv, envp)
int argc;
char **argv, **envp;
{
    uid_$t        p2_uid;
    status_$t     status;
    unsigned short hpriority = 1; /* higher limit process priority */
    unsigned short lpriority = 5; /* lower limit of process priority */

    proc2_$who_am_i(&p2_uid);

    proc2_$set_priority(p2_uid,lpriority,hpriority,&status);

    (void) getchar();
}
-- 
**************************************************************************
* {letni | egsner | mic | supernet}!harlie!mitch     Mitch Mitchell      *
* {uunet | texsun | sulaco}!digi!mmitchel      Voice Mail (214) 519-3257 *
* mmitchel@digi.lonestar.org                     FidoNet: 1:124/4115.224 *