]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/TypedMsgHdr.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / TypedMsgHdr.h
index 95afe00dd67201606bae090f2e26e68ac79c77fb..0e03a1cc515b0353295e1b8bedb813eb71c089bc 100644 (file)
@@ -1,13 +1,17 @@
 /*
- * $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
@@ -60,7 +64,8 @@ public:
 
     /* 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
@@ -90,7 +95,8 @@ private:
     } 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
@@ -100,3 +106,4 @@ private:
 } // namespace Ipc
 
 #endif /* SQUID_IPC_TYPED_MSG_HDR_H */
+