Re: How to write to stdin of another process?
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 03/27/05
- Next message: Barry Margolin: "Re: Nice question: what happens to child?"
- Previous message: Samik Raychaudhuri: "Nice question: what happens to child?"
- In reply to: Paul: "How to write to stdin of another process?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 27 Mar 2005 15:22:47 -0500
In article <d2658f$7sg$1@news.sap-ag.de>, Paul <pg_x@yahoo.com> wrote:
> Jeremiah DeWitt Weiner wrote:
>
> > Paul <pg_x@yahoo.com> wrote:
> >> if I have the PID of another already running process is it possible to
> >> write to its stdin? I guess it is possible so the question is HOW?
> >
> > To an arbitrary process, which was not started in any special way?
> > No.
>
> Are you sure? Those processes still have stdin. Foreground processes read
> from the terminal. Background processes have their stdin connected to some
> created especially for them internal pipes:
>
> # ls /proc/31905/fd/
> lr-x------ 1 p p 64 2005-03-27 14:04 0 -> pipe:[126663]
>
> It should be possible to somehow get the pipe and write to it?
Unless it's a named pipe, you can't get at the other end. It's just an
anonymous endpoint within another process.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: Barry Margolin: "Re: Nice question: what happens to child?"
- Previous message: Samik Raychaudhuri: "Nice question: what happens to child?"
- In reply to: Paul: "How to write to stdin of another process?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|