Index: head/lib/libcasper/services/cap_dns/cap_dns.h =================================================================== --- head/lib/libcasper/services/cap_dns/cap_dns.h (revision 359695) +++ head/lib/libcasper/services/cap_dns/cap_dns.h (revision 359696) @@ -1,75 +1,80 @@ /*- * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _CAP_DNS_H_ #define _CAP_DNS_H_ #ifdef HAVE_CASPER #define WITH_CASPER #endif +#include #include /* socklen_t */ struct addrinfo; struct hostent; #ifdef WITH_CASPER +__BEGIN_DECLS + struct hostent *cap_gethostbyname(cap_channel_t *chan, const char *name); struct hostent *cap_gethostbyname2(cap_channel_t *chan, const char *name, int type); struct hostent *cap_gethostbyaddr(cap_channel_t *chan, const void *addr, socklen_t len, int type); int cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res); int cap_getnameinfo(cap_channel_t *chan, const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags); int cap_dns_type_limit(cap_channel_t *chan, const char * const *types, size_t ntypes); int cap_dns_family_limit(cap_channel_t *chan, const int *families, size_t nfamilies); + +__END_DECLS #else #define cap_gethostbyname(chan, name) gethostbyname(name) #define cap_gethostbyname2(chan, name, type) gethostbyname2(name, type) #define cap_gethostbyaddr(chan, addr, len, type) gethostbyaddr(addr, len, type) #define cap_getaddrinfo(chan, hostname, servname, hints, res) \ getaddrinfo(hostname, servname, hints, res) #define cap_getnameinfo(chan, sa, salen, host, hostlen, serv, servlen, flags) \ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) #define cap_dns_type_limit(chan, types, ntypes) (0) #define cap_dns_family_limit(chan, families, nfamilies) (0) #endif #endif /* !_CAP_DNS_H_ */ Index: head/lib/libcasper/services/cap_fileargs/cap_fileargs.h =================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.h (revision 359695) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.h (revision 359696) @@ -1,143 +1,149 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2018 Mariusz Zaborski * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _FILEARGS_H_ #define _FILEARGS_H_ +#include #include #include #include #define FA_OPEN 1 #define FA_LSTAT 2 #ifdef WITH_CASPER struct fileargs; typedef struct fileargs fileargs_t; struct stat; +__BEGIN_DECLS + fileargs_t *fileargs_init(int argc, char *argv[], int flags, mode_t mode, cap_rights_t *rightsp, int operations); fileargs_t *fileargs_cinit(cap_channel_t *cas, int argc, char *argv[], int flags, mode_t mode, cap_rights_t *rightsp, int operations); fileargs_t *fileargs_initnv(nvlist_t *limits); fileargs_t *fileargs_cinitnv(cap_channel_t *cas, nvlist_t *limits); int fileargs_lstat(fileargs_t *fa, const char *name, struct stat *sb); int fileargs_open(fileargs_t *fa, const char *name); void fileargs_free(fileargs_t *fa); FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode); fileargs_t *fileargs_wrap(cap_channel_t *chan, int fdflags); cap_channel_t *fileargs_unwrap(fileargs_t *fa, int *fdflags); + +__END_DECLS + #else typedef struct fileargs { int fa_flags; mode_t fa_mode; } fileargs_t; static inline fileargs_t * fileargs_init(int argc __unused, char *argv[] __unused, int flags, mode_t mode, cap_rights_t *rightsp __unused, int operations __unused) { fileargs_t *fa; fa = malloc(sizeof(*fa)); if (fa != NULL) { fa->fa_flags = flags; fa->fa_mode = mode; } return (fa); } static inline fileargs_t * fileargs_cinit(cap_channel_t *cas __unused, int argc, char *argv[], int flags, mode_t mode, cap_rights_t *rightsp, int operations) { return (fileargs_init(argc, argv, flags, mode, rightsp, operations)); } static inline fileargs_t * fileargs_initnv(nvlist_t *limits) { fileargs_t *fa; fa = fileargs_init(0, NULL, nvlist_get_number(limits, "flags"), dnvlist_get_number(limits, "mode", 0), NULL, nvlist_get_number(limits, "operations")); nvlist_destroy(limits); return (fa); } static inline fileargs_t * fileargs_cinitnv(cap_channel_t *cas __unused, nvlist_t *limits) { return (fileargs_initnv(limits)); } #define fileargs_lstat(fa, name, sb) \ lstat(name, sb) #define fileargs_open(fa, name) \ open(name, fa->fa_flags, fa->fa_mode) static inline FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode) { (void) fa; return (fopen(name, mode)); } #define fileargs_free(fa) (free(fa)) static inline fileargs_t * fileargs_wrap(cap_channel_t *chan, int fdflags) { cap_close(chan); return (fileargs_init(0, NULL, fdflags, 0, NULL, 0)); } static inline cap_channel_t * fileargs_unwrap(fileargs_t *fa, int *fdflags) { if (fdflags != NULL) { *fdflags = fa->fa_flags; } fileargs_free(fa); return (cap_init()); } #endif #endif /* !_FILEARGS_H_ */ Index: head/lib/libcasper/services/cap_grp/cap_grp.h =================================================================== --- head/lib/libcasper/services/cap_grp/cap_grp.h (revision 359695) +++ head/lib/libcasper/services/cap_grp/cap_grp.h (revision 359696) @@ -1,89 +1,96 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _CAP_GRP_H_ #define _CAP_GRP_H_ #ifdef HAVE_CASPER #define WITH_CASPER #endif +#include + #ifdef WITH_CASPER +__BEGIN_DECLS + struct group *cap_getgrent(cap_channel_t *chan); struct group *cap_getgrnam(cap_channel_t *chan, const char *name); struct group *cap_getgrgid(cap_channel_t *chan, gid_t gid); int cap_getgrent_r(cap_channel_t *chan, struct group *grp, char *buffer, size_t bufsize, struct group **result); int cap_getgrnam_r(cap_channel_t *chan, const char *name, struct group *grp, char *buffer, size_t bufsize, struct group **result); int cap_getgrgid_r(cap_channel_t *chan, gid_t gid, struct group *grp, char *buffer, size_t bufsize, struct group **result); int cap_setgroupent(cap_channel_t *chan, int stayopen); int cap_setgrent(cap_channel_t *chan); void cap_endgrent(cap_channel_t *chan); int cap_grp_limit_cmds(cap_channel_t *chan, const char * const *cmds, size_t ncmds); int cap_grp_limit_fields(cap_channel_t *chan, const char * const *fields, size_t nfields); int cap_grp_limit_groups(cap_channel_t *chan, const char * const *names, size_t nnames, const gid_t *gids, size_t ngids); + +__END_DECLS + #else #define cap_getgrent(chan) getgrent() #define cap_getgrnam(chan, name) getgrnam(name) #define cap_getgrgid(chan, gid) getgrgid(gid) #define cap_setgroupent(chan, stayopen) etgroupent(stayopen) #define endgrent(chan) endgrent() static inline int cap_setgrent(cap_channel_t *chan __unused) { setgrent(); return(0); } #define cap_getgrent_r(chan, grp, buffer, bufsize, result) \ getgrent_r(grp, buffer, bufsize, result) #define cap_getgrnam_r(chan, name, grp, buffer, bufsize, result) \ getgrnam_r(name, grp, buffer, bufsize, result) #define cap_getgrgid_r(chan, gid, grp, buffer, bufsize, result) \ getgrgid_r(gid, grp, buffer, bufsize, result) #define cap_grp_limit_cmds(chan, cmds, ncmds) (0) #define cap_grp_limit_fields(chan, fields, nfields) (0) #define cap_grp_limit_groups(chan, names, nnames, gids, ngids) (0) #endif #endif /* !_CAP_GRP_H_ */ Index: head/lib/libcasper/services/cap_pwd/cap_pwd.h =================================================================== --- head/lib/libcasper/services/cap_pwd/cap_pwd.h (revision 359695) +++ head/lib/libcasper/services/cap_pwd/cap_pwd.h (revision 359696) @@ -1,82 +1,89 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _CAP_PWD_H_ #define _CAP_PWD_H_ #ifdef HAVE_CASPER #define WITH_CASPER #endif +#include + #ifdef WITH_CASPER +__BEGIN_DECLS + struct passwd *cap_getpwent(cap_channel_t *chan); struct passwd *cap_getpwnam(cap_channel_t *chan, const char *login); struct passwd *cap_getpwuid(cap_channel_t *chan, uid_t uid); int cap_getpwent_r(cap_channel_t *chan, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result); int cap_getpwnam_r(cap_channel_t *chan, const char *name, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result); int cap_getpwuid_r(cap_channel_t *chan, uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result); int cap_setpassent(cap_channel_t *chan, int stayopen); void cap_setpwent(cap_channel_t *chan); void cap_endpwent(cap_channel_t *chan); int cap_pwd_limit_cmds(cap_channel_t *chan, const char * const *cmds, size_t ncmds); int cap_pwd_limit_fields(cap_channel_t *chan, const char * const *fields, size_t nfields); int cap_pwd_limit_users(cap_channel_t *chan, const char * const *names, size_t nnames, uid_t *uids, size_t nuids); + +__END_DECLS + #else #define cap_getpwent(chan) getpwent() #define cap_getpwnam(chan, login) getpwnam(login) #define cap_getpwuid(chan, uid) getpwuid(uid) #define cap_getpwent_r(chan, pwd, buffer, bufsize, result) \ getpwent_r(pwd, buffer, bufsize, result) #define cap_getpwnam_r(chan, name, pwd, buffer, bufsize, result) \ getpwnam_r(name, pwd, buffer, bufsize, result) #define cap_getpwuid_r(chan, uid, pwd, buffer, bufsize, result) \ getpwuid_r(uid, pwd, buffer, bufsize, result) #define cap_setpassent(chan, stayopen) setpassent(stayopen) #define cap_setpwent(chan) setpwent() #define cap_endpwent(chan) endpwent() #define cap_pwd_limit_cmds(chan, cmds, ncmds) (0) #define cap_pwd_limit_fields(chan, fields, nfields) (0) #define cap_pwd_limit_users(chan, names, nnames, uids, nuids) (0) #endif #endif /* !_CAP_PWD_H_ */ Index: head/lib/libcasper/services/cap_sysctl/cap_sysctl.h =================================================================== --- head/lib/libcasper/services/cap_sysctl/cap_sysctl.h (revision 359695) +++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.h (revision 359696) @@ -1,75 +1,82 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _CAP_SYSCTL_H_ #define _CAP_SYSCTL_H_ #ifdef HAVE_CASPER #define WITH_CASPER #endif +#include + #ifdef WITH_CASPER #define CAP_SYSCTL_READ 0x01 #define CAP_SYSCTL_WRITE 0x02 #define CAP_SYSCTL_RDWR (CAP_SYSCTL_READ | CAP_SYSCTL_WRITE) #define CAP_SYSCTL_RECURSIVE 0x04 +__BEGIN_DECLS + int cap_sysctl(cap_channel_t *chan, const int *name, u_int namelen, void *oldp, size_t *oldlenp, const void *newp, size_t newlen); int cap_sysctlbyname(cap_channel_t *chan, const char *name, void *oldp, size_t *oldlenp, const void *newp, size_t newlen); int cap_sysctlnametomib(cap_channel_t *chan, const char *name, int *mibp, size_t *sizep); struct cap_sysctl_limit; typedef struct cap_sysctl_limit cap_sysctl_limit_t; cap_sysctl_limit_t *cap_sysctl_limit_init(cap_channel_t *); cap_sysctl_limit_t *cap_sysctl_limit_name(cap_sysctl_limit_t *limit, const char *name, int flags); cap_sysctl_limit_t *cap_sysctl_limit_mib(cap_sysctl_limit_t *limit, const int *mibp, u_int miblen, int flags); int cap_sysctl_limit(cap_sysctl_limit_t *limit); + +__END_DECLS + #else /* !WITH_CASPER */ #define cap_sysctl(chan, name, namelen, oldp, oldlenp, newp, newlen) \ sysctl((name), (namelen), (oldp), (oldlenp), (newp), (newlen)) #define cap_sysctlbyname(chan, name, oldp, oldlenp, newp, newlen) \ sysctlbyname((name), (oldp), (oldlenp), (newp), (newlen)) #define cap_sysctlnametomib(chan, name, mibp, sizep) \ sysctlnametomib((name), (mibp), (sizep)) #define cap_sysctl_limit_init(chan) (NULL) #define cap_sysctl_limit_name(limit, name, flags) (NULL) #define cap_sysctl_limit_mib(limit, mibp, miblen, flags) (NULL) #define cap_sysctl_limit(limit) (0) #endif /* WITH_CASPER */ #endif /* !_CAP_SYSCTL_H_ */ Index: head/lib/libcasper/services/cap_syslog/cap_syslog.h =================================================================== --- head/lib/libcasper/services/cap_syslog/cap_syslog.h (revision 359695) +++ head/lib/libcasper/services/cap_syslog/cap_syslog.h (revision 359696) @@ -1,54 +1,61 @@ /*- * Copyright (c) 2017 Mariusz Zaborski * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _CAP_SYSLOG_H_ #define _CAP_SYSLOG_H_ +#include + #ifdef WITH_CASPER +__BEGIN_DECLS + void cap_syslog(cap_channel_t *chan, int pri, const char *fmt, ...) __printflike(3, 4); void cap_vsyslog(cap_channel_t *chan, int priority, const char *fmt, va_list ap) __printflike(3, 0); void cap_openlog(cap_channel_t *chan, const char *ident, int logopt, int facility); void cap_closelog(cap_channel_t *chan); int cap_setlogmask(cap_channel_t *chan, int maskpri); + +__END_DECLS + #else #define cap_syslog(chan, pri, ...) syslog(pri, __VA_ARGS__) #define cap_vsyslog(chan, pri, fmt, ap) vsyslog(pri, fmt, ap) #define cap_openlog(chan, ident, logopt, facility) \ openlog(ident, logopt, facility) #define cap_closelog(chan) closelog() #define cap_setlogmask(chan, maskpri) setlogmask(maskpri) #endif /* !WITH_CASPER */ #endif /* !_CAP_SYSLOG_H_ */