2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
23 #include <smbsrv/libsmb.h>
26 * This is exported NODIRECT so that smbd can provide it's own.
29 smb_vsyslog(int pri
, const char *fmt
, va_list ap
)
31 vsyslog(pri
, fmt
, ap
);
35 * This is exported NODIRECT so that fksmbd can provide it's own.
38 smb_syslog(int pri
, const char *fmt
, ...)
43 smb_vsyslog(pri
, fmt
, ap
);
48 * Helper for smb_vsyslog(). Does %m substitutions.
51 smb_syslog_fmt_m(char *buf
, int buflen
, const char *str
, int err
)
55 const char *endp
= buf
+ buflen
- 1;
57 while ((*bp
= *sp
) != '\0' && bp
!= endp
) {
58 if ((*sp
++ == '%') && (*sp
== 'm')) {
60 if (strerror_r(err
, bp
, endp
- bp
) == 0)