Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
03b1fb24
Commit
03b1fb24
authored
Feb 12, 2003
by
Dave Jones
Committed by
Linus Torvalds
Feb 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix sigio on tty drivers outgoing
This went into 2.4.18
parent
4c147101
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
drivers/char/n_tty.c
drivers/char/n_tty.c
+24
-1
No files found.
drivers/char/n_tty.c
View file @
03b1fb24
...
...
@@ -23,6 +23,11 @@
* 2000/01/20 Fixed SMP locking on put_tty_queue using bits of
* the patch by Andrew J. Kroll <ag784@freenet.buffalo.edu>
* who actually finally proved there really was a race.
*
* 2002/03/18 Implemented n_tty_wakeup to send SIGIO POLL_OUTs to
* waiting writing processes-Sapan Bhatia <sapan@corewars.org>.
* Also fixed a bug in BLOCKING mode where write_chan returns
* EAGAIN
*/
#include <linux/types.h>
...
...
@@ -707,6 +712,22 @@ static int n_tty_receive_room(struct tty_struct *tty)
return
0
;
}
/*
* Required for the ptys, serial driver etc. since processes
* that attach themselves to the master and rely on ASYNC
* IO must be woken up
*/
static
void
n_tty_write_wakeup
(
struct
tty_struct
*
tty
)
{
if
(
tty
->
fasync
)
{
set_bit
(
TTY_DO_WRITE_WAKEUP
,
&
tty
->
flags
);
kill_fasync
(
&
tty
->
fasync
,
SIGIO
,
POLL_OUT
);
}
return
;
}
static
void
n_tty_receive_buf
(
struct
tty_struct
*
tty
,
const
unsigned
char
*
cp
,
char
*
fp
,
int
count
)
{
...
...
@@ -1156,6 +1177,8 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file,
while
(
nr
>
0
)
{
ssize_t
num
=
opost_block
(
tty
,
b
,
nr
);
if
(
num
<
0
)
{
if
(
num
==
-
EAGAIN
)
break
;
retval
=
num
;
goto
break_out
;
}
...
...
@@ -1235,6 +1258,6 @@ struct tty_ldisc tty_ldisc_N_TTY = {
normal_poll
,
/* poll */
n_tty_receive_buf
,
/* receive_buf */
n_tty_receive_room
,
/* receive_room */
0
/* write_wakeup */
n_tty_write_wakeup
/* write_wakeup */
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment