3 * - Author: Alejandro Cabrera
5 * - Brief: Library interface to CRAK module. Wraps IOCTL
6 * functionality in convenient uspace functions.
8 * - Added doxygen-style documentation.
11 #include <sys/ioctl.h>
13 #include "../src/ckpt.h"
15 #define CKPT_TEST "testfile"
18 * \brief IOCTL wrapper to run kernel-level restart.
22 * @return < 0 - error, 0 - success
24 int restart(int fd
, const char * filename
, int pid
, int flags
)
26 struct ckpt_param param
;
29 dev_fd
= open(CKPT_DEV_FILE
, O_RDONLY
);
34 param
.filename
= filename
;
38 ret
= ioctl(dev_fd
, CKPT_IOCTL_RESTART
, (int)¶m
);
48 fd
= open(CKPT_TEST
, O_RDWR
);
54 printf("Restarting...\n");
56 restart(fd
, CKPT_TEST
, getpid(), 0);//RESTART_NOTIFY);