source: trunk/minix/commands/simple/newroot.c@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 460 bytes
Line 
1/*
2newroot.c
3
4Replace the current root with a new one
5*/
6
7#include <errno.h>
8#include <stdio.h>
9#include <stdlib.h>
10#include <string.h>
11#include <unistd.h>
12
13int main(int argc, char *argv[])
14{
15 int r;
16 char *dev;
17
18 if (argc != 2)
19 {
20 fprintf(stderr, "Usage: newroot <block-special>\n");
21 exit(1);
22 }
23 dev= argv[1];
24 r= mount(dev, "/", 0 /* !ro */);
25 if (r != 0)
26 {
27 fprintf(stderr, "newroot: mount failed: %s\n", strerror(errno));
28 exit(1);
29 }
30 return 0;
31}
Note: See TracBrowser for help on using the repository browser.