On 04/06/13 15:28, Erez D wrote:
> thanks,
>
> so i guess if i use unidirectional connection, and the reader does not
> expect to get an EOF()
> thank i'm safe.
>
Why are you so keen on doing it wrong?
No, you are not safe. If the child process dies because of a
segmentation fault (or whatever), t
ְAlso, you might cause other software that inherits the fds to
fail/complain/whatever.
I only mention this because just yesterday I noticed that when running
'lvs' on my
Debian wheeze laptop, I get:
File descriptor 3 (/usr/share/bash-completion/completions) leaked on
lvs invocation. Parent PID 1183
thanks,
so i guess if i use unidirectional connection, and the reader does not
expect to get an EOF()
thank i'm safe.
thanks,
erez.
On Tue, Jun 4, 2013 at 3:23 PM, Amos Shapira wrote:
> On 4 June 2013 21:43, ronys wrote:
>
>> Nothing. You're just wasting resources (file descriptors) and maki
On 4 June 2013 21:43, ronys wrote:
> Nothing. You're just wasting resources (file descriptors) and making your
> code a bit harder to understand and maintain.
>
> Note that for pipe(), you can use both fds at both ends of the pipe, but
> it's very easy to get into a race condition.Better to open
Bt. Wrong.
If the unused side of the pipe is left open by the process which doesn't
read it then it will be considered as "open" even if the other side closed
it, therefore preventing the reading process from receiving the EOF mark
(read(2) returning zero bytes).
And just to backup my claim a
On 06/04/2013 02:43 PM, ronys wrote:
Nothing. You're just wasting resources (file descriptors) and making
your code a bit harder to understand and maintain.
It kind of says to anyone reading the code that you put the minimum into
creating it you could, and implies there are details that were
Nothing. You're just wasting resources (file descriptors) and making your
code a bit harder to understand and maintain.
Note that for pipe(), you can use both fds at both ends of the pipe, but
it's very easy to get into a race condition.Better to open a pair of pipes,
one for each direction (of co
hello
using the usual pipe()+fork()+dup()+close() to fork a child process and
pipe data from and to it,
I know both the child and parent must close the unused fds.
why ?
what if i don't close the unsed fds ?
thanks,
erez.
___
Linux-il mailing list
L
*Please*
*send cvs to **shavit.ma...@biscience.com saying - recommendation from
David Ronkin.**
*
*Luck!*
*
*
*Primary responsibilities for role**:*
The IT Manager The will be responsible for managing and leading the entire
IT department and activities in the company including IT and operati