/*
- * $Id$
- *
- * DEBUG: section 54 Interprocess Communication
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
*
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
*/
+/* DEBUG: section 54 Interprocess Communication */
+
#ifndef SQUID_IPC_TYPED_MSG_HDR_H
#define SQUID_IPC_TYPED_MSG_HDR_H
+#include "compat/cmsg.h"
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
/* access to a "file" descriptor that can be passed between processes */
void putFd(int aFd); ///< stores descriptor
- int getFd() const; ///< returns descriptor
+ int getFd() const; ///< returns stored descriptor
+ bool hasFd() const; ///< whether the message has a descriptor stored
/* raw, type-independent access for I/O */
void prepForReading(); ///< reset and provide all buffers
} data; ///< same as .msg_iov[0].iov_base
struct CtrlBuffer {
- char raw[CMSG_SPACE(sizeof(int))]; ///< control buffer space for one fd
+ /// control buffer space for one fd
+ char raw[SQUID_CMSG_SPACE(sizeof(int))];
} ctrl; ///< same as .msg_control
/// data offset for the next get/put*() to start with
} // namespace Ipc
#endif /* SQUID_IPC_TYPED_MSG_HDR_H */
+