summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/syslog_r.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Kernel sendsyslog(2), libc syslog(3), and syslogd(8) restrict andbluhm2017-08-081-2/+2
| | | | | | truncate the length of a syslog message to 8192 bytes. Use one global define LOG_MAXLINE for all of them. OK deraadt@ millert@
* Since sendsyslog(2) handles the LOG_CONS parameter, the variablebluhm2017-08-071-4/+2
| | | | | conp in syslog(3) is unused. Remove dead code. OK jca@ deraadt@
* Rename TBUF_LEN and FMT_LEN to _SIZE as they contain a NUL byte.bluhm2017-07-201-11/+11
| | | | | | Change FMT_SIZE to 1024+1 for consistency. Do not loop over the format string if there is no output space left. OK deraadt@ millert@
* Use the reentrant strerror_r() instead of strerror() to expand %m.millert2016-10-191-10/+5
| | | | | Previously, syslog_r() would avoid calling strerror() since the latter is not reentrant. OK bluhm@
* remove unused variablechl2016-03-271-2/+2
| | | | ok millert@
* Rename the system call sendsyslog2 to sendsyslog. Keep the old onebluhm2016-03-211-3/+3
| | | | | | as osendsyslog for a while. The three argument variant is the only one that will stay. input kettenis@; OK deraadt@
* environ and __progname are not declared in a public header; declare themguenther2016-03-131-4/+2
| | | | | | in libc's hidden/stdlib.h instead of in each .c file that needs one ok deraadt@ gsoares@ mpi@
* Remove the "error" variable; we no longer fall back to writing tomillert2016-02-191-5/+5
| | | | | /dev/console so the value of "error" is never read. Also mention that sendsyslog2 can fail due to ENOBUFS in the comment. OK deraadt@
* Add a syscall stub for sendsyslog2(2), and use it in syslog_r(3), passingderaadt2015-11-251-19/+2
| | | | | | LOG_CONS to the kernel. As a result, the /dev/console opening code can be removed. ok kettenis millert beck
* Do not include a timestamp in the syslog message. There is no need --deraadt2015-10-311-21/+9
| | | | | | | | syslogd will fill it in immediately upon reception on the other side of sendsyslog(2). Our libc only talks to our syslogd, which will fix the timestamp before forwarding. syslog_r has done this for a long time already. ok tedu bluhm
* Wrap <syslog.h> so that internal calls go direct and they're all weak symbolsguenther2015-09-121-16/+6
| | | | | Delete code that's a no-op now that we don't use sockets Eliminate unnecessary #includes
* Syslogd can handle 8192 bytes per message now. Increase the libcbluhm2015-09-091-2/+2
| | | | | | syslog(3) limit to the same size. The buffer needs one byte more as it conains a NUL that sendsyslog(2) does not process. OK deraadt@
* Truncate progname to NAME_MAX in the syslog message, to ensure otherderaadt2015-01-211-2/+3
| | | | | | information also makes it through. This is a compromise to cope with the absolutely ridiculous setprogname() API. ok various discussions
* Strip trailing new-lines from syslog messages. This avoids emptybluhm2014-10-031-6/+11
| | | | | lines when printing to console or stderr. OK deraadt@
* Convert syslog_r(3) to using sendsyslog(2). This ensures that syslog_r(3)deraadt2014-07-141-77/+5
| | | | | | can be used anywhere (signal handler, stack protector fault handler) as long as the format string does not contain floating point. ok tedu miod beck
* use FD_CLOEXEC instead of 1; from David Hillokan2013-04-291-2/+2
| | | | ok otto
* Make printf-like and scanf-like functions marked as such in llib-lc.lnmartynas2011-05-301-1/+2
| | | | | | | and llib-lwrap.ln databases; so that the lint features doing format strings checks are enabled by default. Looks good to millert@.
* remove unused variablechl2009-11-211-2/+1
| | | | ok guenther@
* More shrinkage, a bit for ramdisks but mostly for static binaries:guenther2009-11-181-0/+322
- wrap with #ifndef NO_LOG_BAD_DNS_RESPONSES libc code that uses p_class() and p_type() for diagnostics, then add that define to libstub to avoid pulling in res_debug_syms.o - split rcmd() and ruserok() into separate files, as nothing uses both - split readdir_r() to its own file - split syslog_r() from syslog(), as the latter needs localtime(); many binaries no longer need to pull in all the time code after this; switch from usleep() to nanosleep() while we're at it (The profit of analysis of -Wl,-M,--cref output) Chops 888kB from /bin and /sbin on i386 ok deraadt@, miod@