Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/signal.h

    r823a929 r1a552fd  
    3737
    3838#include "libc/errno.h"
     39#include "sys/types.h"
    3940
    4041/* HelenOS doesn't have signals, so calls to functions of this header
     
    5152#undef SIG_ERR
    5253#define SIG_ERR ((void (*)(int)) 0)
     54#undef SIG_HOLD
     55#define SIG_HOLD ((void (*)(int)) 0)
    5356#undef SIG_IGN
    5457#define SIG_IGN ((void (*)(int)) 0)
     
    5962
    6063typedef int posix_sig_atomic_t;
     64typedef int posix_sigset_t;
     65typedef struct posix_mcontext {
     66        // FIXME: should not be empty to avoid compiler warnings (-pedantic)
     67        int dummy;
     68} posix_mcontext_t;
     69
     70union posix_sigval {
     71        int sival_int;
     72        void *sival_ptr;
     73};
     74
     75struct posix_sigevent {
     76        int sigev_notify; /* Notification type. */
     77        int sigev_signo; /* Signal number. */
     78        union posix_sigval sigev_value; /* Signal value. */
     79        void (*sigev_notify_function)(union posix_sigval); /* Notification function. */
     80        posix_thread_attr_t *sigev_notify_attributes; /* Notification attributes. */
     81};
     82
     83typedef struct {
     84        int si_signo;
     85        int si_code;
     86
     87        int si_errno;
     88
     89        pid_t si_pid;
     90        uid_t si_uid;
     91        void *si_addr;
     92        int si_status;
     93
     94        long si_band;
     95
     96        union posix_sigval si_value;
     97} posix_siginfo_t;
     98
     99struct posix_sigaction {
     100        void (*sa_handler)(int);
     101        posix_sigset_t sa_mask;
     102        int sa_flags;
     103        void (*sa_sigaction)(int, posix_siginfo_t *, void *);
     104};
     105
     106typedef struct {
     107        void *ss_sp;
     108        size_t ss_size;
     109        int ss_flags;
     110} posix_stack_t;
     111
     112typedef struct posix_ucontext {
     113        struct posix_ucontext *uc_link;
     114        posix_sigset_t uc_sigmask;
     115        posix_stack_t uc_stack;
     116        posix_mcontext_t uc_mcontext;
     117} posix_ucontext_t;
     118
     119
     120/* Values of posix_sigevent::sigev_notify */
     121#undef SIGEV_NONE
     122#define SIGEV_NONE 0
     123#undef SIGEV_SIGNAL
     124#define SIGEV_SIGNAL 0
     125#undef SIGEV_THREAD
     126#define SIGEV_THREAD 0
     127
     128#undef SIGRT_MIN
     129#define SIGRT_MIN 0
     130#undef SIGRT_MAX
     131#define SIGRT_MAX 0
     132
     133#undef SIG_BLOCK
     134#define SIG_BLOCK 0
     135#undef SIG_UNBLOCK
     136#define SIG_UNBLOCK 0
     137#undef SIG_SETMASK
     138#define SIG_SETMASK 0
     139
     140#undef SA_NOCLDSTOP
     141#define SA_NOCLDSTOP 0
     142#undef SA_ONSTACK
     143#define SA_ONSTACK 0
     144#undef SA_RESETHAND
     145#define SA_RESETHAND 0
     146#undef SA_RESTART
     147#define SA_RESTART 0
     148#undef SA_SIGINFO
     149#define SA_SIGINFO 0
     150#undef SA_NOCLDWAIT
     151#define SA_NOCLDWAIT 0
     152#undef SA_NODEFER
     153#define SA_NODEFER 0
     154
     155#undef SS_ONSTACK
     156#define SS_ONSTACK 0
     157#undef SS_DISABLE
     158#define SS_DISABLE 0
     159
     160#undef MINSIGSTKSZ
     161#define MINSIGSTKSZ 0
     162#undef SIGSTKSZ
     163#define SIGSTKSZ 0
    61164
    62165/* full POSIX set */
     
    92195};
    93196
     197/* Just declared to avoid compiler warnings. */
     198extern int posix_sigemptyset(posix_sigset_t *set);
     199extern int posix_sigprocmask(int how, const posix_sigset_t *restrict set,
     200    posix_sigset_t *restrict oset);
     201
    94202#ifndef LIBPOSIX_INTERNAL
    95203        #define sig_atomic_t posix_sig_atomic_t
     204        #define sigset_t posix_sigset_t
     205        #define sigval posix_sigval
     206        #define sigevent posix_sigevent
     207        #define sigaction posix_sigaction
     208        #define mcontext_t posix_mcontext_t
     209        #define ucontext_t posix_ucontext_t
     210        #define stack_t posix_stack_t
     211        #define siginfo_t posix_siginfo_t
     212        #define sigemptyset posix_sigemptyset
     213        #define sigprocmask posix_sigprocmask
    96214#endif
    97215
Note: See TracChangeset for help on using the changeset viewer.