lkml.org 
[lkml]   [1998]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] minor change to fcntl(F_GETSIG) interface
Linus, Alan,

While looking into the behaviour of completion ports, I found
that fcntl(fd, F_GETSIG) returns 0 initially, and the value
set by fcntl(fd, F_SETSIG, signr) if it is changed.

That would be fine, but after using F_SETSIG, there is no way to restore
the default behaviour because F_SETSIG does not allow a value of zero.

The code in send_sigio() behaves differently depending on whether the
value is zero or a signal number. Even SIGIO behaves differently from
the default setting. The end result is the same for zero or SIGIO, but
goes through a different path in the signal code, and will have a
different effect in due course.

For consistency therefore, the enclosed patch.

-- Jamie

--- linux/fs/fcntl.c.devel Fri Nov 20 14:21:28 1998
+++ linux/fs/fcntl.c Fri Dec 11 16:26:26 1998
@@ -162,7 +162,9 @@
err = filp->f_owner.signum;
break;
case F_SETSIG:
- if (arg <= 0 || arg > _NSIG) {
+ /* arg == 0 restores default behaviour (single
+ SIGIO without any siginfo). */
+ if (arg < 0 || arg > _NSIG) {
err = -EINVAL;
break;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.045 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site