blob: 06d257485bdf9bb0486da4991cd03b29bf3de0d0 [file] [log] [blame]
Pekka Paalanen51aaf642012-05-30 15:53:41 +03001/*
2 * Copyright © 2012 Collabora, Ltd.
3 *
Bryce Harrington6c6164c2015-06-11 14:20:17 -07004 * 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 Paalanen51aaf642012-05-30 15:53:41 +030011 *
Bryce Harrington6c6164c2015-06-11 14:20:17 -070012 * 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 Paalanen51aaf642012-05-30 15:53:41 +030024 */
25
26#ifndef OS_COMPATIBILITY_H
27#define OS_COMPATIBILITY_H
28
Kristian Høgsberge73eccd2014-01-31 16:15:11 -080029#include "config.h"
Pekka Paalanen1da1b8f2012-06-06 16:59:43 +030030
Andrew Wedgbury9cd661e2014-04-07 12:40:35 +010031#include <sys/types.h>
32
Pekka Paalanen200019c2012-05-30 15:53:42 +030033#ifdef HAVE_EXECINFO_H
34#include <execinfo.h>
35#else
36static inline int
37backtrace(void **buffer, int size)
38{
39 return 0;
40}
41#endif
42
Pekka Paalanen51aaf642012-05-30 15:53:41 +030043int
Derek Foreman6bc33d62015-06-08 11:37:31 -050044os_fd_set_cloexec(int fd);
45
46int
Pekka Paalanen51aaf642012-05-30 15:53:41 +030047os_socketpair_cloexec(int domain, int type, int protocol, int *sv);
48
Pekka Paalanen647f2bf2012-05-30 15:53:43 +030049int
50os_epoll_create_cloexec(void);
51
Pekka Paalanen1da1b8f2012-06-06 16:59:43 +030052int
53os_create_anonymous_file(off_t size);
54
Pekka Paalanenb7a94982012-06-12 17:42:25 +030055#ifndef HAVE_STRCHRNUL
56char *
57strchrnul(const char *s, int c);
58#endif
59
Pekka Paalanen51aaf642012-05-30 15:53:41 +030060#endif /* OS_COMPATIBILITY_H */