Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jul 2000 11:41:02 -0500
From:      Jonathan Lemon <jlemon@flugsvamp.com>
To:        arch@freebsd.org
Subject:   kqueue API change
Message-ID:  <20000717114102.E67727@prism.flugsvamp.com>

next in thread | raw e-mail | index | archive | help

  After some feedback and real real world experience with kqueue,
I'd like to make some small changes to the API in order to clean it up.

The parameters to the system call will be changed from:

    kevent(int kq, int nchanges, struct kevent **changelist, int nevents,
            struct kevent *eventlist, struct timespec *timeout)

to:

    int
    kevent(int kq, const struct kevent *changelist, int nchanges,
            struct kevent *eventlist, int nevents,
            const struct timespec *timeout)


There are 3 changes:

    - swap the argment order so it is (buffer, count) in order to
      match almost every other system call (thanks to green for
      pointing this out)

    - addition of `const' to the parameters to make it clear that 
      they are not changed by the kernel

    - change the `array of pointers to structs' to a flat array of
      structures.

The latter change will allow the elimination of one layer of copyin()
calls in the kernel, and will probably make the API easier to understand
for new users.  By eliminating the indirection, the cache footprint is
also reduced as well.  The only possible downside that I can see is that
the input array now must be contiguous, but because it can also be reaused
as the output list, this seems to be a minor point.

I'd like to get this change in as soon as possible so it will be
contained in the 4.1-release.  Because kq has not appeared in an
official release yet, I don't have too much concern about breaking 
compatability at this point, and I'll take care up updating the two
ports in the tree that currently use it. (l0pht-watch and py-kqueue).
--
Jonathan

(If you've sent me mail in the last 3-4 weeks and haven't gotten a
 response, please resend it.  I've just returned from an extended
 business trip + vacation, and may have been a little too liberal with
 the `delete' key in cleaning up my mailbox)
 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000717114102.E67727>