Change the sched_*() functions to return -1 and set errno to ENOSYS
(per the standard) instead of returning ENOSYS. Noted by Ian Zagorskih in PR kern/30970.
This commit is contained in:
parent
2dac3b071c
commit
34ef731cb3
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sched.h,v 1.7 2005/02/03 04:39:32 perry Exp $ */
|
||||
/* $NetBSD: sched.h,v 1.8 2005/10/09 11:17:28 kleink Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -50,7 +50,7 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
/*
|
||||
* These are permitted to fail and return ENOSYS if
|
||||
* These are permitted to fail and return -1 and set errno = ENOSYS if
|
||||
* _POSIX_PRIORITY_SCHEDULING is not defined.
|
||||
*/
|
||||
int sched_setparam(pid_t, const struct sched_param *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sched.c,v 1.3 2003/03/08 08:03:36 lukem Exp $ */
|
||||
/* $NetBSD: sched.c,v 1.4 2005/10/09 11:17:28 kleink Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__RCSID("$NetBSD: sched.c,v 1.3 2003/03/08 08:03:36 lukem Exp $");
|
||||
__RCSID("$NetBSD: sched.c,v 1.4 2005/10/09 11:17:28 kleink Exp $");
|
||||
|
||||
#include <errno.h>
|
||||
#include <sched.h>
|
||||
@ -48,14 +48,18 @@ int pthread__sched_binder;
|
||||
int
|
||||
sched_setparam(pid_t pid, const struct sched_param *param)
|
||||
{
|
||||
return ENOSYS;
|
||||
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
sched_getparam(pid_t pid, struct sched_param *param)
|
||||
{
|
||||
return ENOSYS;
|
||||
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
@ -63,33 +67,43 @@ int
|
||||
sched_setscheduler(pid_t pid, int policy,
|
||||
const struct sched_param *param)
|
||||
{
|
||||
return ENOSYS;
|
||||
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
sched_getscheduler(pid_t pid)
|
||||
{
|
||||
return ENOSYS;
|
||||
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
sched_get_priority_max(int policy)
|
||||
{
|
||||
return ENOSYS;
|
||||
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
sched_get_priority_min(int policy)
|
||||
{
|
||||
return ENOSYS;
|
||||
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
sched_rr_get_interval(pid_t pid, struct timespec *interval)
|
||||
{
|
||||
return ENOSYS;
|
||||
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user