Ignore:
Timestamp:
Nov 5, 2004, 3:16:17 AM (21 years ago)
Author:
bird
Message:

Non-working signal code. (better having it in CVS than locally now)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/sys/signal.h

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1613 r1614  
    1 #ifdef __NEW_SIGNALS__
    21/* $Id: $ */
    32/** @file
     
    530529#endif /* not _SYS_SIGNAL_H */
    531530
    532 
    533 #else /* !__NEW_SIGNALS__ */
    534 
    535 
    536 /* sys/signal.h (emx+gcc) */
    537 
    538 #ifndef _SYS_SIGNAL_H
    539 #define _SYS_SIGNAL_H
    540 
    541 #if defined (__cplusplus)
    542 extern "C" {
    543 #endif
    544 
    545 typedef int sig_atomic_t;
    546 
    547 #define SIGHUP    1 /* Hangup */
    548 #define SIGINT    2 /* Interrupt (Ctrl-C) */
    549 #define SIGQUIT   3 /* Quit */
    550 #define SIGILL    4 /* Illegal instruction */
    551 #define SIGTRAP   5 /* Single step (debugging) */
    552 #define SIGABRT   6 /* abort () */
    553 #define SIGEMT    7 /* EMT instruction */
    554 #define SIGFPE    8 /* Floating point */
    555 #define SIGKILL   9 /* Kill process */
    556 #define SIGBUS   10 /* Bus error */
    557 #define SIGSEGV  11 /* Segmentation fault */
    558 #define SIGSYS   12 /* Invalid argument to system call */
    559 #define SIGPIPE  13 /* Broken pipe */
    560 #define SIGALRM  14 /* Alarm */
    561 #define SIGTERM  15 /* Termination, process killed */
    562 #define SIGUSR1  16 /* User-defined signal #1 */
    563 #define SIGUSR2  17 /* User-defined signal #2 */
    564 #define SIGCHLD  18 /* Death of a child process */
    565 #define SIGBREAK 21 /* Break (Ctrl-Break) */
    566 #define SIGWINCH 28 /* Window size change (not implemented) */
    567 
    568 #define SIGPTRACENOTIFY 128     /* Notification from ptrace() */
    569 
    570 #define SIGCLD   SIGCHLD
    571 
    572 #define SIG_DFL ((void (*)(int))0)
    573 #define SIG_IGN ((void (*)(int))1)
    574 #define SIG_ERR ((void (*)(int))-1)
    575 
    576 void (*signal (int, void (*)(int)))(int);
    577 int raise (int);
    578 
    579 
    580 #if !defined (__STRICT_ANSI__)
    581 
    582 #define NSIG 29
    583 
    584 #define SA_NOCLDSTOP    0x0001
    585 
    586 #define SIG_BLOCK       1
    587 #define SIG_UNBLOCK     2
    588 #define SIG_SETMASK     3
    589 
    590 #if !defined (_SIGSET_T)
    591 #define _SIGSET_T
    592 typedef unsigned long sigset_t;
    593 #endif
    594 
    595 struct sigaction
    596 {
    597   void (*sa_handler)(int);
    598   sigset_t sa_mask;
    599   int sa_flags;
    600 };
    601 
    602 
    603 int kill (int, int);
    604 int pause (void);
    605 
    606 int sigaction (int, __const__ struct sigaction *, struct sigaction *);
    607 int sigpending (sigset_t *);
    608 int sigprocmask (int, __const__ sigset_t *, sigset_t *);
    609 int sigsuspend (__const__ sigset_t *);
    610 
    611 int sigaddset (sigset_t *, int);
    612 int sigdelset (sigset_t *, int);
    613 int sigemptyset (sigset_t *);
    614 int sigfillset (sigset_t *);
    615 int sigismember (__const__ sigset_t *, int);
    616 
    617 #define _SIGMASK(sig) ((sigset_t)1 << ((sig) - 1))
    618 #define __sigaddset(set,sig)   (*(set) |= _SIGMASK (sig), 0)
    619 #define __sigdelset(set,sig)   (*(set) &= ~_SIGMASK (sig), 0)
    620 #define __sigemptyset(set)     (*(set) = 0, 0)
    621 #define __sigfillset(set)      (*(set) = ~(sigset_t)0, 0)
    622 #define __sigismember(set,sig) ((*(set) & _SIGMASK (sig)) ? 1 : 0)
    623 
    624 int _kill (int, int);
    625 int _pause (void);
    626 
    627 int _sigaction (int, __const__ struct sigaction *, struct sigaction *);
    628 int _sigpending (sigset_t *);
    629 int _sigprocmask (int, __const__ sigset_t *, sigset_t *);
    630 int _sigsuspend (__const__ sigset_t *);
    631 
    632 int _sigaddset (sigset_t *, int);
    633 int _sigdelset (sigset_t *, int);
    634 int _sigemptyset (sigset_t *);
    635 int _sigfillset (sigset_t *);
    636 int _sigismember (__const__ sigset_t *, int);
    637 
    638 #endif
    639 
    640 
    641 #if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) || defined(__USE_EMX)
    642 
    643 #define SIG_ACK ((void (*)(int))4)
    644 
    645 #define SA_SYSV         0x0002  /* Reset to SIG_DFL */
    646 #define SA_ACK          0x0004  /* Don't unblock automatically */
    647 
    648 #define SIGTY void
    649 
    650 #endif
    651 
    652 
    653 #include <sys/_types.h>
    654 
    655 typedef union sigval
    656 {
    657     int     sigval_int;
    658     void   *sigval_ptr;
    659 } sigval_t;
    660 
    661 typedef struct __siginfo
    662 {
    663     /** Signal number. */
    664     int             si_signo;
    665     /** Associated errno. */
    666     int             si_errno;
    667     /** Signal code. (See SI_* and FPE_* macros.) */
    668     int             si_code;
    669     /** Timestamp when the signal was generated - LIBC extension. */
    670     unsigned        si_timestamp;
    671     /** Process sending the signal. */
    672     __pid_t         si_pid;
    673     /** Thread sending the signal - LIBC extension. */
    674     unsigned        si_tid;
    675     /** User sending the signal (ruid). (Usually 0 for OS/2) */
    676     __uid_t         si_uid;
    677     /** Exit value. (SIGCHLD) */
    678     int             si_status;
    679     /** Pointer to the faulting instruction or memory reference. (SIGSEGV, SIGILL, SIGFPE, SIGBUS) */
    680     void           *si_addr;
    681     /** Signal value. */
    682     union sigval    si_value;
    683     /** Band event for SIGPOLL. */
    684     long            si_band;
    685     /** Filehandle for SIGPOLL. */
    686     int             si_fd;
    687     /** Reserve a little bit for future usage. */
    688     unsigned        auReserved[4];
    689 } siginfo_t;
    690 
    691 #if defined (__cplusplus)
    692 }
    693 #endif
    694 
    695 #endif /* not _SYS_SIGNAL_H */
    696 
    697 
    698 #endif /* !__NEW_SIGNALS__ */
Note: See TracChangeset for help on using the changeset viewer.