mirror of
git://git.suckless.org/ubase
synced 2024-12-24 15:42:36 +00:00
30 lines
449 B
C
30 lines
449 B
C
/* See LICENSE file for copyright and license details. */
|
|
#include <sys/syscall.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#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:");
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|