summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-08-08 21:34:25 +0000
committerJakub Jelinek <jakub@redhat.com>2005-08-08 21:34:25 +0000
commita6d1003497d92df2575894474fa1d2c0ee3f39f4 (patch)
tree6665a936728da87053845bdff9ff812ee58981ec /misc
parentc633e822b473e8135a36e413c5b79d7ce5a5d1fc (diff)
Updated to fedora-glibc-20050808T2126
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile2
-rw-r--r--misc/Versions3
-rw-r--r--misc/bits/syslog.h39
-rw-r--r--misc/sys/syslog.h10
4 files changed, 51 insertions, 3 deletions
diff --git a/misc/Makefile b/misc/Makefile
index cd5b64e7ab..7c0b64818d 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -29,7 +29,7 @@ headers := sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \
sys/mman.h sys/param.h fstab.h mntent.h search.h err.h error.h \
sys/queue.h sysexits.h syscall.h sys/syscall.h sys/swap.h \
sys/select.h ustat.h sys/ustat.h bits/ustat.h sys/sysinfo.h \
- regexp.h bits/select.h bits/mman.h sys/xattr.h
+ regexp.h bits/select.h bits/mman.h sys/xattr.h bits/syslog.h
routines := brk sbrk sstk ioctl \
readv writev \
diff --git a/misc/Versions b/misc/Versions
index 13b38eec72..4c3aafad6e 100644
--- a/misc/Versions
+++ b/misc/Versions
@@ -130,4 +130,7 @@ libc {
GLIBC_2.3.3 {
remap_file_pages;
}
+ GLIBC_2.4 {
+ __syslog_chk; __vsyslog_chk;
+ }
}
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
new file mode 100644
index 0000000000..c0427214e3
--- /dev/null
+++ b/misc/bits/syslog.h
@@ -0,0 +1,39 @@
+/* Checking macros for syslog functions.
+ Copyright (C) 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSLOG_H
+# error "Never include <bits/syslog.h> directly; use <sys/syslog.h> instead."
+#endif
+
+
+extern void __syslog_chk (int __pri, int __flag, __const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
+#define syslog(pri, ...) \
+ __syslog_chk (pri, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+
+
+#ifdef __USE_BSD
+extern void __vsyslog_chk (int __pri, int __flag, __const char *__fmt,
+ __gnuc_va_list __ap)
+ __attribute__ ((__format__ (__printf__, 3, 0)));
+
+# define vsyslog(pri, fmt, ap) \
+ __vsyslog_chk (pri, __USE_FORTIFY_LEVEL - 1, fmt, ap)
+#endif
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index 5007525d85..9de7570d8a 100644
--- a/misc/sys/syslog.h
+++ b/misc/sys/syslog.h
@@ -188,7 +188,7 @@ extern int setlogmask (int __mask) __THROW;
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern void syslog (int __pri, __const char *__fmt, ...)
- __attribute__ ((__format__(__printf__, 2, 3)));
+ __attribute__ ((__format__ (__printf__, 2, 3)));
#ifdef __USE_BSD
/* Generate a log message using FMT and using arguments pointed to by AP.
@@ -198,7 +198,13 @@ extern void syslog (int __pri, __const char *__fmt, ...)
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
- __attribute__ ((__format__(__printf__, 2, 0)));
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+#endif
+
+
+/* Define some macros helping to catch buffer overflows. */
+#if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
+# include <bits/syslog.h>
#endif
__END_DECLS