mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 18:07:57 +00:00
* The following files goes into the directory arch/x86/include/asm unmodified: - include/atomic.h, - include/linkage.h, - include/memcpy_64.h, - include/types.h, - include/bitops.h, - pie/parasite-head-x86-64.S, - include/processor-flags.h, - include/syscall-x86-64.def. * Changed include directives in the source files that include the headers listed above. * Modified build scripts to reflect the source moves. Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
50 lines
774 B
C
50 lines
774 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <stdarg.h>
|
|
#include <signal.h>
|
|
#include <limits.h>
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include "asm/types.h"
|
|
#include "file-ids.h"
|
|
#include "rbtree.h"
|
|
#include "kcmp-ids.h"
|
|
#include "compiler.h"
|
|
#include "syscall.h"
|
|
#include "image.h"
|
|
#include "util.h"
|
|
|
|
static DECLARE_KCMP_TREE(fd_tree, KCMP_FILE);
|
|
|
|
void fd_id_show_tree(void)
|
|
{
|
|
kid_show_tree(&fd_tree);
|
|
}
|
|
|
|
u32 fd_id_generate_special(void)
|
|
{
|
|
return fd_tree.subid++;
|
|
}
|
|
|
|
int fd_id_generate(pid_t pid, FdinfoEntry *fe)
|
|
{
|
|
u32 id;
|
|
struct kid_elem e;
|
|
int new_id = 0;
|
|
|
|
e.pid = pid;
|
|
e.genid = fe->id;
|
|
e.idx = fe->fd;
|
|
|
|
id = kid_generate_gen(&fd_tree, &e, &new_id);
|
|
if (!id)
|
|
return -ENOMEM;
|
|
|
|
fe->id = id;
|
|
return new_id;
|
|
}
|