Containerized syslog working properly
[safe/jmp/linux-2.6] / include / linux / syslog.h
index 3891139..102908c 100644 (file)
 #define SYSLOG_FROM_CALL 0
 #define SYSLOG_FROM_FILE 1
 
+#define        CLONE_SYSLOG \
+       (CLONE_NEWUTS | CLONE_NEWIPC | CLONE_NEWUSER | \
+        CLONE_NEWPID | CLONE_NEWNET)
+/*structure used to dispatch syslog data according container of origin */
+struct syslog_ns {
+       struct kref kref;       /*syslog_ns reference count & control      */
+       int handle;             /*syslog handle number                     */
+       struct syslog_ns *prvns;/*parent process own syslog                */
+       spinlock_t logbuf_lock; /* access conflict locker                  */
+       unsigned log_start;     /* Index: next char to be read by syslog() */
+       unsigned con_start;     /* Index: next char to be sent to consoles */
+       unsigned log_end;       /* Index: most-recently-written-char + 1   */
+       unsigned logged_chars;  /* Num chars produced since last read+clear*/
+       unsigned buf_len;       /* buffer available space size             */
+       char *buf;              /* allocated ring buffer                   */
+};
+
+/*
+ * Static structure used by nsproxy
+ */
+extern struct syslog_ns init_syslog_ns;
+extern struct syslog_ns *resize_syslog_ns(struct syslog_ns *syslog_ns,
+                                       unsigned container_buf_len);
+extern struct syslog_ns *copy_syslog_ns(unsigned long flags,
+                                       struct syslog_ns *current_syslog_ns);
+extern void free_syslog_ns(struct kref *kref);
+extern struct syslog_ns *current_syslog_ns(void);
+extern struct syslog_ns *switch_syslog_ns(struct syslog_ns *syslog_ns);
+extern struct syslog_ns *find_syslog_ns_bypid(pid_t pid);
+extern void put_syslog_ns(struct syslog_ns *ns);
+
+
+
 int do_syslog(int type, char __user *buf, int count, bool from_file);
 
 #endif /* _LINUX_SYSLOG_H */