Lines Matching defs:fd

155 __private_extern__ int	preparefileread(struct proc *p, struct fileproc **fp_ret, int fd, int check_for_vnode);
156 __private_extern__ void donefileread(struct proc *p, struct fileproc *fp_ret, int fd);
207 int fd = uap->fd;
210 if ( (error = preparefileread(p, &fp, fd, 0)) )
219 donefileread(p, fp, fd);
245 int fd = uap->fd;
249 if ( (error = preparefileread(p, &fp, fd, 1)) )
258 donefileread(p, fp, fd);
261 uap->fd, uap->nbyte, (unsigned int)((uap->offset >> 32)), (unsigned int)(uap->offset), 0);
272 donefileread(struct proc *p, struct fileproc *fp, int fd)
278 fp_drop(p, fd, fp, 1);
291 preparefileread(struct proc *p, struct fileproc **fp_ret, int fd, int check_for_pread)
297 AUDIT_ARG(fd, fd);
301 error = fp_lookup(p, fd, &fp, 1);
336 fp_drop(p, fd, fp, 1);
433 error = rd_uio(p, uap->fd, auio, retval);
463 int fd = uap->fd;
465 AUDIT_ARG(fd, fd);
467 error = fp_lookup(p,fd,&fp,0);
480 fp_drop_written(p, fd, fp);
482 fp_drop(p, fd, fp, 0);
509 int fd = uap->fd;
512 AUDIT_ARG(fd, fd);
514 error = fp_lookup(p,fd,&fp,0);
547 fp_drop_written(p, fd, fp);
549 fp_drop(p, fd, fp, 0);
552 uap->fd, uap->nbyte, (unsigned int)((uap->offset >> 32)), (unsigned int)(uap->offset), 0);
620 AUDIT_ARG(fd, uap->fd);
649 error = wr_uio(p, uap->fd, auio, retval);
753 int fd = uap->fd;
756 AUDIT_ARG(fd, uap->fd);
768 error = fp_lookup(p,fd,&fp,1);
814 *fdflags(p, uap->fd) &= ~UF_EXCLOSE;
818 *fdflags(p, uap->fd) |= UF_EXCLOSE;
948 fp_drop(p, fd, fp, 1);
1316 int msk, i, j, fd;
1356 while ((j = ffs(bits)) && (fd = i + --j) < nfd) {
1358 fp = fdp->fd_ofiles[fd];
1360 if (fp == NULL || (fdp->fd_ofileflags[fd] & UF_RESERVED)) {
1363 * fd, let the caller unwind...
1391 optr[fd/NFDBITS] |= (1 << (fd % NFDBITS));
1434 * This is kinda bogus. We have fd limits, but that is not
1484 /* per spec, ignore fd values below zero */
1485 if (fds[i].fd < 0) {
1491 kev.ident = fds[i].fd;
1635 * nfd The number of fd's in the vector
1641 * references an invalid fd
1643 * Implicit: *countp (modified) Count of fd's
1654 int msk, i, j, fd;
1679 while ((j = ffs(bits)) && (fd = i + --j) < nfd) {
1681 fp = fdp->fd_ofiles[fd];
1683 (fdp->fd_ofileflags[fd] & UF_RESERVED)) {
1722 * ibits Input pit bector of fd's
1723 * nfd Number of fd's
1735 * Notes: An fd make become bad while the proc_fdlock() is not held,
1736 * if a multithreaded application closes the fd out from under
1744 int msk, i, j, fd;
1769 while ((j = ffs(bits)) && (fd = i + --j) < nfd) {
1771 fp = fdp->fd_ofiles[fd];
2708 /* this routine is called from the close of fd with proc_fdlock held */