]>
Commit | Line | Data |
---|---|---|
91327a77 AA |
1 | /* |
2 | * Ceph - scalable distributed file system | |
3 | * | |
4 | * Copyright (C) 2018 Red Hat, Inc. | |
5 | * | |
6 | * This is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU Lesser General Public | |
8 | * License version 2.1, as published by the Free Software | |
9 | * Foundation. See file COPYING. | |
10 | */ | |
11 | ||
7c673cae FG |
12 | #ifndef CEPH_SOCK_COMPAT_H |
13 | #define CEPH_SOCK_COMPAT_H | |
14 | ||
15 | #include "include/compat.h" | |
91327a77 | 16 | #include <sys/socket.h> |
7c673cae FG |
17 | |
18 | /* | |
19 | * This optimization may not be available on all platforms (e.g. OSX). | |
20 | * Apparently a similar approach based on TCP_CORK can be used. | |
21 | */ | |
22 | #ifndef MSG_MORE | |
23 | # define MSG_MORE 0 | |
24 | #endif | |
25 | ||
3efd9988 FG |
26 | /* |
27 | * On BSD SO_NOSIGPIPE can be set via setsockopt to block SIGPIPE. | |
28 | */ | |
29 | #ifndef MSG_NOSIGNAL | |
30 | # define MSG_NOSIGNAL 0 | |
31 | # ifdef SO_NOSIGPIPE | |
32 | # define CEPH_USE_SO_NOSIGPIPE | |
33 | # else | |
34 | # define CEPH_USE_SIGPIPE_BLOCKER | |
35 | # warning "Using SIGPIPE blocking instead of suppression; this is not well-tested upstream!" | |
36 | # endif | |
37 | #endif | |
38 | ||
91327a77 AA |
39 | int socket_cloexec(int domain, int type, int protocol); |
40 | int socketpair_cloexec(int domain, int type, int protocol, int sv[2]); | |
41 | int accept_cloexec(int sockfd, struct sockaddr* addr, socklen_t* addrlen); | |
42 | ||
7c673cae | 43 | #endif |