[openib-general] Re: [PATCH] signal driven io support for ib_uverbs

Roland Dreier rolandd at cisco.com
Thu Jul 7 09:04:12 PDT 2005


    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);

 - R.



More information about the general mailing list