1. Don't use "nosys" and generate coredumps for unconfigured

system calls - return ENOSYS per the spec.

2. Fix interface stub to set priority properly.
This commit is contained in:
dufault 1998-05-18 12:53:45 +00:00
parent ebd6489ab5
commit 63a9967cb6
4 changed files with 22 additions and 6 deletions

View File

@ -161,7 +161,7 @@ int ksched_setscheduler(int *ret, struct ksched *ksched,
rtp.type = (policy == SCHED_FIFO)
? RTP_PRIO_FIFO : RTP_PRIO_REALTIME;
rtp.prio = p4prio_to_rtpprio(RTP_PRIO_MAX);
rtp.prio = p4prio_to_rtpprio(param->sched_priority);
p->p_rtprio = rtp;
(void)resetpriority(p);
}
@ -174,7 +174,7 @@ int ksched_setscheduler(int *ret, struct ksched *ksched,
case SCHED_OTHER:
{
rtp.type = RTP_PRIO_NORMAL;
rtp.prio = p4prio_to_rtpprio(RTP_PRIO_MIN);
rtp.prio = p4prio_to_rtpprio(param->sched_priority);
p->p_rtprio = rtp;
/* XXX Simply revert to whatever we had for last

View File

@ -106,12 +106,20 @@ int p31b_proc(struct proc *p, pid_t pid, struct proc **pp)
return ret;
}
/* The system calls return ENOSYS if an entry is called that is
* not run-time supported. I am also logging since some programs
* start to use this when they shouldn't. That will be removed if annoying.
*/
int
syscall_not_present(struct proc *p, const char *s, struct nosys_args *uap)
{
log(LOG_ERR, "cmd %s pid %d tried to use non-present %s\n",
p->p_comm, p->p_pid, s);
return nosys(p, uap);
/* a " return nosys(p, uap); " here causes a core dump.
*/
return ENOSYS;
}
#if !defined(_KPOSIX_PRIORITY_SCHEDULING)

View File

@ -161,7 +161,7 @@ int ksched_setscheduler(int *ret, struct ksched *ksched,
rtp.type = (policy == SCHED_FIFO)
? RTP_PRIO_FIFO : RTP_PRIO_REALTIME;
rtp.prio = p4prio_to_rtpprio(RTP_PRIO_MAX);
rtp.prio = p4prio_to_rtpprio(param->sched_priority);
p->p_rtprio = rtp;
(void)resetpriority(p);
}
@ -174,7 +174,7 @@ int ksched_setscheduler(int *ret, struct ksched *ksched,
case SCHED_OTHER:
{
rtp.type = RTP_PRIO_NORMAL;
rtp.prio = p4prio_to_rtpprio(RTP_PRIO_MIN);
rtp.prio = p4prio_to_rtpprio(param->sched_priority);
p->p_rtprio = rtp;
/* XXX Simply revert to whatever we had for last

View File

@ -106,12 +106,20 @@ int p31b_proc(struct proc *p, pid_t pid, struct proc **pp)
return ret;
}
/* The system calls return ENOSYS if an entry is called that is
* not run-time supported. I am also logging since some programs
* start to use this when they shouldn't. That will be removed if annoying.
*/
int
syscall_not_present(struct proc *p, const char *s, struct nosys_args *uap)
{
log(LOG_ERR, "cmd %s pid %d tried to use non-present %s\n",
p->p_comm, p->p_pid, s);
return nosys(p, uap);
/* a " return nosys(p, uap); " here causes a core dump.
*/
return ENOSYS;
}
#if !defined(_KPOSIX_PRIORITY_SCHEDULING)