uipc_mqueue.c (4e27d36d38f4c3b12bcc1855c5d41527d08d1ce0) uipc_mqueue.c (9696feebe2320c9976607df4090f91a34c6549c3)
1/*-
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 67 unchanged lines hidden (view full) ---

76#include <sys/stat.h>
77#include <sys/syscall.h>
78#include <sys/syscallsubr.h>
79#include <sys/sysent.h>
80#include <sys/sx.h>
81#include <sys/sysctl.h>
82#include <sys/taskqueue.h>
83#include <sys/unistd.h>
1/*-
2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 67 unchanged lines hidden (view full) ---

76#include <sys/stat.h>
77#include <sys/syscall.h>
78#include <sys/syscallsubr.h>
79#include <sys/sysent.h>
80#include <sys/sx.h>
81#include <sys/sysctl.h>
82#include <sys/taskqueue.h>
83#include <sys/unistd.h>
84#include <sys/user.h>
84#include <sys/vnode.h>
85#include <machine/atomic.h>
86
87FEATURE(p1003_1b_mqueue, "POSIX P1003.1B message queues support");
88
89/*
90 * Limits and constants
91 */

--- 2474 unchanged lines hidden (view full) ---

2566filt_mqwrite(struct knote *kn, long hint)
2567{
2568 struct mqueue *mq = FPTOMQ(kn->kn_fp);
2569
2570 mtx_assert(&mq->mq_mutex, MA_OWNED);
2571 return (mq->mq_curmsgs < mq->mq_maxmsg);
2572}
2573
85#include <sys/vnode.h>
86#include <machine/atomic.h>
87
88FEATURE(p1003_1b_mqueue, "POSIX P1003.1B message queues support");
89
90/*
91 * Limits and constants
92 */

--- 2474 unchanged lines hidden (view full) ---

2567filt_mqwrite(struct knote *kn, long hint)
2568{
2569 struct mqueue *mq = FPTOMQ(kn->kn_fp);
2570
2571 mtx_assert(&mq->mq_mutex, MA_OWNED);
2572 return (mq->mq_curmsgs < mq->mq_maxmsg);
2573}
2574
2575static int
2576mqf_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
2577{
2578
2579 kif->kf_type = KF_TYPE_MQUEUE;
2580 return (0);
2581}
2582
2574static struct fileops mqueueops = {
2575 .fo_read = invfo_rdwr,
2576 .fo_write = invfo_rdwr,
2577 .fo_truncate = invfo_truncate,
2578 .fo_ioctl = invfo_ioctl,
2579 .fo_poll = mqf_poll,
2580 .fo_kqfilter = mqf_kqfilter,
2581 .fo_stat = mqf_stat,
2582 .fo_close = mqf_close,
2583 .fo_chmod = mqf_chmod,
2584 .fo_chown = mqf_chown,
2585 .fo_sendfile = invfo_sendfile,
2583static struct fileops mqueueops = {
2584 .fo_read = invfo_rdwr,
2585 .fo_write = invfo_rdwr,
2586 .fo_truncate = invfo_truncate,
2587 .fo_ioctl = invfo_ioctl,
2588 .fo_poll = mqf_poll,
2589 .fo_kqfilter = mqf_kqfilter,
2590 .fo_stat = mqf_stat,
2591 .fo_close = mqf_close,
2592 .fo_chmod = mqf_chmod,
2593 .fo_chown = mqf_chown,
2594 .fo_sendfile = invfo_sendfile,
2595 .fo_fill_kinfo = mqf_fill_kinfo,
2586};
2587
2588static struct vop_vector mqfs_vnodeops = {
2589 .vop_default = &default_vnodeops,
2590 .vop_access = mqfs_access,
2591 .vop_cachedlookup = mqfs_lookup,
2592 .vop_lookup = vfs_cache_lookup,
2593 .vop_reclaim = mqfs_reclaim,

--- 261 unchanged lines hidden ---
2596};
2597
2598static struct vop_vector mqfs_vnodeops = {
2599 .vop_default = &default_vnodeops,
2600 .vop_access = mqfs_access,
2601 .vop_cachedlookup = mqfs_lookup,
2602 .vop_lookup = vfs_cache_lookup,
2603 .vop_reclaim = mqfs_reclaim,

--- 261 unchanged lines hidden ---