summaryrefslogtreecommitdiff
path: root/qmake/include/private/qsharedmemory_p.h
Unidiff
Diffstat (limited to 'qmake/include/private/qsharedmemory_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/private/qsharedmemory_p.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/qmake/include/private/qsharedmemory_p.h b/qmake/include/private/qsharedmemory_p.h
new file mode 100644
index 0000000..4a8339d
--- a/dev/null
+++ b/qmake/include/private/qsharedmemory_p.h
@@ -0,0 +1,84 @@
1/****************************************************************************
2** $Id$
3**
4** Includes system files for shared memory
5**
6** Created : 020124
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file.
16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software.
20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27**
28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you.
30**
31**********************************************************************/
32
33//
34// W A R N I N G
35// -------------
36//
37// This file is not part of the Qt API. It exists for the convenience
38// of qapplication_qws.cpp and qgfxvnc_qws.cpp. This header file may
39// change from version to version without notice, or even be removed.
40//
41//
42
43#if !defined(QT_QSHM_H)
44#define QT_QSHM_H
45
46#include <qstring.h>
47
48#if !defined (QT_QWS_NO_SHM)
49
50#include <sys/types.h>
51#include <sys/ipc.h>
52
53class QSharedMemory {
54public:
55 QSharedMemory(){};
56 QSharedMemory(int, QString, char c = 'Q');
57 ~QSharedMemory(){};
58
59 bool create();
60 void destroy();
61
62 bool attach();
63 void detach();
64
65 void setPermissions(mode_t mode);
66 int size();
67 void * base() { return shmBase; };
68
69private:
70 void *shmBase;
71 int shmSize;
72 QString shmFile;
73 char character;
74#if defined(QT_POSIX_QSHM)
75 int shmFD;
76#else
77 int shmId;
78 key_t key;
79 int idInitted;
80#endif
81};
82
83#endif
84#endif