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)
Feb 5 2024, 1:30 AM
Unknown Object (File)
Jan 17 2024, 2:22 AM
Unknown Object (File)
Dec 20 2023, 7:32 AM
Unknown Object (File)
Dec 17 2023, 1:58 PM
Unknown Object (File)
Nov 13 2023, 3:07 PM
Unknown Object (File)
Nov 7 2023, 11:27 AM
Unknown Object (File)
Oct 30 2023, 6:52 AM
Unknown Object (File)
Oct 6 2023, 10:26 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
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.