home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / pr / src / md / unix / reliantunix.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 KB  |  115 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /*
  20.  * ReliantUNIX5.4 - copied from unixware.c by chrisk 040497
  21.  */
  22. #include "primpl.h"
  23.  
  24. #include <ucontext.h>
  25.  
  26. void _MD_EarlyInit(void)
  27. {
  28. }
  29.  
  30. PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
  31. {
  32.     if (isCurrent) {
  33.     (void) _GETCONTEXT(CONTEXT(t));
  34.     }
  35.     *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
  36.     return (PRWord *) CONTEXT(t);
  37. }
  38.  
  39. #ifdef ALARMS_BREAK_TCP /* I don't think they do */
  40.  
  41. PRInt32 _MD_connect(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen,
  42.                         PRIntervalTime timeout)
  43. {
  44.     PRInt32 rv;
  45.  
  46.     _MD_BLOCK_CLOCK_INTERRUPTS();
  47.     rv = _connect(osfd,addr,addrlen);
  48.     _MD_UNBLOCK_CLOCK_INTERRUPTS();
  49. }
  50.  
  51. PRInt32 _MD_accept(PRInt32 osfd, PRNetAddr *addr, PRInt32 addrlen,
  52.                         PRIntervalTime timeout)
  53. {
  54.     PRInt32 rv;
  55.  
  56.     _MD_BLOCK_CLOCK_INTERRUPTS();
  57.     rv = _accept(osfd,addr,addrlen);
  58.     _MD_UNBLOCK_CLOCK_INTERRUPTS();
  59.     return(rv);
  60. }
  61. #endif
  62.  
  63. void
  64. _MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
  65. {
  66.     return;
  67. }
  68.  
  69. PRStatus
  70. _MD_InitializeThread(PRThread *thread)
  71. {
  72.     return PR_SUCCESS;
  73. }
  74.  
  75. PRStatus
  76. _MD_WAIT(PRThread *thread, PRIntervalTime ticks)
  77. {
  78.     PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
  79.     _PR_MD_SWITCH_CONTEXT(thread);
  80.     return PR_SUCCESS;
  81. }
  82.  
  83. PRStatus
  84. _MD_WAKEUP_WAITER(PRThread *thread)
  85. {
  86.     if (thread) {
  87.     PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
  88.     }
  89.     return PR_SUCCESS;
  90. }
  91.  
  92. /* These functions should not be called for ReliantUNIX */
  93. /* Why? Just copied it from UNIXWARE... flying-by-night, chrisk 040497 */
  94. void
  95. _MD_YIELD(void)
  96. {
  97.     PR_NOT_REACHED("_MD_YIELD should not be called for ReliantUNIX.");
  98. }
  99.  
  100. PRStatus
  101. _MD_CREATE_THREAD(
  102.     PRThread *thread,
  103.     void (*start) (void *),
  104.     PRUintn priority,
  105.     PRThreadScope scope,
  106.     PRThreadState state,
  107.     PRUint32 stackSize)
  108. {
  109.     PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for ReliantUNIX.");
  110. #if defined(SNI) && !defined(__GNUC__)
  111.     /* make compiler happy */
  112.     return (PRStatus)NULL;
  113. #endif
  114. }
  115.