~ubuntu-branches/ubuntu/lucid/nspr/lucid-updates

« back to all changes in this revision

Viewing changes to nspr/pr/src/md/unix/bsdi.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2014-09-19 08:25:13 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20140919082513-ldt99o79f1yggc7e
Tags: 4.10.7-0ubuntu0.10.04.1
* Update to 4.10.7 to support nss security update.
* Removed unneeded patches:
  - debian/patches/30_config_64bits.patch: no longer needed
  - debian/patches/99_configure.patch: no longer needed
  - debian/patches/CVE-2013-5607.patch: included upstream.
  - debian/patches/CVE-2014-1545.patch: included upstream.
* debian/libnspr4-0d.symbols: updated for new version.
* debian/rules: adjust paths, add --enable-64bit when appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* This Source Code Form is subject to the terms of the Mozilla Public
 
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
5
 
 
6
#include "primpl.h"
 
7
 
 
8
#include <signal.h>
 
9
 
 
10
void _MD_EarlyInit(void)
 
11
{
 
12
    /*
 
13
     * Ignore FPE because coercion of a NaN to an int causes SIGFPE
 
14
     * to be raised.
 
15
     */
 
16
    struct sigaction act;
 
17
 
 
18
    act.sa_handler = SIG_IGN;
 
19
    sigemptyset(&act.sa_mask);
 
20
    act.sa_flags = SA_RESTART;
 
21
    sigaction(SIGFPE, &act, 0);
 
22
}
 
23
 
 
24
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
 
25
{
 
26
#ifndef _PR_PTHREADS
 
27
    if (isCurrent) {
 
28
        (void) setjmp(CONTEXT(t));
 
29
    }
 
30
    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
 
31
    return (PRWord *) CONTEXT(t);
 
32
#else
 
33
    *np = 0;
 
34
    return NULL;
 
35
#endif
 
36
}
 
37
 
 
38
#ifndef _PR_PTHREADS
 
39
void
 
40
_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
 
41
{
 
42
    return;
 
43
}
 
44
 
 
45
PRStatus
 
46
_MD_InitializeThread(PRThread *thread)
 
47
{
 
48
        return PR_SUCCESS;
 
49
}
 
50
 
 
51
PRStatus
 
52
_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
 
53
{
 
54
    PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
 
55
    _PR_MD_SWITCH_CONTEXT(thread);
 
56
    return PR_SUCCESS;
 
57
}
 
58
 
 
59
PRStatus
 
60
_MD_WAKEUP_WAITER(PRThread *thread)
 
61
{
 
62
    if (thread) {
 
63
        PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
 
64
    }
 
65
    return PR_SUCCESS;
 
66
}
 
67
 
 
68
/* These functions should not be called for BSDI */
 
69
void
 
70
_MD_YIELD(void)
 
71
{
 
72
    PR_NOT_REACHED("_MD_YIELD should not be called for BSDI.");
 
73
}
 
74
 
 
75
PRStatus
 
76
_MD_CREATE_THREAD(
 
77
    PRThread *thread,
 
78
    void (*start) (void *),
 
79
    PRThreadPriority priority,
 
80
    PRThreadScope scope,
 
81
    PRThreadState state,
 
82
    PRUint32 stackSize)
 
83
{
 
84
    PR_NOT_REACHED("_MD_CREATE_THREAD should not be called for BSDI.");
 
85
        return PR_FAILURE;
 
86
}
 
87
#endif /* ! _PR_PTHREADS */