repo
stringlengths
1
152
file
stringlengths
14
221
code
stringlengths
501
25k
file_length
int64
501
25k
avg_line_length
float64
20
99.5
max_line_length
int64
21
134
extension_type
stringclasses
2 values
criu
criu-master/compel/arch/ppc64/src/lib/include/uapi/asm/sigframe.h
#ifndef UAPI_COMPEL_ASM_SIGFRAME_H__ #define UAPI_COMPEL_ASM_SIGFRAME_H__ #include <asm/ptrace.h> #include <asm/elf.h> #include <asm/types.h> /* * sigcontext structure defined in file * /usr/include/powerpc64le-linux-gnu/bits/sigcontext.h, * included from /usr/include/signal.h * * Kernel definition can be found ...
2,609
29.705882
108
h
criu
criu-master/compel/arch/s390/plugins/include/asm/syscall-types.h
#ifndef COMPEL_ARCH_SYSCALL_TYPES_H__ #define COMPEL_ARCH_SYSCALL_TYPES_H__ #define SA_RESTORER 0x04000000U typedef void rt_signalfn_t(int, siginfo_t *, void *); typedef rt_signalfn_t *rt_sighandler_t; typedef void rt_restorefn_t(void); typedef rt_restorefn_t *rt_sigrestore_t; #define _KNSIG 64 #define _NSIG_BPW ...
766
20.914286
73
h
criu
criu-master/compel/arch/s390/plugins/std/syscalls/syscalls-s390.c
#include "asm/infect-types.h" /* * Define prototype because of compile error if we include uapi/std/syscall.h */ long sys_old_mmap(struct mmap_arg_struct *); /* * On s390 we have defined __ARCH_WANT_SYS_OLD_MMAP - Therefore implement * system call with one parameter "mmap_arg_struct". */ unsigned long sys_mmap(v...
682
25.269231
112
c
criu
criu-master/compel/arch/s390/src/lib/infect.c
#include <sys/ptrace.h> #include <sys/types.h> #include <sys/uio.h> #include <sys/user.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <elf.h> #include <compel/plugins/std/syscall-codes.h> #include "uapi/compel/asm/infect-types.h" #include "errno.h" #include...
19,770
25.862772
115
c
criu
criu-master/compel/arch/s390/src/lib/include/uapi/asm/infect-types.h
#ifndef UAPI_COMPEL_ASM_TYPES_H__ #define UAPI_COMPEL_ASM_TYPES_H__ #include <stdint.h> #include <signal.h> #include <sys/mman.h> #include <asm/ptrace.h> #include "common/page.h" #define SIGMAX 64 #define SIGMAX_OLD 31 /* * Definitions from /usr/include/asm/ptrace.h: * * typedef struct * { * __u32 fp...
2,209
21.55102
69
h
criu
criu-master/compel/arch/s390/src/lib/include/uapi/asm/sigframe.h
#ifndef UAPI_COMPEL_ASM_SIGFRAME_H__ #define UAPI_COMPEL_ASM_SIGFRAME_H__ #include <asm/ptrace.h> #include <asm/types.h> #include <signal.h> #include <stdint.h> // XXX: the identifier rt_sigcontext is expected to be struct by the CRIU code #define rt_sigcontext sigcontext #include <compel/sigframe-common.h> #defi...
1,889
22.333333
108
h
criu
criu-master/compel/arch/x86/plugins/include/asm/syscall-types.h
#ifndef COMPEL_ARCH_SYSCALL_TYPES_H__ #define COMPEL_ARCH_SYSCALL_TYPES_H__ /* Types for sigaction, sigprocmask syscalls */ typedef void rt_signalfn_t(int, siginfo_t *, void *); typedef rt_signalfn_t *rt_sighandler_t; typedef void rt_restorefn_t(void); typedef rt_restorefn_t *rt_sigrestore_t; #define SA_RESTORER 0x0...
1,600
25.245902
72
h
criu
criu-master/compel/arch/x86/plugins/std/syscalls/syscall32.c
#include "asm/types.h" #include "syscall-32.h" #define SYS_SOCKET 1 /* sys_socket(2) */ #define SYS_BIND 2 /* sys_bind(2) */ #define SYS_CONNECT 3 /* sys_connect(2) */ #define SYS_SENDTO 11 /* sys_sendto(2) */ #define SYS_RECVFROM 12 /* sys_recvfrom(2) */ #define SYS_SHUTDOWN 13 /* sys_sh...
3,113
34.386364
112
c
criu
criu-master/compel/arch/x86/src/lib/cpu.c
#include <string.h> #include <stdbool.h> #include "compel-cpu.h" #include "common/bitops.h" #include "common/compiler.h" #include "log.h" #include "common/bug.h" #undef LOG_PREFIX #define LOG_PREFIX "cpu: " static compel_cpuinfo_t rt_info; static void fetch_rt_cpuinfo(void) { static bool rt_info_done = false; i...
13,462
27.828694
112
c
criu
criu-master/compel/arch/x86/src/lib/handle-elf.c
#include <string.h> #include <errno.h> #include "handle-elf.h" #include "piegen.h" #include "log.h" static const unsigned char __maybe_unused elf_ident_64_le[EI_NIDENT] = { 0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00, /* clang-format */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; int handle_binary(void *...
510
23.333333
72
c
criu
criu-master/compel/arch/x86/src/lib/infect.c
#include <sys/types.h> #include <sys/uio.h> #include <sys/auxv.h> #include <sys/mman.h> #include <sys/user.h> #include <errno.h> #include <stdlib.h> #include <time.h> #include <compel/asm/fpu.h> #include "asm/cpu.h" #include <compel/asm/processor-flags.h> #include <compel/cpu.h> #include "errno.h" #include <compel/p...
17,740
24.711594
115
c
criu
criu-master/compel/arch/x86/src/lib/thread_area.c
#include <errno.h> #include <string.h> #include <sys/ptrace.h> #include <sys/wait.h> #include "log.h" #include "asm/infect-types.h" #include "infect.h" #include "infect-priv.h" #ifndef PTRACE_GET_THREAD_AREA #define PTRACE_GET_THREAD_AREA 25 #endif /* * For 64-bit applications, TLS (fs_base for Glibc) is in MSR, * ...
2,308
25.238636
77
c
criu
criu-master/compel/arch/x86/src/lib/include/cpu.h
#ifndef __COMPEL_ASM_CPU_H__ #define __COMPEL_ASM_CPU_H__ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { /* ecx is often an input as well as an output. */ asm volatile("cpuid" : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) : "0"(*eax), "2"(*ecx) : "mem...
1,302
21.465517
117
h
criu
criu-master/compel/arch/x86/src/lib/include/handle-elf.h
#ifndef COMPEL_HANDLE_ELF_H__ #define COMPEL_HANDLE_ELF_H__ #include "elf64-types.h" #define ELF_X86_64 #ifndef R_X86_64_GOTPCRELX #define R_X86_64_GOTPCRELX 41 #endif #ifndef R_X86_64_REX_GOTPCRELX #define R_X86_64_REX_GOTPCRELX 42 #endif #define __handle_elf handle_elf_x86_64 #define arch_is_machine_suppo...
506
21.043478
69
h
criu
criu-master/compel/arch/x86/src/lib/include/uapi/asm/cpu.h
#ifndef __CR_ASM_CPU_H__ #define __CR_ASM_CPU_H__ #include <stdint.h> #include <compel/asm/fpu.h> /* * Adopted from linux kernel and enhanced from Intel/AMD manuals. * Note these bits are not ABI for linux kernel but they _are_ * for us, so make sure they are at proper position between * versions. * * In parti...
21,120
59.173789
122
h
criu
criu-master/compel/arch/x86/src/lib/include/uapi/asm/fpu.h
#ifndef __CR_ASM_FPU_H__ #define __CR_ASM_FPU_H__ #include <sys/types.h> #include <stdbool.h> #include <stdint.h> #include <compel/common/compiler.h> #define FP_MIN_ALIGN_BYTES 64 #define FXSAVE_ALIGN_BYTES 16 #define FP_XSTATE_MAGIC1 0x46505853U #define FP_XSTATE_MAGIC2 0x46505845U #ifndef FP_XSTATE_MAGIC2_SIZE #d...
8,366
24.587156
118
h
criu
criu-master/compel/arch/x86/src/lib/include/uapi/asm/infect-types.h
#ifndef UAPI_COMPEL_ASM_TYPES_H__ #define UAPI_COMPEL_ASM_TYPES_H__ #include <stdint.h> #include <stdbool.h> #include <signal.h> #include <compel/plugins/std/asm/syscall-types.h> #define SIGMAX 64 #define SIGMAX_OLD 31 #define ARCH_HAS_PTRACE_GET_THREAD_AREA /* * Linux preserves three TLS segments in GDT. * Of...
3,728
24.367347
111
h
criu
criu-master/compel/arch/x86/src/lib/include/uapi/asm/processor-flags.h
#ifndef __CR_PROCESSOR_FLAGS_H__ #define __CR_PROCESSOR_FLAGS_H__ /* Taken from linux kernel headers */ /* * EFLAGS bits */ #define X86_EFLAGS_CF 0x00000001 /* Carry Flag */ #define X86_EFLAGS_BIT1 0x00000002 /* Bit 1 - always on */ #define X86_EFLAGS_PF 0x00000004 /* Parity Flag */ #define X86_EFLAGS_AF 0x00000010...
1,144
38.482759
65
h
criu
criu-master/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h
#ifndef UAPI_COMPEL_ASM_SIGFRAME_H__ #define UAPI_COMPEL_ASM_SIGFRAME_H__ #include <stdint.h> #include <stdbool.h> #include <string.h> #include <compel/asm/fpu.h> #include <compel/plugins/std/syscall-codes.h> #define SIGFRAME_MAX_OFFSET 8 struct rt_sigcontext { uint64_t r8; uint64_t r9; uint64_t r10; uint64_t r...
4,926
21.497717
112
h
criu
criu-master/compel/include/infect-priv.h
#ifndef __COMPEL_INFECT_PRIV_H__ #define __COMPEL_INFECT_PRIV_H__ #include <stdbool.h> #define BUILTIN_SYSCALL_SIZE 8 struct thread_ctx { k_rtsigset_t sigmask; user_regs_struct_t regs; #ifdef ARCH_HAS_PTRACE_GET_THREAD_AREA tls_t tls; #endif user_fpregs_struct_t ext_regs; }; /* parasite control block */ struct ...
2,522
30.148148
118
h
criu
criu-master/compel/include/log.h
#ifndef COMPEL_LOG_H__ #define COMPEL_LOG_H__ #include <errno.h> #include <string.h> #include "uapi/compel/log.h" #ifndef LOG_PREFIX #define LOG_PREFIX #endif static inline int pr_quelled(unsigned int loglevel) { return compel_log_get_loglevel() < loglevel && loglevel != COMPEL_LOG_MSG; } extern void compel_print...
1,702
30.537037
109
h
criu
criu-master/compel/include/uapi/cpu.h
#ifndef UAPI_COMPEL_CPU_H__ #define UAPI_COMPEL_CPU_H__ #include <stdbool.h> #include <stdint.h> #include <compel/asm/cpu.h> extern int /* TODO: __must_check */ compel_cpuid(compel_cpuinfo_t *info); extern bool compel_cpu_has_feature(unsigned int feature); extern bool compel_fpu_has_feature(unsigned int feature); ex...
598
32.277778
73
h
criu
criu-master/compel/include/uapi/handle-elf.h
#ifndef __COMPEL_UAPI_HANDLE_ELF__ #define __COMPEL_UAPI_HANDLE_ELF__ #define COMPEL_TYPE_INT (1u << 0) #define COMPEL_TYPE_LONG (1u << 1) #define COMPEL_TYPE_GOTPCREL (1u << 2) #ifdef CONFIG_MIPS #define COMPEL_TYPE_MIPS_26 (1u << 3) #define COMPEL_TYPE_MIPS_HI16 (1u << 4) #define COMPEL_TYPE_MIPS_LO16 (1...
572
23.913043
42
h
criu
criu-master/compel/include/uapi/infect-rpc.h
#ifndef __COMPEL_INFECT_RPC_H__ #define __COMPEL_INFECT_RPC_H__ #include <sys/socket.h> #include <sys/un.h> #include <stdint.h> #include <common/compiler.h> struct parasite_ctl; extern int __must_check compel_rpc_sync(unsigned int cmd, struct parasite_ctl *ctl); extern int __must_check compel_rpc_call(unsigned int c...
534
27.157895
89
h
criu
criu-master/compel/include/uapi/infect.h
#ifndef __COMPEL_INFECT_H__ #define __COMPEL_INFECT_H__ #include <stdbool.h> #include <compel/asm/sigframe.h> #include <compel/asm/infect-types.h> #include <compel/ksigset.h> #include <compel/handle-elf.h> #include <compel/task-state.h> #include "common/compiler.h" #define PARASITE_START_AREA_MIN (4096) extern int...
6,595
34.462366
115
h
criu
criu-master/compel/include/uapi/loglevels.h
#ifndef UAPI_COMPEL_LOGLEVELS_H__ #define UAPI_COMPEL_LOGLEVELS_H__ /* * Log levels used by compel itself (see compel_log_init()), * also by log functions in the std plugin. */ enum __compel_log_levels { COMPEL_LOG_MSG, /* Print message regardless of log level */ COMPEL_LOG_ERROR, /* Errors only, when we're in...
546
26.35
62
h
criu
criu-master/compel/include/uapi/plugins.h
#ifndef UAPI_COMPEL_PLUGIN_H__ #define UAPI_COMPEL_PLUGIN_H__ #define __init __attribute__((__used__)) __attribute__((__section__(".compel.init"))) #define __exit __attribute__((__used__)) __attribute__((__section__(".compel.exit"))) #ifndef __ASSEMBLY__ typedef struct { const char *name; int (*init)(void); void ...
1,151
32.882353
103
h
criu
criu-master/compel/include/uapi/ptrace.h
#ifndef UAPI_COMPEL_PTRACE_H__ #define UAPI_COMPEL_PTRACE_H__ #include "common/compiler.h" /* * We'd want to include both sys/ptrace.h and linux/ptrace.h, * hoping that most definitions come from either one or another. * Alas, on Alpine/musl both files declare struct ptrace_peeksiginfo_args, * so there is no way t...
2,411
24.125
87
h
criu
criu-master/compel/include/uapi/sigframe-common.h
/* * Don't include it directly but use "arch-sigframe.h" instead. */ #ifndef UAPI_COMPEL_SIGFRAME_COMMON_H__ #define UAPI_COMPEL_SIGFRAME_COMMON_H__ #ifndef UAPI_COMPEL_ASM_SIGFRAME_H__ #error "Direct inclusion is forbidden, use <compel/asm/sigframe.h> instead" #endif #include "common/compiler.h" #include <signal.h...
1,611
25
104
h
criu
criu-master/compel/plugins/include/uapi/std/infect.h
#ifndef COMPEL_PLUGIN_STD_INFECT_H__ #define COMPEL_PLUGIN_STD_INFECT_H__ #include "common/compiler.h" extern int parasite_get_rpc_sock(void); extern unsigned int __export_parasite_service_cmd; extern void *__export_parasite_service_args_ptr; extern int __must_check parasite_service(void); /* * Must be supplied by...
682
25.269231
65
h
criu
criu-master/compel/plugins/include/uapi/std/log.h
#ifndef COMPEL_PLUGIN_STD_LOG_H__ #define COMPEL_PLUGIN_STD_LOG_H__ #include "compel/loglevels.h" #include "common/compiler.h" #define STD_LOG_SIMPLE_CHUNK 256 extern void std_log_set_fd(int fd); extern void std_log_set_loglevel(enum __compel_log_levels level); extern void std_log_set_start(struct timeval *tv); /* ...
1,225
38.548387
83
h
criu
criu-master/compel/plugins/include/uapi/std/string.h
#ifndef COMPEL_PLUGIN_STD_STRING_H__ #define COMPEL_PLUGIN_STD_STRING_H__ #include <sys/types.h> #include <stdbool.h> #include <stdarg.h> /* Standard file descriptors. */ #define STDIN_FILENO 0 /* Standard input. */ #define STDOUT_FILENO 1 /* Standard output. */ #define STDERR_FILENO 2 /* Standard error output. ...
1,178
37.032258
103
h
criu
criu-master/compel/src/main.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <unistd.h> #include <stdint.h> #include <getopt.h> #include <string.h> #include <ctype.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include "version.h" #include "piegen.h" #include "log.h" #define CFLAG...
8,962
20.807786
90
c
criu
criu-master/compel/src/lib/handle-elf.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <unistd.h> #include <stdint.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include "handle-elf.h" #include "piegen.h" #include "log.h" #ifdef CONFIG_MIPS #include "l...
23,719
31.944444
117
c
criu
criu-master/compel/test/stack/spy.c
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <fcntl.h> #include <sys/wait.h> #include <sys/mman.h> #include <common/page.h> #include <compel/log.h> #include <compel/infect-rpc.h> #include <errno.h> #include "parasite.h" #define PARASITE_CMD_INC PARASITE_USER_CMDS #define PARASITE_CMD_DEC PARA...
8,729
20.502463
117
c
criu
criu-master/criu/aio.c
#include <unistd.h> #include <stdio.h> #include <stdbool.h> #include "vma.h" #include "xmalloc.h" #include "pstree.h" #include "restorer.h" #include "aio.h" #include "rst_info.h" #include "rst-malloc.h" #include "parasite.h" #include "parasite-syscall.h" #include "images/mm.pb-c.h" #include "compel/infect.h" #define N...
3,357
21.386667
114
c
criu
criu-master/criu/apparmor.c
#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/mman.h> #include <unistd.h> #include <ftw.h> #include "common/config.h" #include "imgset.h" #include "pstree.h" #include "util.h" #include "string.h" #include "lsm.h" #include "cr_opt...
17,767
20.854859
106
c
criu
criu-master/criu/bitmap.c
#include "common/bitsperlong.h" #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) #define BITMAP_FIRST_WORD_MASK(start) (~0ul << ((start) % BITS_PER_LONG)) #define BITMAP_LAST_WORD_MASK(nbits) (((nbits) % BITS_PER_LONG) ? (1ul << ((nbits) % BITS_PER_LONG)) - 1 : ~0ul) #define small_const_nbits(nbits) (__builtin_constant_...
1,326
25.54
112
c
criu
criu-master/criu/bpfmap.c
#include <stdio.h> #include <bpf/bpf.h> #include "common/compiler.h" #include "imgset.h" #include "bpfmap.h" #include "fdinfo.h" #include "image.h" #include "util.h" #include "log.h" #include "protobuf.h" #ifndef LIBBPF_OPTS #define LIBBPF_OPTS DECLARE_LIBBPF_OPTS #define LEGACY_LIBBPF /* Using libbpf < 0.7 */ #en...
10,158
26.756831
112
c
criu
criu-master/criu/cgroup-props.c
#include <stdio.h> #include <string.h> #include <ctype.h> #include <unistd.h> #include <fcntl.h> #include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h> #include "int.h" #include "common/config.h" #include "common/compiler.h" #include "cgroup-props.h" #include "cr_options.h" #include "xmalloc.h" #include "...
12,694
20.850258
96
c
criu
criu-master/criu/clone-noasan.c
#include <stdlib.h> #include <sched.h> #include <unistd.h> #include <compel/plugins/std/syscall-codes.h> #include "sched.h" #include "common/compiler.h" #include "log.h" #include "common/bug.h" /* * ASan doesn't play nicely with clone if we use current stack for * child task. ASan puts local variables on the fake ...
2,473
28.105882
95
c
criu
criu-master/criu/crtools.c
#include <stdio.h> #include <stdlib.h> #include <limits.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <ctype.h> #include <sched.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <dlfcn.h> #incl...
21,860
36.887348
106
c
criu
criu-master/criu/eventfd.c
#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <limits.h> #include <sys/stat.h> #include <sys/statfs.h> #include <sys/types.h> #include <sys/ioctl.h> #include <sys/eventfd.h> #include "common/compiler.h" #include "imgset.h" #include "eventf...
2,545
21.13913
106
c
criu
criu-master/criu/eventpoll.c
#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <limits.h> #include <sys/stat.h> #include <sys/statfs.h> #include <sys/types.h> #include <sys/ioctl.h> #include <sys/epoll.h> #include "types.h" #include "crtools.h" #include "common/compiler.h...
11,255
21.467066
112
c
criu
criu-master/criu/fifo.c
#include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdlib.h> #include "imgset.h" #include "image.h" #include "files.h" #include "files-reg.h" #include "file-ids.h" #include "pipes.h" #include "fifo.h" #include "protobuf.h" #include "images/regfile.pb-c.h" #include "images/f...
4,348
22.895604
88
c
criu
criu-master/criu/file-lock.c
#include <stdlib.h> #include <signal.h> #include <unistd.h> #include <sys/file.h> #include <fcntl.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/fsuid.h> #include <sys/sysmacros.h> #include "cr_options.h" #include "imgset.h" #include "files.h" #include "fs-magic.h" #include "kerndat....
16,118
21.896307
111
c
criu
criu-master/criu/files-ext.c
/* An external file is a file, which is dumped with help a plugin */ #include <unistd.h> #include "imgset.h" #include "files.h" #include "plugin.h" #include "protobuf.h" #include "images/ext-file.pb-c.h" static int dump_one_ext_file(int lfd, u32 id, const struct fd_parms *p) { int ret; struct cr_img *rimg; FileE...
2,052
20.164948
95
c
criu
criu-master/criu/fsnotify.c
#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <signal.h> #include <string.h> #include <utime.h> #include <limits.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/inotify.h> #include <linux/magic.h> #include <sys/wait.h> #include <poll.h> #include ...
21,957
23.156216
111
c
criu
criu-master/criu/hugetlb.c
#include "hugetlb.h" #include "kerndat.h" #include "sizes.h" // clang-format off struct htlb_info hugetlb_info[HUGETLB_MAX] = { [HUGETLB_16KB] = { SZ_16K, MAP_HUGETLB_16KB }, [HUGETLB_64KB] = { SZ_64K, MAP_HUGETLB_64KB }, [HUGETLB_512KB] = { SZ_512K, MAP_HUGETLB_512KB }, [HUGETLB_1MB] = { SZ_1M, MAP_HUGETLB_1MB },...
1,631
25.754098
111
c
criu
criu-master/criu/image-desc.c
#include <stdlib.h> #include "image-desc.h" #include "magic.h" #include "image.h" /* * The cr fd set is the set of files where the information * about dumped processes is stored. Each file carries some * small portion of info about the whole picture, see below * for more details. */ #define FD_ENTRY(_name, _fmt...
4,031
31.780488
78
c
criu
criu-master/criu/img-streamer.c
#include <sys/socket.h> #include <sys/un.h> #include <unistd.h> #include <stdio.h> #include "cr_options.h" #include "img-streamer.h" #include "image.h" #include "images/img-streamer.pb-c.h" #include "protobuf.h" #include "servicefd.h" #include "rst-malloc.h" #include "common/scm.h" #include "common/lock.h" /* * We u...
6,035
24.905579
103
c
criu
criu-master/criu/ipc_ns.c
#include <unistd.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <sys/wait.h> #include <sys/msg.h> #include <sys/sem.h> #include <sys/shm.h> #include <sched.h> #include "util.h" #include "cr_options.h" #include "imgset.h" #include "namespaces.h" #include "sysctl.h" #include "ipc_ns.h" #include "...
21,512
20.752275
111
c
criu
criu-master/criu/kcmp-ids.c
#include <unistd.h> #include <stdlib.h> #include <sys/syscall.h> #include "log.h" #include "xmalloc.h" #include "common/compiler.h" #include "common/bug.h" #include "rbtree.h" #include "kcmp-ids.h" /* * We track shared files by global rbtree, where each node might * be a root for subtree. The reason for that is t...
5,430
26.429293
115
c
criu
criu-master/criu/libnetlink.c
#include <linux/types.h> #include <sys/socket.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <libnl3/netlink/attr.h> #include <libnl3/netlink/msg.h> #include <string.h> #include <unistd.h> #include "libnetlink.h" #include "util.h" static int nlmsg_receive(char *buf, int len, int (*cb)(struct nlms...
5,342
23.067568
117
c
criu
criu-master/criu/log.c
#include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <errno.h> #include <unistd.h> #include <stdbool.h> #include <limits.h> #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/utsname.h> #include <fcntl.h> #include "page.h" #include "common/compiler.h" #include "util.h...
9,386
21.035211
106
c
criu
criu-master/criu/memfd.c
#include <unistd.h> #include <linux/memfd.h> #include "common/compiler.h" #include "common/lock.h" #include "memfd.h" #include "fdinfo.h" #include "imgset.h" #include "image.h" #include "util.h" #include "log.h" #include "files.h" #include "fs-magic.h" #include "kerndat.h" #include "files-reg.h" #include "rst-malloc.h...
9,579
20.19469
108
c
criu
criu-master/criu/netfilter.c
#include <sys/socket.h> #include <arpa/inet.h> #include <unistd.h> #include <string.h> #include <sys/wait.h> #include <stdlib.h> #if defined(CONFIG_HAS_NFTABLES_LIB_API_0) || defined(CONFIG_HAS_NFTABLES_LIB_API_1) #include <nftables/libnftables.h> #endif #include "../soccr/soccr.h" #include "util.h" #include "common...
8,308
25.977273
113
c
criu
criu-master/criu/page-pipe.c
#include <unistd.h> #undef LOG_PREFIX #define LOG_PREFIX "page-pipe: " #include "common/config.h" #include "page.h" #include "util.h" #include "criu-log.h" #include "page-pipe.h" #include "fcntl.h" #include "stats.h" #include "cr_options.h" /* can existing iov accumulate the page? */ static inline bool iov_grow_page...
10,130
21.217105
112
c
criu
criu-master/criu/pagemap-cache.c
#include <unistd.h> #include <fcntl.h> #include "page.h" #include "pagemap-cache.h" #include "common/compiler.h" #include "xmalloc.h" #include "util.h" #include "log.h" #include "vma.h" #include "mem.h" #include "kerndat.h" #undef LOG_PREFIX #define LOG_PREFIX "pagemap-cache: " /* To carry up to 2M of physical memor...
4,908
24.567708
109
c
criu
criu-master/criu/pagemap.c
#include <fcntl.h> #include <stdio.h> #include <unistd.h> #include <linux/falloc.h> #include <sys/uio.h> #include <limits.h> #include "types.h" #include "image.h" #include "cr_options.h" #include "servicefd.h" #include "pagemap.h" #include "restorer.h" #include "rst-malloc.h" #include "page-xfer.h" #include "fault-in...
19,208
21.232639
117
c
criu
criu-master/criu/parasite-syscall.c
#include <unistd.h> #include <inttypes.h> #include <sys/stat.h> #include <sys/wait.h> #include <sys/mman.h> #include "common/config.h" #include "common/compiler.h" #include "types.h" #include "protobuf.h" #include "images/sa.pb-c.h" #include "images/timer.pb-c.h" #include "images/creds.pb-c.h" #include "images/core.p...
16,870
24.875767
119
c
criu
criu-master/criu/path.c
#include <string.h> #include <stdio.h> #include <stdbool.h> #include "int.h" #include "mount.h" #include "path.h" #include "log.h" #include "util.h" #include "common/bug.h" char *cut_root_for_bind(char *target_root, char *source_root) { int tok = 0; char *path = NULL; /* * Cut common part of root. * For non-ro...
1,560
20.680556
95
c
criu
criu-master/criu/pidfd-store.c
#include <sys/socket.h> #include <unistd.h> #include <limits.h> #include <errno.h> #include <stdio.h> #include <poll.h> #include "compel/plugins/std/syscall-codes.h" #include "cr_options.h" #include "common/scm.h" #include "common/list.h" #include "kerndat.h" #include "log.h" #include "util.h" #include "pidfd-store.h"...
7,446
21.704268
104
c
criu
criu-master/criu/pipes.c
#include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <stdlib.h> #include <sys/mman.h> #include "crtools.h" #include "imgset.h" #include "image.h" #include "files.h" #include "pipes.h" #include "util-pie.h" #include "autofs.h" #include "protobuf.h" #include "util.h" #include "images/pipe.pb-c.h" #...
11,194
20.822612
92
c
criu
criu-master/criu/plugin.c
#include <unistd.h> #include <stdlib.h> #include <string.h> #include <dirent.h> #include <stdio.h> #include <errno.h> #include <dlfcn.h> #include "cr_options.h" #include "common/compiler.h" #include "xmalloc.h" #include "plugin.h" #include "servicefd.h" #include "common/list.h" #include "log.h" cr_plugin_ctl_t cr_plu...
5,866
21.056391
106
c
criu
criu-master/criu/protobuf-desc.c
#include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <arpa/inet.h> #include <ctype.h> #include "common/compiler.h" #include "log.h" #include "protobuf-desc.h" #include "images/inventory.pb-c.h" #include "images/stats.pb-c.h" #include "images/regfile.pb-c....
4,202
32.094488
120
c
criu
criu-master/criu/protobuf.c
#include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdlib.h> #include <arpa/inet.h> #include <ctype.h> #include <google/protobuf-c/protobuf-c.h> #include "image.h" #include "servicefd.h" #include "common/compiler.h" #include "log.h" #include "rst-malloc.h" #include "string.h...
5,308
20.151394
97
c
criu
criu-master/criu/rbtree.c
/* * RBtree implementation adopted from the Linux kernel sources. */ #include <sys/types.h> #include "rbtree.h" static void __rb_rotate_left(struct rb_node *node, struct rb_root *root) { struct rb_node *right = node->rb_right; struct rb_node *parent = rb_parent(node); node->rb_right = right->rb_left; if (node-...
7,667
20.6
96
c
criu
criu-master/criu/rst-malloc.c
#include <stdio.h> #include <stdbool.h> #include <sys/mman.h> #include "page.h" #include "rst-malloc.h" #include "log.h" #include "common/bug.h" struct rst_mem_type_s { bool remapable; bool enabled; unsigned long free_bytes; void *free_mem; int (*grow)(struct rst_mem_type_s *, unsigned long size); unsigned long...
5,407
20.207843
94
c
criu
criu-master/criu/seccomp.c
#include <linux/filter.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <ptrace.h> #include "common/config.h" #include "imgset.h" #include "kcmp.h" #include "pstree.h" #include <compel/ptrace.h> #include "proc_parse.h" #include "restorer.h" #include "seccomp.h" #include "servicefd.h" #inclu...
12,964
25.034137
97
c
criu
criu-master/criu/seize.c
#include <stdbool.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/wait.h> #include <time.h> #include "int.h" #include "common/compiler.h" #include "cr_options.h" #include "cr-errno.h" #include "pstr...
22,410
20.779397
96
c
criu
criu-master/criu/servicefd.c
#include <stdio.h> #include <errno.h> #include <unistd.h> #include <sched.h> #include <sys/time.h> #include <sys/syscall.h> #include <sys/resource.h> #include "common/compiler.h" #include "common/list.h" #include "util.h" #include "bitops.h" #include "pstree.h" #include "files.h" #include "rst_info.h" #include "serv...
7,734
23.400631
87
c
criu
criu-master/criu/shmem.c
#include <unistd.h> #include <sys/mman.h> #include <stdlib.h> #include <fcntl.h> #include <stdbool.h> #include "common/config.h" #include "common/list.h" #include "pid.h" #include "shmem.h" #include "image.h" #include "cr_options.h" #include "kerndat.h" #include "stats.h" #include "page-pipe.h" #include "page-xfer.h" ...
21,205
21.631804
115
c
criu
criu-master/criu/sigframe.c
#include <unistd.h> #include <string.h> #include "log.h" #include "restore.h" #include "images/core.pb-c.h" #ifndef setup_sas static inline void setup_sas(struct rt_sigframe *sigframe, ThreadSasEntry *sas) { if (sas) { #define UC RT_SIGFRAME_UC(sigframe) UC->uc_stack.ss_sp = (void *)decode_pointer((sas)->ss_sp); ...
1,078
21.957447
105
c
criu
criu-master/criu/signalfd.c
#include <unistd.h> #include <signal.h> #include <sys/signalfd.h> #include "common/compiler.h" #include "signalfd.h" #include "fdinfo.h" #include "imgset.h" #include "image.h" #include "util.h" #include "log.h" #include "files.h" #include "protobuf.h" #include "images/signalfd.pb-c.h" struct signalfd_info { Signalf...
2,397
20.410714
78
c
criu
criu-master/criu/sk-netlink.c
#include <unistd.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <libnl3/netlink/msg.h> #include "imgset.h" #include "files.h" #include "sockets.h" #include "util.h" #include "protobuf.h" #include "images/sk-netlink.pb-c.h" #include "netlink_diag.h" #include "libnetlink.h" #include "namespaces.h" ...
6,389
21.659574
84
c
criu
criu-master/criu/sk-packet.c
#include <linux/if_packet.h> #include <sys/socket.h> #include <net/if.h> #include <sys/ioctl.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <libnl3/netlink/msg.h> #include <unistd.h> #include <string.h> #include "imgset.h" #include "files.h" #include "sockets.h" #include "libnetlink.h" #include "sk...
12,731
20.913941
83
c
criu
criu-master/criu/sk-tcp.c
#include <netinet/tcp.h> #include <unistd.h> #include <stdlib.h> #include <sys/mman.h> #include <string.h> #include <sched.h> #include <netinet/in.h> #include "../soccr/soccr.h" #include "common/config.h" #include "cr_options.h" #include "util.h" #include "common/list.h" #include "log.h" #include "files.h" #include "...
10,737
20.305556
120
c
criu
criu-master/criu/stats.c
#include <unistd.h> #include <fcntl.h> #include <sys/time.h> #include "int.h" #include "atomic.h" #include "cr_options.h" #include "rst-malloc.h" #include "protobuf.h" #include "stats.h" #include "util.h" #include "image.h" #include "images/stats.pb-c.h" struct timing { struct timeval start; struct timeval total; };...
6,666
27.613734
105
c
criu
criu-master/criu/string.c
/* * Adopted from linux kernel */ #include <sys/types.h> #include <string.h> #include "string.h" /** * strlcpy - Copy a %NUL terminated string into a sized buffer * @dest: Where to copy the string to * @src: Where to copy the string from * @size: size of destination buffer * * Compatible with *BSD: the result...
1,308
21.964912
71
c
criu
criu-master/criu/sysctl.c
#include <unistd.h> #include <fcntl.h> #include <ctype.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> #include <sched.h> #include "namespaces.h" #include "sysctl.h" #include "util.h" /* These are the namespaces we know how to restore in various ways. */ #define KNOWN_NS_MASK ...
16,281
32.228571
99
c
criu
criu-master/criu/sysfs_parse.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <ctype.h> #include <errno.h> #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> #include "cr_options.h" #include "log.h" #include "xmalloc.h" #include "files.h" #include "proc_parse.h" #include "util.h" #include "sysf...
7,739
22.815385
89
c
criu
criu-master/criu/timens.c
#include <time.h> #include <sched.h> #include "types.h" #include "proc_parse.h" #include "namespaces.h" #include "timens.h" #include "cr_options.h" #include "protobuf.h" #include "images/timens.pb-c.h" int dump_time_ns(int ns_id) { struct cr_img *img; TimensEntry te = TIMENS_ENTRY__INIT; Timespec b = TIMESPEC__IN...
3,166
22.116788
93
c
criu
criu-master/criu/timerfd.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/timerfd.h> #include <sys/ioctl.h> #include "protobuf.h" #include "images/timerfd.pb-c.h" #include "fdinfo.h" #include "rst-malloc.h" #include "cr_options.h" #include "restorer.h" #include "timerfd.h" #include "pstree.h" #include "files.h" #incl...
4,139
21.139037
105
c
criu
criu-master/criu/tls.c
#include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <linux/limits.h> #include <gnutls/gnutls.h> #include "cr_options.h" #include "xmalloc.h" /* Compatibility with GnuTLS version < 3.5 */ #ifndef GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR #define GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR GNUTLS_E_C...
9,361
22.116049
91
c
criu
criu-master/criu/vdso-compat.c
#include <sys/syscall.h> #include <signal.h> #include <string.h> #include <unistd.h> #include "types.h" #include "parasite-syscall.h" #include "parasite.h" #include "vdso.h" static void exit_on(int ret, int err_fd, char *reason) { if (ret) { syscall(__NR_write, err_fd, reason, strlen(reason)); syscall(__NR_exit,...
2,372
31.506849
107
c
criu
criu-master/criu/vdso.c
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <elf.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include <sys/wait.h> #include "types.h" #include "parasite-syscall.h" #include "parasite.h" #include "common/compiler.h" #include "kern...
17,161
23.447293
120
c
criu
criu-master/criu/arch/aarch64/crtools.c
#include <string.h> #include <unistd.h> #include <linux/elf.h> #include "types.h" #include <compel/asm/processor-flags.h> #include <compel/asm/infect-types.h> #include "asm/restorer.h" #include "common/compiler.h" #include <compel/ptrace.h> #include "asm/dump.h" #include "protobuf.h" #include "images/core.pb-c.h" #i...
3,273
22.724638
83
c
criu
criu-master/criu/arch/aarch64/vdso-pie.c
#include <unistd.h> #include "asm/types.h" #include <compel/plugins/std/syscall.h> #include "parasite-vdso.h" #include "log.h" #include "common/bug.h" #ifdef LOG_PREFIX #undef LOG_PREFIX #endif #define LOG_PREFIX "vdso: " int vdso_redirect_calls(unsigned long base_to, unsigned long base_from, struct vdso_symtable *...
761
22.8125
100
c
criu
criu-master/criu/arch/aarch64/include/asm/restore.h
#ifndef __CR_ASM_RESTORE_H__ #define __CR_ASM_RESTORE_H__ #include "asm/restorer.h" #include "images/core.pb-c.h" /* clang-format off */ #define JUMP_TO_RESTORER_BLOB(new_sp, restore_task_exec_start, \ task_args) \ asm volatile( \ "and sp, %0, #~15 \n" \ "mov x0, %2 \n" \ "br %1 \n...
637
20.266667
64
h
criu
criu-master/criu/arch/aarch64/include/asm/restorer.h
#ifndef __CR_ASM_RESTORER_H__ #define __CR_ASM_RESTORER_H__ #include <asm/sigcontext.h> #include <sys/ucontext.h> #include "asm/types.h" #include "images/core.pb-c.h" #include <compel/asm/sigframe.h> /* clang-format off */ #define RUN_CLONE_RESTORE_FN(ret, clone_flags, new_sp, parent_tid, \ thread_args, cl...
3,930
26.110345
75
h
criu
criu-master/criu/arch/aarch64/include/asm/thread_pointer.h
/* __thread_pointer definition. Generic version. Copyright (C) 2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Softw...
1,021
35.5
71
h
criu
criu-master/criu/arch/aarch64/include/asm/vdso.h
#ifndef __CR_ASM_VDSO_H__ #define __CR_ASM_VDSO_H__ #include "asm/int.h" #include "common/compiler.h" #include "asm-generic/vdso.h" /* * This is a minimal amount of symbols * we should support at the moment. */ #define VDSO_SYMBOL_MAX 4 #define VDSO_SYMBOL_GTOD 2 /* * Workaround for VDSO array symbol table's re...
922
29.766667
104
h
criu
criu-master/criu/arch/arm/crtools.c
#include <string.h> #include <unistd.h> #include "types.h" #include <compel/asm/processor-flags.h> #include <compel/asm/infect-types.h> #include "asm/restorer.h" #include "common/compiler.h" #include "asm/dump.h" #include <compel/ptrace.h> #include "protobuf.h" #include "images/core.pb-c.h" #include "images/creds.pb-...
3,567
24.304965
107
c
criu
criu-master/criu/arch/arm/restorer.c
#include <unistd.h> #include "restorer.h" #include "asm/restorer.h" #include <compel/plugins/std/syscall.h> #include "log.h" #include <compel/asm/fpu.h> #include "cpu.h" #include "page.h" #include "common/err.h" int restore_nonsigframe_gpregs(UserArmRegsEntry *r) { return 0; } /* * On ARMv6 CPUs with VIPT caches ...
2,567
34.666667
116
c
criu
criu-master/criu/arch/arm/vdso-pie.c
#include <unistd.h> #include "asm/types.h" #include <compel/plugins/std/string.h> #include <compel/plugins/std/syscall.h> #include "parasite-vdso.h" #include "log.h" #include "common/bug.h" #ifdef LOG_PREFIX #undef LOG_PREFIX #endif #define LOG_PREFIX "vdso: " static void insert_trampoline(uintptr_t from, uintptr_t...
1,273
21.350877
98
c
criu
criu-master/criu/arch/arm/include/asm/restore.h
#ifndef __CR_ASM_RESTORE_H__ #define __CR_ASM_RESTORE_H__ #include "asm/restorer.h" #include "images/core.pb-c.h" /* clang-format off */ #define JUMP_TO_RESTORER_BLOB(new_sp, restore_task_exec_start, \ task_args) \ asm volatile( \ "mov sp, %0 \n" \ "mov r1, %1 \n" \ ...
720
22.258065
65
h
criu
criu-master/criu/arch/arm/include/asm/restorer.h
#ifndef __CR_ASM_RESTORER_H__ #define __CR_ASM_RESTORER_H__ #include "asm/types.h" #include "images/core.pb-c.h" #include <compel/asm/sigframe.h> /* clang-format off */ #define RUN_CLONE_RESTORE_FN(ret, clone_flags, new_sp, parent_tid, \ thread_args, clone_restore_fn) \ asm volatile( \ "clone_...
4,001
25.503311
83
h
criu
criu-master/criu/arch/arm/include/asm/thread_pointer.h
/* __thread_pointer definition. Generic version. Copyright (C) 2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Softw...
1,021
35.5
71
h
criu
criu-master/criu/arch/arm/include/asm/vdso.h
#ifndef __CR_ASM_VDSO_H__ #define __CR_ASM_VDSO_H__ #include "asm/int.h" #include "asm-generic/vdso.h" /* This definition is used in pie/util-vdso.c to initialize the vdso symbol * name string table 'vdso_symbols' * * Poke from kernel file arch/arm/vdso/vdso.lds.S */ #define VDSO_SYMBOL_MAX 2 #define VDSO_SYMBOL...
610
29.55
75
h