This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Retract the changes made at #9176 to Neil's and Ilya's module pods.
[perl5.git] / os2 / os2ish.h
CommitLineData
4633a7c4
LW
1#include <signal.h>
2
3/* HAS_IOCTL:
4 * This symbol, if defined, indicates that the ioctl() routine is
5 * available to set I/O characteristics
6 */
7#define HAS_IOCTL /**/
8
9/* HAS_UTIME:
10 * This symbol, if defined, indicates that the routine utime() is
11 * available to update the access and modification times of files.
12 */
13#define HAS_UTIME /**/
14
15#define HAS_KILL
16#define HAS_WAIT
4ea6d94f 17#define HAS_DLERROR
367f3c24 18#define HAS_WAITPID_RUNTIME (_emx_env & 0x200)
4ea6d94f 19
20/* USEMYBINMODE
21 * This symbol, if defined, indicates that the program should
16fe6d59 22 * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
4ea6d94f 23 * that a file is in "binary" mode -- that is, that no translation
24 * of bytes occurs on read or write operations.
25 */
26#undef USEMYBINMODE
27
61bb5906
CB
28/* Stat_t:
29 * This symbol holds the type used to declare buffers for information
30 * returned by stat(). It's usually just struct stat. It may be necessary
31 * to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
32 * information.
33 */
34#define Stat_t struct stat
35
4ea6d94f 36/* USE_STAT_RDEV:
37 * This symbol is defined if this system has a stat structure declaring
38 * st_rdev
39 */
40#define USE_STAT_RDEV /**/
41
42/* ACME_MESS:
43 * This symbol, if defined, indicates that error messages should be
44 * should be generated in a format that allows the use of the Acme
45 * GUI/editor's autofind feature.
46 */
47#undef ACME_MESS /**/
4633a7c4 48
44a8e56a 49/* ALTERNATE_SHEBANG:
50 * This symbol, if defined, contains a "magic" string which may be used
51 * as the first line of a Perl program designed to be executed directly
52 * by name, instead of the standard Unix #!. If ALTERNATE_SHEBANG
53 * begins with a character other then #, then Perl will only treat
54 * it as a command line if if finds the string "perl" in the first
55 * word; otherwise it's treated as the first line of code in the script.
56 * (IOW, Perl won't hand off to another interpreter via an alternate
57 * shebang sequence that might be legal Perl code.)
58 */
aa689395 59#define ALTERNATE_SHEBANG "extproc "
44a8e56a 60
4633a7c4
LW
61#ifndef SIGABRT
62# define SIGABRT SIGILL
63#endif
64#ifndef SIGILL
65# define SIGILL 6 /* blech */
66#endif
7766f137 67#define ABORT() kill(PerlProc_getpid(),SIGABRT);
4633a7c4 68
760ac839 69#define BIT_BUCKET "/dev/nul" /* Will this work? */
c07a80fd 70
202975e6
IZ
71/* Apparently TCPIPV4 defines may be included even with only IAK present */
72
73#if !defined(NO_TCPIPV4) && !defined(TCPIPV4)
74# define TCPIPV4
75# define TCPIPV4_FORCED /* Just in case */
76#endif
77
4a6a15c8
IZ
78#if defined(I_SYS_UN) && !defined(TCPIPV4)
79/* It is not working without TCPIPV4 defined. */
80# undef I_SYS_UN
81#endif
dd96f567
IZ
82
83#ifdef USE_THREADS
84
23da6c43
GS
85#define do_spawn(a) os2_do_spawn(aTHX_ (a))
86#define do_aspawn(a,b,c) os2_do_aspawn(aTHX_ (a),(b),(c))
87
dd96f567
IZ
88#define OS2_ERROR_ALREADY_POSTED 299 /* Avoid os2.h */
89
90extern int rc;
91
92#define MUTEX_INIT(m) \
93 STMT_START { \
94 int rc; \
95 if ((rc = _rmutex_create(m,0))) \
23da6c43 96 Perl_croak_nocontext("panic: MUTEX_INIT: rc=%i", rc); \
dd96f567
IZ
97 } STMT_END
98#define MUTEX_LOCK(m) \
99 STMT_START { \
100 int rc; \
101 if ((rc = _rmutex_request(m,_FMR_IGNINT))) \
23da6c43 102 Perl_croak_nocontext("panic: MUTEX_LOCK: rc=%i", rc); \
dd96f567
IZ
103 } STMT_END
104#define MUTEX_UNLOCK(m) \
105 STMT_START { \
106 int rc; \
107 if ((rc = _rmutex_release(m))) \
23da6c43 108 Perl_croak_nocontext("panic: MUTEX_UNLOCK: rc=%i", rc); \
dd96f567
IZ
109 } STMT_END
110#define MUTEX_DESTROY(m) \
111 STMT_START { \
112 int rc; \
113 if ((rc = _rmutex_close(m))) \
23da6c43 114 Perl_croak_nocontext("panic: MUTEX_DESTROY: rc=%i", rc); \
dd96f567
IZ
115 } STMT_END
116
117#define COND_INIT(c) \
118 STMT_START { \
119 int rc; \
120 if ((rc = DosCreateEventSem(NULL,c,0,0))) \
23da6c43 121 Perl_croak_nocontext("panic: COND_INIT: rc=%i", rc); \
dd96f567
IZ
122 } STMT_END
123#define COND_SIGNAL(c) \
124 STMT_START { \
125 int rc; \
23da6c43
GS
126 if ((rc = DosPostEventSem(*(c))) && rc != OS2_ERROR_ALREADY_POSTED)\
127 Perl_croak_nocontext("panic: COND_SIGNAL, rc=%ld", rc); \
dd96f567
IZ
128 } STMT_END
129#define COND_BROADCAST(c) \
130 STMT_START { \
131 int rc; \
132 if ((rc = DosPostEventSem(*(c))) && rc != OS2_ERROR_ALREADY_POSTED)\
23da6c43 133 Perl_croak_nocontext("panic: COND_BROADCAST, rc=%i", rc); \
dd96f567
IZ
134 } STMT_END
135/* #define COND_WAIT(c, m) \
136 STMT_START { \
137 if (WaitForSingleObject(*(c),INFINITE) == WAIT_FAILED) \
23da6c43 138 Perl_croak_nocontext("panic: COND_WAIT"); \
dd96f567
IZ
139 } STMT_END
140*/
141#define COND_WAIT(c, m) os2_cond_wait(c,m)
142
143#define COND_WAIT_win32(c, m) \
144 STMT_START { \
145 int rc; \
23da6c43
GS
146 if ((rc = SignalObjectAndWait(*(m),*(c),INFINITE,FALSE))) \
147 Perl_croak_nocontext("panic: COND_WAIT"); \
dd96f567
IZ
148 else \
149 MUTEX_LOCK(m); \
150 } STMT_END
151#define COND_DESTROY(c) \
152 STMT_START { \
153 int rc; \
154 if ((rc = DosCloseEventSem(*(c)))) \
23da6c43 155 Perl_croak_nocontext("panic: COND_DESTROY, rc=%i", rc); \
dd96f567 156 } STMT_END
6b88bc9c 157/*#define THR ((struct thread *) TlsGetValue(PL_thr_key))
dd96f567
IZ
158*/
159
90866323
IZ
160#ifdef USE_SLOW_THREAD_SPECIFIC
161# define pthread_getspecific(k) (*_threadstore())
162# define pthread_setspecific(k,v) (*_threadstore()=v,0)
163# define pthread_key_create(keyp,flag) (*keyp=_gettid(),0)
23da6c43 164#else /* USE_SLOW_THREAD_SPECIFIC */
90866323
IZ
165# define pthread_getspecific(k) (*(k))
166# define pthread_setspecific(k,v) (*(k)=(v),0)
23da6c43
GS
167# define pthread_key_create(keyp,flag) \
168 ( DosAllocThreadLocalMemory(1,(U32*)keyp) \
169 ? Perl_croak_nocontext("LocalMemory"),1 \
170 : 0 \
171 )
172#endif /* USE_SLOW_THREAD_SPECIFIC */
90866323 173#define pthread_key_delete(keyp)
dd96f567 174#define pthread_self() _gettid()
27139dc0 175#define YIELD DosSleep(0)
dd96f567
IZ
176
177#ifdef PTHREADS_INCLUDED /* For ./x2p stuff. */
178int pthread_join(pthread_t tid, void **status);
179int pthread_detach(pthread_t tid);
180int pthread_create(pthread_t *tid, const pthread_attr_t *attr,
181 void *(*start_routine)(void*), void *arg);
23da6c43 182#endif /* PTHREAD_INCLUDED */
dd96f567
IZ
183
184#define THREADS_ELSEWHERE
185
23da6c43
GS
186#else /* USE_THREADS */
187
188#define do_spawn(a) os2_do_spawn(a)
189#define do_aspawn(a,b,c) os2_do_aspawn((a),(b),(c))
190
191#endif /* USE_THREADS */
4a6a15c8 192
aa689395 193void Perl_OS2_init(char **);
194
195/* XXX This code hideously puts env inside: */
365eb7b5 196
ed344e4f
IZ
197#ifdef PERL_CORE
198# define PERL_SYS_INIT3(argcp, argvp, envp) STMT_START { \
199 _response(argcp, argvp); \
200 _wildcard(argcp, argvp); \
201 Perl_OS2_init(*envp); } STMT_END
aab1f907 202# define PERL_SYS_INIT(argcp, argvp) STMT_START { \
eacfb5f1 203 _response(argcp, argvp); \
c0c09dfd 204 _wildcard(argcp, argvp); \
ed344e4f
IZ
205 Perl_OS2_init(NULL); } STMT_END
206#else /* Compiling embedded Perl or Perl extension */
207# define PERL_SYS_INIT3(argcp, argvp, envp) STMT_START { \
208 Perl_OS2_init(*envp); } STMT_END
aab1f907 209# define PERL_SYS_INIT(argcp, argvp) STMT_START { \
ed344e4f
IZ
210 Perl_OS2_init(NULL); } STMT_END
211#endif
212
213#ifndef __EMX__
aab1f907
IZ
214# define PERL_CALLCONV _System
215#endif
ed344e4f 216
18f739ee 217#define PERL_SYS_TERM() MALLOC_TERM
365eb7b5 218
4ea6d94f 219/* #define PERL_SYS_TERM() STMT_START { \
220 if (Perl_HAB_set) WinTerminate(Perl_hab); } STMT_END */
221
8cc95fdb 222#define dXSUB_SYS OS2_XS_init()
eacfb5f1 223
4ea6d94f 224#ifdef PERL_IS_AOUT
4a6a15c8 225/* # define HAS_FORK */
760ac839
LW
226/* # define HIDEMYMALLOC */
227/* # define PERL_SBRK_VIA_MALLOC */ /* gets off-page sbrk... */
228#else /* !PERL_IS_AOUT */
229# ifndef PERL_FOR_X2P
4a6a15c8
IZ
230# ifdef EMX_BAD_SBRK
231# define USE_PERL_SBRK
232# endif
233# else
234# define PerlIO FILE
760ac839
LW
235# endif
236# define SYSTEM_ALLOC(a) sys_alloc(a)
237
238void *sys_alloc(int size);
239
240#endif /* !PERL_IS_AOUT */
4a6a15c8
IZ
241#if !defined(PERL_CORE) && !defined(PerlIO) /* a2p */
242# define PerlIO FILE
243#endif
4ea6d94f 244
23da6c43
GS
245/* os2ish is used from a2p/a2p.h without pTHX/pTHX_ first being
246 * defined. Hack around this to get us to compile.
247*/
248#ifdef PTHX_UNUSED
249# ifndef pTHX
250# define pTHX
251# endif
252# ifndef pTHX_
253# define pTHX_
254# endif
255#endif
256
c0c09dfd 257#define TMPPATH1 "plXXXXXX"
258extern char *tmppath;
23da6c43 259PerlIO *my_syspopen(pTHX_ char *cmd, char *mode);
4a6a15c8
IZ
260/* Cannot prototype with I32 at this point. */
261int my_syspclose(PerlIO *f);
55497cff 262FILE *my_tmpfile (void);
263char *my_tmpnam (char *);
5ba48348
JH
264int my_mkdir (__const__ char *, long);
265int my_rmdir (__const__ char *);
55497cff 266
bddf7535
GS
267#undef L_tmpnam
268#define L_tmpnam MAXPATHLEN
269
55497cff 270#define tmpfile my_tmpfile
271#define tmpnam my_tmpnam
3ed26a2c 272#define isatty _isterm
44a8e56a 273#define rand random
274#define srand srandom
e75931a7
YST
275#define strtoll _strtoll
276#define strtoull _strtoull
eacfb5f1 277
4633a7c4
LW
278/*
279 * fwrite1() should be a routine with the same calling sequence as fwrite(),
280 * but which outputs all of the bytes requested as a single stream (unlike
281 * fwrite() itself, which on some systems outputs several distinct records
282 * if the number_of_items parameter is >1).
283 */
284#define fwrite1 fwrite
285
286#define my_getenv(var) getenv(var)
367f3c24 287#define flock my_flock
5ba48348
JH
288#define rmdir my_rmdir
289#define mkdir my_mkdir
4633a7c4 290
df3ef7a9
IZ
291void *emx_calloc (size_t, size_t);
292void emx_free (void *);
293void *emx_malloc (size_t);
294void *emx_realloc (void *, size_t);
295
4633a7c4
LW
296/*****************************************************************************/
297
298#include <stdlib.h> /* before the following definitions */
299#include <unistd.h> /* before the following definitions */
300
301#define chdir _chdir2
302#define getcwd _getcwd2
303
304/* This guy is needed for quick stdstd */
305
306#if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE)
4633a7c4
LW
307 /* Perl uses ungetc only with successful return */
308# define ungetc(c,fp) \
309 (FILE_ptr(fp) > FILE_base(fp) && c == (int)*(FILE_ptr(fp) - 1) \
310 ? (--FILE_ptr(fp), ++FILE_cnt(fp), (int)c) : ungetc(c,fp))
311#endif
312
46e87256
YST
313/* ctermid is missing from emx0.9d */
314char *ctermid(char *s);
315
4633a7c4
LW
316#define OP_BINARY O_BINARY
317
318#define OS2_STAT_HACK 1
319#if OS2_STAT_HACK
320
321#define Stat(fname,bufptr) os2_stat((fname),(bufptr))
322#define Fstat(fd,bufptr) fstat((fd),(bufptr))
365eb7b5 323#define Fflush(fp) fflush(fp)
8cc95fdb 324#define Mkdir(path,mode) mkdir((path),(mode))
4633a7c4
LW
325
326#undef S_IFBLK
327#undef S_ISBLK
328#define S_IFBLK 0120000
329#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
330
331#else
332
333#define Stat(fname,bufptr) stat((fname),(bufptr))
334#define Fstat(fd,bufptr) fstat((fd),(bufptr))
365eb7b5 335#define Fflush(fp) fflush(fp)
8cc95fdb 336#define Mkdir(path,mode) mkdir((path),(mode))
4633a7c4
LW
337
338#endif
365eb7b5 339
44a8e56a 340/* With SD386 it is impossible to debug register variables. */
341#if !defined(PERL_IS_AOUT) && defined(DEBUGGING) && !defined(register)
342# define register
343#endif
344
365eb7b5 345/* Our private OS/2 specific data. */
346
347typedef struct OS2_Perl_data {
348 unsigned long flags;
349 unsigned long phab;
350 int (*xs_init)();
4ea6d94f 351 unsigned long rc;
352 unsigned long severity;
4bfbfac5
IZ
353 unsigned long phmq; /* Handle to message queue */
354 unsigned long phmq_refcnt;
355 unsigned long phmq_servers;
356 unsigned long initial_mode; /* VIO etc. mode we were started in */
365eb7b5 357} OS2_Perl_data_t;
358
359extern OS2_Perl_data_t OS2_Perl_data;
360
4ea6d94f 361#define Perl_hab ((HAB)OS2_Perl_data.phab)
362#define Perl_rc (OS2_Perl_data.rc)
363#define Perl_severity (OS2_Perl_data.severity)
364#define errno_isOS2 12345678
ed344e4f 365#define errno_isOS2_set 12345679
4ea6d94f 366#define OS2_Perl_flags (OS2_Perl_data.flags)
365eb7b5 367#define Perl_HAB_set_f 1
4ea6d94f 368#define Perl_HAB_set (OS2_Perl_flags & Perl_HAB_set_f)
369#define set_Perl_HAB_f (OS2_Perl_flags |= Perl_HAB_set_f)
370#define set_Perl_HAB(h) (set_Perl_HAB_f, Perl_hab = h)
4bfbfac5
IZ
371#define _obtain_Perl_HAB (init_PMWIN_entries(), \
372 Perl_hab = (*PMWIN_entries.Initialize)(0), \
373 set_Perl_HAB_f, Perl_hab)
374#define perl_hab_GET() (Perl_HAB_set ? Perl_hab : _obtain_Perl_HAB)
375#define Acquire_hab() perl_hab_GET()
376#define Perl_hmq ((HMQ)OS2_Perl_data.phmq)
377#define Perl_hmq_refcnt (OS2_Perl_data.phmq_refcnt)
378#define Perl_hmq_servers (OS2_Perl_data.phmq_servers)
379#define Perl_os2_initial_mode (OS2_Perl_data.initial_mode)
380
381unsigned long Perl_hab_GET();
382unsigned long Perl_Register_MQ(int serve);
383void Perl_Deregister_MQ(int serve);
384int Perl_Serve_Messages(int force);
385/* Cannot prototype with I32 at this point. */
386int Perl_Process_Messages(int force, long *cntp);
23da6c43 387char *os2_execname(pTHX);
4bfbfac5
IZ
388
389struct _QMSG;
390struct PMWIN_entries_t {
391 unsigned long (*Initialize)( unsigned long fsOptions );
392 unsigned long (*CreateMsgQueue)(unsigned long hab, long cmsg);
393 int (*DestroyMsgQueue)(unsigned long hmq);
394 int (*PeekMsg)(unsigned long hab, struct _QMSG *pqmsg,
395 unsigned long hwndFilter, unsigned long msgFilterFirst,
396 unsigned long msgFilterLast, unsigned long fl);
397 int (*GetMsg)(unsigned long hab, struct _QMSG *pqmsg,
398 unsigned long hwndFilter, unsigned long msgFilterFirst,
399 unsigned long msgFilterLast);
400 void * (*DispatchMsg)(unsigned long hab, struct _QMSG *pqmsg);
5ba48348
JH
401 unsigned long (*GetLastError)(unsigned long hab);
402 unsigned long (*CancelShutdown)(unsigned long hmq, unsigned long fCancelAlways);
4bfbfac5
IZ
403};
404extern struct PMWIN_entries_t PMWIN_entries;
405void init_PMWIN_entries(void);
406
ed344e4f
IZ
407#define perl_hmq_GET(serve) Perl_Register_MQ(serve)
408#define perl_hmq_UNSET(serve) Perl_Deregister_MQ(serve)
4bfbfac5 409
23da6c43 410#define OS2_XS_init() (*OS2_Perl_data.xs_init)(aTHX)
ed344e4f
IZ
411
412#if _EMX_CRT_REV_ >= 60
413# define os2_setsyserrno(rc) (Perl_rc = rc, errno = errno_isOS2_set, \
414 _setsyserrno(rc))
415#else
416# define os2_setsyserrno(rc) (Perl_rc = rc, errno = errno_isOS2)
417#endif
418
4ea6d94f 419/* The expressions below return true on error. */
4a6a15c8 420/* INCL_DOSERRORS needed. rc should be declared outside. */
4ea6d94f 421#define CheckOSError(expr) (!(rc = (expr)) ? 0 : (FillOSError(rc), 1))
422/* INCL_WINERRORS needed. */
423#define SaveWinError(expr) ((expr) ? : (FillWinError, 0))
424#define CheckWinError(expr) ((expr) ? 0: (FillWinError, 1))
ed344e4f 425#define FillOSError(rc) (os2_setsyserrno(rc), \
4ea6d94f 426 Perl_severity = SEVERITY_ERROR)
5ba48348
JH
427
428/* At this moment init_PMWIN_entries() should be a nop (WinInitialize should
429 be called already, right?), so we do not risk stepping over our own error */
430#define FillWinError ( init_PMWIN_entries(), \
431 Perl_rc=(*PMWIN_entries.GetLastError)(perl_hab_GET()),\
432 Perl_severity = ERRORIDSEV(Perl_rc), \
433 Perl_rc = ERRORIDERROR(Perl_rc), \
434 os2_setsyserrno(Perl_rc))
4ea6d94f 435
760ac839 436#define STATIC_FILE_LENGTH 127
ff68c719 437
760ac839
LW
438#define PERLLIB_MANGLE(s, n) perllib_mangle((s), (n))
439char *perllib_mangle(char *, unsigned int);
4ea6d94f 440
441char *os2error(int rc);
442
443/* ************************************************************ */
444#define Dos32QuerySysState DosQuerySysState
445#define QuerySysState(flags, pid, buf, bufsz) \
446 Dos32QuerySysState(flags, 0, pid, 0, buf, bufsz)
447
448#define QSS_PROCESS 1
df3ef7a9
IZ
449#define QSS_MODULE 4
450#define QSS_SEMAPHORES 2
4ea6d94f 451#define QSS_FILE 8 /* Buggy until fixpack18 */
452#define QSS_SHARED 16
453
ed344e4f 454#ifdef _OS2_H
4ea6d94f 455
456APIRET APIENTRY Dos32QuerySysState(ULONG func,ULONG arg1,ULONG pid,
457 ULONG _res_,PVOID buf,ULONG bufsz);
458typedef struct {
459 ULONG threadcnt;
460 ULONG proccnt;
461 ULONG modulecnt;
462} QGLOBAL, *PQGLOBAL;
463
464typedef struct {
465 ULONG rectype;
466 USHORT threadid;
467 USHORT slotid;
468 ULONG sleepid;
469 ULONG priority;
470 ULONG systime;
471 ULONG usertime;
472 UCHAR state;
473 UCHAR _reserved1_; /* padding to ULONG */
474 USHORT _reserved2_; /* padding to ULONG */
475} QTHREAD, *PQTHREAD;
476
477typedef struct {
478 USHORT sfn;
479 USHORT refcnt;
480 USHORT flags1;
481 USHORT flags2;
482 USHORT accmode1;
483 USHORT accmode2;
484 ULONG filesize;
485 USHORT volhnd;
486 USHORT attrib;
487 USHORT _reserved_;
488} QFDS, *PQFDS;
489
490typedef struct qfile {
491 ULONG rectype;
492 struct qfile *next;
493 ULONG opencnt;
494 PQFDS filedata;
495 char name[1];
496} QFILE, *PQFILE;
497
498typedef struct {
499 ULONG rectype;
500 PQTHREAD threads;
501 USHORT pid;
502 USHORT ppid;
503 ULONG type;
504 ULONG state;
505 ULONG sessid;
506 USHORT hndmod;
507 USHORT threadcnt;
508 ULONG privsem32cnt;
509 ULONG _reserved2_;
510 USHORT sem16cnt;
511 USHORT dllcnt;
512 USHORT shrmemcnt;
513 USHORT fdscnt;
514 PUSHORT sem16s;
515 PUSHORT dlls;
516 PUSHORT shrmems;
517 PUSHORT fds;
518} QPROCESS, *PQPROCESS;
519
520typedef struct sema {
521 struct sema *next;
522 USHORT refcnt;
523 UCHAR sysflags;
524 UCHAR sysproccnt;
525 ULONG _reserved1_;
526 USHORT index;
527 CHAR name[1];
528} QSEMA, *PQSEMA;
529
530typedef struct {
531 ULONG rectype;
532 ULONG _reserved1_;
533 USHORT _reserved2_;
534 USHORT syssemidx;
535 ULONG index;
536 QSEMA sema;
537} QSEMSTRUC, *PQSEMSTRUC;
538
539typedef struct {
540 USHORT pid;
541 USHORT opencnt;
542} QSEMOWNER32, *PQSEMOWNER32;
543
544typedef struct {
545 PQSEMOWNER32 own;
546 PCHAR name;
547 PVOID semrecs; /* array of associated sema's */
548 USHORT flags;
549 USHORT semreccnt;
550 USHORT waitcnt;
551 USHORT _reserved_; /* padding to ULONG */
552} QSEMSMUX32, *PQSEMSMUX32;
553
554typedef struct {
555 PQSEMOWNER32 own;
556 PCHAR name;
557 PQSEMSMUX32 mux;
558 USHORT flags;
559 USHORT postcnt;
560} QSEMEV32, *PQSEMEV32;
561
562typedef struct {
563 PQSEMOWNER32 own;
564 PCHAR name;
565 PQSEMSMUX32 mux;
566 USHORT flags;
567 USHORT refcnt;
568 USHORT thrdnum;
569 USHORT _reserved_; /* padding to ULONG */
570} QSEMMUX32, *PQSEMMUX32;
571
572typedef struct semstr32 {
573 struct semstr *next;
574 QSEMEV32 evsem;
575 QSEMMUX32 muxsem;
576 QSEMSMUX32 smuxsem;
577} QSEMSTRUC32, *PQSEMSTRUC32;
578
579typedef struct shrmem {
580 struct shrmem *next;
581 USHORT hndshr;
582 USHORT selshr;
583 USHORT refcnt;
584 CHAR name[1];
585} QSHRMEM, *PQSHRMEM;
586
587typedef struct module {
588 struct module *next;
589 USHORT hndmod;
590 USHORT type;
591 ULONG refcnt;
592 ULONG segcnt;
593 PVOID _reserved_;
594 PCHAR name;
595 USHORT modref[1];
596} QMODULE, *PQMODULE;
597
598typedef struct {
599 PQGLOBAL gbldata;
600 PQPROCESS procdata;
601 PQSEMSTRUC semadata;
602 PQSEMSTRUC32 sem32data;
603 PQSHRMEM shrmemdata;
604 PQMODULE moddata;
605 PVOID _reserved2_;
606 PQFILE filedata;
607} QTOPLEVEL, *PQTOPLEVEL;
608/* ************************************************************ */
609
610PQTOPLEVEL get_sysinfo(ULONG pid, ULONG flags);
611
ed344e4f 612#endif /* _OS2_H */
5ae7bdf7 613