This patch merges the upstream NetBSD syslog.[ch], which adds syslogp()
family of APIs to support RFC5424. This API will first go into use in
the logger tool, klogd, and syslog_tst, then it will also be exposed
as libsyslog and syslog/syslog.h for end-users.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
When a user links with syslog.c, or the future libsyslog, they may still
use the standard GLIBC header files. GLIBC redirects syslog() to the
__syslog_chk() definition early on, but a user may not notice when a
simple non-optimized (-O0 or none) program is compiled.
This currently does not affect musl libc.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Let syslog_tst.c use local syslog.c API, for wrapping
- Add -DTESTING to build of syslog_tst & C:o
- Enable CLOEXEC on each opened log file in syslog.c
- Simplify code for readability
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
From upstream FreeBSD Subversion r165903:
"Per Regents of the University of Calfornia letter,
remove advertising clause."
This patch also includes the renumbering of the clauses, making
this codebase truly 3-clause BSD licensed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Relocate all source files to src/ and manual pages to man/
- Replace static Makefile with GNU configure and build system
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>