From 790aa1f272f22c2a4912d2e776bc6e2f38474633 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 24 Jan 2005 22:57:26 +0000 Subject: Update. 2005-01-24 Ulrich Drepper * misc/syslog.c: Moved to... * sysdeps/generic/syslog.c: ...here. [NO_SIGIPE]: Don't install SIGPIPE handler. * sysdeps/unix/sysv/linux/syslog.c: New file. * sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_MSG_NOSIGNAL. --- sysdeps/unix/sysv/linux/kernel-features.h | 7 ++++++- sysdeps/unix/sysv/linux/syslog.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 sysdeps/unix/sysv/linux/syslog.c (limited to 'sysdeps/unix/sysv') diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index f499a712c4..39b980e898 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -1,6 +1,6 @@ /* Set flags signalling availability of kernel features based on given kernel version number. - Copyright (C) 1999-2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1999-2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -79,6 +79,11 @@ # define __ASSUME_SIOCGIFNAME 1 #endif +/* MSG_NOSIGNAL was at least available with Linux 2.3.15. */ +#if __LINUX_KERNEL_VERSION >= 131855 +# define __ASSUME_MSG_NOSIGNAL 1 +#endif + /* On x86 another `getrlimit' syscall was added in 2.3.25. */ #if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__ # define __ASSUME_NEW_GETRLIMIT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/syslog.c b/sysdeps/unix/sysv/linux/syslog.c new file mode 100644 index 0000000000..eaaa9839dc --- /dev/null +++ b/sysdeps/unix/sysv/linux/syslog.c @@ -0,0 +1,10 @@ +#include "kernel-features.h" + +#if __ASSUME_MSG_NOSIGNAL +# define NO_SIGPIPE +# define send_flags MSG_NOSIGNAL +#else +# define send_flags 0 +#endif + +#include -- cgit 1.4.1