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)
Thu, Oct 17, 12:32 AM
Unknown Object (File)
Oct 6 2024, 3:20 PM
Unknown Object (File)
Sep 23 2024, 8:23 PM
Unknown Object (File)
Sep 23 2024, 6:29 PM
Unknown Object (File)
Sep 20 2024, 11:14 AM
Unknown Object (File)
Sep 13 2024, 9:22 AM
Unknown Object (File)
Sep 12 2024, 12:42 PM
Unknown Object (File)
Sep 10 2024, 7:32 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
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

lib/libc/gen/syslog.c
37

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

413

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.

268

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.