Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Jan 2004 11:01:10 -0800
From:      Luigi Rizzo <rizzo@icir.org>
To:        Eugene Grosbein <eugen@grosbein.pp.ru>
Cc:        ache@freebsd.org
Subject:   Re: syslog
Message-ID:  <20040104110110.A79771@xorpc.icir.org>
In-Reply-To: <3FF714C6.1D099404@grosbein.pp.ru>; from eugen@grosbein.pp.ru on Sun, Jan 04, 2004 at 02:15:18AM %2B0700
References:  <3FF714C6.1D099404@grosbein.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 04, 2004 at 02:15:18AM +0700, Eugene Grosbein wrote:
> Hi!
> 
> ache@freebsd.org wrote 8 years ago in src/lib/libc/gen/syslog.c:
> 
> p += sprintf(p, "%.15s ", ctime(&now) + 4);
> 
> What is '+ 4' for?

quite likely it is to skip the 'day of week' field -- the ctime
manpage says

     The ctime() function adjusts the time value for the current time zone in
     the same manner as localtime(), and returns a pointer to a 26-character
     string of the form:

           Thu Nov 24 18:22:48 1986\n\0

     All the fields have constant width.

so it makes sense

	cheers
	luigi

> http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/syslog.c.diff?r1=1.2&r2=1.3
> 
> Eugene Grosbein
> 
> P.S. Please CC me, I'm not in list
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"



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