LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Export linux/syslog.h
@ 2011-02-07 11:51 Paul Bolle
  2011-02-07 12:55 ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Bolle @ 2011-02-07 11:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: Kees Cook, David Woodhouse

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.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Kees Cook <kees.cook@canonical.com>
---
 include/linux/Kbuild   |    1 +
 include/linux/syslog.h |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index b0ada6f..c80f55f 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -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
diff --git a/include/linux/syslog.h b/include/linux/syslog.h
index 3891139..75950af 100644
--- a/include/linux/syslog.h
+++ b/include/linux/syslog.h
@@ -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 1
 
 int do_syslog(int type, char __user *buf, int count, bool from_file);
+#endif
 
 #endif /* _LINUX_SYSLOG_H */
-- 
1.7.4




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Export linux/syslog.h
  2011-02-07 11:51 [PATCH] Export linux/syslog.h Paul Bolle
@ 2011-02-07 12:55 ` Arnd Bergmann
  2011-02-07 13:17   ` Paul Bolle
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2011-02-07 12:55 UTC (permalink / raw)
  To: Paul Bolle; +Cc: linux-kernel, Kees Cook, David Woodhouse

On Monday 07 February 2011, Paul Bolle wrote:
> 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.
> 
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> Signed-off-by: Kees Cook <kees.cook@canonical.com>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Export linux/syslog.h
  2011-02-07 12:55 ` Arnd Bergmann
@ 2011-02-07 13:17   ` Paul Bolle
  2011-02-07 14:33     ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Bolle @ 2011-02-07 13:17 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-kernel, Kees Cook, David Woodhouse

On Mon, 2011-02-07 at 13:55 +0100, Arnd Bergmann wrote:
> 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.

> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Export linux/syslog.h
  2011-02-07 13:17   ` Paul Bolle
@ 2011-02-07 14:33     ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2011-02-07 14:33 UTC (permalink / raw)
  To: Paul Bolle, mtk.manpages; +Cc: linux-kernel, Kees Cook, David Woodhouse

On Monday 07 February 2011, Paul Bolle wrote:
> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-07 14:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-07 11:51 [PATCH] Export linux/syslog.h Paul Bolle
2011-02-07 12:55 ` Arnd Bergmann
2011-02-07 13:17   ` Paul Bolle
2011-02-07 14:33     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).