Page MenuHomeFreeBSD

libc: Some enhancements to syslog(3)
ClosedPublic

Authored by dmitry.wagin_ya.ru on Nov 13 2020, 3:24 PM.

Details

Summary

There're some enhancements to libc syslog(3):

  1. Defined MAXLINE constant (8192 octets by default instead 2048) for centralized limit setting up. It sets maximum number of characters of the syslog message. RFC5424 doesn't limit maximum size of the message. Named after MAXLINE in syslogd(8).
  2. Fixed size of fmt_cpy buffer up to MAXLINE for rendering formatted (%m) messages.
  3. Introduced autoexpansion of sending socket buffer up to MAXLINE.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

lib/libc/gen/syslog.c
36

How exactly does it help? syslogd still uses MAXLINE = 2048.

410

If the intent is to ignore errors, please add a cast to void, i.e., (void)_setsockopt(...);.

ping

Sorry for the delay. I think it's ok. I have a couple of questions but otherwise I will commit.

lib/libc/gen/syslog.c
36

Is there a reason it is defined before includes? If not it should be moved below.

263–266

I don't see why we need this part of the change.

  • fixed "#define" position
  • revert some unimportant changes
This revision was not accepted when it landed; it landed in state Needs Review.Tue, Mar 23, 4:53 PM
This revision was automatically updated to reflect the committed changes.