Ignore:
Timestamp:
Nov 7, 2004, 3:19:42 PM (21 years ago)
Author:
bird
Message:

More signal debugging and cleanup.

Location:
trunk/src/emx/include/InnoTekLIBC
Files:
3 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r1617 r1618  
    560560 *
    561561 * @returns 0 on success.
    562  * @returns -Negative errno on failure.
     562 * @returns Negative error code (errno) on failure.
    563563 * @param   iSignalNo   Signal number.
    564564 * @param   pSigAct     Pointer to new signal action.
     
    570570
    571571/**
     572 * Change interrupt/restart system call properties for a signal.
     573 *
     574 * @returns 0 on success.
     575 * @returns Negative error code (errno) on failure.
     576 * @param   iSignalNo   Signal number to change interrupt/restart
     577 *                      properties for.
     578 * @param   fFlag       If set Then clear the SA_RESTART from the handler action.
     579 *                      If clear Then set the SA_RESTART from the handler action.
     580 * @remark  The SA_RESTART flag is inherited when using signal().
     581 */
     582int __libc_Back_signalInterrupt(int iSignalNo, int fFlag);
     583
     584/**
    572585 * Changes and/or queries the alternative signal stack settings of a thread.
    573586 *
     
    584597 *
    585598 * @returns 0 on success.
    586  * @returns -1 and errno set to EINVAL on failure.
     599 * @returns Negative error code (errno) on failure.
    587600 * @param   pThrd       Thread to apply this to.
    588601 * @param   iHow        Describes the action taken if pSigSetNew not NULL. Recognized
     
    604617int __libc_Back_signalMask(__LIBC_PTHREAD pThrd, int iHow, const sigset_t * __restrict pSigSetNew, sigset_t * __restrict pSigSetOld);
    605618
     619/**
     620 * Wait for one or more signals and remove and return the first of them
     621 * to occur.
     622 *
     623 * Will return immediately if one of the signals is already pending. If more than
     624 * one signal is pending the signal with highest priority will be returned.
     625 *
     626 * @returns Signal number on success.
     627 * @returns Negative error code (errno) on failure.
     628 * @param   pSigSet     Signals to wait for.
     629 * @param   pSigInfo    Where to store the signal info for the signal
     630 *                      that we accepted.
     631 * @param   pTimeout    Timeout specification. If NULL wait for ever.
     632 */
     633int __libc_Back_signalWait(const sigset_t *pSigSet, siginfo_t *pSigInfo, const struct timespec *pTimeout);
     634
     635/**
     636 * Suspends the current thread till a signal have been handled.
     637 * The signal semaphore is owned.
     638 *
     639 * @returns Negative error code (errno) on failure. (allways fails)
     640 * @param   pSigSet     Temporary signal mask for the thread.
     641 */
     642int __libc_Back_signalSuspend(const sigset_t *pSigSet);
     643
     644/**
     645 * Gets the set of signals which are blocked by the current thread and are
     646 * pending on the process or the calling thread.
     647 *
     648 * @returns 0 indicating success.
     649 * @returns Negative error code (errno) on failure.
     650 * @param   pSigSet     Pointer to signal set where the result is to be stored.
     651 */
     652int __libc_Back_signalPending(sigset_t *pSigSet);
     653
    606654/** @} */
    607655
  • trunk/src/emx/include/InnoTekLIBC/libc.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1617 r1618  
    2929
    3030#include <sys/cdefs.h>
     31#include <sys/signal.h>
    3132
    3233__BEGIN_DECLS
     
    4142extern int __libc_gfNoUnix;
    4243
     44/** Signal set of the signals which will interrupt system call execution.
     45 * By default all signals will interrupt syscall execution, since OS/2 can't really
     46 * restart system calls easily.
     47 * Update is protected by the signal semaphore, however read access isn't.
     48 */
     49extern sigset_t __libc_gSignalRestartMask;
     50
    4351__END_DECLS
    4452
  • trunk/src/emx/include/InnoTekLIBC/thread.h

    • Property cvs2svn:cvs-rev changed from 1.8 to 1.9
    r1617 r1618  
    5050*******************************************************************************/
    5151struct _uheap;
     52
     53/**
     54 * sigwait,sigwaitinfo, sigtimedwait data.
     55 */
     56typedef volatile struct __libc_thread_sigwait
     57{
     58    /** Done waitin' indicator.*/
     59    volatile int    fDone;
     60    /** The signals we're waiting for. */
     61    sigset_t        SigSetWait;
     62    /** The where to return signal info. */
     63    siginfo_t       SigInfo;
     64} __LIBC_THREAD_SIGWAIT, *__LIBC_PTHREAD_SIGWAIT;
     65
     66
     67/**
     68 * sigsuspend data.
     69 */
     70typedef volatile struct __libc_thread_sigsuspend
     71{
     72    /** Done waitin' indicator.*/
     73    volatile int    fDone;
     74} __LIBC_THREAD_SIGSUSPEND, *__LIBC_PTHREAD_SIGSUSPEND;
     75
    5276
    5377/**
     
    150174
    151175    /** Thread status, chiefly used for the u member of the thread structure. */
    152     enum enmLIBCThreadStatus
     176    volatile enum enmLIBCThreadStatus
    153177    {
    154178        /** The thread status must be queried from the OS. */
     
    158182        /** The thread is in a sigwait(), sigwaitinfo(), or sigtimedwait() call. */
    159183        enmLIBCThreadStatus_sigwait,
     184        /** The thread is in a sigsuspend() call. */
     185        enmLIBCThreadStatus_sigsuspend,
    160186    }               enmStatus;
    161187
     
    166192    {
    167193        /** enmLIBCThreadStatus_startup:    Begin Thread Arguments. */
    168         struct __libc_thread_startup
     194        struct __libc_thread_u_startup
    169195        {
    170196            /** Thread argument. */
     
    175201
    176202        /** enmLIBCThreadStatus_sigwait:    Thread blocked in sigwait(), sigwaitinfo() or sigtimedwait(). */
    177         struct __libc_thread_sigwait
    178         {
    179             /** The signals we're waiting for. */
    180             sigset_t    SigSetWait;
    181             /** The where to return signal info. */
    182             siginfo_t  *pSigInfo;
    183         } SigWait;
     203        __LIBC_PTHREAD_SIGWAIT      pSigWait;
     204        /** enmLIBCThreadStatus_sigsuspend: Thread blocked in sigsuspend(). */
     205        __LIBC_PTHREAD_SIGSUSPEND   pSigSuspend;
    184206    } u;
    185207
     
    211233} __LIBC_THREAD;
    212234
     235
    213236#ifndef __LIBC_THREAD_DECLARED
    214237#define __LIBC_THREAD_DECLARED
Note: See TracChangeset for help on using the changeset viewer.