mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* use O_DIRECT open file, when read will hang.
@ 2003-09-19  4:46 Hugang
  2003-09-19  5:54 ` Andrew Morton
  2003-09-19 13:06 ` Richard B. Johnson
  0 siblings, 2 replies; 7+ messages in thread
From: Hugang @ 2003-09-19  4:46 UTC (permalink / raw)
  To: linux-kernel

Hello all:

Steps to reproduce:

rm -f /tmp/1.log
touch /tmp/1.log
echo << EOF > /tmp/hang.c 
#include <sys/types.h>
#include <asm/fcntl.h>

main()
{
        int i;
        char buf[1025];

        i = open("/tmp/1.log", O_RDONLY | 040000, 0);
        if ( i != -1) {
                read(i, buf, 1);
        }
        printf("'%s'", buf);
}
EOF
gcc -o /tmp/hang /tmp/hang.c
/tmp/hang


-- 
Hu Gang / Steve
Email         : hugang@soulinfo.com, steve@soulinfo.com
GPG FinePrint : 4099 3F1D AE01 1817 68F7  D499 A6C2 C418 86C8 610E
GPG Public Key: http://soulinfo.com/~hugang/HuGang.asc
MSN#          : huganglinux@hotmail.com [9:00AM - 5:30PM +8:00]
RLU#          : 204016 [1999] (Register Linux User)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-09-19 22:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-19  4:46 use O_DIRECT open file, when read will hang Hugang
2003-09-19  5:54 ` Andrew Morton
2003-09-19 16:39   ` Badari Pulavarty
2003-09-19 16:57     ` Andrew Morton
2003-09-19 17:38       ` Badari Pulavarty
2003-09-19 22:12       ` Badari Pulavarty
2003-09-19 13:06 ` Richard B. Johnson

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®