Code Monkey home page Code Monkey logo

kqueue-ml's People

Contributors

anuragsoni avatar davidalphafox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

davidalphafox

kqueue-ml's Issues

FreeBSD and OpenBSD support

So far this library has been just tested on macOS. We should test this on the various BSD systems (starting with FreeBSD, OpenBSD), and add tests to ensure the library works on them.

Some differences across the various systems is the type definition for kevent.

macOS:

     struct kevent {
             uintptr_t       ident;          /* identifier for this event */
             int16_t         filter;         /* filter for event */
             uint16_t        flags;          /* general flags */
             uint32_t        fflags;         /* filter-specific flags */
             intptr_t        data;           /* filter-specific data */
             void            *udata;         /* opaque user data identifier */
     };

NetBSD

     struct kevent {
             uintptr_t ident;        /* identifier for this event */
             uint32_t  filter;       /* filter for event */
             uint32_t  flags;        /* action flags for kqueue */
             uint32_t  fflags;       /* filter flag value */
             int64_t   data;         /* filter data value */
             void     *udata;        /* opaque user data identifier */
     };

openBSD:

struct kevent {
	uintptr_t   ident;	/* identifier for this event */
	short	    filter;	/* filter for event */
	u_short	    flags;	/* action flags for kqueue */
	u_int	    fflags;	/* filter flag value */
	int64_t	    data;	/* filter data value */
	void	   *udata;	/* opaque user data identifier */
};

FreeBSD:

     struct kevent {
	     uintptr_t	ident;	     /*	identifier for this event */
	     short     filter;	     /*	filter for event */
	     u_short   flags;	     /*	action flags for kqueue	*/
	     u_int     fflags;	     /*	filter flag value */
	     int64_t   data;	     /*	filter data value */
	     void      *udata;	     /*	opaque user data identifier */
	     uint64_t  ext[4];	     /*	extensions */
     };

Another area that will take some work is to go over the various filters and filter flags (NOTE_*), to add os specific support for each platform. We already use ppx_optcomp for some conditional compilation, we could leverage it further to work with filters and flags that aren't defined on all platforms. The list of variables generated by our dune setup that can be consumed via ppx_optcomp is available at

let vars =
[ "KQUEUE_AVAILABLE", C.C_define.Value.Switch (kqueue_available operating_systems)
; "FREEBSD", List.assoc "__FreeBSD__" operating_systems
; "OPENBSD", List.assoc "__OpenBSD__" operating_systems
; "DRAGONFLY", List.assoc "__DragonFly__" operating_systems
; "NETBSD", List.assoc "__NetBSD__" operating_systems
; "KQUEUE_ML_ARCH_SIXTYFOUR", List.assoc "ARCH_SIXTYFOUR" system

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.