mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 00:33:57 +00:00
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:
parent
af9f1d50ae
commit
2a61a11038
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36155
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue