aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2007-07-16 02:39:43 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:41 -0400
commit9c1729db3e6d738f872bcb090212af00473bf666 (patch)
treebe68b99784607953fb50d9330d34c2728215be57 /include/linux/tty.h
parentc9c64155f5a81b4b41e98f9fb9c464a565c1bf72 (diff)
Prevent an O_NDELAY writer from blocking when a tty write is blocked by the tty atomic writer mutex
Without this a tty write could block if a previous blocking tty write was in progress on the same tty and blocked by a line discipline or hardware event. Originally found and reported by Dave Johnson. Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Dave Johnson <djohnson+linux-kernel@sw.starentnetworks.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index bb4576085203..deaba9ec5004 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -338,6 +338,12 @@ extern struct tty_struct *get_current_tty(void);
338 338
339extern struct mutex tty_mutex; 339extern struct mutex tty_mutex;
340 340
341extern void tty_write_unlock(struct tty_struct *tty);
342extern int tty_write_lock(struct tty_struct *tty, int ndelay);
343#define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock))
344
345
346
341/* n_tty.c */ 347/* n_tty.c */
342extern struct tty_ldisc tty_ldisc_N_TTY; 348extern struct tty_ldisc tty_ldisc_N_TTY;
343 349