2 * Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
11 #include <errno_private.h>
13 #include <syscall_utils.h>
17 chdir(const char *path
)
19 RETURN_AND_SET_ERRNO(_kern_setcwd(-1, path
));
26 RETURN_AND_SET_ERRNO(_kern_setcwd(fd
, NULL
));
31 getcwd(char *buffer
, size_t size
)
33 bool allocated
= false;
37 buffer
= malloc(size
= PATH_MAX
);
39 __set_errno(B_NO_MEMORY
);
46 status
= _kern_getcwd(buffer
, size
);
59 rmdir(const char *path
)
61 RETURN_AND_SET_ERRNO(_kern_remove_dir(-1, path
));