#ifndef lint static char sccsid[] = "@(#)win_syscall.c 1.1 94/10/31 SMI"; #endif /* * Copyright (c) 1987 by Sun Microsystems, Inc. */ /* * SunWindows kernel equivalents of selected user process level calls, * i.e, dup and read. */ #include #include #include #include #include #include #include #include #include /* * Dup file descriptor for device opened by user for kernel use. */ int kern_dupfd(fd, fpp) int fd; struct file **fpp; { register struct file *fp; *fpp = NULL; fp = getf(fd); if (fp == 0) { #ifdef WINDEVDEBUG printf("getf fp == 0\n"); #endif return (EINVAL); } if (fp->f_type != DTYPE_VNODE) return (EINVAL); /* not a vnode */ *fpp = fp; fp->f_count++; return (0); } int kern_read(vp, buf, len_ptr) struct vnode *vp; caddr_t buf; int *len_ptr; { int error; error = strkread(vp->v_stream, buf, len_ptr); /* * If any data was read, mark the vnode as accessed. */ if (*len_ptr != 0) smark(VTOS(vp), SACC); return (error); }