chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] daemonize egg: redirect I/O?


From: Thomas Christian Chust
Subject: Re: [Chicken-users] daemonize egg: redirect I/O?
Date: Fri, 26 Oct 2007 13:05:43 +0200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

Elf wrote:

> um, why not just use (duplicate-fileno (portfileno <port>))  ? [...]

Because not the file descriptor of a given port should be duplicated but
rather the file descriptor of a given port should be replaced by a
duplicate of another one.

Of course one could use (portfileno ...) instead of the fileno/...
constants in my example, but it wouldn't make much of a difference,
unless the ports were already set to something different from the
standard -- but in that case it may not be such a good idea to redirect
them. I think it makes much more sense to redirect those descriptors
which are, by default, connected to the controlling terminal of the
process, because they usually become useless after detaching from the
original process group.

> (re: the daemon question, i would just use
>      (foreign-lambda int "daemon" int int) ,
>  but thats just me.)

Isn't daemon(3) a BSD C library function? I don't know whether it is
available everywhere -- and besides that, an implementation in Scheme is
not a lot of work but could offer a great deal of added flexibility in
addition to what deamon(3) can do.

> [...]

cu,
Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]