xref: /openbsd-src/gnu/llvm/lldb/source/Host/android/LibcGlue.cpp (revision be691f3bb6417f04a68938fadbcaee2d5795e764)
1dda28197Spatrick //===-- LibcGlue.cpp ------------------------------------------------------===//
2061da546Spatrick //
3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information.
5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6061da546Spatrick //
7061da546Spatrick //===----------------------------------------------------------------------===//
8061da546Spatrick 
9061da546Spatrick // This files adds functions missing from libc on earlier versions of Android
10061da546Spatrick 
11061da546Spatrick #include <android/api-level.h>
12061da546Spatrick 
13061da546Spatrick #include <sys/syscall.h>
14061da546Spatrick 
15061da546Spatrick #if __ANDROID_API__ < 21
16061da546Spatrick 
17*be691f3bSpatrick #include <csignal>
18061da546Spatrick #include <fcntl.h>
19061da546Spatrick #include <sys/stat.h>
20061da546Spatrick #include <sys/types.h>
21061da546Spatrick 
22061da546Spatrick #include "lldb/Host/Time.h"
23061da546Spatrick 
timegm(struct tm * t)24061da546Spatrick time_t timegm(struct tm *t) { return (time_t)timegm64(t); }
25061da546Spatrick 
posix_openpt(int flags)26061da546Spatrick int posix_openpt(int flags) { return open("/dev/ptmx", flags); }
27061da546Spatrick 
28061da546Spatrick #endif
29