mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Linux kernel <linux-kernel@vger.kernel.org>
Subject: poll 2.6 and beyond
Date: Tue, 2 Mar 2004 15:59:48 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.53.0403021550320.2150@chaos> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2431 bytes --]


Hello all,
The provided driver and test code clearly shows that
poll_wait is returning to the driver as soon as it is
called, therefore not able to return the correct status.

It must remain sleeping until awakened by the driver so
that the driver can provide the correct return status.

This driver code doesn't even provide a method of waking
up poll_wait().  There is no wake_up_interruptible() in
the code at all!!!

The first

	Linux Thingy : poll() called
	Linux Thingy : poll() returned

... group occurred when the user-mode code called poll(). The
second identical group occurred when ^C was used to signal
termination.


Script started on Tue Mar  2 15:46:50 2004
# make clean
rm -f *.o THINK tester
# make
gcc -Wall -O2 -D__KERNEL__ -DMODULE -DMAJOR_NR=199  -I/usr/src/linux-2.4.24/include -c -o thingy.o thingy.c
gcc -Wall -o tester -O2 tester.c
rm -f THING
mknod THING c 199 0
# insmod thingy.o
# strace ./tester
execve("./tester", ["./tester"], [/* 32 vars */]) = 0
brk(0)                                  = 0x8049710
open("/etc/ld.so.preload", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 0, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
old_mmap(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4000c000
munmap(0x4000c000, 4096)                = 0
old_mmap(NULL, 644232, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4000c000
mprotect(0x40097000, 74888, PROT_NONE)  = 0
old_mmap(0x40097000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x8b000) = 0x40097000
old_mmap(0x4009d000, 50312, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4009d000
close(3)                                = 0
mprotect(0x4000c000, 569344, PROT_READ|PROT_WRITE) = 0
mprotect(0x4000c000, 569344, PROT_READ|PROT_EXEC) = 0
personality(PER_LINUX)                  = 0
getpid()                                = 2122
open("THING", O_RDONLY)                 = 3
poll(
 <unfinished ...>
# dmesg | tail
Linux Thingy : module removed
Linux Thingy : initialization complete
Linux Thingy : poll() called
Linux Thingy : poll() returned
Linux Thingy : poll() called
Linux Thingy : poll() returned
# exit
exit

Script done on Tue Mar  2 15:47:48 2004


Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.


[-- Attachment #2: Type: APPLICATION/octet-stream, Size: 2025 bytes --]

                 reply	other threads:[~2004-03-02 20:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.4.53.0403021550320.2150@chaos \
    --to=root@chaos.analogic.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®