1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // gccgo specific implementation of syslog for Solaris. Solaris uses
6 // STREAMS to communicate with syslogd. That is enough of a pain that
7 // we just call the libc function.
18 func unixSyslog() (conn serverConn
, err error
) {
19 return libcConn(0), nil
24 func syslog_c(int, *byte)
26 func (libcConn
) writeString(p Priority
, hostname
, tag
, msg
string) (int, error
) {
27 timestamp
:= time
.Now().Format(time
.RFC3339
)
28 log
:= fmt
.Sprintf("%s %s %s[%d]: %s", timestamp
, hostname
, tag
, os
.Getpid(), msg
)
29 buf
, err
:= syscall
.BytePtrFromString(log
)
33 syscall
.Entersyscall()
39 func (libcConn
) close() error
{