From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 5 Jan 2010 14:48:06 +0100 From: Enrico Weigelt To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20100105134806.GD21460@nibiru.local> References: <20091205031747.GA8759@nipl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Subject: Re: [9fans] ideas for helpful system io functions Topicbox-Message-UUID: b7aea6ec-ead5-11e9-9d60-3106f5b1d025 * Tim Newsham wrote: > ps. if you wanted to hide this ugliness of passing a buffer and > fd to a child process instead of just passing an fd, you could > still solve it in userland without a syscall. Write a library > that does buffered IO. Include unget() if you like. Write the > library in a way that you can initialize it after a fork/exec > to pick up state from the parent (ie. by taking two fds, > reading the buffer from the first, and continuing on with the > 2nd when it is exhausted). Not sure how things work on Plan9, but on GNU/Linux you could even use LD_PRELOAD to overlay the read() libc function to hide that magic, or even tweak libc for that. BTW: how to do you in general think about having tweaked libc's instead of all these "cross-platform libraries" ? For example, I'm thinking about whether it's worth to change uclibc in a way that it allows to plug-in userland-vfs'es. cu -- ---------------------------------------------------------------------- Enrico Weigelt, metux IT service -- http://www.metux.de/ phone: +49 36207 519931 email: weigelt@metux.de mobile: +49 174 7066481 icq: 210169427 skype: nekrad666 ---------------------------------------------------------------------- Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme ----------------------------------------------------------------------