Re: [Chicken-users] Interaction of subprocess and condition handling

2019-07-19 Thread Lassi Kortela
Sorry, that code cleared the FD_CLOEXEC flag instead of setting it. Fixed code at . ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users

Re: [Chicken-users] Interaction of subprocess and condition handling

2019-07-19 Thread Lassi Kortela
Obviously in Chicken you would not exit the parent, but you'd exit the child with code 126 as here. In Chicken you'd probably want some fancy way to propagate the errno value from the child to the parent after a failed execve(). It's unwise to do something like _exit(errno); One solution would

[Chicken-users] (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

2019-07-19 Thread Matt Welland
There are three interfaces on the host but hostinfo-addresses returns only one. I think this may be a bug. I'm using chicken 4.13 and see the same behavior on Ubuntu 18.04 and SLES11. csi> (hostinfo-addresses (hostname->hostinfo (get-host-name))) #(#u8(10 27 44 127)) Sometimes I get 127.0.0.1,

Re: [Chicken-users] Interaction of subprocess and condition handling

2019-07-19 Thread Lassi Kortela
I think you'd basically have to replicate the following C traditional programming technique in whatever mixture of Scheme and C is appropriate for Chicken. So when you run "./spawn date" it succeeds and prints output from the standard Unix "date" utility. But when you run "./spawn nonexistent"

Re: [Chicken-users] Interaction of subprocess and condition handling

2019-07-19 Thread Lassi Kortela
OK, I perused the chicken-core git repo. posixunix.scm defines the 'process' procedure. It's a wrapper for the 'process-impl' procedure in the same file. process-impl does a lot of setup, then: (chicken.process#process-fork (lambda () ;; ...set up input and output pipes...

Re: [Chicken-users] Interaction of subprocess and condition handling

2019-07-19 Thread Lassi Kortela
Thanks for helping out :) *Normally*, closing both ports returned from "process" will do a waitpid(2) (or the equivalent) and throw an exception if WIFEXITED returns false. So WIFEXITED checks for a normal exit (instead of being terminated by signal, e.g. segfault or kill -9). But what if

Re: [Chicken-users] Interaction of subprocess and condition handling

2019-07-19 Thread felix . winkelmann
> How do you handle errors signaled by the 'process' procedure from the > (chicken process) module in Chicken 5? > > When I try things like > >(receive (from-child to-child child) >(condition-case >(process command args) > (_ () > (values #f #f #f)))

[Chicken-users] [announc] MMCK Exceptional Conditions v0.1.0-devel.0

2019-07-19 Thread Marco Maggi
Stuff related to exceptions, condition objects, and the dynamic environment. -- Marco Maggi ___ Chicken-users mailing list Chicken-users@nongnu.org