static int psem_access(struct pseminfo *pinfo, int mode, kauth_cred_t cred);
static int psem_cache_search(struct pseminfo **,
- struct psemname *, struct psemcache **);
+ struct psemname *, struct psemcache **);
static int psem_delete(struct pseminfo * pinfo);
static int psem_read (struct fileproc *fp, struct uio *uio,
- int flags, vfs_context_t ctx);
+ int flags, vfs_context_t ctx);
static int psem_write (struct fileproc *fp, struct uio *uio,
- int flags, vfs_context_t ctx);
+ int flags, vfs_context_t ctx);
static int psem_ioctl (struct fileproc *fp, u_long com,
- caddr_t data, vfs_context_t ctx);
+ caddr_t data, vfs_context_t ctx);
static int psem_select (struct fileproc *fp, int which, void *wql, vfs_context_t ctx);
static int psem_closefile (struct fileglob *fp, vfs_context_t ctx);
static int psem_unlink_internal(struct pseminfo *pinfo, struct psemcache *pcache);
-static int psem_kqfilter (struct fileproc *fp, struct knote *kn, vfs_context_t ctx);
+static int psem_kqfilter (struct fileproc *fp, struct knote *kn,
+ struct kevent_internal_s *kev, vfs_context_t ctx);
static const struct fileops psemops = {
.fo_type = DTYPE_PSXSEM,
proc_fdunlock(p);
return(error);
}
+ if (fp->f_type != DTYPE_PSXSEM) {
+ proc_fdunlock(p);
+ return(EBADF);
+ }
procfdtbl_markclosefd(p, fd);
fileproc_drain(p, fp);
fdrelse(p, fd);
}
static int
-psem_read(__unused struct fileproc *fp, __unused struct uio *uio,
- __unused int flags, __unused vfs_context_t ctx)
+psem_read(__unused struct fileproc *fp, __unused struct uio *uio,
+ __unused int flags, __unused vfs_context_t ctx)
{
return(ENOTSUP);
}
static int
-psem_write(__unused struct fileproc *fp, __unused struct uio *uio,
- __unused int flags, __unused vfs_context_t ctx)
+psem_write(__unused struct fileproc *fp, __unused struct uio *uio,
+ __unused int flags, __unused vfs_context_t ctx)
{
return(ENOTSUP);
}
static int
-psem_ioctl(__unused struct fileproc *fp, __unused u_long com,
- __unused caddr_t data, __unused vfs_context_t ctx)
+psem_ioctl(__unused struct fileproc *fp, __unused u_long com,
+ __unused caddr_t data, __unused vfs_context_t ctx)
{
return(ENOTSUP);
}
static int
-psem_select(__unused struct fileproc *fp, __unused int which,
- __unused void *wql, __unused vfs_context_t ctx)
+psem_select(__unused struct fileproc *fp, __unused int which,
+ __unused void *wql, __unused vfs_context_t ctx)
{
return(ENOTSUP);
}
static int
-psem_kqfilter(__unused struct fileproc *fp, struct knote *kn,
- __unused vfs_context_t ctx)
+psem_kqfilter(__unused struct fileproc *fp, struct knote *kn,
+ __unused struct kevent_internal_s *kev, __unused vfs_context_t ctx)
{
kn->kn_flags = EV_ERROR;
kn->kn_data = ENOTSUP;