summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/termios.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-01-18 11:54:20 +0000
committerkib <kib@FreeBSD.org>2015-01-18 11:54:20 +0000
commit7fe8fbec77343dc12cd90833d80eb7f721248bc7 (patch)
tree0e4ae5740dfb6ba34a4755307529abeee008c52c /lib/libc/gen/termios.c
parent5846d19730e47a408fae1ccea41b50ccb351b403 (diff)
downloadFreeBSD-src-7fe8fbec77343dc12cd90833d80eb7f721248bc7.zip
FreeBSD-src-7fe8fbec77343dc12cd90833d80eb7f721248bc7.tar.gz
Fix known issues which blow up the process after dlopen("libthr.so")
(or loading a dso linked to libthr.so into process which was not linked against threading library). MFC r276630: Remove interposing, fix malloc, reinstall signal handlers wrappers on libthr load. MFC r276681: Avoid calling internal libc function through PLT or accessing data though GOT. MFC r277032: Reduce the size of the interposing table and amount of cancellation-handling code in the libthr. MFC note: r276646 ("do not erronously export 'openat' symbol from rtld") is not applicable to stable/10 yet, since PATHFDS support was not merged.
Diffstat (limited to 'lib/libc/gen/termios.c')
-rw-r--r--lib/libc/gen/termios.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c
index 7e9f169..f8b7354 100644
--- a/lib/libc/gen/termios.c
+++ b/lib/libc/gen/termios.c
@@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "un-namespace.h"
+#include "libc_private.h"
+
int
tcgetattr(int fd, struct termios *t)
{
@@ -208,13 +210,23 @@ tcsendbreak(int fd, int len __unused)
}
int
-__tcdrain(int fd)
+__libc_tcdrain(int fd)
{
+
return (_ioctl(fd, TIOCDRAIN, 0));
}
-__weak_reference(__tcdrain, tcdrain);
-__weak_reference(__tcdrain, _tcdrain);
+#pragma weak tcdrain
+int
+tcdrain(int fd)
+{
+
+ return (((int (*)(int))
+ __libc_interposing[INTERPOS_tcdrain])(fd));
+}
+
+__weak_reference(__libc_tcdrain, __tcdrain);
+__weak_reference(__libc_tcdrain, _tcdrain);
int
tcflush(int fd, int which)
OpenPOWER on IntegriCloud