Changeset 1642


Ignore:
Timestamp:
Nov 16, 2004, 11:18:46 AM (21 years ago)
Author:
bird
Message:

signal timers. (very untested!)

Location:
trunk/src/emx
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/InnoTekLIBC/backend.h

    • Property cvs2svn:cvs-rev changed from 1.13 to 1.14
    r1641 r1642  
    3232#include <sys/_timeval.h>
    3333#include <sys/resource.h>
     34#include <sys/time.h>
    3435#include <sys/wait.h>
    3536#include <signal.h>
     
    498499 *                              deliver the signal.
    499500 */
    500 int __libc_Back_signalRaise(int iSignalNo, siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags);
     501int __libc_Back_signalRaise(int iSignalNo, const siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags);
    501502
    502503/**
     
    637638 */
    638639int __libc_Back_signalPending(sigset_t *pSigSet);
     640
     641/**
     642 * Queries and/or starts/stops a timer.
     643 *
     644 * @returns 0 on success.
     645 * @returns Negative error code (errno.h) on failure.
     646 * @param   iWhich      Which timer to get, any of the ITIMER_* #defines.
     647 *                      OS/2 only supports ITIMER_REAL.
     648 * @param   pValue      Where to store the value.
     649 *                      Optional. If NULL pOldValue must not be NULL.
     650 * @param   pOldValue   Where to store the old value.
     651 *                      Optional. If NULL pValue must not be NULL.
     652 */
     653int __libc_Back_signalTimer(int iWhich, const struct itimerval *pValue, struct itimerval *pOldValue);
     654
     655
    639656
    640657/** @} */
  • trunk/src/emx/src/lib/sys/b_signal.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1641 r1642  
    6060void        __libc_back_signalOS2V1Handler32bit(unsigned uSignal, unsigned uArg);
    6161int         __libc_back_signalInheritPack(__LIBC_PSPMINHSIG *ppSig, size_t *pcbSig);
     62void        __libc_back_signalTimerNotifyTerm(void);
    6263
    6364
  • trunk/src/emx/src/lib/sys/sharedpm.c

    • Property cvs2svn:cvs-rev changed from 1.24 to 1.25
    r1641 r1642  
    7474#include <InnoTekLIBC/logstrict.h>
    7575#include "b_process.h"
     76#include "b_signal.h"
    7677#include "syscalls.h"
    7778
     
    20522053{
    20532054    /*
    2054      * Notify the wait facilities.
     2055     * Notify the wait and timer facilities.
    20552056     */
    20562057    __libc_back_processWaitNotifyTerm();
     2058    __libc_back_signalTimerNotifyTerm();
    20572059
    20582060    /*
  • trunk/src/emx/src/lib/sys/signals.c

    • Property cvs2svn:cvs-rev changed from 1.13 to 1.14
    r1641 r1642  
    934934 *                              deliver the signal.
    935935 */
    936 int __libc_Back_signalRaise(int iSignalNo, siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags)
     936int __libc_Back_signalRaise(int iSignalNo, const siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags)
    937937{
    938938    LIBCLOG_ENTER("iSignalNo=%d pSigInfo=%p{.si_signo=%d, .si_errno=%d, .si_code=%#x, .si_timestamp=%#x, .si_flags=%#x .si_pid=%#x, .si_pgrp=%#x, .si_tid=%#x, .si_uid=%d, .si_status=%d, .si_addr=%p, .si_value=%p, .si_band=%ld, .si_fd=%d} pvXcptOrQueued=%p fFlags=%#x\n",
     
    985985
    986986    /*
    987      * Fill in the rest of the SigInfo packet if we've got one.
    988      */
     987     * Copy the siginfo structure and fill in the rest of
     988     * the SigInfo packet (if we've got one).
     989     */
     990    siginfo_t SigInfo;
    989991    if (pSigInfo)
    990992    {
    991         if (!pSigInfo->si_timestamp)
    992             pSigInfo->si_timestamp = signalTimestamp();
     993        SigInfo = *pSigInfo;
     994        if (!SigInfo.si_timestamp)
     995            SigInfo.si_timestamp = signalTimestamp();
    993996        if (fFlags & __LIBC_BSRF_QUEUED)
    994             pSigInfo->si_flags |= __LIBC_SI_QUEUED;
    995         if (!pSigInfo->si_pid)
    996             pSigInfo->si_pid = _sys_pid;
    997         if (!pSigInfo->si_tid && pThrd)
    998             pSigInfo->si_tid = pThrd->tid;
     997            SigInfo.si_flags |= __LIBC_SI_QUEUED;
     998        if (!SigInfo.si_pid)
     999            SigInfo.si_pid = _sys_pid;
     1000        if (!SigInfo.si_tid && pThrd)
     1001            SigInfo.si_tid = pThrd->tid;
    9991002    }
    10001003
     
    10151018     * Schedule the signal.
    10161019     */
    1017     int rc = signalSchedule(pThrd, iSignalNo, pSigInfo, fFlags, fFlags & __LIBC_BSRF_QUEUED ? pvXcptOrQueued : NULL);
     1020    int rc = signalSchedule(pThrd, iSignalNo, pSigInfo ? &SigInfo : NULL, fFlags, fFlags & __LIBC_BSRF_QUEUED ? pvXcptOrQueued : NULL);
    10181021    if (rc >= 0)
    10191022    {
Note: See TracChangeset for help on using the changeset viewer.