[pg-cvs] CFFI fork_and_exec for Hemlock/iolib

Luís Oliveira luismbo at gmail.com
Tue Dec 22 22:41:14 UTC 2009


[Added osicat-devel to the Cc: list.]

On Tue, Dec 22, 2009 at 11:17 AM, Nikodemus Siivola
<nikodemus at random-state.net> wrote:
> Assuming someone had the time to do it, would all involved be happy if
> iolib and osicat shared a low-level POSIX/BSD/Linux API with minimal
> deps, or are there reasons not to use a shared layer?

Initially the new Osicat stuff was in a library called CL-POSIX.
However it turns out to be useful to share a bit of code between
posix, windows, mach, etc. In particular, it's nice to have e.g. posix
and windows errors inherit from a common condition.

Thus OSICAT-SYS was born, that includes code shared by OSICAT-POSIX,
OSICAT-WINDOWS and OSICAT-MACH. OSICAT is then implemented on top of
these. Splitting all these into different projects didn't seem worth
the trouble at the time. Still doesn't seem worth the trouble right
now, what do you think?


> Also related to both Osicat and iolib: neither includes the name of
> the failing syscall in the error conditions they signal. I don't quite
> understand the way the CFFI type system works to provide these, but
> assuming you do... would it be hard to add it in?

It was fairly straightforward:

OSICAT> (handler-case (nix:mkdir "/" 0)
          (nix:eisdir (c) ; OSX signals this funny error
            (nix::posix-error-syscall c)))
OSICAT-POSIX:MKDIR

Is this what you were looking for? If yes, I'll clean up the attached
patch and commit it to Osicat.

-- 
Luís Oliveira
http://r42.eu/~luis/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osicat-syscall.diff
Type: application/octet-stream
Size: 5155 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/osicat-devel/attachments/20091222/016de85b/attachment.obj>


More information about the osicat-devel mailing list