[lkml]   [2001]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: How do I make a circular pipe?
> >  Apparently, the pipe
> > fd's evaporate when the process does an execve.
> Check out:
> #include <unistd.h>
> #include <fcntl.h>
> /* ... */
> fcntl (fd, F_SETFD, (long) FD_CLOEXEC);
> to set/reset the close on exec bit.

Cool. That's EXACTLY what I was looking for. Thanks.

Thanks also to the people who pointed out pppd's "pty"
option (yes I read the docs on that, but they're a bit
cryptic). And yes, my pseudo-code example used fd[0]
twice. Thanks. You can stop emailing me now. :)

> You might want to check out something like Stevens
> advanced UNIX programming, though it is probably
> somewhat dated :-)

I've got about fifteen books with names like that, but
strangely in real world situations I keep trying to
use the man pages instead. Sad, I know...

> At a guess I would say that the reason is you don't
> have as much control with pipes as you do with
> devices. Under the standard termios, you can tell
> the system to not return from the read until either
> characters have been read, or a given character such
> as a newline has been read. You can also switch to
> alternative line disciplines that are more targeted
> to a given application such as PPP, etc.

Hmmm. And the reason these cool toys aren't available
as some kind of wrapper around a normal read-from-fd
is...? (Performance?)

> You probably want to check out pseudo tty's (pty's),
> which allow you to create your own terminal.

This occurred to me in the car on the way home after
five hours messing with this. (Of course. :)

> Here is the glibc documentation,


Info. Never thought to check info. Here I am
checking linuxdoc's howtos, man pages, and google...
Sigh... I don't suppose there's an info2html tool

Well what do you know, there is. (I LIKE Google.)


Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 13:25    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean