Changeset fa9815d9 in mainline


Ignore:
Timestamp:
2011-06-25T19:06:21Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e3891262
Parents:
f246c81c
Message:

Add types and constants to signal.h

Location:
uspace/lib/posix
Files:
2 edited

Legend:

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

    rf246c81c rfa9815d9  
    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} posix_mcontext_t;
     67
     68union posix_sigval {
     69        int sival_int;
     70        void *sival_ptr;
     71};
     72
     73struct posix_sigevent {
     74        int sigev_notify; /* Notification type. */
     75        int sigev_signo; /* Signal number. */
     76        union posix_sigval sigev_value; /* Signal value. */
     77        void (*sigev_notify_function)(union sigval); /* Notification function. */
     78        posix_thread_attr_t *sigev_notify_attributes; /* Notification attributes. */
     79};
     80
     81typedef struct {
     82        int si_signo;
     83        int si_code;
     84
     85        int si_errno;
     86
     87        pid_t si_pid;
     88        uid_t si_uid;
     89        void *si_addr;
     90        int si_status;
     91
     92        long si_band;
     93
     94        union posix_sigval si_value;
     95} posix_siginfo_t;
     96
     97struct posix_sigaction {
     98        void (*sa_handler)(int);
     99        posix_sigset_t sa_mask;
     100        int sa_flags;
     101        void (*sa_sigaction)(int, posix_siginfo_t *, void *);
     102};
     103
     104typedef struct {
     105        void *ss_sp;
     106        size_t ss_size;
     107        int ss_flags;
     108} posix_stack_t;
     109
     110typedef struct posix_ucontext {
     111        struct posix_ucontext *uc_link;
     112        posix_sigset_t uc_sigmask;
     113        posix_stack_t uc_stack;
     114        posix_mcontext_t uc_mcontext;
     115} posix_ucontext_t;
     116
     117
     118/* Values of posix_sigevent::sigev_notify */
     119#undef SIGEV_NONE
     120#define SIGEV_NONE 0
     121#undef SIGEV_SIGNAL
     122#define SIGEV_SIGNAL 0
     123#undef SIGEV_THREAD
     124#define SIGEV_THREAD 0
     125
     126#undef SIGRT_MIN
     127#define SIGRT_MIN 0
     128#undef SIGRT_MAX
     129#define SIGRT_MAX 0
     130
     131#undef SIG_BLOCK
     132#define SIG_BLOCK 0
     133#undef SIG_UNBLOCK
     134#define SIG_UNBLOCK 0
     135#undef SIG_SETMASK
     136#define SIG_SETMASK 0
     137
     138#undef SA_NOCLDSTOP
     139#define SA_NOCLDSTOP 0
     140#undef SA_ONSTACK
     141#define SA_ONSTACK 0
     142#undef SA_RESETHAND
     143#define SA_RESETHAND 0
     144#undef SA_RESTART
     145#define SA_RESTART 0
     146#undef SA_SIGINFO
     147#define SA_SIGINFO 0
     148#undef SA_NOCLDWAIT
     149#define SA_NOCLDWAIT 0
     150#undef SA_NODEFER
     151#define SA_NODEFER 0
     152
     153#undef SS_ONSTACK
     154#define SS_ONSTACK 0
     155#undef SS_DISABLE
     156#define SS_DISABLE 0
     157
     158#undef MINSIGSTKSZ
     159#define MINSIGSTKSZ 0
     160#undef SIGSTKSZ
     161#define SIGSTKSZ 0
    61162
    62163/* full POSIX set */
     
    94195#ifndef LIBPOSIX_INTERNAL
    95196        #define sig_atomic_t posix_sig_atomic_t
     197        #define sigset_t posix_sigset_t
     198        #define sigval posix_sigval
     199        #define sigevent posix_sigevent
     200        #define sigaction posix_sigaction
     201        #define mcontext_t posix_mcontext_t
     202        #define ucontext_t posix_ucontext_t
     203        #define stack_t posix_stack_t
     204        #define siginfo_t posix_siginfo_t
    96205#endif
    97206
  • uspace/lib/posix/sys/types.h

    rf246c81c rfa9815d9  
    4949typedef sysarg_t posix_dev_t;
    5050
     51/* PThread types */
     52typedef struct posix_thread_attr posix_thread_attr_t;
     53
    5154#ifndef LIBPOSIX_INTERNAL
    5255        #define ino_t posix_ino_t
     
    5962        #define pid_t posix_pid_t
    6063        #define dev_t posix_dev_t
     64       
     65        #define pthread_attr_t posix_thread_attr_t
    6166#endif
    6267
Note: See TracChangeset for help on using the changeset viewer.