linux_getcwd.c (102872) | linux_getcwd.c (109623) |
---|---|
1/* $FreeBSD: head/sys/compat/linux/linux_getcwd.c 102872 2002-09-02 22:46:05Z iedowse $ */ | 1/* $FreeBSD: head/sys/compat/linux/linux_getcwd.c 109623 2003-01-21 08:56:16Z alfred $ */ |
2/* $OpenBSD: linux_getcwd.c,v 1.2 2001/05/16 12:50:21 ho Exp $ */ 3/* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */ 4 5/*- 6 * Copyright (c) 1999 The NetBSD Foundation, Inc. 7 * All rights reserved. 8 * 9 * This code is derived from software contributed to The NetBSD Foundation --- 166 unchanged lines hidden (view full) --- 176 return 0; 177 } 178 179 fileno = va.va_fileid; 180 181 dirbuflen = DIRBLKSIZ; 182 if (dirbuflen < va.va_blocksize) 183 dirbuflen = va.va_blocksize; | 2/* $OpenBSD: linux_getcwd.c,v 1.2 2001/05/16 12:50:21 ho Exp $ */ 3/* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */ 4 5/*- 6 * Copyright (c) 1999 The NetBSD Foundation, Inc. 7 * All rights reserved. 8 * 9 * This code is derived from software contributed to The NetBSD Foundation --- 166 unchanged lines hidden (view full) --- 176 return 0; 177 } 178 179 fileno = va.va_fileid; 180 181 dirbuflen = DIRBLKSIZ; 182 if (dirbuflen < va.va_blocksize) 183 dirbuflen = va.va_blocksize; |
184 dirbuf = (char *)malloc(dirbuflen, M_TEMP, M_WAITOK); | 184 dirbuf = (char *)malloc(dirbuflen, M_TEMP, 0); |
185 186#if 0 187unionread: 188#endif 189 off = 0; 190 do { 191 /* call VOP_READDIR of parent */ 192 iov.iov_base = dirbuf; --- 231 unchanged lines hidden (view full) --- 424 425 len = args->bufsize; 426 427 if (len > MAXPATHLEN*4) 428 len = MAXPATHLEN*4; 429 else if (len < 2) 430 return ERANGE; 431 | 185 186#if 0 187unionread: 188#endif 189 off = 0; 190 do { 191 /* call VOP_READDIR of parent */ 192 iov.iov_base = dirbuf; --- 231 unchanged lines hidden (view full) --- 424 425 len = args->bufsize; 426 427 if (len > MAXPATHLEN*4) 428 len = MAXPATHLEN*4; 429 else if (len < 2) 430 return ERANGE; 431 |
432 path = (char *)malloc(len, M_TEMP, M_WAITOK); | 432 path = (char *)malloc(len, M_TEMP, 0); |
433 434 error = kern___getcwd(td, path, UIO_SYSSPACE, len); 435 if (!error) { 436 lenused = strlen(path) + 1; 437 if (lenused <= args->bufsize) { 438 td->td_retval[0] = lenused; 439 error = copyout(path, args->buf, lenused); 440 } --- 28 unchanged lines hidden --- | 433 434 error = kern___getcwd(td, path, UIO_SYSSPACE, len); 435 if (!error) { 436 lenused = strlen(path) + 1; 437 if (lenused <= args->bufsize) { 438 td->td_retval[0] = lenused; 439 error = copyout(path, args->buf, lenused); 440 } --- 28 unchanged lines hidden --- |