kern_event.c (246e7a2b6494cd991b08ac669ed761ecea0cc98c) kern_event.c (2d69d0dcc2bb94d874dd0fa77d53b08112b9d530)
1/*-
2 * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
3 * Copyright 2004 John-Mark Gurney <jmg@FreeBSD.org>
4 * Copyright (c) 2009 Apple, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

104static int kqueue_scan(struct kqueue *kq, int maxevents,
105 struct kevent_copyops *k_ops,
106 const struct timespec *timeout,
107 struct kevent *keva, struct thread *td);
108static void kqueue_wakeup(struct kqueue *kq);
109static struct filterops *kqueue_fo_find(int filt);
110static void kqueue_fo_release(int filt);
111
1/*-
2 * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
3 * Copyright 2004 John-Mark Gurney <jmg@FreeBSD.org>
4 * Copyright (c) 2009 Apple, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

104static int kqueue_scan(struct kqueue *kq, int maxevents,
105 struct kevent_copyops *k_ops,
106 const struct timespec *timeout,
107 struct kevent *keva, struct thread *td);
108static void kqueue_wakeup(struct kqueue *kq);
109static struct filterops *kqueue_fo_find(int filt);
110static void kqueue_fo_release(int filt);
111
112static fo_rdwr_t kqueue_read;
113static fo_rdwr_t kqueue_write;
114static fo_truncate_t kqueue_truncate;
115static fo_ioctl_t kqueue_ioctl;
116static fo_poll_t kqueue_poll;
117static fo_kqfilter_t kqueue_kqfilter;
118static fo_stat_t kqueue_stat;
119static fo_close_t kqueue_close;
120
121static struct fileops kqueueops = {
112static fo_ioctl_t kqueue_ioctl;
113static fo_poll_t kqueue_poll;
114static fo_kqfilter_t kqueue_kqfilter;
115static fo_stat_t kqueue_stat;
116static fo_close_t kqueue_close;
117
118static struct fileops kqueueops = {
122 .fo_read = kqueue_read,
123 .fo_write = kqueue_write,
124 .fo_truncate = kqueue_truncate,
119 .fo_read = invfo_rdwr,
120 .fo_write = invfo_rdwr,
121 .fo_truncate = invfo_truncate,
125 .fo_ioctl = kqueue_ioctl,
126 .fo_poll = kqueue_poll,
127 .fo_kqfilter = kqueue_kqfilter,
128 .fo_stat = kqueue_stat,
129 .fo_close = kqueue_close,
130 .fo_chmod = invfo_chmod,
131 .fo_chown = invfo_chown,
132 .fo_sendfile = invfo_sendfile,

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

1597done_nl:
1598 KQ_NOTOWNED(kq);
1599 if (nkev != 0)
1600 error = k_ops->k_copyout(k_ops->arg, keva, nkev);
1601 td->td_retval[0] = maxevents - count;
1602 return (error);
1603}
1604
122 .fo_ioctl = kqueue_ioctl,
123 .fo_poll = kqueue_poll,
124 .fo_kqfilter = kqueue_kqfilter,
125 .fo_stat = kqueue_stat,
126 .fo_close = kqueue_close,
127 .fo_chmod = invfo_chmod,
128 .fo_chown = invfo_chown,
129 .fo_sendfile = invfo_sendfile,

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

1594done_nl:
1595 KQ_NOTOWNED(kq);
1596 if (nkev != 0)
1597 error = k_ops->k_copyout(k_ops->arg, keva, nkev);
1598 td->td_retval[0] = maxevents - count;
1599 return (error);
1600}
1601
1605/*
1606 * XXX
1607 * This could be expanded to call kqueue_scan, if desired.
1608 */
1609/*ARGSUSED*/
1610static int
1602/*ARGSUSED*/
1603static int
1611kqueue_read(struct file *fp, struct uio *uio, struct ucred *active_cred,
1612 int flags, struct thread *td)
1613{
1614 return (ENXIO);
1615}
1616
1617/*ARGSUSED*/
1618static int
1619kqueue_write(struct file *fp, struct uio *uio, struct ucred *active_cred,
1620 int flags, struct thread *td)
1621{
1622 return (ENXIO);
1623}
1624
1625/*ARGSUSED*/
1626static int
1627kqueue_truncate(struct file *fp, off_t length, struct ucred *active_cred,
1628 struct thread *td)
1629{
1630
1631 return (EINVAL);
1632}
1633
1634/*ARGSUSED*/
1635static int
1636kqueue_ioctl(struct file *fp, u_long cmd, void *data,
1637 struct ucred *active_cred, struct thread *td)
1638{
1639 /*
1640 * Enabling sigio causes two major problems:
1641 * 1) infinite recursion:
1642 * Synopsys: kevent is being used to track signals and have FIOASYNC
1643 * set. On receipt of a signal this will cause a kqueue to recurse

--- 719 unchanged lines hidden ---
1604kqueue_ioctl(struct file *fp, u_long cmd, void *data,
1605 struct ucred *active_cred, struct thread *td)
1606{
1607 /*
1608 * Enabling sigio causes two major problems:
1609 * 1) infinite recursion:
1610 * Synopsys: kevent is being used to track signals and have FIOASYNC
1611 * set. On receipt of a signal this will cause a kqueue to recurse

--- 719 unchanged lines hidden ---