Re: blocked_dup2.c testcase wrong?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tobias Ulmer
Date: Sunday, May 3, 2009 - 3:18 pm

On Sun, May 03, 2009 at 01:57:16PM -0700, Marco S Hyman wrote:

I'm only interested in what the kernel does and all the comments refer
to the kernel side of things. I know userland pthreads passes this test,
but I'm arguing that this is wrong.

Pthreads do use sys_dup2 internally and debugging output shows that the
underlying object of newfd is never really closed. The EBADF is
simulated by pthreads even though the object is perfectly valid.

This sort of context sensitive information isn't available to the kernel.

Btw lets say the kernel does the "right" thing and closes the object
pointed by newfd (in the 2nd iteration) and notifies the threads with a
EBADF like pthread does. Remember that fd and newfd point at the same
object? That would mean in the third iteration, dup2 errors out with
EBADF and so does recvfrom. Testcase fails (and a few other things, as
you can easily imagine).
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
blocked_dup2.c testcase wrong?, Tobias Ulmer, (Sun May 3, 12:26 pm)
Re: blocked_dup2.c testcase wrong?, Marco S Hyman, (Sun May 3, 1:57 pm)
Re: blocked_dup2.c testcase wrong?, Tobias Ulmer, (Sun May 3, 3:18 pm)
Re: blocked_dup2.c testcase wrong?, patrick keshishian, (Sun May 3, 4:44 pm)
Re: blocked_dup2.c testcase wrong?, Tobias Ulmer, (Sun May 3, 5:45 pm)
Re: blocked_dup2.c testcase wrong?, patrick keshishian, (Sun May 3, 6:05 pm)
Re: blocked_dup2.c testcase wrong?, Philip Guenther, (Sun May 3, 6:18 pm)
Re: blocked_dup2.c testcase wrong?, Marco S Hyman, (Sun May 3, 6:27 pm)
Re: blocked_dup2.c testcase wrong?, patrick keshishian, (Sun May 3, 7:07 pm)
Re: blocked_dup2.c testcase wrong?, Ted Unangst, (Sun May 3, 7:16 pm)
Re: blocked_dup2.c testcase wrong?, Tobias Ulmer, (Sun May 3, 7:41 pm)
Re: blocked_dup2.c testcase wrong?, Tobias Ulmer, (Sun May 3, 7:44 pm)
Re: blocked_dup2.c testcase wrong?, Philip Guenther, (Sun May 3, 8:28 pm)
Re: blocked_dup2.c testcase wrong?, Marco S Hyman, (Sun May 3, 8:56 pm)
Re: blocked_dup2.c testcase wrong?, Philip Guenther, (Sun May 3, 9:15 pm)
Re: blocked_dup2.c testcase wrong?, Artur Grabowski, (Mon May 4, 2:03 am)
Re: blocked_dup2.c testcase wrong?, Kurt Miller, (Thu May 7, 8:08 am)