summary refs log tree commit diff
path: root/src/rt/rust_android_dummy.c
blob: c322dc6706f7211c70094c63e29668b93326fa5c (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef __ANDROID__

#include "rust_android_dummy.h"
#include <math.h>
#include <errno.h>

int backtrace(void **array, int size) { return 0; }

char **backtrace_symbols(void *const *array, int size) { return 0; }

void backtrace_symbols_fd (void *const *array, int size, int fd) {}

volatile int* __errno_location() {
    return &errno;
}

float log2f(float f)
{
    return logf( f ) / logf( 2 );
}

double log2( double n )
{
    return log( n ) / log( 2 );
}

double exp10( double x )
{
    return pow( 10, x );
}

void telldir()
{
}

void seekdir()
{
}

void mkfifo()
{
}

void abs()
{
}

void labs()
{
}

void rand()
{
}

void srand()
{
}

void atof()
{
}

int glob(const char *pattern,
                    int flags,
                    int (*errfunc) (const char *epath, int eerrno),
                    glob_t *pglob)
{
    return 0;
}

void globfree(glob_t *pglob)
{
}

int pthread_atfork(void (*prefork)(void),
                              void (*postfork_parent)(void),
                              void (*postfork_child)(void))
{
    return 0;
}

int mlockall(int flags)
{
    return 0;
}

int munlockall(void)
{
    return 0;
}

int shm_open(const char *name, int oflag, mode_t mode)
{
    return 0;
}

int shm_unlink(const char *name)
{
    return 0;
}

int posix_madvise(void *addr, size_t len, int advice)
{
    return 0;
}

#endif