3 * - Author: Alejandro Cabrera
5 * - Brief: Library interface to CRAK module. Wraps IOCTL
6 * functionality in convenient uspace functions.
8 * - Added doxygen-style documentation.
12 #include <sys/ioctl.h>
14 #include "../src/ckpt.h"
16 #define CKPT_TEST "testfile"
19 * \brief IOCTL wrapper to run kernel-level checkpoint.
23 * @return < 0 - error, 0 - success
25 int checkpoint(int fd
, int pid
, int flags
)
27 struct ckpt_param param
;
30 dev_fd
= open(CKPT_DEV_FILE
, O_RDONLY
);
32 perror(CKPT_DEV_FILE
);
40 printf("Sending...\n");
41 ret
= ioctl(dev_fd
, CKPT_IOCTL_CHECKPOINT
, (int)¶m
);
51 fd
= open(CKPT_TEST
, O_RDWR
);
57 printf("Before ckpt.\n");
59 checkpoint(fd
, getpid(), CKPT_KILL
);
61 printf("After ckpt.\n");