Page MenuHomeFreeBSD

libc: Some enhancements to syslog(3)
ClosedPublic

Authored by dmitry.wagin_ya.ru on Nov 13 2020, 3:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 6, 10:37 PM
Unknown Object (File)
Tue, Nov 26, 10:13 AM
Unknown Object (File)
Tue, Nov 26, 10:13 AM
Unknown Object (File)
Tue, Nov 26, 10:13 AM
Unknown Object (File)
Tue, Nov 26, 10:12 AM
Unknown Object (File)
Tue, Nov 26, 10:12 AM
Unknown Object (File)
Tue, Nov 26, 9:47 AM
Unknown Object (File)
Oct 17 2024, 12:32 AM

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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/libc/gen/syslog.c
37

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

411

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
37

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.Mar 23 2021, 4:53 PM
This revision was automatically updated to reflect the committed changes.