svr4_misc.c (109254) | svr4_misc.c (109623) |
---|---|
1/* 2 * Copyright (c) 1998 Mark Newton 3 * Copyright (c) 1994 Christos Zoulas 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/* 2 * Copyright (c) 1998 Mark Newton 3 * Copyright (c) 1994 Christos Zoulas 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/compat/svr4/svr4_misc.c 109254 2003-01-14 21:31:31Z dillon $ | 28 * $FreeBSD: head/sys/compat/svr4/svr4_misc.c 109623 2003-01-21 08:56:16Z alfred $ |
29 */ 30 31/* 32 * SVR4 compatibility module. 33 * 34 * SVR4 system calls that are implemented differently in BSD are 35 * handled here. 36 */ --- 254 unchanged lines hidden (view full) --- 291 } 292 else 293 justone = 0; 294 295 off = fp->f_offset; 296#define DIRBLKSIZ 512 /* XXX we used to use ufs's DIRBLKSIZ */ 297 buflen = max(DIRBLKSIZ, nbytes); 298 buflen = min(buflen, MAXBSIZE); | 29 */ 30 31/* 32 * SVR4 compatibility module. 33 * 34 * SVR4 system calls that are implemented differently in BSD are 35 * handled here. 36 */ --- 254 unchanged lines hidden (view full) --- 291 } 292 else 293 justone = 0; 294 295 off = fp->f_offset; 296#define DIRBLKSIZ 512 /* XXX we used to use ufs's DIRBLKSIZ */ 297 buflen = max(DIRBLKSIZ, nbytes); 298 buflen = min(buflen, MAXBSIZE); |
299 buf = malloc(buflen, M_TEMP, M_WAITOK); | 299 buf = malloc(buflen, M_TEMP, 0); |
300 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); 301again: 302 aiov.iov_base = buf; 303 aiov.iov_len = buflen; 304 auio.uio_iov = &aiov; 305 auio.uio_iovcnt = 1; 306 auio.uio_rw = UIO_READ; 307 auio.uio_segflg = UIO_SYSSPACE; --- 146 unchanged lines hidden (view full) --- 454 455 vp = fp->f_data; 456 if (vp->v_type != VDIR) { 457 fdrop(fp, td); 458 return (EINVAL); 459 } 460 461 buflen = min(MAXBSIZE, uap->nbytes); | 300 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); 301again: 302 aiov.iov_base = buf; 303 aiov.iov_len = buflen; 304 auio.uio_iov = &aiov; 305 auio.uio_iovcnt = 1; 306 auio.uio_rw = UIO_READ; 307 auio.uio_segflg = UIO_SYSSPACE; --- 146 unchanged lines hidden (view full) --- 454 455 vp = fp->f_data; 456 if (vp->v_type != VDIR) { 457 fdrop(fp, td); 458 return (EINVAL); 459 } 460 461 buflen = min(MAXBSIZE, uap->nbytes); |
462 buf = malloc(buflen, M_TEMP, M_WAITOK); | 462 buf = malloc(buflen, M_TEMP, 0); |
463 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); 464 off = fp->f_offset; 465again: 466 aiov.iov_base = buf; 467 aiov.iov_len = buflen; 468 auio.uio_iov = &aiov; 469 auio.uio_iovcnt = 1; 470 auio.uio_rw = UIO_READ; --- 1294 unchanged lines hidden --- | 463 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); 464 off = fp->f_offset; 465again: 466 aiov.iov_base = buf; 467 aiov.iov_len = buflen; 468 auio.uio_iov = &aiov; 469 auio.uio_iovcnt = 1; 470 auio.uio_rw = UIO_READ; --- 1294 unchanged lines hidden --- |