instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inin 'tools/testing/selftests/x86/sysret_rip' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * sigreturn.c - tests that x86 avoids Intel SYSRET pitfalls * Copyright (c) 2014-2016 Andrew Lutomirski */ #define _GNU_SOURCE #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <string.h> #include <inttypes.h> #include <sys/signal.h> #include <sys/...
Linux kernel'inin 'tools/testing/selftests/x86/nx_stack' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* * Copyright (c) 2023 Alexey Dobriyan <adobriyan@gmail.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "A...
Linux kernel'inin 'tools/testing/selftests/x86/test_syscall_vdso' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * 32-bit syscall ABI conformance test. * * Copyright (c) 2015 Denys Vlasenko */ /* * Can be built statically: * gcc -Os -Wall -static -m32 test_syscall_vdso.c thunks_32.S */ #undef _GNU_SOURCE #define _GNU_SOURCE 1 #undef __USE_GNU #define __USE_GNU 1 #include <un...
Linux kernel'inin 'tools/testing/selftests/x86/xstate' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <elf.h> #include <pthread.h> #include <stdbool.h> #include <asm/prctl.h> #include <sys/ptrace.h> #include <sys/syscall.h> #include <sys/uio.h> #include <sys/wait.h> #include "helpers.h" #include "xstate.h" /* * The userspace xstate test suite i...
Linux kernel'inin 'tools/testing/selftests/x86/sigreturn' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * sigreturn.c - tests for x86 sigreturn(2) and exit-to-userspace * Copyright (c) 2014-2015 Andrew Lutomirski * * This is a series of tests that exercises the sigreturn(2) syscall and * the IRET / SYSRET paths in the kernel. * * For now, this focuses on the effects...
Linux kernel'inin 'tools/testing/selftests/x86/single_step_syscall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * single_step_syscall.c - single-steps various x86 syscalls * Copyright (c) 2014-2015 Andrew Lutomirski * * This is a very simple series of tests that makes system calls with * the TF flag set. This exercises some nasty kernel code in the * SYSENTER case: SYSENTER...
Linux kernel'inin 'tools/testing/selftests/x86/sigtrap_loop' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2025 Intel Corporation */ #define _GNU_SOURCE #include <err.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ucontext.h> #ifdef __x86_64__ # define REG_IP REG_RIP #else # define REG_IP REG_EIP #endif sta...
Linux kernel'inde 'tools/testing/selftests/x86/raw_syscall_helper_32' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0 */ .global sys32_helper sys32_helper: /* Args: syscall_args_32*, function pointer */ pushl %ebp pushl %ebx pushl %esi pushl %edi movl 5*4(%esp), %eax /* pointer to args struct */ movl 1*4(%eax), %ebx movl 2*4(%eax), %ecx movl 3*4(%eax), %edx movl 4*4(%eax), %es...
Linux kernel'inin 'tools/testing/selftests/x86/sysret_ss_attrs' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * sysret_ss_attrs.c - test that syscalls return valid hidden SS attributes * Copyright (c) 2015 Andrew Lutomirski * * On AMD CPUs, SYSRET can return with a valid SS descriptor with with * the hidden attributes set to an unusable state. Make sure the kernel * doesn...
Linux kernel'inin 'tools/testing/selftests/x86/ptrace_syscall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/syscall.h> #include <sys/user.h> #include <unistd.h> #include <errno.h> #include <stddef.h> #include <stdio.h> #include <err.h> #include <string.h> #include <asm/ptrace-abi.h>...
Linux kernel'inin 'tools/testing/selftests/x86/ioperm' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ioperm.c - Test case for ioperm(2) * Copyright (c) 2015 Andrew Lutomirski */ #define _GNU_SOURCE #include <err.h> #include <stdio.h> #include <stdint.h> #include <signal.h> #include <setjmp.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <unistd.h...
Linux kernel'inin 'tools/testing/selftests/x86/apx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include "xstate.h" int main(void) { test_xstate(XFEATURE_APX); } ```
Linux kernel'inin 'tools/testing/selftests/x86/test_FCMOV' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #undef _GNU_SOURCE #define _GNU_SOURCE 1 #undef __USE_GNU #define __USE_GNU 1 #include <unistd.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <signal.h> #include <sys/types.h> #include <sys/select.h> #include <sys/time.h> #include <sys/wait.h> #define TE...
Linux kernel'inin 'tools/testing/selftests/x86/test_mremap_vdso' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * 32-bit test to check vDSO mremap. * * Copyright (c) 2016 Dmitry Safonov * Suggested-by: Andrew Lutomirski */ /* * Can be built statically: * gcc -Os -Wall -static -m32 test_mremap_vdso.c */ #define _GNU_SOURCE #include <stdio.h> #include <errno.h> #include <uni...
Linux kernel'inin 'tools/testing/selftests/x86/sigaltstack' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #define _GNU_SOURCE #include <signal.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include <err.h> #include <errno.h> #include <limits.h> #include <sys/mman.h> #include <sys/auxv.h> #include <sys/prctl.h> #include <sys/resource.h> #include <setjmp.h> #in...
Linux kernel'inde 'tools/testing/selftests/x86/clang_helpers_64' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-only */ /* * 64-bit assembly helpers for asm operations that lack support in both gcc and * clang. For example, clang asm does not support segment prefixes. */ .global dereference_seg_base dereference_seg_base: mov %gs:(0), %rax ret .global test_page .global test_s...
Linux kernel'inin 'tools/testing/selftests/x86/syscall_arg_fault' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * syscall_arg_fault.c - tests faults 32-bit fast syscall stack args * Copyright (c) 2015 Andrew Lutomirski */ #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/signal.h> #include <sys/ucontext.h> #include <err.h> #include <...
Linux kernel'inin 'tools/testing/selftests/x86/test_shadow_stack' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * This program test's basic kernel shadow stack support. It enables shadow * stack manual via the arch_prctl(), instead of relying on glibc. It's * Makefile doesn't compile with shadow stack support, so it doesn't rely on * any particular glibc. As a result it can't do an...
Linux kernel'inin 'tools/testing/selftests/x86/check_initial_reg_state' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * check_initial_reg_state.c - check that execve sets the correct state * Copyright (c) 2014-2016 Andrew Lutomirski */ #define _GNU_SOURCE #include <stdio.h> unsigned long ax, bx, cx, dx, si, di, bp, sp, flags; unsigned long r8, r9, r10, r11, r12, r13, r14, r15; as...
Linux kernel'inin 'tools/testing/selftests/x86/srso' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/perf_event.h> #include <cpuid.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <sys/syscall.h> #include <unistd.h> int main(void) { struct perf_event_attr ret_attr, mret_attr; long long count_rets...
Linux kernel'inin 'tools/testing/selftests/x86/trivial_64bit_program' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Trivial program to check that we have a valid 64-bit build environment. * Copyright (c) 2015 Andy Lutomirski */ #ifndef __x86_64__ # error wrong architecture #endif #include <stdio.h> int main() { printf("\n"); return 0; } ```
Linux kernel'inin 'tools/testing/selftests/x86/test_vsyscall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ #define _GNU_SOURCE #include <stdio.h> #include <sys/time.h> #include <time.h> #include <stdlib.h> #include <sys/syscall.h> #include <unistd.h> #include <dlfcn.h> #include <string.h> #include <inttypes.h> #include <signal.h> #include <sys/ucontext.h> #include <errno.h> #inc...
Linux kernel'inin 'tools/testing/selftests/x86/iopl' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * iopl.c - Test case for a Linux on Xen 64-bit bug * Copyright (c) 2015 Andrew Lutomirski */ #define _GNU_SOURCE #include <err.h> #include <stdio.h> #include <stdint.h> #include <signal.h> #include <setjmp.h> #include <stdlib.h> #include <string.h> #include <errno.h> #inc...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/x86/helpers' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only #ifndef __SELFTESTS_X86_HELPERS_H #define __SELFTESTS_X86_HELPERS_H #include <signal.h> #include <string.h> #include <asm/processor-flags.h> #include "kselftest.h" static inline unsigned long get_eflags(void) { #ifdef __x86_64__ return __builtin_ia32_readeflags_u64(); ...
Linux kernel'inin 'tools/testing/selftests/x86/amx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <err.h> #include <errno.h> #include <setjmp.h> #include <stdio.h> #include <string.h> #include <stdbool.h> #include <unistd.h> #include <x86intrin.h> #include <sys/auxv.h> #include <sys/mman.h> #include <sys/shm.h> #include <sys/syscall.h> #include...
Linux kernel'inin 'tools/testing/selftests/x86/syscall_numbering' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * syscall_numbering.c - test calling the x86-64 kernel with various * valid and invalid system call numbers. * * Copyright (c) 2018 Andrew Lutomirski */ #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <errno.h> #include <unis...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/x86/xstate' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0-only #ifndef __SELFTESTS_X86_XSTATE_H #define __SELFTESTS_X86_XSTATE_H #include <stdint.h> #include "kselftest.h" #define XSAVE_HDR_OFFSET 512 #define XSAVE_HDR_SIZE 64 /* * List of XSAVE features Linux knows about. Copied from * arch/x86/include/asm/fpu/types.h */ enum ...
Linux kernel'inin 'tools/testing/selftests/x86/ldt_gdt' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * ldt_gdt.c - Test cases for LDT and GDT access * Copyright (c) 2015 Andrew Lutomirski */ #define _GNU_SOURCE #include <err.h> #include <stdio.h> #include <stdint.h> #include <signal.h> #include <setjmp.h> #include <stdlib.h> #include <string.h> #include <errno.h> #includ...
Linux kernel'inde 'tools/testing/selftests/x86/thunks_32' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-only */ /* * thunks_32.S - assembly helpers for mixed-bitness code * Copyright (c) 2015 Denys Vlasenko * * These are little helpers that make it easier to switch bitness on * the fly. */ .text .code32 .global call64_from_32 .type call32_from_64, @function //...
Linux kernel'inin 'tools/testing/selftests/x86/test_FISTTP' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #undef _GNU_SOURCE #define _GNU_SOURCE 1 #undef __USE_GNU #define __USE_GNU 1 #include <unistd.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <signal.h> #include <sys/types.h> #include <sys/select.h> #include <sys/time.h> #include <sys/wait.h> #include <f...
Linux kernel'inin 'tools/testing/selftests/x86/test_FCOMI' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #undef _GNU_SOURCE #define _GNU_SOURCE 1 #undef __USE_GNU #define __USE_GNU 1 #include <unistd.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <signal.h> #include <sys/types.h> #include <sys/select.h> #include <sys/time.h> #include <sys/wait.h> #include <f...
Linux kernel'inin 'tools/testing/selftests/x86/syscall_nt' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * syscall_nt.c - checks syscalls with NT set * Copyright (c) 2014-2015 Andrew Lutomirski * * Some obscure user-space code requires the ability to make system calls * with FLAGS.NT set. Make sure it works. */ #include <stdio.h> #include <unistd.h> #include <string...
Linux kernel'inde 'tools/testing/selftests/x86/thunks' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0-only */ /* * thunks.S - assembly helpers for mixed-bitness code * Copyright (c) 2015 Andrew Lutomirski * * These are little helpers that make it easier to switch bitness on * the fly. */ .text .global call32_from_64 .type call32_from_64, @function call32_from_6...
Linux kernel'inin 'tools/testing/selftests/x86/mov_ss_trap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * mov_ss_trap.c: Exercise the bizarre side effects of a watchpoint on MOV SS * * This does MOV SS from a watchpointed address followed by various * types of kernel entries. A MOV SS that hits a watchpoint will queue * up a #DB trap but will not actually deliver that ...
Linux kernel'inin 'tools/testing/selftests/x86/lam' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/syscall.h> #include <sys/ioctl.h> #include <time.h> #include <signal.h> #include <setjmp.h> #include <sys/mman.h> #include <sys/utsname.h> #include <sys/wait.h> #include <sys/stat.h> #in...
Linux kernel'inin 'tools/testing/selftests/x86/trivial_32bit_program' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Trivial program to check that we have a valid 32-bit build environment. * Copyright (c) 2015 Andy Lutomirski */ #ifndef __i386__ # error wrong architecture #endif #include <stdio.h> int main() { printf("\n"); return 0; } ```
Linux kernel'inin 'tools/testing/selftests/x86/fsgsbase_restore' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * fsgsbase_restore.c, test ptrace vs fsgsbase * Copyright (c) 2020 Andy Lutomirski * * This test case simulates a tracer redirecting tracee execution to * a function and then restoring tracee state using PTRACE_GETREGS and * PTRACE_SETREGS. This is similar to what...
Linux kernel'inin 'tools/testing/selftests/x86/avx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE /* Required for inline xstate helpers */ #include "xstate.h" int main(void) { test_xstate(XFEATURE_YMM); test_xstate(XFEATURE_OPMASK); test_xstate(XFEATURE_ZMM_Hi256); test_xstate(XFEATURE_Hi16_ZMM); } ```
Linux kernel'inin 'tools/testing/selftests/x86/unwind_vdso' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * unwind_vdso.c - tests unwind info for AT_SYSINFO in the vDSO * Copyright (c) 2014-2015 Andrew Lutomirski * * This tests __kernel_vsyscall's unwind info. */ #define _GNU_SOURCE #include <features.h> #include <stdio.h> #include "helpers.h" #if defined(__GLIBC__)...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_klp-call_getpid' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2023 SUSE * Authors: Libor Pechacek <lpechacek@suse.cz> * Marcos Paulo de Souza <mpdesouza@suse.com> */ #include <stdio.h> #include <unistd.h> #include <sys/syscall.h> #include <sys/types.h> #include <signal.h> static int stop; static int sig_in...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_atomic_replace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2018 Joe Lawrence <joe.lawrence@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/livepatch.h> static int replace; module_param(replace, int, 0644); MODULE_PARM_DESC(replace, "replace (...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_state2' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2019 SUSE #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/slab.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/printk.h> #include <linux/livepatch.h> #define CONSOLE_LOGLEVEL_STATE 1 /* Version 2 supports migration. */ #defi...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_callbacks_demo2' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2018 Joe Lawrence <joe.lawrence@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/livepatch.h> static int replace; module_param(replace, int, 0644); MODULE_PARM_DESC(replace, "replace (...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_mod_patch' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2026 Pablo Hugen <phugen@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/livepatch.h> #include <linux/seq_file.h> static int livepatch_mod_target_show(struct seq_file *m, void *v) { ...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_livepatch' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2014 Seth Jennings <sjenning@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/livepatch.h> #include <linux/seq_file.h> static int livepatch_cmdline_proc_show(struct seq_file *m, void *...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_callbacks_mod' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2018 Joe Lawrence <joe.lawrence@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> static int test_klp_callbacks_mod_init(void) { pr_info("%s\n", __func__); return 0; } static void test_klp_callbacks...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_callbacks_busy' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2018 Joe Lawrence <joe.lawrence@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/workqueue.h> #include <linux/delay.h> /* load/run-time control from sysfs writ...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_kprobe' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2024 Marcos Paulo de Souza <mpdesouza@suse.com> // Copyright (C) 2024 Michael Vetter <mvetter@suse.com> #include <linux/kernel.h> #include <linux/module.h> #include <linux/kprobes.h> static bool has_post_handler = true; module_param(has_post_handler, bool, 044...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_state3' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2019 SUSE /* The console loglevel fix is the same in the next cumulative patch. */ #include "test_klp_state2.c" ```
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_state' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2019 SUSE #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/slab.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/printk.h> #include <linux/livepatch.h> #define CONSOLE_LOGLEVEL_STATE 1 /* Version 1 does not support migration. ...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_callbacks_demo' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2018 Joe Lawrence <joe.lawrence@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/livepatch.h> static int pre_patch_ret; module_param(pre_patch_ret, int, 0644); MODULE_PARM_DESC(pre_pat...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_syscall' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2017-2023 SUSE * Authors: Libor Pechacek <lpechacek@suse.cz> * Nicolai Stange <nstange@suse.de> * Marcos Paulo de Souza <mpdesouza@suse.com> */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_shadow_vars' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2018 Joe Lawrence <joe.lawrence@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/livepatch.h> #include <linux/slab.h> /* * Keep a small list of pointers so tha...
Linux kernel'inin 'tools/testing/selftests/livepatch/test_modules/test_klp_mod_target' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2026 Pablo Hugen <phugen@redhat.com> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> #include <linux/kernel.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> static struct proc_dir_entry *pde; static noinline int test_klp_mod_ta...
Linux kernel'inin 'tools/testing/selftests/mincore/mincore_selftest' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0+ /* * kselftest suite for mincore(). * * Copyright (C) 2020 Collabora, Ltd. */ #define _GNU_SOURCE #include <stdio.h> #include <errno.h> #include <unistd.h> #include <stdlib.h> #include <sys/mman.h> #include <string.h> #include <fcntl.h> #include "kselftest.h" #include "k...
Linux kernel'inin 'tools/testing/selftests/resctrl/mba_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Memory Bandwidth Allocation (MBA) test * * Copyright (C) 2018 Intel Corporation * * Authors: * Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, * Fenghua Yu <fenghua.yu@intel.com> */ #include "resctrl.h" #define RESULT_FILE_NAME "result_mba" #define NUM...
Linux kernel'inin 'tools/testing/selftests/resctrl/resctrlfs' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Basic resctrl file system operations * * Copyright (C) 2018 Intel Corporation * * Authors: * Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, * Fenghua Yu <fenghua.yu@intel.com> */ #include <fcntl.h> #include <limits.h> #include "resctrl.h" int snc_unr...
Linux kernel'inin 'tools/testing/selftests/resctrl/mbm_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Memory Bandwidth Monitoring (MBM) test * * Copyright (C) 2018 Intel Corporation * * Authors: * Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, * Fenghua Yu <fenghua.yu@intel.com> */ #include "resctrl.h" #define RESULT_FILE_NAME "result_mbm" #define MAX...
Linux kernel'inin 'tools/testing/selftests/resctrl/resctrl_tests' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Resctrl tests * * Copyright (C) 2018 Intel Corporation * * Authors: * Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, * Fenghua Yu <fenghua.yu@intel.com> */ #include "resctrl.h" /* Volatile memory sink to prevent compiler optimizations */ static volati...
Linux kernel'inin 'tools/testing/selftests/resctrl/cat_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Cache Allocation Technology (CAT) test * * Copyright (C) 2018 Intel Corporation * * Authors: * Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, * Fenghua Yu <fenghua.yu@intel.com> */ #include "resctrl.h" #include <unistd.h> #define RESULT_FILE_NAME "res...
Linux kernel'inin 'tools/testing/selftests/resctrl/fill_buf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * fill_buf benchmark * * Copyright (C) 2018 Intel Corporation * * Authors: * Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, * Fenghua Yu <fenghua.yu@intel.com> */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/types.h> #include ...
Linux kernel'inin 'tools/testing/selftests/resctrl/cmt_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Cache Monitoring Technology (CMT) test * * Copyright (C) 2018 Intel Corporation * * Authors: * Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, * Fenghua Yu <fenghua.yu@intel.com> */ #include "resctrl.h" #include <unistd.h> #define RESULT_FILE_NAME "res...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/resctrl/resctrl' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef RESCTRL_H #define RESCTRL_H #include <stdio.h> #include <math.h> #include <errno.h> #include <sched.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <signal.h> #include <dirent.h> #include <stdbool.h> #include <ctype.h> #include <sys/stat.h> #in...
Linux kernel'inin 'tools/testing/selftests/resctrl/cache' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdint.h> #include "resctrl.h" char llc_occup_path[1024]; void perf_event_attr_initialize(struct perf_event_attr *pea, __u64 config) { memset(pea, 0, sizeof(*pea)); pea->type = PERF_TYPE_HARDWARE; pea->size = sizeof(*pea); pea->read_format = PERF_FORMAT_GROUP; ...
Linux kernel'inin 'tools/testing/selftests/resctrl/resctrl_val' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Memory bandwidth monitoring and allocation library * * Copyright (C) 2018 Intel Corporation * * Authors: * Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, * Fenghua Yu <fenghua.yu@intel.com> */ #include "resctrl.h" #define UNCORE_IMC "uncore_imc" #def...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/riscv/cfi/cfi_rv_test' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_RISCV_CFI_H #define SELFTEST_RISCV_CFI_H #include <stddef.h> #include <sys/types.h> #include "shadowstack.h" #define CHILD_EXIT_CODE_SSWRITE 10 #define CHILD_EXIT_CODE_SIG_TEST 11 #define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \ ({ ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/riscv/cfi/shadowstack' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_SHADOWSTACK_TEST_H #define SELFTEST_SHADOWSTACK_TEST_H #include <stddef.h> #include <linux/prctl.h> /* * A CFI test returns true for success or false for fail. * Takes a test number to index into array, and a void pointer. */ typedef bool (*shstk_te...
Linux kernel'inin 'tools/testing/selftests/riscv/cfi/cfitests' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include "../../kselftest.h" #include <sys/signal.h> #include <asm/ucontext.h> #include <linux/prctl.h> #include <errno.h> #include <linux/ptrace.h> #include <sys/wait.h> #include <linux/elf.h> #include <sys/uio.h> #include <asm-generic/unistd.h> #include "cfi_rv_test.h" ...
Linux kernel'inin 'tools/testing/selftests/riscv/cfi/shadowstack' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include "../../kselftest.h" #include <sys/wait.h> #include <signal.h> #include <fcntl.h> #include <asm-generic/unistd.h> #include <sys/mman.h> #include "shadowstack.h" #include "cfi_rv_test.h" static struct shadow_stack_tests shstk_tests[] = { { "shstk fork test\n", sha...
Linux kernel'inin 'tools/testing/selftests/riscv/mm/mmap_default' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <sys/mman.h> #include <mmap_test.h> #include "kselftest_harness.h" TEST(default_rlimit) { EXPECT_EQ(TOP_DOWN, memory_layout()); } TEST_HARNESS_MAIN ```
Linux kernel'inin 'tools/testing/selftests/riscv/mm/mmap_bottomup' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <sys/mman.h> #include <mmap_test.h> #include "kselftest_harness.h" TEST(infinite_rlimit) { EXPECT_EQ(BOTTOM_UP, memory_layout()); } TEST_HARNESS_MAIN ```
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/riscv/mm/mmap_test' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef _TESTCASES_MMAP_TEST_H #define _TESTCASES_MMAP_TEST_H #include <sys/mman.h> #include <sys/resource.h> #include <stddef.h> #include <strings.h> #include "kselftest_harness.h" #define TOP_DOWN 0 #define BOTTOM_UP 1 #define PROT (PROT_READ | PROT_WRITE) #define FL...
Linux kernel'inin 'tools/testing/selftests/riscv/abi/pointer_masking' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <errno.h> #include <fcntl.h> #include <setjmp.h> #include <signal.h> #include <stdbool.h> #include <sys/prctl.h> #include <sys/wait.h> #include <unistd.h> #include "kselftest.h" #ifndef PR_PMLEN_SHIFT #define PR_PMLEN_SHIFT 24 #endif #ifndef PR_PMLEN_MASK #def...
Linux kernel'inin 'tools/testing/selftests/riscv/sigreturn/sigreturn' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <ucontext.h> #include <linux/ptrace.h> #include "kselftest_harness.h" #define RISCV_V_MAGIC 0x53465457 #define DEFAULT_VALUE 2 #define SIGNAL_HANDLER_OVERRIDE 3 static void simple_handle(int sig_no, sig...
Linux kernel'inin 'tools/testing/selftests/riscv/hwprobe/hwprobe' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include "hwprobe.h" #include "kselftest.h" int main(int argc, char **argv) { struct riscv_hwprobe pairs[8]; unsigned long cpus; long out; ksft_print_header(); ksft_set_plan(5); /* Fake the CPU_SET ops. */ cpus = -1; /* * Just run a basic test: pass enough pai...
Linux kernel'inin 'tools/testing/selftests/riscv/hwprobe/cbo' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2023 Ventana Micro Systems Inc. * * Run with 'taskset -c <cpu-list> cbo' to only execute hwprobe on a * subset of cpus, as well as only executing the tests on those cpus. */ #define _GNU_SOURCE #include <stdbool.h> #include <stdint.h> #include <strin...
Linux kernel'inde 'tools/testing/selftests/riscv/hwprobe/sys_hwprobe' modülü için gerekli Low-Level Assembly kodunu yaz.
```assembly /* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) 2023 Rivos, Inc */ .text .global riscv_hwprobe riscv_hwprobe: # Put __NR_riscv_hwprobe in the syscall number register, then just shim # back the kernel's return. This doesn't do any sort of errno # handling, the caller can deal with it. li a7, 25...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/riscv/hwprobe/hwprobe' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef SELFTEST_RISCV_HWPROBE_H #define SELFTEST_RISCV_HWPROBE_H #include <stddef.h> #include <asm/hwprobe.h> #if __BYTE_ORDER == __BIG_ENDIAN # define le32_bswap(_x) \ ((((_x) & 0x000000ffU) << 24) | \ (((_x) & 0x0000ff00U) << 8) | \ (((_x) & 0x00ff0000U) >...
Linux kernel'inin 'tools/testing/selftests/riscv/hwprobe/which-cpus' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2023 Ventana Micro Systems Inc. * * Test the RISCV_HWPROBE_WHICH_CPUS flag of hwprobe. Also provides a command * line interface to get the cpu list for arbitrary hwprobe pairs. */ #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <s...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/riscv/vector/v_helpers' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #include <stdbool.h> bool is_xtheadvector_supported(void); bool is_vector_supported(void); unsigned long get_vr_len(void); int launch_test(char *next_program, int test_inherit, int xtheadvector); ```
Linux kernel'inin 'tools/testing/selftests/riscv/vector/vstate_prctl' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <sys/prctl.h> #include <unistd.h> #include <errno.h> #include <sys/wait.h> #include <sys/types.h> #include <stdlib.h> #include "kselftest_harness.h" #include "v_helpers.h" #define NEXT_PROGRAM "./vstate_exec_nolibc" int test_and_compare_child(long provided, long...
Linux kernel'inin 'tools/testing/selftests/riscv/vector/vstate_exec_nolibc' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <linux/wait.h> #define THIS_PROGRAM "./vstate_exec_nolibc" int main(int argc, char **argv) { int rc, pid, status, test_inherit = 0, xtheadvector = 0; long ctrl, ctrl_c; char *exec_argv[2], *exec_envp[2]; if (argc > 1 && strcmp(argv[1], "x")) test_inherit ...
Linux kernel'inin 'tools/testing/selftests/riscv/vector/v_helpers' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include "../hwprobe/hwprobe.h" #include <asm/vendor/thead.h> #include <stdbool.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <sys/wait.h> bool is_xtheadvector_supported(void) { struct riscv_hwprobe pair; pair.key = RISCV_HWPROBE_KEY_VENDOR_EXT...
Linux kernel'inin 'tools/testing/selftests/riscv/vector/validate_v_ptrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/uio.h> #include <unistd.h> #include <errno.h> #include <linux/ptrace.h> #include <linux/elf.h> #include "kselftest_harness.h" #include "v_helpers.h" #define SR_FS_DIRTY 0x00006000UL #defin...
Linux kernel'inin 'tools/testing/selftests/riscv/vector/v_exec_initval_nolibc' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Get values of vector registers as soon as the program starts to test if * is properly cleaning the values before starting a new program. Vector * registers are caller saved, so no function calls may happen before reading * the values. To further ensure consistency,...
Linux kernel'inin 'tools/testing/selftests/riscv/vector/vstate_ptrace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include <stdio.h> #include <stdlib.h> #include <asm/ptrace.h> #include <linux/elf.h> #include <sys/ptrace.h> #include <sys/uio.h> #include <sys/wait.h> #include "../../kselftest.h" #include "v_helpers.h" int parent_set_val, child_set_val; static long do_ptrace(enum __ptr...
Linux kernel'inin 'tools/testing/selftests/riscv/vector/v_initval' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #include "kselftest_harness.h" #include "v_helpers.h" #define NEXT_PROGRAM "./v_exec_initval_nolibc" TEST(v_initval) { int xtheadvector = 0; if (!is_vector_supported()) { if (is_xtheadvector_supported()) xtheadvector = 1; else SKIP(return, "Vector not suppor...
Linux kernel'inin 'tools/testing/selftests/firmware/fw_namespace' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Test triggering of loading of firmware from different mount * namespaces. Expect firmware to be always loaded from the mount * namespace of PID 1. */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <sched.h> #include <stdarg.h> #include <stdbool.h> #inclu...
Linux kernel'inin 'tools/testing/selftests/dmabuf-heaps/dmabuf-heap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <dirent.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <sys/types.h> #include <linux/dma-buf.h> #include <linux/dma-heap....
Linux kernel'inin 'tools/testing/selftests/kho/init' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/syscall.h> #include <sys/mount.h> #include <sys/reboot.h> #include <linux/kexec.h> /* from arch/x86/include/asm/setup.h */ #define COMMAND_LINE_SIZE 2048 #define KERNEL_IMAGE "/kernel" static int mount_f...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_file_handle_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <limits.h> #include <linux/types.h> #include <poll.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys/prctl.h> #include <sys/w...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_getfd_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <limits.h> #include <linux/types.h> #include <poll.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys/prctl.h> #include <sys/w...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_fdinfo_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <assert.h> #include <errno.h> #include <fcntl.h> #include <linux/types.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys/wait.h> #include <sys/mman.h> #include <sy...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <linux/types.h> #include <pthread.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys/epoll.h> #include...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_poll_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <linux/types.h> #include <poll.h> #include <signal.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys/wait.h> #include <unistd.h> #include "pidfd.h" #include "kse...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_setns_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <limits.h> #include <linux/types.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys/prctl.h> #include <sys/wait.h> #include <u...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/pidfd/pidfd' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef __PIDFD_H #define __PIDFD_H #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/w...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_setattr_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <limits.h> #include <linux/types.h> #include <poll.h> #include <pthread.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys/prc...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_autoreap_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2026 Christian Brauner <brauner@kernel.org> #define _GNU_SOURCE #include <errno.h> #include <linux/types.h> #include <poll.h> #include <pthread.h> #include <sched.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscal...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_bind_mount' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (c) 2024 Christian Brauner <brauner@kernel.org> #define _GNU_SOURCE #include <fcntl.h> #include <limits.h> #include <sched.h> #include <stdio.h> #include <string.h> #include <linux/fs.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/mount.h> #...