2
* lxc: linux Container library
4
* (C) Copyright IBM Corp. 2007, 2008
7
* Daniel Lezcano <dlezcano at fr.ibm.com>
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 2.1 of the License, or (at your option) any later version.
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
#include <sys/types.h>
34
#include <sys/param.h>
41
lxc_log_define(lxc_columbia, lxc);
46
# define __NR_checkpoint 333
47
# define __NR_restart 334
48
static inline long sys_checkpoint(pid_t pid, int fd, unsigned long flags)
50
return syscall(__NR_checkpoint, pid, fd, flags);
52
static inline long sys_restart(pid_t pid, int fd, unsigned long flags)
54
return syscall(__NR_restart, pid, fd, flags);
57
# define __NR_checkpoint 295
58
# define __NR_restart 296
59
static inline long sys_checkpoint(pid_t pid, int fd, unsigned long flags)
61
return syscall(__NR_checkpoint, pid, fd, flags);
63
static inline long sys_restart(pid_t pid, int fd, unsigned long flags)
65
return syscall(__NR_restart, pid, fd, flags);
68
# warning "Architecture not supported for checkpoint"
69
static inline long sys_checkpoint(pid_t pid, int fd, unsigned long flags)
74
static inline long sys_restart(pid_t pid, int fd, unsigned long flags)
79
# warning "Architecture not supported for restart syscall"
84
int lxc_plugin_checkpoint(pid_t pid, const char *statefile, unsigned long flags)
88
fd = open(statefile, O_RDWR);
90
SYSERROR("failed to open init file for %s", statefile);
94
ret = sys_checkpoint(pid, fd, flags);
96
SYSERROR("failed to checkpoint %d", pid);
107
int lxc_plugin_restart(pid_t pid, const char *statefile, unsigned long flags)
111
fd = open(statefile, O_RDONLY);
113
SYSERROR("failed to open init file for %s", statefile);
117
sys_restart(pid, fd, flags);
118
SYSERROR("failed to restart %d", pid);