summaryrefslogtreecommitdiff
path: root/lib/libc/sys/kqueue.2
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2017-06-07 20:54:59 +0000
committerkamil <kamil@NetBSD.org>2017-06-07 20:54:59 +0000
commit44969eeb45d850bd460617525e964708cdfac57c (patch)
tree58bec872e4d8caf40946db36a16fe1e7665d70c5 /lib/libc/sys/kqueue.2
parent3064b3bc27c0773a98aaf8b4d36a803dca21c477 (diff)
EV_SET(2) - simplify description
Note only the information that it does not evaluate multiple times its parameters. Suggested by <wiz>.
Diffstat (limited to 'lib/libc/sys/kqueue.2')
-rw-r--r--lib/libc/sys/kqueue.218
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2
index 67ab22c1c9b..a69765039d5 100644
--- a/lib/libc/sys/kqueue.2
+++ b/lib/libc/sys/kqueue.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: kqueue.2,v 1.44 2017/06/07 05:26:19 abhinav Exp $
+.\" $NetBSD: kqueue.2,v 1.45 2017/06/07 20:54:59 kamil Exp $
.\"
.\" Copyright (c) 2000 Jonathan Lemon
.\" All rights reserved.
@@ -156,18 +156,7 @@ and
.Pp
.Fn EV_SET
is a macro which is provided for ease of initializing a kevent structure.
-It wraps an internal static inline function to prevent preprocessor misuse.
-In the past this code would behave incorrectly and damage process's memory,
-if incrementation or decrementation would be used as the first argument.
-This example has been taken from LLDB, that caused the memory corruption and
-inspired the
-.Nx
-developers for improving the implementation.
-.Bd -literal -offset indent
-EV_SET(&in_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0);
-.Ed
-.Pp
-This macro is now safe in all major BSDs.
+This macro does not evaluate its parameters multiple times.
.Pp
The
.Va kevent
@@ -681,6 +670,7 @@ The
function first appeared in
.Nx 6.0 .
.Pp
+The
.Fn EV_SET
-was converted from a macro implementation to the macro wrapping a static inline function in
+macro was protected from evaluating multiple times the first argument in
.Nx 8.0 .