VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h@ 101971

Last change on this file since 101971 was 101971, checked in by vboxsync, 13 months ago

libs/xpcom: Get rid of the now unused PR_Atomic* API, bugref:10545 [fix]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.1 KB
Line 
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is the Netscape Portable Runtime (NSPR).
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38#ifndef primpl_h___
39#define primpl_h___
40
41/*
42 * HP-UX 10.10's pthread.h (DCE threads) includes dce/cma.h, which
43 * has:
44 * #define sigaction _sigaction_sys
45 * This macro causes chaos if signal.h gets included before pthread.h.
46 * To be safe, we include pthread.h first.
47 */
48
49#include <pthread.h>
50
51#include "nspr.h"
52#include "prpriv.h"
53
54typedef struct PRSegment PRSegment;
55
56#include "md/prosdep.h"
57
58#ifdef _PR_HAVE_POSIX_SEMAPHORES
59#include <semaphore.h>
60#elif defined(_PR_HAVE_SYSV_SEMAPHORES)
61#include <sys/sem.h>
62#endif
63
64/*************************************************************************
65***** A Word about Model Dependent Function Naming Convention ***********
66*************************************************************************/
67
68/*
69NSPR 2.0 must implement its function across a range of platforms
70including: MAC, Windows/16, Windows/95, Windows/NT, and several
71variants of Unix. Each implementation shares common code as well
72as having platform dependent portions. This standard describes how
73the model dependent portions are to be implemented.
74
75In header file pr/include/primpl.h, each publicly declared
76platform dependent function is declared as:
77
78NSPR_API void _PR_MD_FUNCTION( long arg1, long arg2 );
79#define _PR_MD_FUNCTION _MD_FUNCTION
80
81In header file pr/include/md/<platform>/_<platform>.h,
82each #define'd macro is redefined as one of:
83
84#define _MD_FUNCTION <blanks>
85#define _MD_FUNCTION <expanded macro>
86#define _MD_FUNCTION <osFunction>
87#define _MD_FUNCTION <_MD_Function>
88
89Where:
90
91<blanks> is no definition at all. In this case, the function is not implemented
92and is never called for this platform.
93For example:
94#define _MD_INIT_CPUS()
95
96<expanded macro> is a C language macro expansion.
97For example:
98#define _MD_CLEAN_THREAD(_thread) \
99 PR_BEGIN_MACRO \
100 PR_DestroyCondVar(_thread->md.asyncIOCVar); \
101 PR_DestroyLock(_thread->md.asyncIOLock); \
102 PR_END_MACRO
103
104<osFunction> is some function implemented by the host operating system.
105For example:
106#define _MD_EXIT exit
107
108<_MD_function> is the name of a function implemented for this platform in
109pr/src/md/<platform>/<soruce>.c file.
110For example:
111#define _MD_GETFILEINFO _MD_GetFileInfo
112
113In <source>.c, the implementation is:
114PR_IMPLEMENT(PRInt32) _MD_GetFileInfo(const char *fn, PRFileInfo *info);
115*/
116
117#ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
118#define PT_FPrintStats VBoxNsprPT_FPrintStats
119#endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
120
121PR_BEGIN_EXTERN_C
122
123typedef struct _MDLock _MDLock;
124typedef struct _MDCVar _MDCVar;
125typedef struct _MDSegment _MDSegment;
126typedef struct _MDThread _MDThread;
127typedef struct _MDThreadStack _MDThreadStack;
128typedef struct _MDSemaphore _MDSemaphore;
129typedef struct _MDDir _MDDir;
130typedef struct _MDFileDesc _MDFileDesc;
131typedef struct _MDProcess _MDProcess;
132typedef struct _MDFileMap _MDFileMap;
133
134/*
135** The following definitions are unique to implementing NSPR using pthreads.
136** Since pthreads defines most of the thread and thread synchronization
137** stuff, this is a pretty small set.
138*/
139
140#define PT_CV_NOTIFIED_LENGTH 6
141typedef struct _PT_Notified _PT_Notified;
142struct _PT_Notified
143{
144 PRIntn length; /* # of used entries in this structure */
145 struct
146 {
147 PRCondVar *cv; /* the condition variable notified */
148 PRIntn times; /* and the number of times notified */
149 } cv[PT_CV_NOTIFIED_LENGTH];
150 _PT_Notified *link; /* link to another of these | NULL */
151};
152
153/*
154 * bits defined for pthreads 'state' field
155 */
156#define PT_THREAD_DETACHED 0x01 /* thread can't be joined */
157#define PT_THREAD_GLOBAL 0x02 /* a global thread (unlikely) */
158#define PT_THREAD_SYSTEM 0x04 /* system (not user) thread */
159#define PT_THREAD_PRIMORD 0x08 /* this is the primordial thread */
160#define PT_THREAD_ABORTED 0x10 /* thread has been interrupted */
161#define PT_THREAD_GCABLE 0x20 /* thread is garbage collectible */
162#define PT_THREAD_SUSPENDED 0x40 /* thread has been suspended */
163#define PT_THREAD_FOREIGN 0x80 /* thread is not one of ours */
164#define PT_THREAD_BOUND 0x100 /* a bound-global thread */
165
166#define _PT_THREAD_INTERRUPTED(thr) \
167 (!(thr->interrupt_blocked) && (thr->state & PT_THREAD_ABORTED))
168#define _PT_THREAD_BLOCK_INTERRUPT(thr) \
169 (thr->interrupt_blocked = 1)
170#define _PT_THREAD_UNBLOCK_INTERRUPT(thr) \
171 (thr->interrupt_blocked = 0)
172
173#define _PT_IS_GCABLE_THREAD(thr) ((thr)->state & PT_THREAD_GCABLE)
174
175/*
176** Possible values for thread's suspend field
177** Note that the first two can be the same as they are really mutually exclusive,
178** i.e. both cannot be happening at the same time. We have two symbolic names
179** just as a mnemonic.
180**/
181#define PT_THREAD_RESUMED 0x80 /* thread has been resumed */
182#define PT_THREAD_SETGCABLE 0x100 /* set the GCAble flag */
183
184#if defined(DEBUG)
185
186typedef struct PTDebug
187{
188 PRTime timeStarted;
189 PRUintn locks_created, locks_destroyed;
190 PRUintn locks_acquired, locks_released;
191 PRUintn cvars_created, cvars_destroyed;
192 PRUintn cvars_notified, delayed_cv_deletes;
193} PTDebug;
194
195#endif /* defined(DEBUG) */
196
197NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg);
198
199/************************************************************************/
200/*************************************************************************
201** The remainder of the definitions are shared by pthreads and the classic
202** NSPR code. These too may be conditionalized.
203*************************************************************************/
204/************************************************************************/
205
206extern PROffset32 _PR_MD_LSEEK(PRFileDesc *fd, PROffset32 offset, PRSeekWhence whence);
207#define _PR_MD_LSEEK _MD_LSEEK
208
209extern PROffset64 _PR_MD_LSEEK64(PRFileDesc *fd, PROffset64 offset, PRSeekWhence whence);
210#define _PR_MD_LSEEK64 _MD_LSEEK64
211
212extern PRInt32 _PR_MD_GETFILEINFO(const char *fn, PRFileInfo *info);
213#define _PR_MD_GETFILEINFO _MD_GETFILEINFO
214
215extern PRInt32 _PR_MD_GETFILEINFO64(const char *fn, PRFileInfo64 *info);
216#define _PR_MD_GETFILEINFO64 _MD_GETFILEINFO64
217
218extern PRInt32 _PR_MD_GETOPENFILEINFO(const PRFileDesc *fd, PRFileInfo *info);
219#define _PR_MD_GETOPENFILEINFO _MD_GETOPENFILEINFO
220
221extern PRInt32 _PR_MD_GETOPENFILEINFO64(const PRFileDesc *fd, PRFileInfo64 *info);
222#define _PR_MD_GETOPENFILEINFO64 _MD_GETOPENFILEINFO64
223
224
225/*
226 * These flags are used by NSPR temporarily in the poll
227 * descriptor's out_flags field to record the mapping of
228 * NSPR's poll flags to the system poll flags.
229 *
230 * If _PR_POLL_READ_SYS_WRITE bit is set, it means the
231 * PR_POLL_READ flag specified by the topmost layer is
232 * mapped to the WRITE flag at the system layer. Similarly
233 * for the other three _PR_POLL_XXX_SYS_YYY flags. It is
234 * assumed that the PR_POLL_EXCEPT flag doesn't get mapped
235 * to other flags.
236 */
237#define _PR_POLL_READ_SYS_READ 0x1
238#define _PR_POLL_READ_SYS_WRITE 0x2
239#define _PR_POLL_WRITE_SYS_READ 0x4
240#define _PR_POLL_WRITE_SYS_WRITE 0x8
241
242/*
243** These methods are coerced into file descriptor methods table
244** when the intended service is inappropriate for the particular
245** type of file descriptor.
246*/
247extern PRIntn _PR_InvalidInt(void);
248extern PRInt16 _PR_InvalidInt16(void);
249extern PRInt64 _PR_InvalidInt64(void);
250extern PRStatus _PR_InvalidStatus(void);
251extern PRFileDesc *_PR_InvalidDesc(void);
252
253extern PRIOMethods _pr_faulty_methods;
254
255/*
256** The PR_NETADDR_SIZE macro can only be called on a PRNetAddr union
257** whose 'family' field is set. It returns the size of the union
258** member corresponding to the specified address family.
259*/
260
261extern PRUintn _PR_NetAddrSize(const PRNetAddr* addr);
262
263#if defined(_PR_INET6)
264
265#define PR_NETADDR_SIZE(_addr) _PR_NetAddrSize(_addr)
266
267#elif defined(_PR_HAVE_MD_SOCKADDR_IN6)
268
269/*
270** Under the following conditions:
271** 1. _PR_INET6 is not defined;
272** 2. _PR_INET6_PROBE is defined;
273** 3. struct sockaddr_in6 has nonstandard fields at the end
274** (e.g., on Solaris 8),
275** (_addr)->ipv6 is smaller than struct sockaddr_in6, and
276** hence we can't pass sizeof((_addr)->ipv6) to socket
277** functions such as connect because they would fail with
278** EINVAL.
279**
280** To pass the correct socket address length to socket
281** functions, define the macro _PR_HAVE_MD_SOCKADDR_IN6 and
282** define struct _md_sockaddr_in6 to be isomorphic to
283** struct sockaddr_in6.
284*/
285
286#if defined(XP_UNIX) || defined(XP_OS2_EMX)
287#define PR_NETADDR_SIZE(_addr) \
288 ((_addr)->raw.family == PR_AF_INET \
289 ? sizeof((_addr)->inet) \
290 : ((_addr)->raw.family == PR_AF_INET6 \
291 ? sizeof(struct _md_sockaddr_in6) \
292 : sizeof((_addr)->local)))
293#else
294#define PR_NETADDR_SIZE(_addr) \
295 ((_addr)->raw.family == PR_AF_INET \
296 ? sizeof((_addr)->inet) \
297 : sizeof(struct _md_sockaddr_in6)
298#endif /* defined(XP_UNIX) */
299
300#else
301
302#if defined(XP_UNIX) || defined(XP_OS2_EMX)
303#define PR_NETADDR_SIZE(_addr) \
304 ((_addr)->raw.family == PR_AF_INET \
305 ? sizeof((_addr)->inet) \
306 : ((_addr)->raw.family == PR_AF_INET6 \
307 ? sizeof((_addr)->ipv6) \
308 : sizeof((_addr)->local)))
309#else
310#define PR_NETADDR_SIZE(_addr) \
311 ((_addr)->raw.family == PR_AF_INET \
312 ? sizeof((_addr)->inet) \
313 : sizeof((_addr)->ipv6))
314#endif /* defined(XP_UNIX) */
315
316#endif /* defined(_PR_INET6) */
317
318extern PRStatus _PR_MapOptionName(
319 PRSockOption optname, PRInt32 *level, PRInt32 *name);
320extern void _PR_InitThreads(
321 PRThreadType type, PRThreadPriority priority, PRUintn maxPTDs);
322
323struct PRLock {
324 pthread_mutex_t mutex; /* the underlying lock */
325 _PT_Notified notified; /* array of conditions notified */
326 PRBool locked; /* whether the mutex is locked */
327 pthread_t owner; /* if locked, current lock owner */
328};
329
330extern void _PR_InitLocks(void);
331
332struct PRCondVar {
333 PRLock *lock; /* associated lock that protects the condition */
334 pthread_cond_t cv; /* underlying pthreads condition */
335 volatile uint32_t notify_pending; /* CV has destroy pending notification */
336};
337
338/************************************************************************/
339
340struct PRMonitor {
341 const char* name; /* monitor name for debugging */
342 PRLock lock; /* the lock structure */
343 pthread_t owner; /* the owner of the lock or invalid */
344 PRCondVar *cvar; /* condition variable queue */
345 PRUint32 entryCount; /* # of times re-entered */
346};
347
348/************************************************************************/
349
350struct PRSemaphore {
351 PRCondVar *cvar; /* associated lock and condition variable queue */
352 PRUintn count; /* the value of the counting semaphore */
353 PRUint32 waiters; /* threads waiting on the semaphore */
354};
355
356NSPR_API(void) _PR_InitSem(void);
357
358/*************************************************************************/
359
360struct PRSem {
361#ifdef _PR_HAVE_POSIX_SEMAPHORES
362 sem_t *sem;
363#elif defined(_PR_HAVE_SYSV_SEMAPHORES)
364 int semid;
365#elif defined(WIN32)
366 HANDLE sem;
367#else
368 PRInt8 notused;
369#endif
370};
371
372/************************************************************************/
373
374typedef void (PR_CALLBACK *_PRStartFn)(void *);
375
376struct PRThread {
377 PRUint32 state; /* thread's creation state */
378 PRThreadPriority priority; /* apparent priority, loosly defined */
379
380 void *arg; /* argument to the client's entry point */
381 _PRStartFn startFunc; /* the root of the client's thread */
382
383 void *environment; /* pointer to execution environment */
384
385 /*
386 ** Per thread private data
387 */
388 PRUint32 tpdLength; /* thread's current vector length */
389 void **privateData; /* private data vector or NULL */
390 PRErrorCode errorCode; /* current NSPR error code | zero */
391 PRInt32 osErrorCode; /* mapping of errorCode | zero */
392 PRIntn errorStringLength; /* textLength from last call to PR_SetErrorText() */
393 PRInt32 errorStringSize; /* malloc()'d size of buffer | zero */
394 char *errorString; /* current error string | NULL */
395
396 pthread_t id; /* pthread identifier for the thread */
397 PRBool okToDelete; /* ok to delete the PRThread struct? */
398 PRCondVar *waiting; /* where the thread is waiting | NULL */
399 void *sp; /* recorded sp for garbage collection */
400 PRThread *next, *prev; /* simple linked list of all threads */
401 PRUint32 suspend; /* used to store suspend and resume flags */
402#ifdef PT_NO_SIGTIMEDWAIT
403 pthread_mutex_t suspendResumeMutex;
404 pthread_cond_t suspendResumeCV;
405#endif
406 PRUint32 interrupt_blocked; /* interrupt blocked */
407 struct pollfd *syspoll_list; /* Unix polling list used by PR_Poll */
408 PRUint32 syspoll_count; /* number of elements in syspoll_list */
409};
410
411struct PRProcessAttr {
412 PRFileDesc *stdinFd;
413 PRFileDesc *stdoutFd;
414 PRFileDesc *stderrFd;
415 char *currentDirectory;
416 char *fdInheritBuffer;
417 PRSize fdInheritBufferSize;
418 PRSize fdInheritBufferUsed;
419};
420
421struct PRProcess {
422 _MDProcess md;
423};
424
425/************************************************************************/
426
427/*
428** File descriptors of the NSPR layer can be in one of the
429** following states (stored in the 'state' field of struct
430** PRFilePrivate):
431** - _PR_FILEDESC_OPEN: The OS fd is open.
432** - _PR_FILEDESC_CLOSED: The OS fd is closed. The PRFileDesc
433** is still open but is unusable. The only operation allowed
434** on the PRFileDesc is PR_Close().
435** - _PR_FILEDESC_FREED: The OS fd is closed and the PRFileDesc
436** structure is freed.
437*/
438
439#define _PR_FILEDESC_OPEN 0xaaaaaaaa /* 1010101... */
440#define _PR_FILEDESC_CLOSED 0x55555555 /* 0101010... */
441#define _PR_FILEDESC_FREED 0x11111111
442
443/*
444** A boolean type with an additional "unknown" state
445*/
446
447typedef enum {
448 _PR_TRI_TRUE = 1,
449 _PR_TRI_FALSE = 0,
450 _PR_TRI_UNKNOWN = -1
451} _PRTriStateBool;
452
453struct PRFilePrivate {
454 PRInt32 state;
455 PRBool nonblocking;
456 _PRTriStateBool inheritable;
457 PRFileDesc *next;
458 PRIntn lockCount; /* 0: not locked
459 * -1: a native lockfile call is in progress
460 * > 0: # times the file is locked */
461#ifdef _PR_HAVE_PEEK_BUFFER
462 char *peekBuffer;
463 PRInt32 peekBufSize;
464 PRInt32 peekBytes;
465#endif
466#if !defined(XP_UNIX) /* BugZilla: 4090 */
467 PRBool appendMode;
468#endif
469 _MDFileDesc md;
470#ifdef _PR_STRICT_ADDR_LEN
471 PRUint16 af; /* If the platform requires passing the exact
472 * length of the sockaddr structure for the
473 * address family of the socket to socket
474 * functions like accept(), we need to save
475 * the address family of the socket. */
476#endif
477};
478
479extern void _PR_InitSegs(void);
480extern void _PR_InitStacks(void);
481extern void _PR_InitMem(void);
482extern void _PR_InitIO(void);
483extern void _PR_InitLog(void);
484extern void _PR_InitNet(void);
485extern void _PR_InitClock(void);
486extern void _PR_InitCPUs(void);
487extern void _PR_InitDtoa(void);
488extern void _PR_InitMW(void);
489extern void _PR_NotifyCondVar(PRCondVar *cvar, PRThread *me);
490extern void _PR_CleanupThread(PRThread *thread);
491extern void _PR_CleanupMW(void);
492extern void _PR_CleanupDtoa(void);
493extern void _PR_CleanupIO(void);
494extern void _PR_CleanupNet(void);
495extern void _PR_CleanupLayerCache(void);
496extern void _PR_CleanupStacks(void);
497#ifdef WINNT
498extern void _PR_CleanupCPUs(void);
499#endif
500extern void _PR_CleanupThreads(void);
501extern void _PR_CleanupTPD(void);
502extern void _PR_Cleanup(void);
503extern void _PR_LogCleanup(void);
504extern void _PR_InitLayerCache(void);
505
506extern PRBool _pr_initialized;
507extern void _PR_ImplicitInitialization(void);
508
509/************************************************************************/
510
511struct PRSegment {
512 void *vaddr;
513 PRUint32 size;
514 PRUintn flags;
515};
516
517/* PRSegment.flags */
518#define _PR_SEG_VM 0x1
519
520/************************************************************************/
521
522extern PRInt32 _pr_pageSize;
523extern PRInt32 _pr_pageShift;
524
525extern PRLogModuleInfo *_pr_clock_lm;
526extern PRLogModuleInfo *_pr_cmon_lm;
527extern PRLogModuleInfo *_pr_io_lm;
528extern PRLogModuleInfo *_pr_cvar_lm;
529extern PRLogModuleInfo *_pr_mon_lm;
530extern PRLogModuleInfo *_pr_linker_lm;
531extern PRLogModuleInfo *_pr_sched_lm;
532extern PRLogModuleInfo *_pr_thread_lm;
533extern PRLogModuleInfo *_pr_gc_lm;
534
535extern PRFileDesc *_pr_stdin;
536extern PRFileDesc *_pr_stdout;
537extern PRFileDesc *_pr_stderr;
538
539
540/*************************************************************************
541* External machine-dependent code provided by each OS. * *
542*************************************************************************/
543
544/* Initialization related */
545extern void _PR_MD_EARLY_INIT(void);
546#define _PR_MD_EARLY_INIT _MD_EARLY_INIT
547
548extern void _PR_MD_INTERVAL_INIT(void);
549#define _PR_MD_INTERVAL_INIT _MD_INTERVAL_INIT
550
551NSPR_API(void) _PR_MD_FINAL_INIT(void);
552#define _PR_MD_FINAL_INIT _MD_FINAL_INIT
553
554/* Process control */
555
556#ifdef _MD_CREATE_PROCESS_DETACHED
557# define _PR_MD_CREATE_PROCESS_DETACHED _MD_CREATE_PROCESS_DETACHED
558#endif
559
560/* Current Time */
561NSPR_API(PRTime) _PR_MD_NOW(void);
562#define _PR_MD_NOW _MD_NOW
563
564/* Environment related */
565extern char* _PR_MD_GET_ENV(const char *name);
566#define _PR_MD_GET_ENV _MD_GET_ENV
567
568extern PRIntn _PR_MD_PUT_ENV(const char *name);
569#define _PR_MD_PUT_ENV _MD_PUT_ENV
570
571/* Atomic operations */
572
573extern void _PR_MD_INIT_ATOMIC(void);
574#define _PR_MD_INIT_ATOMIC _MD_INIT_ATOMIC
575
576extern PRInt32 _PR_MD_ATOMIC_INCREMENT(PRInt32 *);
577#define _PR_MD_ATOMIC_INCREMENT _MD_ATOMIC_INCREMENT
578
579extern PRInt32 _PR_MD_ATOMIC_ADD(PRInt32 *, PRInt32);
580#define _PR_MD_ATOMIC_ADD _MD_ATOMIC_ADD
581
582extern PRInt32 _PR_MD_ATOMIC_DECREMENT(PRInt32 *);
583#define _PR_MD_ATOMIC_DECREMENT _MD_ATOMIC_DECREMENT
584
585extern PRInt32 _PR_MD_ATOMIC_SET(PRInt32 *, PRInt32);
586#define _PR_MD_ATOMIC_SET _MD_ATOMIC_SET
587
588/* Time intervals */
589
590extern PRIntervalTime _PR_MD_GET_INTERVAL(void);
591#define _PR_MD_GET_INTERVAL _MD_GET_INTERVAL
592
593extern PRIntervalTime _PR_MD_INTERVAL_PER_SEC(void);
594#define _PR_MD_INTERVAL_PER_SEC _MD_INTERVAL_PER_SEC
595
596/* Affinity masks */
597
598extern PRInt32 _PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask );
599#define _PR_MD_SETTHREADAFFINITYMASK _MD_SETTHREADAFFINITYMASK
600
601extern PRInt32 _PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask);
602#define _PR_MD_GETTHREADAFFINITYMASK _MD_GETTHREADAFFINITYMASK
603
604/* File locking */
605
606extern PRStatus _PR_MD_LOCKFILE(PRInt32 osfd);
607#define _PR_MD_LOCKFILE _MD_LOCKFILE
608
609extern PRStatus _PR_MD_TLOCKFILE(PRInt32 osfd);
610#define _PR_MD_TLOCKFILE _MD_TLOCKFILE
611
612extern PRStatus _PR_MD_UNLOCKFILE(PRInt32 osfd);
613#define _PR_MD_UNLOCKFILE _MD_UNLOCKFILE
614
615/* Socket call error code */
616
617NSPR_API(PRInt32) _PR_MD_GET_SOCKET_ERROR(void);
618#define _PR_MD_GET_SOCKET_ERROR _MD_GET_SOCKET_ERROR
619
620/* Get name of current host */
621extern PRStatus _PR_MD_GETHOSTNAME(char *name, PRUint32 namelen);
622#define _PR_MD_GETHOSTNAME _MD_GETHOSTNAME
623
624/* File descriptor inheritance */
625
626/*
627 * If fd->secret->inheritable is _PR_TRI_UNKNOWN and we need to
628 * know the inheritable attribute of the fd, call this function
629 * to find that out. This typically requires a system call.
630 */
631extern void _PR_MD_QUERY_FD_INHERITABLE(PRFileDesc *fd);
632#define _PR_MD_QUERY_FD_INHERITABLE _MD_QUERY_FD_INHERITABLE
633
634PR_END_EXTERN_C
635
636#endif /* primpl_h___ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette