Changeset 1615 for trunk/src/emx/include


Ignore:
Timestamp:
Nov 6, 2004, 9:35:32 AM (21 years ago)
Author:
bird
Message:

signals are finally getting somewhere...

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

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.11 to 1.12
    r1614 r1615  
    109109
    110110
     111/** The maximum number of signals a process can have pending on other processes concurrently. */
     112#define __LIBC_SPM_SIGNALS_MAX_SENT 48
     113
    111114/**
    112115 * Signal (queued).
     
    118121    /** Pointer to the next signal. */
    119122    struct __libc_SPMSignal    *pNext;
     123    /** Sender process.
     124     * This is used to decrement the cSigsSent count of the sender. */
     125    pid_t                       pidSender;
     126
    120127    /** Signal info. */
    121128    siginfo_t                   Info;
     
    277284     * For signals which aren't queable only one signal can be queued.
    278285     */
    279     __LIBC_PSPMSIGNAL           pSigHead;
    280     /** Number of queued signals.
    281      * After it passes 48 signals, only SIGCHLD will be queued.
    282      * This means siqueue() won't work 100% according to spec. */
    283     unsigned                    cSigsQueued;
     286    volatile __LIBC_PSPMSIGNAL  pSigHead;
     287    /** Number of signals send.
     288     * After __LIBC_SPM_SIGNALS_MAX_SENT signals only SIGCHLD will be allowed sent.
     289     */
     290    volatile unsigned           cSigsSent;
    284291
    285292    /** Reserved pool pointer field with default value 0. */
     
    653660
    654661/**
    655  * De-queues one or more pending signals.
     662 * Get the signal set of pending signals.
     663 *
     664 * @returns Number of pending signals on success.
     665 * @returns 0 if no signals are pending.
     666 * @returns Negative error code (errno.h) on failure.
     667 * @param   pSigSet     Where to create the set of pending signals.
     668 */
     669int     __libc_spmSigPending(sigset_t *pSigSet);
     670
     671/**
     672 * De-queues one or more pending signals of a specific type.
     673 *
    656674 * @returns Number of de-queued signals on success.
    657675 * @returns Negative error code (errno.h) on failure.
     676 * @param   iSignalNo   Signal type to dequeue.
    658677 * @param   paSignals   Where to store the signals.
    659678 * @param   cSignals    Size of the signal array.
    660679 * @param   cbSignal    Size of one signal entry.
    661680 */
    662 int     __libc_spmSigDequeue(siginfo_t *paSignals, unsigned cSignals, size_t cbSignal);
     681int     __libc_spmSigDequeue(int iSignalNo, siginfo_t *paSignals, unsigned cSignals, size_t cbSignal);
    663682
    664683
  • trunk/src/emx/include/InnoTekLIBC/signals.h

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1614 r1615  
    3232*******************************************************************************/
    3333/** @defgroup __libc_back_signalRaise_return    __libc_back_signalRaise() returns.
     34 * These are only valid for positive return values.
    3435 * @{ */
    3536/** Try restart any interrupted system call. */
     
    4445/** If set the passed in SIGQUEUED structure was used. */
    4546#define __LIBC_BSRR_USED_QUEUED 0x40
    46 /** Failure. */
    47 #define __LIBC_BSRR_ERROR       0xffffff22
    4847/** @} */
    4948
     
    9493int         __libc_back_signalSuspend(void);
    9594int         __libc_back_signalWait(const struct timespec *pTimeout);
    96 int         __libc_back_signalVerifyPid(pid_t pid);
    97 int         __libc_back_signalVerifyPGrp(pid_t pgid);
    98 int         __libc_back_signalSendPid(pid_t pid, int iSignalNo);
    9995int         __libc_back_signalSendPidOther(pid_t pid, int iSignalNo);
    100 int         __libc_back_signalSendPGrp(pid_t pgrp, int iSignalNo);
    10196int         __libc_back_signalAction(int iSignalNo, const struct sigaction *pSigAct, struct sigaction *pSigActOld);
    102 unsigned    __libc_back_signalRaise(int iSignalNo, siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags);
    10397int         __libc_back_signalRaisePoked(void *pvXcptParams, int tidPoker);
    10498void        __libc_back_signalOS2V1Handler16bit(unsigned short uSignal, unsigned short uArg);
    10599void        __libc_back_signalOS2V1Handler32bit(unsigned uSignal, unsigned uArg);
    106100
     101
     102/**
     103 * Raises a signal in the current process.
     104 *
     105 * @returns On success a flag mask out of the __LIBC_BSRR_* #defines is returned.
     106 * @returns On failure a negative error code (errno.h) is returned.
     107 * @param   iSignalNo           Signal to raise.
     108 * @param   pSigInfo            Pointer to signal info for this signal.
     109 *                              NULL is allowed.
     110 * @param   pvXcptOrQueued      Exception handler parameter list.
     111 *                              Or if __LIBC_BSRF_QUEUED is set, a pointer to locally malloced
     112 *                              SIGQUEUED node.
     113 * @param   fFlags              Flags of the #defines __LIBC_BSRF_* describing how to
     114 *                              deliver the signal.
     115 *
     116 * @remark  This Backend Signal API does NOT require the caller to own the signal semaphore.
     117 */
     118int __libc_Back_signalRaise(int iSignalNo, siginfo_t *pSigInfo, void *pvXcptOrQueued, unsigned fFlags);
     119
     120/**
     121 * Send a signal to a process.
     122 *
     123 * @returns 0 on if signal sent.
     124 * @returns -errno on failure.
     125 *
     126 * @param   pid         Process Id of the process which the signal is to be sent to.
     127 * @param   iSignalNo   The signal to send.
     128 * @remark  This Backend Signal API does NOT require the caller to own the signal semaphore.
     129 */
     130int     __libc_Back_signalSendPid(pid_t pid, int iSignalNo);
     131
     132/**
     133 * Verify the existance of another process and that the current process
     134 * is allowed to signal it.
     135 *
     136 * @return 0 on success.
     137 * @return -ESRCH if pid doesn't exist.
     138 * @return -EPERM if we aren't allowed to signal the pid.
     139 * @param   pid     Process Id for the process which we wanna signal.
     140 * @todo    Do EPERM check, no ideas here yet.
     141 * @remark  This Backend Signal API does NOT require the caller to own the signal semaphore.
     142 */
     143int     __libc_Back_signalVerifyPid(pid_t pid);
     144
     145/**
     146 * Not implemented.
     147 *
     148 * @returns -ENOSYS.
     149 * @param   pgrp        Process group (positive).
     150 *                      0 means the process group of this process.
     151 *                      1 means all process in the system.
     152 * @param   iSignalNo   Signal to send to all the processes in the group.
     153 */
     154int     __libc_Back_signalSendPGrp(pid_t pgrp, int iSignalNo);
     155
     156/**
     157 * Verify the existance of a process group and that the current process
     158 * is allowed to signal it.
     159 *
     160 * @return 0 on success.
     161 * @return -ESRCH if pgid doesn't exist.
     162 * @return -EPERM if we aren't allowed to signal the pgid.
     163 * @param   pgid    Process group id which the current process intend to signal.
     164 * @todo    Do EPERM check, no ideas here yet.
     165 * @remark  This Backend Signal API does NOT require the caller to own the signal semaphore.
     166 */
     167int     __libc_Back_signalVerifyPGrp(pid_t pgid);
     168
     169
    107170__END_DECLS
    108171
  • trunk/src/emx/include/sys/signal.h

    • Property cvs2svn:cvs-rev changed from 1.6 to 1.7
    r1614 r1615  
    147147/** Take signal on a registerd stack_t. */
    148148#define SA_ONSTACK          0x00000001
    149 /** Restart system call on signal return. Not implemented on OS/2. */
     149/** Restart system call on signal return. */
    150150#define SA_RESTART          0x00000002
    151151/** Reset signal handler to SIG_DFL when deliving the signal. */
     
    395395    /** Timestamp when the signal was generated - LIBC extension. */
    396396    unsigned        si_timestamp;
     397    /** Flags - LIBC extension. __LIBC_SI_* */
     398    unsigned        si_flags;
    397399    /** Process sending the signal. */
    398400    __pid_t         si_pid;
     
    412414    int             si_fd;
    413415    /** Reserve a little bit for future usage. */
    414     unsigned        auReserved[4];
     416    unsigned        auReserved[3];
    415417} siginfo_t;
     418
     419#ifdef __BSD_VISIBLE
     420/** Signals LIBC flags.
     421 * @{ */
     422/** If set the signal was queue. */
     423#define __LIBC_SI_QUEUED        0x00000001
     424/** @} */
     425#endif
    416426#endif
    417427
Note: See TracChangeset for help on using the changeset viewer.