1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * Copyright (c) 1994-1995 S��ren Schmidt 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 283421 2015-05-24 15:51:18Z dchagin $"); |
32 33#include "opt_compat.h" 34 35#include <sys/param.h> 36#include <sys/blist.h> 37#include <sys/fcntl.h> 38#if defined(__i386__) 39#include <sys/imgact_aout.h> --- 2152 unchanged lines hidden (view full) --- 2192 lts.tv_sec = uts.tv_sec; 2193 lts.tv_nsec = uts.tv_nsec; 2194 error = copyout(<s, args->tsp, sizeof(lts)); 2195 } 2196 2197 return (error); 2198} 2199 |
2200#if defined(DEBUG) || defined(KTR) 2201/* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */ 2202 2203u_char linux_debug_map[howmany(LINUX_SYS_MAXSYSCALL, sizeof(u_char))]; 2204 2205static int 2206linux_debug(int syscall, int toggle, int global) 2207{ 2208 2209 if (global) { 2210 char c = toggle ? 0 : 0xff; 2211 2212 memset(linux_debug_map, c, sizeof(linux_debug_map)); 2213 return (0); 2214 } 2215 if (syscall < 0 || syscall >= LINUX_SYS_MAXSYSCALL) 2216 return (EINVAL); 2217 if (toggle) 2218 clrbit(linux_debug_map, syscall); 2219 else 2220 setbit(linux_debug_map, syscall); 2221 return (0); 2222} 2223 2224/* 2225 * Usage: sysctl linux.debug=<syscall_nr>.<0/1> 2226 * 2227 * E.g.: sysctl linux.debug=21.0 2228 * 2229 * As a special case, syscall "all" will apply to all syscalls globally. 2230 */ 2231#define LINUX_MAX_DEBUGSTR 16 |
2232int |
2233linux_sysctl_debug(SYSCTL_HANDLER_ARGS) 2234{ 2235 char value[LINUX_MAX_DEBUGSTR], *p; 2236 int error, sysc, toggle; 2237 int global = 0; 2238 2239 value[0] = '\0'; 2240 error = sysctl_handle_string(oidp, value, LINUX_MAX_DEBUGSTR, req); 2241 if (error || req->newptr == NULL) 2242 return (error); 2243 for (p = value; *p != '\0' && *p != '.'; p++); 2244 if (*p == '\0') 2245 return (EINVAL); 2246 *p++ = '\0'; 2247 sysc = strtol(value, NULL, 0); 2248 toggle = strtol(p, NULL, 0); 2249 if (strcmp(value, "all") == 0) 2250 global = 1; 2251 error = linux_debug(sysc, toggle, global); 2252 return (error); 2253} 2254 2255#endif /* DEBUG || KTR */ 2256 2257int |
2258linux_sched_rr_get_interval(struct thread *td, 2259 struct linux_sched_rr_get_interval_args *uap) 2260{ 2261 struct timespec ts; 2262 struct l_timespec lts; 2263 struct thread *tdt; 2264 int error; 2265 --- 82 unchanged lines hidden --- |