Home | History | Annotate | Download | only in gen
History log of /src/lib/libc/gen/syslog.c
RevisionDateAuthorComments
 1.58  12-Jan-2017  christos undo SSP damage from -Wsystem-headers
 1.57  12-Jan-2017  christos A little more restructuring so that we don't need mutex stuff in syslog_ss.
 1.56  12-Jan-2017  christos Split syslog.c to:

- syslog_ss.c *_ss api functions (don't use stdio, time)
- syslog.c: *syslog* non _ss api functions (use stdio, time)
- xsyslog.c> common guts.

The motivation for this is not to drag in stdio/locale/floating point/time
for every binary, since syslog_ss() is used in __stack_check_fail() for SSP.
 1.55  26-Oct-2015  roy branches: 1.55.2;
Use strerror(3) instead of strerror_r(3) and an arbitary buffer size which could be too small.
 1.54  18-Sep-2014  christos make more descriptors that we open as close-on-exec
 1.53  11-Oct-2012  christos take care of the signal safe syslog calls which are not exposed.
 1.52  10-Oct-2012  christos add more locking (when we read and write fields)
 1.51  10-Oct-2012  christos PR/47055: David Holland: Remove static hostname and store the hostname in
syslog_data. Initialize hostname before it is used. While here, add a version
to syslog_data.
 1.50  13-Mar-2012  christos branches: 1.50.2;
PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.49  15-Oct-2011  christos branches: 1.49.2;
close on exec fixes:
- open + fcntl -> open O_CLOEXEC
- configuration database file descriptors that can stay open are now opened
fopen(db, "re")
 1.48  13-May-2010  christos PR/43300: Takahiro Kambe: LOG_PID and LOG_CONSOLE printed syslogp messages
to the console/stderr since the syslogp conversion.
 1.47  11-Jan-2009  christos merge christos-time_t
 1.46  10-Dec-2008  christos Martin says:

I had added a getaddrinfo()/getnameinfo() lookup to obtain an FQDN even
if gethostname() would return only the local part of the hostname.
I did not really consider that many systems do not have FQDNs and more
importantly that the calls introduce a high latency (timeout) when DNS
is not available.

On the other hand I do not (or no longer) think that using a non-FQDN is
such a big problem here. Those users/admins that do collect logs from
different hosts and want an FQDN should notice the problem quickly
enough and can easily fix it by correctly setting their hostname.
 1.45  03-Nov-2008  cube branches: 1.45.2;
Invert the test for the return value of getaddrinfo(), because that's what
is actually meant there, to do nothing when the name doesn't resolve to an
address.
 1.44  31-Oct-2008  christos fix compile error.
 1.43  31-Oct-2008  christos Import syslogd SoC project by Martin Schuette:
- new syslog protocol api syslogp(3) that supports structured data
and draft-rfc timestamps
- reliable tcp connections with queueing
- encrypted connections
 1.42  22-Oct-2008  dogcow appease lint: warning: assignment in conditional context [159]
 1.41  21-Oct-2008  christos - vsyslog_r only closes if it opened
- maintain opened properly
- preserve the tag (from OpenBSD)
 1.40  12-Jun-2008  christos PR/38539: Ed Ravin: libc/gen/syslog.c always logs to console if LOG_CONS is set.
While here:
1. Don't loop forever, handle closing and opening the log after each send.
2. Release the lock later, after we've possibly printed to the console.
 1.39  22-Nov-2006  christos branches: 1.39.16; 1.39.18;
Don't expose _ss functions for 4.0. Requested by core.
 1.38  05-Nov-2006  christos weak for syslog_ss
 1.37  03-Nov-2006  christos use FD_CLOEXEC instead of 1.
 1.36  02-Nov-2006  christos - verify that the log file is usable, otherwise re-open it.
- if the file is re-opened, clear the connected flag.
- don't check that the file is opened before connecting, because the
file will be opened then.
 1.35  27-Oct-2006  christos need to negate before masking; from abp.
 1.34  27-Oct-2006  christos add async-signal-safe versions: syslog_ss and vsyslog_ss
multithread-safe syslog_r and vsyslog_r are not async-signal-safe.
 1.33  26-Oct-2006  christos don't use strerror_r in the re-entrant case.
 1.32  25-Oct-2006  christos add _r functions for syslog from OpenBSD
 1.31  29-Nov-2005  christos WARNS=4
 1.30  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.29  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.28  26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.27  30-Jul-2001  atatat Build a single retry into syslog() so that if someone restarted
syslogd after we called openlog(), we don't just to lose until we call
openlog() again. Or get restarted. This is good for long running
processes that use syslog(), like sendmail, postfix, named, etc.
 1.26  19-Feb-2001  cgd branches: 1.26.2;
convert from __progname to getprogname()
 1.25  30-Dec-2000  martin Be consistent with argument types vs. prototype; use _BSD_VA_LIST_ as
the argument, instead of va_list. Might not make a difference on most
ports, depending on toolchain/MD typedefs. Does make a difference on sparc64,
where it wouldn't compile otherwise.
 1.24  22-Jan-2000  mycroft branches: 1.24.4;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.23  03-May-1999  christos Fix unaligned access lint warning.
 1.22  16-Mar-1999  is Use SUN_LEN, not sizeof.
 1.21  16-Mar-1999  is Use a struct sockaddr_un, so that the new _PATH_LOG actually fits into it.
 1.20  04-Feb-1999  kleink Protect syslog descriptor state with a mutex. TODO: cleanup handling for
cancellation points.
 1.19  13-Nov-1998  christos delint
 1.18  13-Sep-1998  kleink Use localtime_r() rather than localtime(); removes a potential source of
surprise for the application.
 1.17  18-Aug-1998  thorpej Add some braces to make egcs happy.
 1.16  27-Jul-1998  mycroft Delint (partially).
 1.15  18-Jul-1998  lukem use AF_LOCAL instead of AF_UNIX
 1.14  03-Feb-1998  perry remove obsolete register declarations
 1.13  02-Feb-1998  perry merge/update to lite-2
 1.12  21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.11  13-Jul-1997  christos Pacify gcc
Fix RCSID's
 1.10  31-Aug-1995  mycroft branches: 1.10.4;
Clean up a little, and fix a fencepost error.
 1.9  30-Aug-1995  jtc Don't overflow fixed sized buffers. Parts of this patch come from
Perry Metzger, Charles Hannum and Paul Kranenburg.
 1.8  11-Apr-1995  cgd fix operator precedence error (pr 951 from Ted Lemon)
 1.7  04-Mar-1995  cgd fix up some RCS Id's i botched.
 1.6  27-Feb-1995  cgd merge with 4.4-Lite, keeping local changes. clean up Ids
 1.5  24-Nov-1993  jtc branches: 1.5.4;
Change C library functions to use strchr() and strrchr() instead of index()
and rindex(). This will allow (strict {ANSI, POSIX, XOPEN}) applications
to redefine index() and rindex() without effecting the library internals.
 1.4  26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.3  30-Jul-1993  mycroft Add even more RCS frobs.
 1.2  27-Apr-1993  glass improved error handling from ftp.uu.net:bsd-sources
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3  02-Feb-1998  perry import lite-2
 1.1.1.2  25-Feb-1995  cgd from lite, with minor name rearrangement to fit.
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.4.2  02-May-1995  jtc #include "namespace.h"
 1.5.4.1  26-Apr-1995  jtc don't explicitly declare strerror --- <string.h> already provides a prototype
 1.10.4.2  20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.10.4.1  19-Sep-1996  jtc snapshot namespace cleanup: gen
 1.24.4.1  29-Mar-2002  he Pull up revision 1.27 (requested by atatat):
Add a single retry into syslog(), to cope with a restarted syslogd,
so that log messages don't get lost. Most useful for long-running
programs.
 1.26.2.3  21-Jun-2002  nathanw Catch up to -current.
 1.26.2.2  08-Oct-2001  nathanw Catch up to -current.
 1.26.2.1  08-Aug-2001  nathanw _REENT -> _REENTRANT
 1.39.18.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.39.16.1  17-Jun-2008  yamt sync with head.
 1.45.2.3  04-Jan-2009  christos merge with head.
 1.45.2.2  08-Nov-2008  christos time_t changes
 1.45.2.1  03-Nov-2008  christos file syslog.c was added on branch christos-time_t on 2008-11-08 21:45:38 +0000
 1.49.2.2  30-Oct-2012  yamt sync with head
 1.49.2.1  17-Apr-2012  yamt sync with head
 1.50.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.55.2.1  20-Mar-2017  pgoyette Sync with HEAD

RSS XML Feed