[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible bug with grep/sed/tail?
From: |
Brian Dessent |
Subject: |
Re: Possible bug with grep/sed/tail? |
Date: |
Thu, 20 Nov 2008 17:02:27 -0800 |
Pádraig Brady wrote:
> It's probably useful to add this functionality to all coreutil filters.
> I still need to be convinced that glibc is not the correct place for this.
> If it was there then any users of stdio could be controlled.
It has been said before in previous threads but I want to re-state that
this is possible in a very simple and general way with the LD_PRELOAD facility:
$ echo '__attribute__((constructor)) void f() { setvbuf (stdout, NULL, _IOLBF,
0); }' | \
gcc -include stdio.h -x c - -fPIC -shared -o linebuf.so
$ ( while true; do echo "foo"; sleep 1; done ) | LD_PRELOAD=./linebuf.so grep
foo | cat
foo
foo
foo
... # immediate output
Brian
- Possible bug with grep/sed/tail?, David Corlette, 2008/11/20
- Re: Possible bug with grep/sed/tail?, Paolo Bonzini, 2008/11/20
- Re: Possible bug with grep/sed/tail?, Pádraig Brady, 2008/11/20
- Re: Possible bug with grep/sed/tail?,
Brian Dessent <=
- Re: Possible bug with grep/sed/tail?, Jim Meyering, 2008/11/21
- Re: Possible bug with grep/sed/tail?, Reuben Thomas, 2008/11/21
- Re: Possible bug with grep/sed/tail?, Paolo Bonzini, 2008/11/21
- Re: Possible bug with grep/sed/tail?, Andreas Schwab, 2008/11/21
- Re: Possible bug with grep/sed/tail?, Jim Meyering, 2008/11/21
- Re: Possible bug with grep/sed/tail?, Jim Meyering, 2008/11/22
- Re: Possible bug with grep/sed/tail?, Pádraig Brady, 2008/11/22
- Re: Possible bug with grep/sed/tail?, Jim Meyering, 2008/11/22
- Re: Possible bug with grep/sed/tail?, Brian Dessent, 2008/11/22
- Re: Possible bug with grep/sed/tail?, Jim Meyering, 2008/11/29