aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/syslog/syslog_c.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-03-09 22:13:09 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-03-09 22:13:09 +0000
commitbef18456b74c6e8114214e7252882f55500d43df (patch)
treea79eaedceae2cad9594cb151794741e8feba386e /libgo/go/syslog/syslog_c.c
parentdb7ec03597533caa93e7eb3688de61c0d6e2bc77 (diff)
downloadgcc-bef18456b74c6e8114214e7252882f55500d43df.zip
gcc-bef18456b74c6e8114214e7252882f55500d43df.tar.gz
gcc-bef18456b74c6e8114214e7252882f55500d43df.tar.bz2
Solaris specific syslog support.
From-SVN: r170837
Diffstat (limited to 'libgo/go/syslog/syslog_c.c')
-rw-r--r--libgo/go/syslog/syslog_c.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libgo/go/syslog/syslog_c.c b/libgo/go/syslog/syslog_c.c
new file mode 100644
index 0000000..f49b9ff
--- /dev/null
+++ b/libgo/go/syslog/syslog_c.c
@@ -0,0 +1,19 @@
+/* syslog_c.c -- call syslog for Go.
+
+ Copyright 2011 The Go Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style
+ license that can be found in the LICENSE file. */
+
+#include <syslog.h>
+
+/* We need to use a C function to call the syslog function, because we
+ can't represent a C varargs function in Go. */
+
+void syslog_c(int, const char*)
+ asm ("libgo_syslog.syslog.syslog_c");
+
+void
+syslog_c (int priority, const char *msg)
+{
+ syslog (priority, "%s", msg);
+}