vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / posix / unistd / chroot.cpp
blob4e9091dbf2eed517eadf5d650a41b088bc8b52f8
1 /*
2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
6 #include <syscalls.h>
8 #include <errno.h>
9 #include <unistd.h>
11 #include <errno_private.h>
14 int
15 chroot(const char *path)
17 status_t error = _kern_change_root(path);
18 if (error != B_OK) {
19 __set_errno(error);
20 return -1;
23 return 0;