OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [log/] [syslog/] [syslog_libc.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// 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.
4
 
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.
8
 
9
package syslog
10
 
11
import (
12
        "fmt"
13
        "syscall"
14
)
15
 
16
func unixSyslog() (conn serverConn, err error) {
17
        return libcConn(0), nil
18
}
19
 
20
type libcConn int
21
 
22
func syslog_c(int, *byte)
23
 
24
func (libcConn) writeBytes(p Priority, prefix string, b []byte) (int, error) {
25
        syslog_c(int(p), syscall.StringBytePtr(fmt.Sprintf("%s: %s", prefix, b)))
26
        return len(b), nil
27
}
28
 
29
func (libcConn) writeString(p Priority, prefix string, s string) (int, error) {
30
        syslog_c(int(p), syscall.StringBytePtr(fmt.Sprintf("%s: %s", prefix, s)))
31
        return len(s), nil
32
}
33
 
34
func (libcConn) close() error {
35
        return nil
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.