Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_getcwd.c
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
* Find pathname of process's current directory. | * Find pathname of process's current directory. | ||||
*/ | */ | ||||
int | int | ||||
linux_getcwd(struct thread *td, struct linux_getcwd_args *args) | linux_getcwd(struct thread *td, struct linux_getcwd_args *args) | ||||
{ | { | ||||
char *path; | char *path; | ||||
int error, lenused; | int error, lenused; | ||||
#ifdef DEBUG | |||||
if (ldebug(getcwd)) | |||||
printf(ARGS(getcwd, "%p, %ld"), args->buf, (long)args->bufsize); | |||||
#endif | |||||
/* | /* | ||||
* Linux returns ERANGE instead of EINVAL. | * Linux returns ERANGE instead of EINVAL. | ||||
*/ | */ | ||||
if (args->bufsize < 2) | if (args->bufsize < 2) | ||||
return (ERANGE); | return (ERANGE); | ||||
path = malloc(LINUX_PATH_MAX, M_LINUX, M_WAITOK); | path = malloc(LINUX_PATH_MAX, M_LINUX, M_WAITOK); | ||||
Show All 12 Lines |