mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-21 01:06:58 +00:00
compel: plusings -- Add std plugin
The plugin provides basic features as string copying, syscalls, printing. Not used on its own by now but will be shipping by default with other plugins. With great help from Dmitry Safonov. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
a437c2d969
commit
20d5bb140d
14 changed files with 1064 additions and 0 deletions
28
compel/plugins/include/uapi/std/string.h
Normal file
28
compel/plugins/include/uapi/std/string.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#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. */
|
||||
|
||||
|
||||
extern void __std_putc(int fd, char c);
|
||||
extern void __std_puts(int fd, const char *s);
|
||||
extern void __std_printk(int fd, const char *format, va_list args);
|
||||
extern void __std_printf(int fd, const char *format, ...);
|
||||
|
||||
#define std_printf(fmt, ...) __std_printf(STDOUT_FILENO, fmt, ##__VA_ARGS__)
|
||||
#define std_puts(s) __std_puts(STDOUT_FILENO, s)
|
||||
#define std_putchar(c) __std_putc(STDOUT_FILENO, c)
|
||||
|
||||
extern unsigned long std_strtoul(const char *nptr, char **endptr, int base);
|
||||
extern void *std_memcpy(void *to, const void *from, unsigned int n);
|
||||
extern int std_memcmp(const void *cs, const void *ct, size_t count);
|
||||
extern int std_strcmp(const char *cs, const char *ct);
|
||||
|
||||
#endif /* COMPEL_PLUGIN_STD_STRING_H__ */
|
||||
55
compel/plugins/include/uapi/std/syscall-types.h
Normal file
55
compel/plugins/include/uapi/std/syscall-types.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Please add here type definitions if
|
||||
* syscall prototypes need them.
|
||||
*/
|
||||
|
||||
#ifndef COMPEL_SYSCALL_TYPES_H__
|
||||
#define COMPEL_SYSCALL_TYPES_H__
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/time.h>
|
||||
#include <stdbool.h>
|
||||
#include <signal.h>
|
||||
#include <sched.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
|
||||
struct cap_header {
|
||||
u32 version;
|
||||
int pid;
|
||||
};
|
||||
|
||||
struct cap_data {
|
||||
u32 eff;
|
||||
u32 prm;
|
||||
u32 inh;
|
||||
};
|
||||
|
||||
struct robust_list_head;
|
||||
struct file_handle;
|
||||
struct itimerspec;
|
||||
struct io_event;
|
||||
struct sockaddr;
|
||||
struct timespec;
|
||||
struct siginfo;
|
||||
struct msghdr;
|
||||
struct rusage;
|
||||
struct iocb;
|
||||
|
||||
typedef unsigned long aio_context_t;
|
||||
|
||||
#ifndef F_GETFD
|
||||
# define F_GETFD 1
|
||||
#endif
|
||||
|
||||
struct krlimit {
|
||||
unsigned long rlim_cur;
|
||||
unsigned long rlim_max;
|
||||
};
|
||||
|
||||
/* Type of timers in the kernel. */
|
||||
typedef int kernel_timer_t;
|
||||
|
||||
#include "asm/std/syscall-types.h"
|
||||
|
||||
#endif /* COMPEL_SYSCALL_TYPES_H__ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue