Deleted Added
sdiff udiff text old ( 293897 ) new ( 294368 )
full compact
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: stable/10/sys/compat/linux/linux_misc.c 293897 2016-01-14 09:11:42Z glebius $");
32
33#include "opt_compat.h"
34#include "opt_kdtrace.h"
35
36#include <sys/param.h>
37#include <sys/blist.h>
38#include <sys/fcntl.h>
39#if defined(__i386__)

--- 2317 unchanged lines hidden (view full) ---

2357 }
2358
2359 return (error);
2360}
2361
2362#if defined(DEBUG) || defined(KTR)
2363/* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */
2364
2365u_char linux_debug_map[howmany(LINUX_SYS_MAXSYSCALL, sizeof(u_char))];
2366
2367static int
2368linux_debug(int syscall, int toggle, int global)
2369{
2370
2371 if (global) {
2372 char c = toggle ? 0 : 0xff;
2373
2374 memset(linux_debug_map, c, sizeof(linux_debug_map));
2375 return (0);
2376 }
2377 if (syscall < 0 || syscall >= LINUX_SYS_MAXSYSCALL)
2378 return (EINVAL);
2379 if (toggle)
2380 clrbit(linux_debug_map, syscall);
2381 else
2382 setbit(linux_debug_map, syscall);
2383 return (0);
2384}
2385
2386/*
2387 * Usage: sysctl linux.debug=<syscall_nr>.<0/1>
2388 *
2389 * E.g.: sysctl linux.debug=21.0
2390 *
2391 * As a special case, syscall "all" will apply to all syscalls globally.
2392 */

--- 116 unchanged lines hidden ---