[openib-general] Re: [PATCH] signal driven io support for ib_uverbs
Gleb Natapov
glebn at voltaire.com
Thu Jul 7 13:20:58 PDT 2005
On Thu, Jul 07, 2005 at 09:04:12AM -0700, Roland Dreier wrote:
> Gleb> The question is what is the right way? Do it from the kernel
> Gleb> or left it to userspace? Parts of the kernel do f_setown()
> Gleb> from the kernel others don't.
>
> I think that userspace is supposed to do the fcntl. For example, the
> code at <http://kegel.com/c10k.html> looks like:
>
> /* For each file descriptor, invoke F_SETOWN, F_SETSIG, and set O_ASYNC. */
> fcntl(fd, F_SETOWN, (int) getpid());
> fcntl(fd, F_SETSIG, signum);
> flags = fcntl(fd, F_GETFL);
> flags |= O_NONBLOCK|O_ASYNC;
> fcntl(fd, F_SETFL, flags);
>
The kernel is inconsistent in this respect so correct program should set
owner anyway. Lets use your patch.
--
Gleb.
More information about the general
mailing list