authorgravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2021-01-05 17:16:52+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-05 13:09:40-08:00
log6c4924408b1957d493568271a0158b1190574dd0
tree322f290a9679c9bf0534604369d8d2f97ecbe202
parent1640c357f42e0fc18d88a02995c25094063fef5e

std.c add syslog


2 files changed, 24 insertions(+), 0 deletions(-)

lib/std/c.zig+5
......@@ -353,6 +353,11 @@ pub extern "c" fn setrlimit(resource: rlimit_resource, rlim: *const rlimit) c_in
353353
354354pub extern "c" fn fmemopen(noalias buf: ?*c_void, size: usize, noalias mode: [*:0]const u8) ?*FILE;
355355
356pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void;
357pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void;
358pub extern "c" fn closelog() void;
359pub extern "c" fn setlogmask(maskpri: c_int) c_int;
360
356361pub const max_align_t = if (std.Target.current.abi == .msvc)
357362 f64
358363else if (std.Target.current.isDarwin())
lib/std/os/bits.zig+19
......@@ -34,3 +34,22 @@ pub const iovec_const = extern struct {
3434 iov_base: [*]const u8,
3535 iov_len: usize,
3636};
37
38// syslog
39
40/// system is unusable
41pub const LOG_EMERG = 0;
42/// action must be taken immediately
43pub const LOG_ALERT = 1;
44/// critical conditions
45pub const LOG_CRIT = 2;
46/// error conditions
47pub const LOG_ERR = 3;
48/// warning conditions
49pub const LOG_WARNING = 4;
50/// normal but significant condition
51pub const LOG_NOTICE = 5;
52/// informational
53pub const LOG_INFO = 6;
54/// debug-level messages
55pub const LOG_DEBUG = 7;