scanint
(void) scanint(str, &signum);
if (scanint(str, &procnum) == -1)
procnum = scanint(str, &prio);