repo.or.cz
/
haiku.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
vfs: check userland buffers before reading them.
[haiku.git]
/
src
/
system
/
libroot
/
posix
/
unistd
/
chroot.cpp
blob
4e9091dbf2eed517eadf5d650a41b088bc8b52f8
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
#include <errno_private.h>
12
13
14
int
15
chroot
(
const char
*
path
)
16
{
17
status_t error
=
_kern_change_root
(
path
);
18
if
(
error
!=
B_OK
) {
19
__set_errno
(
error
);
20
return
-
1
;
21
}
22
23
return
0
;
24
}