asst3-Virtual Memory Translation/kern/syscall/file_syscalls.c
int
sys___getcwd(userptr_t buf, size_t buflen, int *retval)
{
	struct iovec iov;
	struct uio useruio;
	int result;

	uio_uinit(&iov, &useruio, buf, buflen, 0, UIO_READ);

	result = vfs_getcwd(&useruio);
	if (result) {
		return result;
	}

	*retval = buflen - useruio.uio_resid;
	return 0;
}
/*
 * __getcwd() - get current directory. Make a uio and get the data
 * from the VFS code.
 */
get current directory. Make a uio and get the data
from the VFS code.
get current directory . Make a uio and get the data from the VFS code .
int
sys___getcwd(userptr_t buf, size_t buflen, int *retval)
{
	struct iovec iov;
	struct uio useruio;
	int result;
	uio_uinit(&iov, &useruio, buf, buflen, 0, UIO_READ);
	result = vfs_getcwd(&useruio);
	if (result) {
		return result;
	}
	*retval = buflen - useruio.uio_resid;
	return 0;
}
int sys___getcwd ( userptr_t buf , size_t buflen , int * retval ) { struct iovec iov ; struct uio useruio ; int result ; uio_uinit ( & iov , & useruio , buf , buflen , 0 , UIO_READ ) ; result = vfs_getcwd ( & useruio ) ; if ( result ) { return result ; } * retval = buflen - useruio . uio_resid ; return 0 ; }
__getcwd() - get current directory.
__getcwd () - get current directory .