ubase/pivot_root.c

32 lines
440 B
C
Raw Normal View History

2013-08-14 13:38:56 +00:00
/* See LICENSE file for copyright and license details. */
#include <sys/syscall.h>
2014-06-30 18:03:41 +00:00
2013-08-14 13:38:56 +00:00
#include <stdio.h>
2013-10-07 18:11:40 +00:00
#include <stdlib.h>
2014-06-30 18:03:41 +00:00
#include <unistd.h>
2013-08-14 13:38:56 +00:00
#include "util.h"
static void
usage(void)
{
eprintf("usage: %s new-root put-old\n", argv0);
}
int
main(int argc, char *argv[])
{
ARGBEGIN {
default:
usage();
} ARGEND;
if (argc < 2)
usage();
if (syscall(SYS_pivot_root, argv[0], argv[1]) < 0)
eprintf("pivot_root:");
2014-10-02 22:45:25 +00:00
return 0;
2013-08-14 13:38:56 +00:00
}