From nikodemus at random-state.net Tue Dec 22 13:11:29 2009 From: nikodemus at random-state.net (Nikodemus Siivola) Date: Tue, 22 Dec 2009 20:11:29 +0200 Subject: [pg-cvs] osicat-posix additions Message-ID: <633d72b0912221011q665acc3dr50939221b7231e09@mail.gmail.com> I pushed a few additions used by qthemlock to the Osicat master -- mostly termios related. Even if they qthemlock should move away from Osicat, they still belong appropriately to NIX. Cheers, -- Nikodemus From luismbo at gmail.com Tue Dec 22 17:41:14 2009 From: luismbo at gmail.com (=?ISO-8859-1?Q?Lu=EDs_Oliveira?=) Date: Tue, 22 Dec 2009 22:41:14 +0000 Subject: [pg-cvs] CFFI fork_and_exec for Hemlock/iolib In-Reply-To: <633d72b0912220317i4992c583id2496bbed6db529f@mail.gmail.com> References: <633d72b0912212328j68e1dc2epc34d7ff08329fbd@mail.gmail.com> <391f79580912220212r776c074aj238e632eaac7be98@mail.gmail.com> <633d72b0912220317i4992c583id2496bbed6db529f@mail.gmail.com> Message-ID: <391f79580912221441y319babc3tfedb4c5b93cbd949@mail.gmail.com> [Added osicat-devel to the Cc: list.] On Tue, Dec 22, 2009 at 11:17 AM, Nikodemus Siivola 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: 5154 bytes Desc: not available Url : http://common-lisp.net/pipermail/osicat-devel/attachments/20091222/016de85b/attachment.obj From nikodemus at random-state.net Wed Dec 23 03:54:56 2009 From: nikodemus at random-state.net (Nikodemus Siivola) Date: Wed, 23 Dec 2009 10:54:56 +0200 Subject: [pg-cvs] CFFI fork_and_exec for Hemlock/iolib In-Reply-To: <391f79580912221441y319babc3tfedb4c5b93cbd949@mail.gmail.com> References: <633d72b0912212328j68e1dc2epc34d7ff08329fbd@mail.gmail.com> <391f79580912220212r776c074aj238e632eaac7be98@mail.gmail.com> <633d72b0912220317i4992c583id2496bbed6db529f@mail.gmail.com> <391f79580912221441y319babc3tfedb4c5b93cbd949@mail.gmail.com> Message-ID: <633d72b0912230054l72ddaa49n7abbdae464e3e08c@mail.gmail.com> 2009/12/23 Lu?s Oliveira : > 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