2 Copyright © 2013 Alastair Stuart
4 This program is open source software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
20 #define VERSION "0.01"
22 int main(int argc
, char* argv
[])
25 fprintf(stderr
, "%s: missing operand\n"
26 "Run '%s --help' for usage.\n",
33 for (arg
= 1; arg
< argc
; arg
++)
35 if (strcmp(argv
[arg
], "--help") == 0) {
36 printf("Usage: %s [newroot]\n", argv
[0]);
38 } else if (strcmp(argv
[arg
], "--version") == 0) {
39 printf("chroot (mutos) v"VERSION
"\n");
47 int rc
= chroot(argv
[arg
]);
49 fprintf(stderr
, "%s: cannot change root directory to %s: %s\n", argv
[0], argv
[arg
], strerror(errno
));