Re: RFC: Does it make sense to build a ocaml-eventfd package?
ygrek <firstname.lastname@example.org> writes:
> On Tue, 14 Sep 2010 21:27:45 +0200
> Goswin von Brederlow <email@example.com> wrote:
>> > On Fri, 27 Aug 2010 13:27:29 +0200
>> > StÃ?Â©phane Glondu <firstname.lastname@example.org> wrote:
>> >> And I also have some bindings to ioctl() that manipulate serial ports
>> >> parameters buried in one of my other projects that should be elsewhere,
>> >> but are not significant enough (IMHO) to make a separate project .
>> >> 
>> >> http://krobot.git.sourceforge.net/git/gitweb.cgi?p=krobot/krobot;a=tree;f=info/ocaml-serial;hb=HEAD
> Converting from BSD3 to LGPL is ok?
>> Should we have an ExtUnix.Linux submodule for eventfd and signalfd?
>> Or use
>> let eventfd () = throw ENOSYS
>> on platforms that don't have it?
> We have devised a README with sort of "vision" for ExtUnix, which should answer this question,
> please have a look -
403 Forbidden - Invalid action parameter
But I browsed to find the file.
>> I could imagine emulating the eventfd with pipes but signalfd might be
>> impossible to emulate.
> I think eventfd emulation on pipes doesn't count for "thin" binding and it can be probably
> done entirely in ocaml side, but we could have it in single place anyway..
Obviously the emulation would be for systems that don't have the system
call to bind to. Might be more friendly than raising Not_available.
Here are some more calls I frequently miss:
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
And read, write, pread, pwrite with Bigarray instead of string for
zero-copy operations or buffers >16MB on 32bit platforms.
int epoll_create1(int flags);
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
int epoll_wait(int epfd, struct epoll_event *events,
int maxevents, int timeout);
int epoll_pwait(int epfd, struct epoll_event *events,
int maxevents, int timeout,
const sigset_t *sigmask);
BSD has epoll too but with a different interface. Hopefully close enough
so we can provide the same interface in ocaml with different
implementations underneath. Don't know about MacOS X or Windows.