author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Fri, 16 Apr 2010 11:39:52 +0300 | |
branch | RCL_3 |
changeset 9 | 740e5562c97f |
parent 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 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 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QFUNCTIONS_VXWORKS_H |
|
43 |
#define QFUNCTIONS_VXWORKS_H |
|
44 |
#ifdef Q_OS_VXWORKS |
|
45 |
||
46 |
#include <unistd.h> |
|
47 |
#include <pthread.h> |
|
48 |
#include <dirent.h> |
|
49 |
#include <signal.h> |
|
50 |
#include <string.h> |
|
51 |
#include <strings.h> |
|
52 |
#include <errno.h> |
|
53 |
#include <sys/types.h> |
|
54 |
#include <sys/ioctl.h> |
|
55 |
#include <sys/times.h> |
|
56 |
#include <sys/socket.h> |
|
57 |
#include <sys/stat.h> |
|
58 |
#include <sys/wait.h> |
|
59 |
#include <netinet/in.h> |
|
60 |
#ifndef QT_NO_IPV6IFNAME |
|
61 |
#include <net/if.h> |
|
62 |
#endif |
|
63 |
||
64 |
QT_BEGIN_HEADER |
|
65 |
QT_BEGIN_NAMESPACE |
|
66 |
||
67 |
#ifdef QT_BUILD_CORE_LIB |
|
68 |
QT_MODULE(Core) |
|
69 |
#endif |
|
70 |
||
71 |
QT_END_NAMESPACE |
|
72 |
QT_END_HEADER |
|
73 |
||
74 |
||
75 |
#ifndef RTLD_LOCAL |
|
76 |
#define RTLD_LOCAL 0 |
|
77 |
#endif |
|
78 |
||
79 |
#ifndef NSIG |
|
80 |
#define NSIG _NSIGS |
|
81 |
#endif |
|
82 |
||
83 |
#ifdef __cplusplus |
|
84 |
extern "C" { |
|
85 |
#endif |
|
86 |
||
87 |
// isascii is missing (sometimes!!) |
|
88 |
#ifndef isascii |
|
89 |
inline int isascii(int c) { return (c & 0x7f); } |
|
90 |
#endif |
|
91 |
||
92 |
// no lfind() - used by the TIF image format |
|
93 |
void *lfind(const void* key, const void* base, size_t* elements, size_t size, |
|
94 |
int (*compare)(const void*, const void*)); |
|
95 |
||
96 |
// no rand_r(), but rand() |
|
97 |
// NOTE: this implementation is wrong for multi threaded applications, |
|
98 |
// but there is no way to get it right on VxWorks (in kernel mode) |
|
99 |
int rand_r(unsigned int * /*seedp*/); |
|
100 |
||
101 |
// no usleep() support |
|
102 |
int usleep(unsigned int); |
|
103 |
||
104 |
// gettimeofday() is declared, but is missing from the library. |
|
105 |
// It IS however defined in the Curtis-Wright X11 libraries, so |
|
106 |
// we have to make the symbol 'weak' |
|
107 |
int gettimeofday(struct timeval *tv, void /*struct timezone*/ *) __attribute__((weak)); |
|
108 |
||
109 |
// neither getpagesize() or sysconf(_SC_PAGESIZE) are available |
|
110 |
int getpagesize(); |
|
111 |
||
112 |
// symlinks are not supported (lstat is now just a call to stat - see qplatformdefs.h) |
|
113 |
int symlink(const char *, const char *); |
|
114 |
ssize_t readlink(const char *, char *, size_t); |
|
115 |
||
116 |
// there's no truncate(), but ftruncate() support... |
|
117 |
int truncate(const char *path, off_t length); |
|
118 |
||
119 |
// VxWorks doesn't know about passwd & friends. |
|
120 |
// in order to avoid patching the unix fs path everywhere |
|
121 |
// we introduce some dummy functions that simulate a single |
|
122 |
// 'root' user on the system. |
|
123 |
||
124 |
uid_t getuid(); |
|
125 |
gid_t getgid(); |
|
126 |
uid_t geteuid(); |
|
127 |
||
128 |
struct passwd { |
|
129 |
char *pw_name; /* user name */ |
|
130 |
char *pw_passwd; /* user password */ |
|
131 |
uid_t pw_uid; /* user ID */ |
|
132 |
gid_t pw_gid; /* group ID */ |
|
133 |
char *pw_gecos; /* real name */ |
|
134 |
char *pw_dir; /* home directory */ |
|
135 |
char *pw_shell; /* shell program */ |
|
136 |
}; |
|
137 |
||
138 |
struct group { |
|
139 |
char *gr_name; /* group name */ |
|
140 |
char *gr_passwd; /* group password */ |
|
141 |
gid_t gr_gid; /* group ID */ |
|
142 |
char **gr_mem; /* group members */ |
|
143 |
}; |
|
144 |
||
145 |
struct passwd *getpwuid(uid_t uid); |
|
146 |
struct group *getgrgid(gid_t gid); |
|
147 |
||
148 |
#ifdef __cplusplus |
|
149 |
} // extern "C" |
|
150 |
#endif |
|
151 |
||
152 |
#endif // Q_OS_VXWORKS |
|
153 |
#endif // QFUNCTIONS_VXWORKS_H |