1
/****************************************************************************
2
**
3
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4
** All rights reserved.
5
** Contact: Nokia Corporation (qt-info@nokia.com)
6
**
7
** This file is part of the QtCore module of the Qt Toolkit.
8
**
9
** $QT_BEGIN_LICENSE:LGPL$
10
** GNU Lesser General Public License Usage
11
** This file may be used under the terms of the GNU Lesser General Public
12
** License version 2.1 as published by the Free Software Foundation and
13
** appearing in the file LICENSE.LGPL included in the packaging of this
14
** file. Please review the following information to ensure the GNU Lesser
15
** General Public License version 2.1 requirements will be met:
16
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17
**
18
** In addition, as a special exception, Nokia gives you certain additional
19
** rights. These rights are described in the Nokia Qt LGPL Exception
20
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21
**
22
** GNU General Public License Usage
23
** Alternatively, this file may be used under the terms of the GNU General
24
** Public License version 3.0 as published by the Free Software Foundation
25
** and appearing in the file LICENSE.GPL included in the packaging of this
26
** file. Please review the following information to ensure the GNU General
27
** Public License version 3.0 requirements will be met:
28
** http://www.gnu.org/copyleft/gpl.html.
29
**
30
** Other Usage
31
** Alternatively, this file may be used in accordance with the terms and
32
** conditions contained in a signed written agreement between you and Nokia.
33
**
34
**
35
**
36
**
37
**
38
** $QT_END_LICENSE$
39
**
40
****************************************************************************/
41
42
#include "qfunctions_nacl.h"
43
#include <pthread.h>
44
#include <qglobal.h>
45
46
/*
47
    The purpose of this file is to stub out certain functions
48
    that are not provided by the Native Client SDK. This is
49
    done as an alterative to sprinkling the Qt sources with
50
    NACL ifdefs.
51
52
    There are two main classes of functions:
53
54
    - Functions that are called but can have no effect:
55
    For these we simply give an empty implementation
56
57
    - Functions that are referenced in the source code, but
58
    is not/must not be called at run-time:
59
    These we either leave undefined or implement with a
60
    qFatal.
61
62
    This is a work in progress.
63
*/
64
65
extern "C" {
66
67
void pthread_cleanup_push(void (*)(void *), void *)
68
{
69
70
}
71
72
void pthread_cleanup_pop(int)
73
{
74
75
}
76
77
int pthread_setcancelstate(int, int *)
78
{
79
    return 0;
80
}
81
82
int pthread_setcanceltype(int, int *)
83
{
84
    return 0;
85
}
86
87
void pthread_testcancel(void)
88
{
89
90
}
91
92
93
int pthread_cancel(pthread_t)
94
{
95
    return 0;
96
}
97
98
int pthread_attr_setinheritsched(pthread_attr_t *,int)
99
{
100
    return 0;
101
}
102
103
104
int pthread_attr_getinheritsched(const pthread_attr_t *, int *)
105
{
106
    return 0;
107
}
108
109
// event dispatcher, select
110
//struct fd_set;
111
//struct timeval;
112
113
int fcntl(int, int, ...)
114
{
115
    return 0;
116
}
117
118
int sigaction(int, const struct sigaction *, struct sigaction *)
119
{
120
    return 0;
121
}
122
123
int open(const char *, int, ...)
124
{
125
    return 0;
126
}
127
128
int open64(const char *, int, ...)
129
{
130
    return 0;
131
}
132
133
int access(const char *, int)
134
{
135
    return 0;
136
}
137
138
typedef long off64_t;
139
off64_t ftello64(void *)
140
{
141
    qFatal("ftello64 called");
142
    return 0;
143
}
144
145
off64_t lseek64(int, off_t, int)
146
{
147
    qFatal("lseek64 called");
148
    return 0;
149
}
150
151
} // Extern C
152
153
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
154
{
155
    return 0;
156
}