2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-23 10:28:05 +00:00
criu/include/files.h
Pavel Emelyanov 7a451ff108 rst: Open exe link fd early
Open the exec link at fd restore stage as yet another service fd,
then pass it to restover via args and just call prctl on it.

This is good for several reasons -- the amount of code required for
this is less and opening files should better happen before we switch
to restorer (opening will be complex and it's MUCH easier to open all
we need in one place).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-03-24 15:30:20 +04:00

48 lines
823 B
C

#ifndef FILES_H_
#define FILES_H_
#include "compiler.h"
#include "types.h"
#include "list.h"
#include "image.h"
enum fdinfo_states {
FD_STATE_PREP, /* Create unix sockets */
FD_STATE_CREATE, /* Create and send fd */
FD_STATE_RECV, /* Receive fd */
FD_STATE_MAX
};
struct fmap_fd {
struct fmap_fd *next;
unsigned long start;
int pid;
int fd;
};
struct fdinfo_desc {
u64 id;
u64 addr;
int pid;
u32 real_pid; /* futex */
u32 users; /* futex */
struct list_head list;
};
struct fdinfo_list_entry {
struct list_head list;
int fd;
int pid;
u32 real_pid;
};
extern int prepare_fds(int pid);
extern int prepare_fd_pid(int pid);
extern int prepare_shared_fdinfo(void);
extern int get_filemap_fd(int pid, struct vma_entry *vma_entry);
extern int self_exe_fd;
#endif /* FILES_H_ */