lkml.org 
[lkml]   [2003]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectuse O_DIRECT open file, when read will hang.
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)
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.112 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site