log: add CMD_SYSINFO()

Add a thread-safe and uniform way to retrieve errno values in programs that are shipped as part of LXC but are not expected to have access to the logging system. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 37b9abb1
......@@ -435,6 +435,12 @@ ATTR_UNUSED static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
fprintf(stderr, "%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
#define CMD_SYSINFO(format, ...) \
do { \
lxc_log_strerror_r; \
printf("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
extern int lxc_log_fd;
extern int lxc_log_syslog(int facility);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment