Qt 4.8
qfunctions_vxworks.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtCore module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
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 #if defined(_WRS_KERNEL)
56 #include <sys/times.h>
57 #else
58 #include <sys/time.h>
59 #endif
60 #include <sys/socket.h>
61 #include <sys/stat.h>
62 #include <sys/wait.h>
63 #include <netinet/in.h>
64 #ifndef QT_NO_IPV6IFNAME
65 #include <net/if.h>
66 #endif
67 
68 // VxWorks has public header mbuf.h which defines following variables for DKM.
69 // Let's undef those to because they overlap with Qt variable names-
70 // File mbuf.h is included in headers <netinet/in.h> <net/if.h>, so make sure
71 // that those are included before undef's.
72 #if defined(mbuf)
73 # undef mbuf
74 #endif
75 #if defined(m_data)
76 # undef m_data
77 #endif
78 #if defined(m_type)
79 # undef m_type
80 #endif
81 #if defined(m_next)
82 # undef m_next
83 #endif
84 #if defined(m_len)
85 # undef m_len
86 #endif
87 #if defined(m_flags)
88 # undef m_flags
89 #endif
90 #if defined(m_hdr)
91 # undef m_hdr
92 #endif
93 #if defined(m_ext)
94 # undef m_ext
95 #endif
96 #if defined(m_act)
97 # undef m_act
98 #endif
99 #if defined(m_nextpkt)
100 # undef m_nextpkt
101 #endif
102 #if defined(m_pkthdr)
103 # undef m_pkthdr
104 #endif
105 
108 
109 #ifdef QT_BUILD_CORE_LIB
110 QT_MODULE(Core)
111 #endif
112 
115 
116 
117 #ifndef RTLD_LOCAL
118 #define RTLD_LOCAL 0
119 #endif
120 
121 #ifndef NSIG
122 #define NSIG _NSIGS
123 #endif
124 
125 #ifdef __cplusplus
126 extern "C" {
127 #endif
128 
129 // isascii is missing (sometimes!!)
130 #ifndef isascii
131 inline int isascii(int c) { return (c & 0x7f); }
132 #endif
133 
134 // no lfind() - used by the TIF image format
135 void *lfind(const void* key, const void* base, size_t* elements, size_t size,
136  int (*compare)(const void*, const void*));
137 
138 // no rand_r(), but rand()
139 // NOTE: this implementation is wrong for multi threaded applications,
140 // but there is no way to get it right on VxWorks (in kernel mode)
141 int rand_r(unsigned int * /*seedp*/);
142 
143 // no usleep() support
144 int usleep(unsigned int);
145 
146 #if defined(VXWORKS_DKM) || defined(VXWORKS_RTP)
147 int gettimeofday(struct timeval *, void *);
148 #else
149 // gettimeofday() is declared, but is missing from the library.
150 // It IS however defined in the Curtis-Wright X11 libraries, so
151 // we have to make the symbol 'weak'
152 int gettimeofday(struct timeval *tv, void /*struct timezone*/ *) __attribute__((weak));
153 #endif
154 
155 // getpagesize() not available
156 int getpagesize();
157 
158 // symlinks are not supported (lstat is now just a call to stat - see qplatformdefs.h)
159 int symlink(const char *, const char *);
160 ssize_t readlink(const char *, char *, size_t);
161 
162 // there's no truncate(), but ftruncate() support...
163 int truncate(const char *path, off_t length);
164 
165 // VxWorks doesn't know about passwd & friends.
166 // in order to avoid patching the unix fs path everywhere
167 // we introduce some dummy functions that simulate a single
168 // 'root' user on the system.
169 
170 uid_t getuid();
171 gid_t getgid();
172 uid_t geteuid();
173 
174 struct passwd {
175  char *pw_name; /* user name */
176  char *pw_passwd; /* user password */
177  uid_t pw_uid; /* user ID */
178  gid_t pw_gid; /* group ID */
179  char *pw_gecos; /* real name */
180  char *pw_dir; /* home directory */
181  char *pw_shell; /* shell program */
182 };
183 
184 struct group {
185  char *gr_name; /* group name */
186  char *gr_passwd; /* group password */
187  gid_t gr_gid; /* group ID */
188  char **gr_mem; /* group members */
189 };
190 
191 struct passwd *getpwuid(uid_t uid);
192 struct group *getgrgid(gid_t gid);
193 
194 #ifdef __cplusplus
195 } // extern "C"
196 #endif
197 
198 #endif // Q_OS_VXWORKS
199 #endif // QFUNCTIONS_VXWORKS_H
unsigned char c[8]
Definition: qnumeric_p.h:62
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_MODULE(x)
Definition: qglobal.h:2783
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
static const uint base
Definition: qurl.cpp:268
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
static bool compare(const QVariant::Private *a, const QVariant::Private *b)
Compares a to b.
Definition: qvariant.cpp:383
int key
static const QTextHtmlElement elements[Html_NumElements]
#define QT_END_HEADER
Definition: qglobal.h:137