1*ace5b9b5Schristos /* $NetBSD: compat_sched.c,v 1.3 2024/01/20 14:52:46 christos Exp $ */
2461a86f9Schristos
3461a86f9Schristos /*-
4461a86f9Schristos * Copyright (c) 2008 The NetBSD Foundation, Inc.
5461a86f9Schristos * All rights reserved.
6461a86f9Schristos *
7461a86f9Schristos * This code is derived from software contributed to The NetBSD Foundation
8461a86f9Schristos * by Christos Zoulas.
9461a86f9Schristos *
10461a86f9Schristos * Redistribution and use in source and binary forms, with or without
11461a86f9Schristos * modification, are permitted provided that the following conditions
12461a86f9Schristos * are met:
13461a86f9Schristos * 1. Redistributions of source code must retain the above copyright
14461a86f9Schristos * notice, this list of conditions and the following disclaimer.
15461a86f9Schristos * 2. Redistributions in binary form must reproduce the above copyright
16461a86f9Schristos * notice, this list of conditions and the following disclaimer in the
17461a86f9Schristos * documentation and/or other materials provided with the distribution.
18461a86f9Schristos *
19461a86f9Schristos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20461a86f9Schristos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21461a86f9Schristos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22461a86f9Schristos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23461a86f9Schristos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24461a86f9Schristos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25461a86f9Schristos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26461a86f9Schristos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27461a86f9Schristos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28461a86f9Schristos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29461a86f9Schristos * POSSIBILITY OF SUCH DAMAGE.
30461a86f9Schristos */
31461a86f9Schristos
32461a86f9Schristos #include <sys/cdefs.h>
33461a86f9Schristos #if defined(LIBC_SCCS) && !defined(lint)
34*ace5b9b5Schristos __RCSID("$NetBSD: compat_sched.c,v 1.3 2024/01/20 14:52:46 christos Exp $");
35461a86f9Schristos #endif /* LIBC_SCCS and not lint */
36461a86f9Schristos
37461a86f9Schristos #define __LIBC12_SOURCE__
38461a86f9Schristos
39461a86f9Schristos #include "namespace.h"
40461a86f9Schristos #include <sys/types.h>
41461a86f9Schristos #include <sys/time.h>
42461a86f9Schristos #include <compat/sys/time.h>
43*ace5b9b5Schristos #include <compat/include/sched.h>
44461a86f9Schristos #include <unistd.h>
45461a86f9Schristos
46461a86f9Schristos __warn_references(sched_rr_get_interval,
47461a86f9Schristos "warning: reference to compatibility sched_rr_get_interval(); include <sched.h> to generate correct reference")
48461a86f9Schristos
49461a86f9Schristos int
50461a86f9Schristos /*ARGSUSED*/
sched_rr_get_interval(pid_t pid,struct timespec50 * interval)51461a86f9Schristos sched_rr_get_interval(pid_t pid, struct timespec50 *interval)
52461a86f9Schristos {
53461a86f9Schristos interval->tv_sec = 0;
54461a86f9Schristos interval->tv_nsec = sysconf(_SC_SCHED_RT_TS) * 1000;
55461a86f9Schristos return 0;
56461a86f9Schristos }
57