-/* $OpenBSD: kern_sysctl.c,v 1.327 2017/06/13 06:16:31 dlg Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.328 2017/06/14 03:00:40 dlg Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
*/
int
sysctl_string(void *oldp, size_t *oldlenp, void *newp, size_t newlen, char *str,
- int maxlen)
+ size_t maxlen)
{
return sysctl__string(oldp, oldlenp, newp, newlen, str, maxlen, 0);
}
int
sysctl_tstring(void *oldp, size_t *oldlenp, void *newp, size_t newlen,
- char *str, int maxlen)
+ char *str, size_t maxlen)
{
return sysctl__string(oldp, oldlenp, newp, newlen, str, maxlen, 1);
}
int
sysctl__string(void *oldp, size_t *oldlenp, void *newp, size_t newlen,
- char *str, int maxlen, int trunc)
+ char *str, size_t maxlen, int trunc)
{
- int len, error = 0;
+ size_t len;
+ int error = 0;
len = strlen(str) + 1;
if (oldp && *oldlenp < len) {
-/* $OpenBSD: sysctl.h,v 1.173 2017/06/13 06:16:31 dlg Exp $ */
+/* $OpenBSD: sysctl.h,v 1.174 2017/06/14 03:00:40 dlg Exp $ */
/* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */
/*
int sysctl_int_arr(int **, int *, u_int, void *, size_t *, void *, size_t);
int sysctl_quad(void *, size_t *, void *, size_t, int64_t *);
int sysctl_rdquad(void *, size_t *, void *, int64_t);
-int sysctl_string(void *, size_t *, void *, size_t, char *, int);
-int sysctl_tstring(void *, size_t *, void *, size_t, char *, int);
-int sysctl__string(void *, size_t *, void *, size_t, char *, int, int);
+int sysctl_string(void *, size_t *, void *, size_t, char *, size_t);
+int sysctl_tstring(void *, size_t *, void *, size_t, char *, size_t);
+int sysctl__string(void *, size_t *, void *, size_t, char *, size_t, int);
int sysctl_rdstring(void *, size_t *, void *, const char *);
int sysctl_rdstruct(void *, size_t *, void *, const void *, size_t);
int sysctl_struct(void *, size_t *, void *, size_t, void *, size_t);