From mboxrd@z Thu Jan 1 00:00:00 1970
From: bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r@public.gmane.org
Subject: [Bug 95331] fcntl.2 + sigaction.2 + signal.7 need further
information about use of a SA_SIGINFO signal handler that uses si->si_fd
Date: Sat, 02 May 2015 23:24:34 +0000
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Return-path:
In-Reply-To:
Sender: linux-man-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
To: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
List-Id: linux-man@vger.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=95331
--- Comment #13 from Jason Vas Dias ---
I think it is because in fs/pipe.c :
static int
pipe_fasync(int fd, struct file *filp, int on)
{
struct pipe_inode_info *pipe = filp->private_data;
int retval = 0;
__pipe_lock(pipe);
if (filp->f_mode & FMODE_READ)
retval = fasync_helper(fd, filp, on, &pipe->fasync_readers);
if ((filp->f_mode & FMODE_WRITE) && retval >= 0) {
retval = fasync_helper(fd, filp, on, &pipe->fasync_writers);
if (retval < 0 && (filp->f_mode & FMODE_READ))
/* this can happen only if on == T */
fasync_helper(-1, filp, 0, &pipe->fasync_readers);
}
__pipe_unlock(pipe);
return retval;
}
Perhaps a pipe FD ioctl could be provided that would set a pipe inode
'sigio_on_write_enabled' flag that could be handled ? :
... else
if (pipe->sigio_on_write_enabled && (filp->f_mode & FMODE_WRITE) &&
(retval == -1 ) && (pipe->last_retval != -1) &&
(pipe->last_readers != 0) )
{ pipe->last_retval = -1;
if( pipe->readers == 0 )
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_OUT);
retval = fasync_helper(fd, filp, on, &pipe->fasync_writers);
} pipe->last_retval = retval; pipe->last_readers = pipe->readers;
__pipe_unlock(pipe);
return retval;
}
ie. so if the last error status was NOT -1, but is now -1, and O_ASYNC is
enabled, and readers is now 0, then if this special new sigio_on_write_enabled
flag was set, then a sigio might be sent for it ?
--
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html