Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Oct 2002 17:27:03 +0200 (CEST)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: increasing MAXLINE for syslog
Message-ID:  <200210261527.g9QFR3G9034511@lurza.secnetix.de>
In-Reply-To: <20021026224646.A362@grosbein.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Eugene Grosbein <eugen@grosbein.pp.ru> wrote:
 > On Sat, Oct 26, 2002 at 01:20:24PM +0200, Oliver Fromme wrote:
 > > Did you inrease the sizes of fmt_cpy[] _and_ tbuf[]
 > > in src/lib/libc/gen/syslog.c:vsyslog() accordingly?
 > 
 > Yes, I did that too. I see it's time to show my patches.
 > [...]

Okay, looks good.

The syslog(3) function (which is used for local logging
by logger(1)) opens a UNIX-domain socket to syslogd and
then send(2)s the message to it.  The socket(2) manpage
says:

   A SOCK_DGRAM socket supports datagrams (connectionless,
   unreliable messages of a fixed (typically small) maximum
   length).

And the send(2) manpage:

   If the message is too long to pass atomically through the
   underlying protocol, the error EMSGSIZE is returned, and
   the message is not transmitted.

$ sysctl net.local.dgram.maxdgram
net.local.dgram.maxdgram: 2048

That would explain that there is a limit, although it is
2 Kb, not 1 Kb ...  At least on my machine here.

BTW:
 > -       char *stdp, tbuf[2048], fmt_cpy[1024], timbuf[26];
 > +       char *stdp, tbuf[MAXLINE], fmt_cpy[MAXLINE], timbuf[26];

Note that tbuf should be 1024 bytes larger than fmt_cpy,
to account for %m expansions in the message.

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210261527.g9QFR3G9034511>