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.
7 // gccgo specific implementation of syslog for Solaris. Solaris uses
8 // STREAMS to communicate with syslogd. That is enough of a pain that
9 // we just call the libc function.
20 func unixSyslog() (conn serverConn
, err error
) {
21 return libcConn(0), nil
26 func syslog_c(int, *byte)
28 func (libcConn
) writeString(p Priority
, hostname
, tag
, msg
, nl
string) error
{
29 timestamp
:= time
.Now().Format(time
.RFC3339
)
30 log
:= fmt
.Sprintf("%s %s %s[%d]: %s%s", timestamp
, hostname
, tag
, os
.Getpid(), msg
, nl
)
31 buf
, err
:= syscall
.BytePtrFromString(log
)
35 syscall
.Entersyscall()
41 func (libcConn
) close() error
{