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