svn commit: r335765 - head/sys/sys

Ed Schouten ed at nuxi.nl
Thu Jun 28 19:44:58 UTC 2018


2018-06-28 21:09 GMT+02:00 Conrad Meyer <cem at freebsd.org>:
> I think the right initializer is something like:
>
> *(kevp_) = (struct kevent) {
> ...
> .ext = {
>   [0] = 0,
>   [1] = 0,
> ...
> },
> };

The nice thing about using an inline function is that you can get rid
of the compound literal:

static __inline void
EV_SET(struct kevent *kevp, ...)
{
    struct kevent kev = {
        // initializer goes here.
    };
    *kevp = kev;
}

This should even work with C89 compilers, assuming <sys/cdefs.h>
provides some smartness for __inline.

-- 
Ed Schouten <ed at nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands


More information about the svn-src-head mailing list