summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/android/LibcGlue.cpp
blob: 3842fb6c2a8ed53948233d59a9383d8d65b1d2e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//===-- LibcGlue.cpp --------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// This files adds functions missing from libc on earlier versions of Android

#include <android/api-level.h>

#include <sys/syscall.h>

#if __ANDROID_API__ < 21

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>

#include "lldb/Host/Time.h"

time_t timegm(struct tm* t)
{
    return (time_t) timegm64(t);
}

int signalfd (int fd, const sigset_t *mask, int flags)
{
    return syscall(__NR_signalfd4, fd, mask, _NSIG / 8, flags);
}

int posix_openpt(int flags)
{
    return open("/dev/ptmx", flags);
}

#endif
OpenPOWER on IntegriCloud