Lines Matching defs:fd
69 * /dev/fd Filesystem
117 static int fdesc_attr(int fd, struct vnode_attr *vap, vfs_context_t a_context);
151 dev_add_entry("fd", rootdir, DEV_DEVFD, NULL, NULL, NULL, &direntp);
172 char zero[] = "fd/0";
173 char one[] = "fd/1";
174 char two[] = "fd/2";
211 struct fdescnode *fd;
220 for (fd = fc->lh_first; fd != 0; fd = fd->fd_hash.le_next) {
221 if (fd->fd_ix == ix && vnode_mount(fd->fd_vnode) == mp) {
222 vid = vnode_vid(fd->fd_vnode);
225 if (vnode_getwithvid(fd->fd_vnode, vid))
228 *vpp = fd->fd_vnode;
245 MALLOC(fd, void *, sizeof(struct fdescnode), M_TEMP, M_WAITOK);
251 vfsp.vnfs_fsnode = fd;
262 FREE(fd, M_TEMP);
268 fd->fd_vnode = *vpp;
269 fd->fd_type = ftype;
270 fd->fd_fd = -1;
271 fd->fd_link = NULL;
272 fd->fd_ix = ix;
273 fd->fd_fd = fdno;
277 LIST_INSERT_HEAD(fc, fd, fd_hash);
296 * This vnop should only be called on the special directory /dev/fd.
307 int fd;
320 fd = 0;
322 fd = 10 * fd + *pname++ - '0';
323 if (fd >= numfiles)
332 if (fd < 0 || fd >= numfiles ||
333 *fdfile(p, fd) == NULL ||
334 (*fdflags(p, fd) & UF_RESERVED)) {
339 error = fdesc_allocvp(Fdesc, FD_DESC+fd, dvp->v_mount, &fvp, VNON, fd);
385 fdesc_attr(int fd, struct vnode_attr *vap, vfs_context_t a_context)
392 if ((error = fp_lookup(p, fd, &fp, 0)))
453 fp_drop(p, fd, fp, 0);
462 unsigned fd;
467 fd = VTOFDESC(vp)->fd_fd;
468 error = fdesc_attr(fd, vap, ap->a_context);
494 unsigned fd;
509 fd = VTOFDESC(ap->a_vp)->fd_fd;
510 if ((error = fp_lookup(vfs_context_proc(ap->a_context), fd, &fp, 0)))
537 fp_drop(p, fd, fp, 0);
550 { FD_DEVFD, UIO_MX, 2, "fd" },
558 /* Only called on /dev/fd */
646 struct fdescnode *fd = VTOFDESC(vp);
650 LIST_REMOVE(fd, fd_hash);
692 * /dev/fd "should never get here" operation