Resolve linker issues with Android API 21 (dprintf, tcdrain)

Signed-off-by: Chris Renshaw <osm0sis@outlook.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Chris Renshaw 2015-12-17 16:42:01 +01:00 committed by Denys Vlasenko
parent e0942acb9e
commit 6df961257d
2 changed files with 8 additions and 1 deletions

View File

@ -481,9 +481,14 @@ typedef unsigned smalluint;
#if defined(ANDROID) || defined(__ANDROID__) #if defined(ANDROID) || defined(__ANDROID__)
# if __ANDROID_API__ < 8 # if __ANDROID_API__ < 8
/* ANDROID < 8 has no [f]dprintf at all */
# undef HAVE_DPRINTF # undef HAVE_DPRINTF
# else # elif __ANDROID_API__ < 21
/* ANDROID < 21 has fdprintf */
# define dprintf fdprintf # define dprintf fdprintf
# else
/* ANDROID >= 21 has standard dprintf */
# endif
# endif # endif
# if __ANDROID_API__ < 21 # if __ANDROID_API__ < 21
# undef HAVE_TTYNAME_R # undef HAVE_TTYNAME_R

View File

@ -40,8 +40,10 @@ int pivot_root(const char *new_root, const char *put_old)
return syscall(__NR_pivot_root, new_root, put_old); return syscall(__NR_pivot_root, new_root, put_old);
} }
# if __ANDROID_API__ < 21
int tcdrain(int fd) int tcdrain(int fd)
{ {
return ioctl(fd, TCSBRK, 1); return ioctl(fd, TCSBRK, 1);
} }
# endif # endif
#endif