[PATCH 2/2] Bionic lacks tcdrain; provide a workaround

Matt Whitlock busybox at mattwhitlock.name
Fri Apr 24 19:32:34 UTC 2015


---
 libbb/missing_syscalls.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libbb/missing_syscalls.c b/libbb/missing_syscalls.c
index e57c2de..0de3df9 100644
--- a/libbb/missing_syscalls.c
+++ b/libbb/missing_syscalls.c
@@ -40,6 +40,11 @@ int pivot_root(const char *new_root, const char *put_old)
 	return syscall(__NR_pivot_root, new_root, put_old);
 }
 
+int tcdrain(int fd)
+{
+	return ioctl(fd, TCSBRK, 1);
+}
+
 int ttyname_r(int fd, char *buf, size_t buflen) {
 	int r;
 	char path[32];
-- 
2.0.5



More information about the busybox mailing list