[pulseaudio-discuss] [PATCH 01/11] creds: Add struct for ancillary data

David Henningsson david.henningsson at canonical.com
Tue Apr 29 06:22:15 PDT 2014


To support later patches that add sending/receiving file descriptors,
let's add this struct.

Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
 src/pulsecore/creds.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/pulsecore/creds.h b/src/pulsecore/creds.h
index aa1d560..f09b35e 100644
--- a/src/pulsecore/creds.h
+++ b/src/pulsecore/creds.h
@@ -29,8 +29,12 @@
 #endif
 
 #include <pulsecore/socket.h>
+#include <stdbool.h>
+
+#define MAX_ANCIL_FDS (2)
 
 typedef struct pa_creds pa_creds;
+typedef struct pa_ancil pa_ancil;
 
 #if defined(SCM_CREDENTIALS)
 
@@ -41,6 +45,15 @@ struct pa_creds {
     uid_t uid;
 };
 
+/* Struct for handling ancillary data, i e, extra data that can be sent together with a message
+   over unix pipes. Supports sending and receiving credentials and file descriptors. */
+struct pa_ancil {
+    pa_creds creds;
+    bool creds_valid;
+    int nfd;
+    int fds[MAX_ANCIL_FDS];
+};
+
 #else
 #undef HAVE_CREDS
 #endif
-- 
1.9.1



More information about the pulseaudio-discuss mailing list