xref: /haiku/src/system/libroot/posix/unistd/chroot.cpp (revision 4466b89c65970de4c7236ac87faa2bee4589f413)
1 /*
2  * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include <syscalls.h>
7 
8 #include <errno.h>
9 #include <unistd.h>
10 
11 
12 int
13 chroot(const char *path)
14 {
15 	status_t error = _kern_change_root(path);
16 	if (error != B_OK) {
17 		errno = error;
18 		return -1;
19 	}
20 
21 	return 0;
22 }
23