mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Fix and complete the AIO syscalls. There are some performance enhancements
coming up soon, but the code is functional. Docs will be forthcoming.
This commit is contained in:
parent
873954b327
commit
fd3bf77574
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31443
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
|
||||
* $Id: kern_descrip.c,v 1.44 1997/11/23 10:43:43 bde Exp $
|
||||
* $Id: kern_descrip.c,v 1.45 1997/11/23 12:24:59 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -744,6 +744,12 @@ fdcopy(p)
|
||||
register struct file **fpp;
|
||||
register int i;
|
||||
|
||||
/*
|
||||
* Certain daemons might not have file descriptors
|
||||
*/
|
||||
if (fdp == NULL)
|
||||
return NULL;
|
||||
|
||||
MALLOC(newfdp, struct filedesc *, sizeof(struct filedesc0),
|
||||
M_FILEDESC, M_WAITOK);
|
||||
bcopy(fdp, newfdp, sizeof(struct filedesc));
|
||||
@ -797,6 +803,12 @@ fdfree(p)
|
||||
struct file **fpp;
|
||||
register int i;
|
||||
|
||||
/*
|
||||
* Certain daemons might not have file descriptors
|
||||
*/
|
||||
if (fdp == NULL)
|
||||
return;
|
||||
|
||||
if (--fdp->fd_refcnt > 0)
|
||||
return;
|
||||
fpp = fdp->fd_ofiles;
|
||||
@ -823,6 +835,12 @@ fdcloseexec(p)
|
||||
char *fdfp;
|
||||
register int i;
|
||||
|
||||
/*
|
||||
* Certain daemons might not have file descriptors
|
||||
*/
|
||||
if (fdp == NULL)
|
||||
return;
|
||||
|
||||
fpp = fdp->fd_ofiles;
|
||||
fdfp = fdp->fd_ofileflags;
|
||||
for (i = 0; i <= fdp->fd_lastfile; i++, fpp++, fdfp++)
|
||||
|
1085
sys/kern/vfs_aio.c
1085
sys/kern/vfs_aio.c
File diff suppressed because it is too large
Load Diff
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
|
||||
* $Id: vfs_vnops.c,v 1.40 1997/10/27 15:26:23 bde Exp $
|
||||
* $Id: vfs_vnops.c,v 1.41 1997/11/07 08:53:11 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -276,7 +276,8 @@ vn_read(fp, uio, cred)
|
||||
|
||||
VOP_LEASE(vp, p, cred, LEASE_READ);
|
||||
vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY, p);
|
||||
uio->uio_offset = fp->f_offset;
|
||||
if (uio->uio_offset == -1)
|
||||
uio->uio_offset = fp->f_offset;
|
||||
count = uio->uio_resid;
|
||||
flag = 0;
|
||||
if (fp->f_flag & FNONBLOCK)
|
||||
@ -329,7 +330,7 @@ vn_write(fp, uio, cred)
|
||||
struct proc *p = uio->uio_procp;
|
||||
int count, error, ioflag = IO_UNIT;
|
||||
|
||||
if (vp->v_type == VREG && (fp->f_flag & O_APPEND))
|
||||
if (uio->uio_offset == -1 && vp->v_type == VREG && (fp->f_flag & O_APPEND))
|
||||
ioflag |= IO_APPEND;
|
||||
if (fp->f_flag & FNONBLOCK)
|
||||
ioflag |= IO_NDELAY;
|
||||
|
Loading…
Reference in New Issue
Block a user