Pekka Paalanen | 51aaf64 | 2012-05-30 15:53:41 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2012 Collabora, Ltd. |
| 3 | * |
Bryce Harrington | 6c6164c | 2015-06-11 14:20:17 -0700 | [diff] [blame^] | 4 | * Permission is hereby granted, free of charge, to any person obtaining |
| 5 | * a copy of this software and associated documentation files (the |
| 6 | * "Software"), to deal in the Software without restriction, including |
| 7 | * without limitation the rights to use, copy, modify, merge, publish, |
| 8 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 9 | * permit persons to whom the Software is furnished to do so, subject to |
| 10 | * the following conditions: |
Pekka Paalanen | 51aaf64 | 2012-05-30 15:53:41 +0300 | [diff] [blame] | 11 | * |
Bryce Harrington | 6c6164c | 2015-06-11 14:20:17 -0700 | [diff] [blame^] | 12 | * The above copyright notice and this permission notice (including the |
| 13 | * next paragraph) shall be included in all copies or substantial |
| 14 | * portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | * SOFTWARE. |
Pekka Paalanen | 51aaf64 | 2012-05-30 15:53:41 +0300 | [diff] [blame] | 24 | */ |
| 25 | |
| 26 | #ifndef OS_COMPATIBILITY_H |
| 27 | #define OS_COMPATIBILITY_H |
| 28 | |
Kristian Høgsberg | e73eccd | 2014-01-31 16:15:11 -0800 | [diff] [blame] | 29 | #include "config.h" |
Pekka Paalanen | 1da1b8f | 2012-06-06 16:59:43 +0300 | [diff] [blame] | 30 | |
Andrew Wedgbury | 9cd661e | 2014-04-07 12:40:35 +0100 | [diff] [blame] | 31 | #include <sys/types.h> |
| 32 | |
Pekka Paalanen | 200019c | 2012-05-30 15:53:42 +0300 | [diff] [blame] | 33 | #ifdef HAVE_EXECINFO_H |
| 34 | #include <execinfo.h> |
| 35 | #else |
| 36 | static inline int |
| 37 | backtrace(void **buffer, int size) |
| 38 | { |
| 39 | return 0; |
| 40 | } |
| 41 | #endif |
| 42 | |
Pekka Paalanen | 51aaf64 | 2012-05-30 15:53:41 +0300 | [diff] [blame] | 43 | int |
| 44 | os_socketpair_cloexec(int domain, int type, int protocol, int *sv); |
| 45 | |
Pekka Paalanen | 647f2bf | 2012-05-30 15:53:43 +0300 | [diff] [blame] | 46 | int |
| 47 | os_epoll_create_cloexec(void); |
| 48 | |
Pekka Paalanen | 1da1b8f | 2012-06-06 16:59:43 +0300 | [diff] [blame] | 49 | int |
| 50 | os_create_anonymous_file(off_t size); |
| 51 | |
Pekka Paalanen | b7a9498 | 2012-06-12 17:42:25 +0300 | [diff] [blame] | 52 | #ifndef HAVE_STRCHRNUL |
| 53 | char * |
| 54 | strchrnul(const char *s, int c); |
| 55 | #endif |
| 56 | |
Pekka Paalanen | 51aaf64 | 2012-05-30 15:53:41 +0300 | [diff] [blame] | 57 | #endif /* OS_COMPATIBILITY_H */ |