summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_file.c
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>2001-08-29 19:05:27 +0000
committergallatin <gallatin@FreeBSD.org>2001-08-29 19:05:27 +0000
commita0087e29ad992a054c2ff01b4580d329e9895ae8 (patch)
tree321c0e2ac2e1da13c1280eed8530c7060711bcd2 /sys/compat/linux/linux_file.c
parentadf3e081dc1f4765226294de1b614e3f0ddbb5e5 (diff)
downloadFreeBSD-src-a0087e29ad992a054c2ff01b4580d329e9895ae8.zip
FreeBSD-src-a0087e29ad992a054c2ff01b4580d329e9895ae8.tar.gz
Fix linux_getcwd() so that if the cwd isn't cached (__getcwd() fails),
the cwd is looked up inside the kernel. The native getcwd() in libc handles this in userland if __getcwd() fails. Obtained from: NetBSD via OpenBSD Tested by: Chris Casey <chriss@phys.ksu.edu>, Markus Holmberg <markush@acc.umu.se> Reviewed by: Darrell Anderson <anderson@cs.duke.edu> PR: kern/24315
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r--sys/compat/linux/linux_file.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 0f68ab5..2a5d673 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -830,34 +830,6 @@ linux_link(struct proc *p, struct linux_link_args *args)
return link(p, &bsd);
}
-int
-linux_getcwd(struct proc *p, struct linux_getcwd_args *args)
-{
- struct __getcwd_args bsd;
- caddr_t sg;
- int error, len;
-
-#ifdef DEBUG
- if (ldebug(getcwd))
- printf(ARGS(getcwd, "%p, %ld"), args->buf, args->bufsize);
-#endif
-
- sg = stackgap_init();
- bsd.buf = stackgap_alloc(&sg, SPARE_USRSPACE);
- bsd.buflen = SPARE_USRSPACE;
- error = __getcwd(p, &bsd);
- if (!error) {
- len = strlen(bsd.buf) + 1;
- if (len <= args->bufsize) {
- p->p_retval[0] = len;
- error = copyout(bsd.buf, args->buf, len);
- }
- else
- error = ERANGE;
- }
- return (error);
-}
-
#ifndef __alpha__
int
linux_fdatasync(p, uap)
OpenPOWER on IntegriCloud