mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
util: Add make_yard helper
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
17
util.c
17
util.c
@@ -14,7 +14,7 @@
|
||||
#include <sys/sendfile.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
|
||||
#include <sys/mount.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ptrace.h>
|
||||
@@ -845,3 +845,18 @@ int fd_has_data(int lfd)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int make_yard(char *path)
|
||||
{
|
||||
if (mount("none", path, "tmpfs", 0, NULL)) {
|
||||
pr_perror("Unable to mount tmpfs in %s", path);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mount("none", path, NULL, MS_PRIVATE, NULL)) {
|
||||
pr_perror("Unable to mark yard as private");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user