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

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

137static void filt_procdetach(struct knote *kn);
138static int filt_proc(struct knote *kn, long hint);
139static int filt_fileattach(struct knote *kn);
140static void filt_timerexpire(void *knx);
141static int filt_timerattach(struct knote *kn);
142static void filt_timerdetach(struct knote *kn);
143static int filt_timer(struct knote *kn, long hint);
144
1/*-
2 * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
3 * Copyright 2004 John-Mark Gurney <jmg@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

137static void filt_procdetach(struct knote *kn);
138static int filt_proc(struct knote *kn, long hint);
139static int filt_fileattach(struct knote *kn);
140static void filt_timerexpire(void *knx);
141static int filt_timerattach(struct knote *kn);
142static void filt_timerdetach(struct knote *kn);
143static int filt_timer(struct knote *kn, long hint);
144
145static struct filterops file_filtops =
146 { 1, filt_fileattach, NULL, NULL };
147static struct filterops kqread_filtops =
148 { 1, NULL, filt_kqdetach, filt_kqueue };
145static struct filterops file_filtops = {
146 .f_isfd = 1,
147 .f_attach = filt_fileattach,
148};
149static struct filterops kqread_filtops = {
150 .f_isfd = 1,
151 .f_detach = filt_kqdetach,
152 .f_event = filt_kqueue,
153};
149/* XXX - move to kern_proc.c? */
154/* XXX - move to kern_proc.c? */
150static struct filterops proc_filtops =
151 { 0, filt_procattach, filt_procdetach, filt_proc };
152static struct filterops timer_filtops =
153 { 0, filt_timerattach, filt_timerdetach, filt_timer };
155static struct filterops proc_filtops = {
156 .f_isfd = 0,
157 .f_attach = filt_procattach,
158 .f_detach = filt_procdetach,
159 .f_event = filt_proc,
160};
161static struct filterops timer_filtops = {
162 .f_isfd = 0,
163 .f_attach = filt_timerattach,
164 .f_detach = filt_timerdetach,
165 .f_event = filt_timer,
166};
154
155static uma_zone_t knote_zone;
156static int kq_ncallouts = 0;
157static int kq_calloutmax = (4 * 1024);
158SYSCTL_INT(_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW,
159 &kq_calloutmax, 0, "Maximum number of callouts allocated for kqueue");
160
161/* XXX - ensure not KN_INFLUX?? */

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

223
224static int
225filt_nullattach(struct knote *kn)
226{
227
228 return (ENXIO);
229};
230
167
168static uma_zone_t knote_zone;
169static int kq_ncallouts = 0;
170static int kq_calloutmax = (4 * 1024);
171SYSCTL_INT(_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW,
172 &kq_calloutmax, 0, "Maximum number of callouts allocated for kqueue");
173
174/* XXX - ensure not KN_INFLUX?? */

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

236
237static int
238filt_nullattach(struct knote *kn)
239{
240
241 return (ENXIO);
242};
243
231struct filterops null_filtops =
232 { 0, filt_nullattach, NULL, NULL };
244struct filterops null_filtops = {
245 .f_isfd = 0,
246 .f_attach = filt_nullattach,
247};
233
234/* XXX - make SYSINIT to add these, and move into respective modules. */
235extern struct filterops sig_filtops;
236extern struct filterops fs_filtops;
237
238/*
239 * Table for for all system-defined filters.
240 */

--- 1816 unchanged lines hidden ---
248
249/* XXX - make SYSINIT to add these, and move into respective modules. */
250extern struct filterops sig_filtops;
251extern struct filterops fs_filtops;
252
253/*
254 * Table for for all system-defined filters.
255 */

--- 1816 unchanged lines hidden ---