]>
git.proxmox.com Git - ceph.git/blob - ceph/src/include/sock_compat.h
2 * Ceph - scalable distributed file system
4 * Copyright (C) 2018 Red Hat, Inc.
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.
12 #ifndef CEPH_SOCK_COMPAT_H
13 #define CEPH_SOCK_COMPAT_H
15 #include "include/compat.h"
16 #include <sys/socket.h>
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.
27 * On BSD SO_NOSIGPIPE can be set via setsockopt to block SIGPIPE.
30 # define MSG_NOSIGNAL 0
32 # define CEPH_USE_SO_NOSIGPIPE
34 # define CEPH_USE_SIGPIPE_BLOCKER
35 # warning "Using SIGPIPE blocking instead of suppression; this is not well-tested upstream!"
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
);