Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
beos.c File Reference
#include "primpl.h"
#include <signal.h>
#include <unistd.h>
#include <memory.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <errno.h>

Go to the source code of this file.

Defines

#define _PRSockLen_t   int

Functions

void _PR_UnixInit ()
 PR_Now (void)
PRIntervalTime _PR_UNIX_GetInterval ()
PRIntervalTime _PR_UNIX_TicksPerSecond ()
void PR_XLock ()
void PR_XUnlock ()
PRBool PR_XIsLocked ()
void PR_XWait (int ms)
void PR_XNotify (void)
void PR_XNotifyAll (void)
 _MD_LOCKFILE (PRInt32 f)
 _MD_TLOCKFILE (PRInt32 f)
 _MD_UNLOCKFILE (PRInt32 f)
 _MD_GETHOSTNAME (char *name, PRUint32 namelen)

Variables

static PRLock_pr_rename_lock = NULL
static PRMonitor_pr_Xfe_mon = NULL
PRInt32 _pr_zero_fd = -1
static PRLock_pr_md_lock = NULL
sigset_t timer_set

Define Documentation

Definition at line 54 of file beos.c.


Function Documentation

_MD_GETHOSTNAME ( char *  name,
PRUint32  namelen 
)

Definition at line 252 of file beos.c.

{
    PRIntn rv;

    rv = gethostname(name, namelen);
    if (0 == rv) {
              return PR_SUCCESS;
    }
       _PR_MD_MAP_GETHOSTNAME_ERROR(_MD_ERRNO());
    return PR_FAILURE;
}

Here is the call graph for this function:

Definition at line 218 of file beos.c.

{
       PRInt32 rv;
       rv = lockf(f, F_LOCK, 0);
       if (rv == 0)
              return PR_SUCCESS;
       _PR_MD_MAP_LOCKF_ERROR(_MD_ERRNO());
       return PR_FAILURE;
}

Definition at line 229 of file beos.c.

{
       PRInt32 rv;
       rv = lockf(f, F_TLOCK, 0);
       if (rv == 0)
              return PR_SUCCESS;
       _PR_MD_MAP_LOCKF_ERROR(_MD_ERRNO());
       return PR_FAILURE;
}

Definition at line 240 of file beos.c.

{
       PRInt32 rv;
       rv = lockf(f, F_ULOCK, 0);
       if (rv == 0)
              return PR_SUCCESS;
       _PR_MD_MAP_LOCKF_ERROR(_MD_ERRNO());
       return PR_FAILURE;
}

Definition at line 124 of file beos.c.

{
       struct timeval time;
       PRIntervalTime ticks;

       (void)GETTIMEOFDAY(&time);  /* fallicy of course */
       ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC;  /* that's in milliseconds */
       ticks += (PRUint32)time.tv_usec / PR_USEC_PER_MSEC;  /* so's that */
       return ticks;
}  /* _PR_SUNOS_GetInterval */

Definition at line 135 of file beos.c.

{
       return 1000;  /* this needs some work :) */
}

Definition at line 75 of file beos.c.

{
       struct sigaction sigact;
       int rv;

       sigemptyset(&timer_set);

       sigact.sa_handler = SIG_IGN;
       sigemptyset(&sigact.sa_mask);
       sigact.sa_flags = 0;
       rv = sigaction(SIGPIPE, &sigact, 0);
       PR_ASSERT(0 == rv);

       _pr_rename_lock = PR_NewLock();
       PR_ASSERT(NULL != _pr_rename_lock);
       _pr_Xfe_mon = PR_NewMonitor();
       PR_ASSERT(NULL != _pr_Xfe_mon);
}

Here is the call graph for this function:

PR_Now ( void  )

Definition at line 109 of file beos.c.

{
       struct timeval tv;
       PRInt64 s, us, s2us;

       GETTIMEOFDAY(&tv);
       LL_I2L(s2us, PR_USEC_PER_SEC);
       LL_I2L(s, tv.tv_sec);
       LL_I2L(us, tv.tv_usec);
       LL_MUL(s, s, s2us);
       LL_ADD(s, s, us);
       return s;
}

Definition at line 158 of file beos.c.

Here is the caller graph for this function:

Definition at line 148 of file beos.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 168 of file beos.c.

Here is the call graph for this function:

Definition at line 173 of file beos.c.

Here is the call graph for this function:

Definition at line 153 of file beos.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void PR_XWait ( int  ms)

Definition at line 163 of file beos.c.

{
       PR_Wait(_pr_Xfe_mon, PR_MillisecondsToInterval(ms));
}

Here is the call graph for this function:


Variable Documentation

PRLock* _pr_md_lock = NULL [static]

Definition at line 71 of file beos.c.

Definition at line 60 of file beos.c.

PRMonitor* _pr_Xfe_mon = NULL [static]

Definition at line 61 of file beos.c.

Definition at line 70 of file beos.c.

Definition at line 73 of file beos.c.