[pg-cvs] CFFI fork_and_exec for Hemlock/iolib

Nikodemus Siivola nikodemus at random-state.net
Wed Dec 23 08:54:56 UTC 2009


2009/12/23 Luís Oliveira <luismbo at gmail.com>:

> 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,

Right, I remember now. :)

> 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

Pretty much exactly so, yes -- plus a PRINT-OBJECT change along the lines of

(defmethod print-object ((posix-error posix-error) stream)
  (print-unreadable-object (posix-error stream :type t :identity nil)
    (let ((code (system-error-code posix-error))
          (identifier (system-error-identifier posix-error))
          (syscall (posix-error-syscall posix-error)))
      (format stream "~s ~s ~s ~s"
              (or syscall "[No syscall name]")
              (or code "[No code]") identifier
              (or (strerror code) "[Can't get error string.]")))))

or so.

Cheers,

 -- Nikodemus




More information about the osicat-devel mailing list