Export linux/syslog.h
PATCH 1/1 Export linux/syslog.h
Userspace programs (like util-linux' dmesg) still use magic numbers for the klogctl function (glibc's interface to the syslog system call). Exporting linux/syslog.h makes the more descriptive named constants available as a single reference for these values.
--- include/linux/Kbuild | 1 + include/linux/syslog.h | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-)
include/linux/Kbuild +1 -0
@@ -347,6 +347,7 @@ header-y += suspend_ioctls.h header-y += swab.h header-y += synclink.h header-y += sysctl.h +header-y += syslog.h header-y += taskstats.h header-y += tcp.h header-y += telephony.h
include/linux/syslog.h +2 -0
@@ -44,9 +44,11 @@/* Return size of the log buffer */ #define SYSLOG_ACTION_SIZE_BUFFER 10 +#ifdef __KERNEL__#define SYSLOG_FROM_CALL 0#define SYSLOG_FROM_FILE 1int do_syslog (int type,char __user *buf,int count,bool from_file); +#endif #endif /* _LINUX_SYSLOG_H */
Signature · 1 line
1.7.4
Quoted 7 lines · Paul Bolle
Userspace programs (like util-linux' dmesg) still use magic numbers for the klogctl function (glibc's interface to the syslog system call). Exporting
linux/syslog.hmakes the more descriptive named constants available as a single reference for these values.Signed-off-by Paul Bolle <[email protected]>Signed-off-by Kees Cook <[email protected]>
It sounds reasonable to make this a proper ABI in general.
The comment in the header file currently starts with "Syslog internals". If you want to export it, you should probably change that, too. Further, the man page currently documents the raw numbers and should be changed as well with the new constants.
Arnd
Quoted 2 lines · Arnd Bergmann
The comment in the header file currently starts with "Syslog internals". If you want to export it, you should probably change that, too.
That makes sense.
Quoted 2 lines
Further, the man page currently documents the raw numbers and should be changed as well with the new constants.
Yes, I realized that. I assumed that updating the man page should be done after this patch was accepted. Or should patches like this one be done in parallel with the patch(es) to the relevant man page(s)? Either way is fine with me.
Paul
Quoted 7 lines · Paul Bolle
Quoted 2 lines
Further, the man page currently documents the raw numbers and should be changed as well with the new constants.
Yes, I realized that. I assumed that updating the man page should be done after this patch was accepted. Or should patches like this one be done in parallel with the patch(es) to the relevant man page(s)? Either way is fine with me.
I would recommend sending both patches together for review, though the man page change will not be in a release before the kernel gets released with your patch.
Arnd