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:
Peter Dufault 1998-05-18 12:53:45 +00:00
parent af9f1d50ae
commit 2a61a11038
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36155
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.type = (policy == SCHED_FIFO)
? RTP_PRIO_FIFO : RTP_PRIO_REALTIME; ? 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; p->p_rtprio = rtp;
(void)resetpriority(p); (void)resetpriority(p);
} }
@ -174,7 +174,7 @@ int ksched_setscheduler(int *ret, struct ksched *ksched,
case SCHED_OTHER: case SCHED_OTHER:
{ {
rtp.type = RTP_PRIO_NORMAL; 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; p->p_rtprio = rtp;
/* XXX Simply revert to whatever we had for last /* 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; 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 int
syscall_not_present(struct proc *p, const char *s, struct nosys_args *uap) 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", log(LOG_ERR, "cmd %s pid %d tried to use non-present %s\n",
p->p_comm, p->p_pid, s); 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) #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.type = (policy == SCHED_FIFO)
? RTP_PRIO_FIFO : RTP_PRIO_REALTIME; ? 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; p->p_rtprio = rtp;
(void)resetpriority(p); (void)resetpriority(p);
} }
@ -174,7 +174,7 @@ int ksched_setscheduler(int *ret, struct ksched *ksched,
case SCHED_OTHER: case SCHED_OTHER:
{ {
rtp.type = RTP_PRIO_NORMAL; 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; p->p_rtprio = rtp;
/* XXX Simply revert to whatever we had for last /* 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; 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 int
syscall_not_present(struct proc *p, const char *s, struct nosys_args *uap) 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", log(LOG_ERR, "cmd %s pid %d tried to use non-present %s\n",
p->p_comm, p->p_pid, s); 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) #if !defined(_KPOSIX_PRIORITY_SCHEDULING)