- } *uap = (struct a *) scp->sc_ap;
- struct nameidata *ndp = &scp->sc_nd;
-
- ndp->ni_segflg = UIO_USERSPACE;
- ndp->ni_dirp = uap->fname;
- RETURN (copen(scp, uap->mode-FOPEN, uap->crtmode &~ scp->sc_cmask, ndp,
- &scp->sc_retval1));
-}
-
-/*
- * Creat system call.
- */
-creat(scp)
- register struct syscontext *scp;
-{
- struct a {
- char *fname;
- int fmode;
- } *uap = (struct a *)scp->sc_ap;
- struct nameidata *ndp = &scp->sc_nd;
-
- ndp->ni_segflg = UIO_USERSPACE;
- ndp->ni_dirp = uap->fname;
- RETURN (copen(scp, FWRITE|FCREAT|FTRUNC, uap->fmode &~ scp->sc_cmask,
- ndp, &scp->sc_retval1));
-}
-
-/*
- * Common code for open and creat.
- * Check permissions, allocate an open file structure,
- * and call the device open routine if any.
- */
-copen(scp, fmode, cmode, ndp, resultfd)
- register struct syscontext *scp;
- int fmode, cmode;
- struct nameidata *ndp;
- int *resultfd;