mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: johan.adolfsson@axis.com
To: "Rob Landley" <telomerase@yahoo.com>, <linux-kernel@vger.kernel.org>
Subject: Re: How do I make a circular pipe?
Date: Tue, 17 Apr 2001 10:02:19 +0200	[thread overview]
Message-ID: <032e01c0c714$ba76e000$a4b270d5@homeip.net> (raw)
In-Reply-To: <20010414010504.2967.qmail@web5201.mail.yahoo.com>

Can't you do it like this?
# mkfifo fifo
# pppd notty < fifo | pppoe -I eth1 >fifo
/Johan

----- Original Message -----
From: Rob Landley <telomerase@yahoo.com>
To: <linux-kernel@vger.kernel.org>
Sent: Saturday, April 14, 2001 3:05 AM
Subject: How do I make a circular pipe?


> How do I do the following:
>
> #  --> pppd notty | pppoe -I eth1 | --
>    |_________________________________|
>
> I.E. connect the stdout of a process  (or chain
> thereof) to its own stdin?
>
> So I wrote a program to do it, along the lines of:
>
> sixty-nine /bin/sh -c "pppd notty | pppoe -I eth1"
>
> With an executable approximately along the lines of
> (warning, pseudo-code, the other machine isn't hooked
> up to the internet at the moment for obvious reasons):
>
> int main(int argc, char *argv[], char *envp[])
> {
>   int fd[2];
>   pipe(fd);
>   dup2(fd[0],0);
>   dup2(fd[0],1);
>   execve(argv[1],argv+1,envp);
>   fprintf(stderr,"Bad.\n");
>   exit(1);
> }
>
> And it didn't work.  I made a little test program that
> writes to stdout and reads from stdin and reports to
> stderr, and it gets nothing.  Apparently, the pipe
> fd's evaporate when the process does an execve.
>
> What do I do?  (If anybody else knows an easier way to
> get pppoe working, that would be helpful too.
>
> Rob
>
> (P.S.  WHY does pppd want to talk to a tty by default
> instead of stdin and stdout?  Were the people who
> wrote it at all familiar with the unix philosophy?
> Just curious...)
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


      parent reply	other threads:[~2001-04-17  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-14  1:05 Rob Landley
2001-04-14  3:50 ` Michael Meissner
2001-04-14 17:44   ` Rob Landley
2001-04-14 23:58     ` bert hubert
2001-04-17  8:02 ` johan.adolfsson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='032e01c0c714$ba76e000$a4b270d5@homeip.net' \
    --to=johan.adolfsson@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=telomerase@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®