Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

sigsafe.h

Go to the documentation of this file.
00001 
00010 #ifndef SIGSAFE_H
00011 #define SIGSAFE_H
00012 
00013 #ifdef __NetBSD__
00014 #define SIGSAFE_NO_SIGINFO
00015 #endif
00016 
00017 #include <sigsafe_config.h>
00018 #include <signal.h>
00019 #ifndef SIGSAFE_NO_SIGINFO
00020 #include <ucontext.h>
00021 #endif
00022 #include <sys/select.h>
00023 #include <sys/types.h>
00024 #include <sys/resource.h>
00025 #include <sys/wait.h>
00026 #include <sys/time.h>
00027 #include <sys/socket.h>
00028 #ifdef SIGSAFE_HAVE_STDINT_H
00029 #include <stdint.h> /* for intptr_t */
00030 #endif
00031 
00032 #ifdef SIGSAVE_HAVE_KEVENT
00033 #include <sys/event.h>
00034 #endif
00035 
00036 #ifdef SIGSAFE_HAVE_EPOLL
00037 #include <sys/epoll.h>
00038 #endif
00039 
00040 #ifdef SIGSAFE_HAVE_POLL
00041 #include <sys/poll.h>
00042 #endif
00043 
00044 #include <unistd.h>
00045 #include <stddef.h>
00046 #include <setjmp.h>
00047 #include <time.h>
00048 
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif
00052 
00057 
00098 #ifdef SIGSAFE_NO_SIGINFO
00099 typedef void (*sigsafe_user_handler_t)(int, int, struct sigcontext*, intptr_t);
00100 #else
00101 typedef void (*sigsafe_user_handler_t)(int, siginfo_t*, ucontext_t*, intptr_t);
00102 #endif
00103 
00125 int sigsafe_install_handler(int signum, sigsafe_user_handler_t handler);
00126 
00143 int sigsafe_install_tsd(intptr_t userdata, void (*destructor)(intptr_t));
00144 
00164 intptr_t sigsafe_clear_received(void);
00165 
00206 
00208 int sigsafe_read(int fd, void *buf, size_t count);
00209 
00211 int sigsafe_readv(int d, const struct iovec *iov, int iovcnt);
00212 
00214 int sigsafe_write(int fd, const void *buf, size_t count);
00215 
00217 int sigsafe_writev(int d, const struct iovec *iov, int iovcnt);
00218 
00227 #if defined(SIGSAFE_HAVE_EPOLL) || defined(DOXYGEN)
00228 int sigsafe_epoll_wait(int epfd, struct epoll_event *events, int maxevents,
00229                        int timeout);
00230 #endif
00231 
00241 #if defined(SIGSAFE_HAVE_KEVENT) || defined(DOXYGEN)
00242 int sigsafe_kevent(int kq, int nchanges, struct kevent **changelist,
00243                    int nevents, struct kevent **eventlist,
00244                    struct timespec *timeout);
00245 #endif
00246 
00254 #if defined(SIGSAFE_HAVE_SELECT) || defined(DOXYGEN)
00255 int sigsafe_select(int nfds, fd_set *readfds, fd_set *writefds,
00256                    fd_set *errorfds, struct timeval *timeout);
00257 #endif
00258 
00266 #if defined(SIGSAFE_HAVE_POLL) || defined(DOXYGEN)
00267 int sigsafe_poll(struct pollfd *ufds, unsigned int nfds, int timeout);
00268 #endif
00269 
00271 int sigsafe_wait4(pid_t wpid, int *status, int options, struct rusage *rusage);
00272 
00277 int sigsafe_accept(int fd, struct sockaddr *addr, socklen_t *addrlen);
00278 
00280 int sigsafe_connect(int sockfd, const struct sockaddr *serv_addr,
00281                     socklen_t addrlen);
00282 
00289 int sigsafe_nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
00290 
00291 int sigsafe_sigsuspend(const sigset_t*);
00292 int sigsafe_pause(void);
00293 
00296 #ifdef __cplusplus
00297 } // extern "C"
00298 #endif
00299 #endif /* !SIGSAFE_H */

Generated on Fri Feb 4 11:13:32 2005 for sigsafe by doxygen 1.3.5