From: Hugang <hugang@soulinfo.com>
To: linux-kernel@vger.kernel.org
Subject: use O_DIRECT open file, when read will hang.
Date: Fri, 19 Sep 2003 12:46:31 +0800 [thread overview]
Message-ID: <20030919124631.3b4e6301.hugang@soulinfo.com> (raw)
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)
next reply other threads:[~2003-09-19 4:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-19 4:46 Hugang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030919124631.3b4e6301.hugang@soulinfo.com \
--to=hugang@soulinfo.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®