instruction
stringlengths
82
202
input
stringclasses
1 value
output
stringlengths
73
23.9M
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_info_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_exec_helper' alt sistemi için gerekli C kaynak kodunu implemente et.
```c #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char *argv[]) { if (pause()) _exit(EXIT_FAILURE); _exit(EXIT_SUCCESS); } ```
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_open_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 <inttypes.h> #include <limits.h> #include <linux/types.h> #include <sched.h> #include <signal.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syscall.h> #include <sys...
Linux kernel'inin 'tools/testing/selftests/pidfd/pidfd_xattr_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_wait' 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/sched.h> #include <linux/types.h> #include <signal.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <sched.h> #include <string.h> #include <sys/resource.h> #include <sys/time.h> #include <sys/types....
Linux kernel'inin 'tools/testing/selftests/drivers/net/napi_id_helper' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <netdb.h> #include "../../net/lib/ksft.h" int main(int argc, char *argv[]) { struct sockaddr_storage address; struct add...
Linux kernel'inin 'tools/testing/selftests/drivers/net/psp_responder' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdio.h> #include <string.h> #include <sys/poll.h> #include <sys/socket.h> #include <sys/time.h> #include <netinet/in.h> #include <unistd.h> #include <ynl.h> #include "psp-user.h" #define dbg(msg...) \ do { \ if (opts->verbose) \ fprintf(stderr, "DEBUG...
Linux kernel'inin 'tools/testing/selftests/drivers/net/hw/iou-zcrx' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <assert.h> #include <errno.h> #include <error.h> #include <fcntl.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <linux/mman.h> #include <linu...
Linux kernel'inin 'tools/testing/selftests/drivers/net/hw/nk_forward.bpf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/bpf.h> #include <linux/pkt_cls.h> #include <linux/if_ether.h> #include <linux/ipv6.h> #include <linux/in6.h> #include <bpf/bpf_endian.h> #include <bpf/bpf_helpers.h> #define TC_ACT_OK 0 #define ETH_P_IPV6 0x86DD #define ctx_ptr(field) ((void *)(long)(field)) ...
Linux kernel'inin 'tools/testing/selftests/drivers/net/hw/ncdevmem' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * tcpdevmem netcat. Works similarly to netcat but does device memory TCP * instead of regular TCP. Uses udmabuf to mock a dmabuf provider. * * Usage: * * On server: * ncdevmem -s <server IP> [-c <client IP>] -f eth1 -l -p 5201 * * On client: * echo -...
Linux kernel'inin 'tools/testing/selftests/drivers/net/hw/toeplitz' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Toeplitz test * * 1. Read packets and their rx_hash using PF_PACKET/TPACKET_V3 * 2. Compute the rx_hash in software based on the packet contents * 3. Compare the two * * Optionally, either '-C $rx_irq_cpu_list' or '-r $rps_bitmap' may be given. * * If '-C $rx_irq_cpu_...
Linux kernel'inin 'tools/testing/selftests/drivers/s390x/uvdevice/test_uvdevice' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * selftest for the Ultravisor UAPI device * * Copyright IBM Corp. 2022 * Author(s): Steffen Eiden <seiden@linux.ibm.com> */ #include <stdint.h> #include <fcntl.h> #include <errno.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <asm/uvdevice.h> #include "ks...
Linux kernel'inin 'tools/testing/selftests/drivers/dma-buf/udmabuf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #define __EXPORTED_HEADERS__ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <malloc.h> #include <stdbool.h> #include <sys/ioctl.h> #include <sys/syscall.h> #include <sys/mman.h> ...
Linux kernel'inin 'tools/testing/selftests/drivers/ntsync/ntsync' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Various unit tests for the "ntsync" synchronization primitive driver. * * Copyright (C) 2021-2022 Elizabeth Figura <zfigura@codeweavers.com> */ #define _GNU_SOURCE #include <sys/ioctl.h> #include <sys/stat.h> #include <fcntl.h> #include <time.h> #include <pthr...
Linux kernel'inin 'tools/testing/selftests/kexec/test_kexec_jump' alt sistemi için gerekli C kaynak kodunu implemente et.
```c #include <unistd.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <linux/kexec.h> #include <linux/reboot.h> #include <sys/reboot.h> #include <sys/syscall.h> asm( " .code64\n" " .data\n" "purgatory_start:\n" // Trigger kexec debug exception handling " int3\n" // Se...
Linux kernel'inin 'tools/testing/selftests/size/get_size' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2014 Sony Mobile Communications Inc. * * Selftest for runtime system size * * Prints the amount of RAM that the currently running system is using. * * This program tries to be as small as possible itself, to * avoid perturbing the system memory utiliz...
Linux kernel'inin 'tools/testing/selftests/sched/cs_prctl_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Use the core scheduling prctl() to test core scheduling cookies control. * * Copyright (c) 2021 Oracle and/or its affiliates. * Author: Chris Hyser <chris.hyser@oracle.com> * * * This library is free software; you can redistribute it and/or modify it * under th...
Linux kernel'inin 'tools/testing/selftests/membarrier/membarrier_test_single_thread' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <pthread.h> #include "membarrier_test_impl.h" int main(int argc, char **argv) { ksft_print_header(); ksft_set_plan(18); test_membarrier...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/membarrier/membarrier_test_impl' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #define _GNU_SOURCE #include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <pthread.h> #include "kselftest.h" static int registrations; static int sys_membarrier(int cmd, int flags) { return syscall(__NR_memba...
Linux kernel'inin 'tools/testing/selftests/membarrier/membarrier_test_multi_thread' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <linux/membarrier.h> #include <syscall.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <pthread.h> #include "membarrier_test_impl.h" static int thread_ready, thread_quit; static pthread_mutex_t test_membarrier_thread_mutex = ...
Linux kernel'inin 'tools/testing/selftests/ipc/msgque' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <sys/msg.h> #include <fcntl.h> #include "kselftest.h" #define MAX_MSG_SIZE 32 struct msg1 { int msize; long mtype; char mtext[MAX_MSG_SIZE]; }; #define TEST_STRING ...
Linux kernel'inin 'tools/testing/selftests/landlock/fs_bench' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock filesystem benchmark * * This program benchmarks the time required for file access checks. We use a * large number (-d flag) of nested directories where each directory inode has * an associated Landlock rule, and we repeatedly (-n flag) exercise a file * acc...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/landlock/wrappers' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Syscall wrappers * * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> * Copyright © 2019-2020 ANSSI * Copyright © 2021-2025 Microsoft Corporation */ #define _GNU_SOURCE #include <linux/landlock.h> #include <sys/syscall.h> #include <sys/types.h> #include <uni...
Linux kernel'inin 'tools/testing/selftests/landlock/wait-pipe-sandbox' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Write in a pipe, wait, sandbox itself, test sandboxing, and wait again. * * Used by audit_exec.flags from audit_test.c * * Copyright © 2024-2025 Microsoft Corporation */ #define _GNU_SOURCE #include <fcntl.h> #include <linux/landlock.h> #include <linux/prctl.h> #incl...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/landlock/scoped_common' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Landlock scope test helpers * * Copyright © 2024 Tahera Fahimi <fahimitahera@gmail.com> */ #define _GNU_SOURCE #include <sys/types.h> static void create_scoped_domain(struct __test_metadata *const _metadata, const __u16 scope) { int ruleset_fd; const struct...
Linux kernel'inin 'tools/testing/selftests/landlock/scoped_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock tests - Common scope restriction * * Copyright © 2024 Tahera Fahimi <fahimitahera@gmail.com> */ #define _GNU_SOURCE #include <errno.h> #include <linux/landlock.h> #include <sys/prctl.h> #include "common.h" #define ACCESS_LAST LANDLOCK_SCOPE_SIGNAL TEST(rule...
Linux kernel'inin 'tools/testing/selftests/landlock/scoped_signal_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock tests - Signal Scoping * * Copyright © 2024 Tahera Fahimi <fahimitahera@gmail.com> */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <linux/landlock.h> #include <pthread.h> #include <signal.h> #include <sys/prctl.h> #include <sys/types.h> #...
Linux kernel'inin 'tools/testing/selftests/landlock/net_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Landlock tests - Network * * Copyright © 2022-2023 Huawei Tech. Co., Ltd. * Copyright © 2023 Microsoft Corporation */ #define _GNU_SOURCE #include <arpa/inet.h> #include <errno.h> #include <fcntl.h> #include <linux/landlock.h> #include <linux/in.h> #include <sche...
Linux kernel'inin 'tools/testing/selftests/landlock/sandbox-and-launch' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Sandbox itself and execute another program (in a different mount point). * * Used by layout1.umount_sandboxer from fs_test.c * * Copyright © 2024-2025 Microsoft Corporation */ #define _GNU_SOURCE #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <sys...
Linux kernel'inin 'tools/testing/selftests/landlock/true' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 int main(void) { return 0; } ```
Linux kernel'inin 'tools/testing/selftests/landlock/fs_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock tests - Filesystem * * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> * Copyright © 2020 ANSSI * Copyright © 2020-2022 Microsoft Corporation */ #define _GNU_SOURCE #include <asm/termbits.h> #include <fcntl.h> #include <libgen.h> #include <linux/fiema...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/landlock/scoped_multiple_domain_variants' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Landlock variants for three processes with various domains. * * Copyright © 2024 Tahera Fahimi <fahimitahera@gmail.com> */ enum sandbox_type { NO_SANDBOX, SCOPE_SANDBOX, /* Any other type of sandboxing domain */ OTHER_SANDBOX, }; /* clang-format on */ FIXTURE_V...
Linux kernel'inin 'tools/testing/selftests/landlock/base_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock tests - Common user space base * * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> * Copyright © 2019-2020 ANSSI */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <linux/keyctl.h> #include <linux/landlock.h> #include <string.h> #inc...
Linux kernel'inin 'tools/testing/selftests/landlock/ptrace_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock tests - Ptrace * * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> * Copyright © 2019-2020 ANSSI * Copyright © 2024-2025 Microsoft Corporation */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <linux/landlock.h> #include <signal.h>...
Linux kernel'inin 'tools/testing/selftests/landlock/tsync_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock tests - Enforcing the same restrictions across multiple threads * * Copyright © 2025 Günther Noack <gnoack3000@gmail.com> */ #define _GNU_SOURCE #include <linux/landlock.h> #include <pthread.h> #include <signal.h> #include <sys/prctl.h> #include "common.h" /...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/landlock/audit' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Landlock audit helpers * * Copyright © 2024-2025 Microsoft Corporation */ #define _GNU_SOURCE #include <errno.h> #include <linux/audit.h> #include <linux/limits.h> #include <linux/netlink.h> #include <regex.h> #include <stdbool.h> #include <stdint.h> #include <stdio...
Linux kernel'inin 'tools/testing/selftests/landlock/wait-pipe' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Write in a pipe and wait. * * Used by layout1.umount_sandboxer from fs_test.c * * Copyright © 2024-2025 Microsoft Corporation */ #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char *argv[]) { int pipe_child, pipe_p...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/landlock/common' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Landlock test helpers * * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net> * Copyright © 2019-2020 ANSSI * Copyright © 2021 Microsoft Corporation */ #include <arpa/inet.h> #include <errno.h> #include <linux/securebits.h> #include <sys/capability.h> #include ...
Linux kernel'inin 'tools/testing/selftests/landlock/audit_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock tests - Audit * * Copyright © 2024-2025 Microsoft Corporation */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <limits.h> #include <linux/landlock.h> #include <pthread.h> #include <stdlib.h> #include <sys/mount.h> #include <sys/prctl.h> #i...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/landlock/scoped_base_variants' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ /* * Landlock scoped_domains test variant definition. * * This file defines a fixture variant "scoped_domains" that has all * permutations of parent/child process being in separate or shared * Landlock domain, or not being in a Landlock domain at all. * * Scoped access...
Linux kernel'inin 'tools/testing/selftests/landlock/scoped_abstract_unix_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Landlock tests - Abstract UNIX socket * * Copyright © 2024 Tahera Fahimi <fahimitahera@gmail.com> */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <linux/landlock.h> #include <sched.h> #include <signal.h> #include <stddef.h> #include <sys/prctl.h> ...
Linux kernel'inin 'tools/testing/selftests/tdx/tdx_guest_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* * Test TDX guest features * * Copyright (C) 2022 Intel Corporation. * * Author: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> */ #include <sys/ioctl.h> #include <errno.h> #include <fcntl.h> #include <linux/tdx-guest.h> #include "kselftest_ha...
Linux kernel'inin 'tools/testing/selftests/cachestat/test_cachestat' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE #define __SANE_USERSPACE_TYPES__ // Use ll64 #include <stdio.h> #include <stdbool.h> #include <linux/kernel.h> #include <linux/magic.h> #include <linux/mman.h> #include <sys/mman.h> #include <sys/shm.h> #include <sys/syscall.h> #include <sys/vfs.h> #include ...
Linux kernel'inin 'tools/testing/selftests/coredump/coredump_socket_protocol_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <sys/stat.h> #include <sys/epoll.h> #include <sys/socket.h> #include <sys/un.h> #include "coredump_test.h" #define NUM_CRASHING_COREDUMPS 5 FIXTURE_SETUP(coredump) { FILE *file; int ret; self->pid_coredump_server = -ESRCH; self->fd_tmpfs_detached = -1; file = ...
Linux işletim sistemi çekirdeği için 'tools/testing/selftests/coredump/coredump_test' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef __COREDUMP_TEST_H #define __COREDUMP_TEST_H #include <stdbool.h> #include <sys/types.h> #include <linux/coredump.h> #include "../kselftest_harness.h" #include "../pidfd/pidfd.h" #ifndef PAGE_SIZE #define PAGE_SIZE 4096 #endif #define NUM_THREAD_SPAWN 128 /* Core...
Linux kernel'inin 'tools/testing/selftests/coredump/stackdump_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <assert.h> #include <fcntl.h> #include <inttypes.h> #include <libgen.h> #include <limits.h> #include <linux/coredump.h> #include <linux/fs.h> #include <linux/limits.h> #include <pthread.h> #include <string.h> #include <sys/mount.h> #include <poll.h> #include <sys/epoll...
Linux kernel'inin 'tools/testing/selftests/coredump/coredump_socket_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <sys/stat.h> #include <sys/epoll.h> #include <sys/socket.h> #include <sys/un.h> #include "coredump_test.h" FIXTURE_SETUP(coredump) { FILE *file; int ret; self->pid_coredump_server = -ESRCH; self->fd_tmpfs_detached = -1; file = fopen("/proc/sys/kernel/core_patte...
Linux kernel'inin 'tools/testing/selftests/coredump/coredump_test_helpers' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <assert.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <linux/coredump.h> #include <linux/fs.h> #include <pthread.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/epoll.h> #include <sys/ioctl.h> #in...
Linux kernel'inin 'tools/testing/vsock/msg_zerocopy_common' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* Some common code for MSG_ZEROCOPY logic * * Copyright (C) 2023 SberDevices. * * Author: Arseniy Krasnov <avkrasnov@salutedevices.com> */ #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <linux/errqueue.h> #include "msg...
Linux işletim sistemi çekirdeği için 'tools/testing/vsock/util' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef UTIL_H #define UTIL_H #include <sys/socket.h> #include <linux/bitops.h> #include <linux/kernel.h> #include <linux/vm_sockets.h> /* All known vsock transports, see callers of vsock_core_register() */ #define KNOWN_TRANSPORTS(x) \ x(LOOPBACK, "loopback") \ x(...
Linux kernel'inin 'tools/testing/vsock/vsock_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * vsock_test - vsock.ko test suite * * Copyright (C) 2017 Red Hat, Inc. * * Author: Stefan Hajnoczi <stefanha@redhat.com> */ #include <getopt.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <linux/kerne...
Linux işletim sistemi çekirdeği için 'tools/testing/vsock/timeout' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef TIMEOUT_H #define TIMEOUT_H enum { /* Default timeout */ TIMEOUT = 10 /* seconds */ }; void sigalrm(int signo); void timeout_begin(unsigned int seconds); void timeout_check(const char *operation); void timeout_end(void); int timeout_usleep(useconds_t usec); ...
Linux işletim sistemi çekirdeği için 'tools/testing/vsock/vsock_test_zerocopy' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef VSOCK_TEST_ZEROCOPY_H #define VSOCK_TEST_ZEROCOPY_H #include "util.h" void test_stream_msgzcopy_client(const struct test_opts *opts); void test_stream_msgzcopy_server(const struct test_opts *opts); void test_seqpacket_msgzcopy_client(const struct test_opts *opt...
Linux kernel'inin 'tools/testing/vsock/vsock_test_zerocopy' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* MSG_ZEROCOPY feature tests for vsock * * Copyright (C) 2023 SberDevices. * * Author: Arseniy Krasnov <avkrasnov@salutedevices.com> */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <unistd.h> #includ...
Linux kernel'inin 'tools/testing/vsock/vsock_uring_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* io_uring tests for vsock * * Copyright (C) 2023 SberDevices. * * Author: Arseniy Krasnov <avkrasnov@salutedevices.com> */ #include <getopt.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <liburing.h> #include <unistd.h> #include <sys/mman.h> ...
Linux kernel'inin 'tools/testing/vsock/vsock_perf' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * vsock_perf - benchmark utility for vsock. * * Copyright (C) 2022 SberDevices. * * Author: Arseniy Krasnov <AVKrasnov@sberdevices.ru> */ #include <getopt.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <errno.h> #include...
Linux işletim sistemi çekirdeği için 'tools/testing/vsock/msg_zerocopy_common' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef MSG_ZEROCOPY_COMMON_H #define MSG_ZEROCOPY_COMMON_H #include <stdbool.h> #ifndef SOL_VSOCK #define SOL_VSOCK 287 #endif #ifndef VSOCK_RECVERR #define VSOCK_RECVERR 1 #endif void vsock_recv_completion(int fd, const bool *zerocopied); #endif /* MSG_ZEROCOPY_CO...
Linux kernel'inin 'tools/testing/vsock/control' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* Control socket for client/server test execution * * Copyright (C) 2017 Red Hat, Inc. * * Author: Stefan Hajnoczi <stefanha@redhat.com> */ /* The client and server may need to coordinate to avoid race conditions like * the client attempting to connect to a socket t...
Linux işletim sistemi çekirdeği için 'tools/testing/vsock/control' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef CONTROL_H #define CONTROL_H #include <stdbool.h> void control_init(const char *control_host, const char *control_port, bool server); void control_cleanup(void); void control_writeln(const char *str); char *control_readln(void); unsigned long control_readulo...
Linux kernel'inin 'tools/testing/vsock/timeout' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* Timeout API for single-threaded programs that use blocking * syscalls (read/write/send/recv/connect/accept). * * Copyright (C) 2017 Red Hat, Inc. * * Author: Stefan Hajnoczi <stefanha@redhat.com> */ /* Use the following pattern: * * timeout_begin(TIMEOUT); * ...
Linux kernel'inin 'tools/testing/vsock/vsock_diag_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * vsock_diag_test - vsock_diag.ko test suite * * Copyright (C) 2017 Red Hat, Inc. * * Author: Stefan Hajnoczi <stefanha@redhat.com> */ #include <getopt.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <unistd.h> #include <s...
Linux kernel'inin 'tools/testing/vsock/util' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * vsock test utilities * * Copyright (C) 2017 Red Hat, Inc. * * Author: Stefan Hajnoczi <stefanha@redhat.com> */ #include <ctype.h> #include <errno.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <signal.h> #include <unis...
Linux kernel'inin 'tools/testing/crypto/chacha20-s390/test-cipher' alt sistemi için gerekli C kaynak kodunu implemente et.
```c /* SPDX-License-Identifier: GPL-2.0 * * Copyright (C) 2022 Red Hat, Inc. * Author: Vladis Dronov <vdronoff@gmail.com> */ #include <asm/elf.h> #include <asm/uaccess.h> #include <asm/smp.h> #include <crypto/skcipher.h> #include <crypto/akcipher.h> #include <crypto/acompress.h> #include <crypto/rng.h> #include <...
Linux kernel'inin 'tools/testing/cxl/cxl_pmem_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */ #include "watermark.h" cxl_test_watermark(cxl_pmem); ```
Linux kernel'inin 'tools/testing/cxl/cxl_core_exports' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */ #include "cxl.h" /* Exporting of cxl_core symbols that are only used by cxl_test */ EXPORT_SYMBOL_NS_GPL(cxl_num_decoders_committed, "CXL"); ```
Linux kernel'inin 'tools/testing/cxl/cxl_mem_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */ #include "watermark.h" cxl_test_watermark(cxl_mem); ```
Linux kernel'inin 'tools/testing/cxl/config_check' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/bug.h> void check(void) { /* * These kconfig symbols must be set to "m" for cxl_test to load * and operate. */ BUILD_BUG_ON(!IS_ENABLED(CONFIG_64BIT)); BUILD_BUG_ON(!IS_MODULE(CONFIG_CXL_BUS)); BUILD_BUG_ON(!IS_MODULE(CONFIG_CXL_ACPI)); BUILD_BUG_ON(!...
Linux kernel'inin 'tools/testing/cxl/mock_acpi' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* Copyright(c) 2021 Intel Corporation. All rights reserved. */ #include <linux/platform_device.h> #include <linux/device.h> #include <linux/acpi.h> #include <cxl.h> #include "test/mock.h" struct acpi_device *to_cxl_host_bridge(struct device *host, struct device *dev) { ...
Linux kernel'inin 'tools/testing/cxl/cxl_core_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */ #include "watermark.h" cxl_test_watermark(cxl_core); ```
Linux kernel'inin 'tools/testing/cxl/cxl_acpi_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */ #include "watermark.h" cxl_test_watermark(cxl_acpi); ```
Linux işletim sistemi çekirdeği için 'tools/testing/cxl/watermark' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */ #ifndef _TEST_CXL_WATERMARK_H_ #define _TEST_CXL_WATERMARK_H_ #include <linux/module.h> #include <linux/printk.h> int cxl_acpi_test(void); int cxl_core_test(void); int cxl_mem_test(void); int cxl_pmem_test(void); i...
Linux kernel'inin 'tools/testing/cxl/cxl_port_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2022 Intel Corporation. All rights reserved. */ #include "watermark.h" cxl_test_watermark(cxl_port); ```
Linux kernel'inin 'tools/testing/cxl/test/mem' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only // Copyright(c) 2021 Intel Corporation. All rights reserved. #include <linux/platform_device.h> #include <linux/mod_devicetable.h> #include <linux/vmalloc.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/sizes.h> #include <linux/bits.h> #include <cxl/m...
Linux kernel'inin 'tools/testing/cxl/test/cxl' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only // Copyright(c) 2021 Intel Corporation. All rights reserved. #include <linux/platform_device.h> #include <linux/memory_hotplug.h> #include <linux/genalloc.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/acpi.h> #include <linux/pci.h> #include <linux/m...
Linux kernel'inin 'tools/testing/cxl/test/mock' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only //Copyright(c) 2021 Intel Corporation. All rights reserved. #include <linux/libnvdimm.h> #include <linux/rculist.h> #include <linux/device.h> #include <linux/export.h> #include <linux/acpi.h> #include <linux/pci.h> #include <cxlmem.h> #include <cxlpci.h> #include "mock.h" ...
Linux kernel'inin 'tools/testing/cxl/test/hmem_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2026 Intel Corporation */ #include <linux/moduleparam.h> #include <linux/workqueue.h> #include "../../../drivers/dax/bus.h" static bool hmem_test; static void hmem_test_work(struct work_struct *work) { } static void hmem_test_release(struct device *dev) { st...
Linux işletim sistemi çekirdeği için 'tools/testing/cxl/test/mock' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #include <linux/list.h> #include <linux/acpi.h> #include <linux/dax.h> #include <cxl.h> struct cxl_mock_ops { struct list_head list; bool (*is_mock_adev)(struct acpi_device *dev); int (*acpi_table_parse_cedt)(enum acpi_cedt_type id, acpi_tbl_entry_handler_arg ha...
Linux kernel'inin 'tools/testing/cxl/test/cxl_translate' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only // Copyright(c) 2025 Intel Corporation. All rights reserved. /* Preface all log entries with "cxl_translate" */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/moduleparam.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include ...
Linux kernel'inin 'tools/testing/nvdimm/pmem_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright(c) 2018 Intel Corporation. All rights reserved. #include <linux/module.h> #include <linux/printk.h> #include "watermark.h" nfit_test_watermark(pmem); ```
Linux kernel'inin 'tools/testing/nvdimm/dax_pmem_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright(c) 2019 Intel Corporation. All rights reserved. #include <linux/module.h> #include <linux/printk.h> #include "watermark.h" nfit_test_watermark(dax_pmem); ```
Linux kernel'inin 'tools/testing/nvdimm/dax-dev' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016, Intel Corporation. */ #include "test/nfit_test.h" #include <linux/mm.h> #include "../../../drivers/dax/dax-private.h" phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff, unsigned long size) { int i; for (i = 0; i < dev_dax-...
Linux kernel'inin 'tools/testing/nvdimm/device_dax_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright(c) 2018 Intel Corporation. All rights reserved. #include <linux/module.h> #include <linux/printk.h> #include "watermark.h" nfit_test_watermark(device_dax); ```
Linux kernel'inin 'tools/testing/nvdimm/libnvdimm_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright(c) 2018 Intel Corporation. All rights reserved. #include <linux/module.h> #include <linux/printk.h> #include "watermark.h" nfit_test_watermark(libnvdimm); ```
Linux kernel'inin 'tools/testing/nvdimm/config_check' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <linux/bug.h> void check(void) { /* * These kconfig symbols must be set to "m" for nfit_test to * load and operate. */ BUILD_BUG_ON(!IS_MODULE(CONFIG_LIBNVDIMM)); BUILD_BUG_ON(!IS_MODULE(CONFIG_BLK_DEV_PMEM)); BUILD_BUG_ON(!IS_MODULE(CONFIG_ND_BTT)); BUILD_B...
Linux kernel'inin 'tools/testing/nvdimm/pmem-dax' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2014-2016, Intel Corporation. */ #include "test/nfit_test.h" #include <linux/blkdev.h> #include <linux/dax.h> #include <pmem.h> #include <nd.h> long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff, long nr_pages, enum dax_access_mode mod...
Linux işletim sistemi çekirdeği için 'tools/testing/nvdimm/watermark' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright(c) 2018 Intel Corporation. All rights reserved. #ifndef _TEST_NVDIMM_WATERMARK_H_ #define _TEST_NVDIMM_WATERMARK_H_ int pmem_test(void); int libnvdimm_test(void); int acpi_nfit_test(void); int device_dax_test(void); int dax_pmem_test(void); int dax_pmem_core_test(vo...
Linux kernel'inin 'tools/testing/nvdimm/acpi_nfit_test' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 // Copyright(c) 2018 Intel Corporation. All rights reserved. #include <linux/module.h> #include <linux/printk.h> #include "watermark.h" #include <nfit.h> nfit_test_watermark(acpi_nfit); /* strong / override definition of nfit_intel_shutdown_status */ void nfit_intel_shutdown_...
Linux kernel'inin 'tools/testing/nvdimm/test/nfit' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <linux/workqueue.h> #include <linux/libnvdimm.h> #include <linux/genalloc.h> #incl...
Linux işletim sistemi çekirdeği için 'tools/testing/nvdimm/test/ndtest' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef NDTEST_H #define NDTEST_H #include <linux/platform_device.h> #include <linux/libnvdimm.h> struct ndtest_config; struct ndtest_priv { struct platform_device pdev; struct device_node *dn; struct list_head resources; struct nvdimm_bus_descriptor bus_desc; st...
Linux işletim sistemi çekirdeği için 'tools/testing/nvdimm/test/nfit_test' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. */ #ifndef __NFIT_TEST_H__ #define __NFIT_TEST_H__ #include <linux/acpi.h> #include <linux/list.h> #include <linux/uuid.h> #include <linux/ioport.h> #include <linux/spinlock_types.h> struct nfit_test_...
Linux kernel'inin 'tools/testing/nvdimm/test/ndtest' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/platform_device.h> #include <linux/device.h> #include <linux/module.h> #include <linux/genalloc.h> #include <linux/vmalloc.h> #include <linux/dma-mapping.h> #include <linux/list_sort.h> #include <linux/libnvdimm.h...
Linux kernel'inin 'tools/testing/nvdimm/test/iomap' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-only /* * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. */ #include <linux/memremap.h> #include <linux/rculist.h> #include <linux/export.h> #include <linux/ioport.h> #include <linux/module.h> #include <linux/types.h> #include <linux/acpi.h> #include <linux/io....
Linux işletim sistemi çekirdeği için 'tools/testing/shared/xarray-shared' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0+ */ #ifndef __XARRAY_SHARED_H__ #define __XARRAY_SHARED_H__ #define XA_DEBUG #include "shared.h" #endif /* __XARRAY_SHARED_H__ */ ```
Linux kernel'inin 'tools/testing/shared/linux' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 #include <stdlib.h> #include <string.h> #include <malloc.h> #include <pthread.h> #include <unistd.h> #include <assert.h> #include <linux/gfp.h> #include <linux/poison.h> #include <linux/slab.h> #include <linux/radix-tree.h> #include <urcu/uatomic.h> int nr_allocated; int preem...
Linux kernel'inin 'tools/testing/shared/rbtree-shim' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Very simple shim around the rbtree. */ #include "../../../lib/rbtree.c" ```
Linux kernel'inin 'tools/testing/shared/xarray-shared' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later #include "xarray-shared.h" #include "../../../lib/xarray.c" ```
Linux işletim sistemi çekirdeği için 'tools/testing/shared/maple-shared' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0+ */ #ifndef __MAPLE_SHARED_H__ #define __MAPLE_SHARED_H__ #define CONFIG_DEBUG_MAPLE_TREE #define CONFIG_MAPLE_SEARCH #define MAPLE_32BIT (MAPLE_NODE_SLOTS > 31) #include "shared.h" #include <stdlib.h> #include <time.h> #include "linux/init.h" void maple_rcu_cb(struct rcu_head...
Linux kernel'inin 'tools/testing/shared/interval_tree-shim' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0 /* Very simple shim around the interval tree. */ #include "../../../lib/interval_tree.c" ```
Linux kernel'inin 'tools/testing/shared/maple-shim' alt sistemi için gerekli C kaynak kodunu implemente et.
```c // SPDX-License-Identifier: GPL-2.0-or-later /* Very simple shim around the maple tree. */ #include "maple-shared.h" #include <linux/slab.h> #include "../../../lib/maple_tree.c" void maple_rcu_cb(struct rcu_head *head) { struct maple_node *node = container_of(head, struct maple_node, rcu); kmem_cache_free(m...
Linux işletim sistemi çekirdeği için 'tools/testing/shared/shared' yapılarının ve prototiplerinin bulunduğu C Header dosyasını yaz.
```c /* SPDX-License-Identifier: GPL-2.0 */ #ifndef __SHARED_H__ #define __SHARED_H__ #include <linux/types.h> #include <linux/bug.h> #include <linux/kernel.h> #include <linux/bitops.h> #include <linux/gfp.h> #include <linux/rcupdate.h> #ifndef module_init #define module_init(x) #endif #ifndef module_exit #define m...