X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/ad3c9f2af814c84582fdd1649e49ec4f68572c5a..aa54d2fad3d9038b43475aa93c76795c5141a993:/gen/FreeBSD/sysctl.c diff --git a/gen/FreeBSD/sysctl.c b/gen/FreeBSD/sysctl.c index 7205820..3cbe748 100644 --- a/gen/FreeBSD/sysctl.c +++ b/gen/FreeBSD/sysctl.c @@ -43,15 +43,12 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/sysctl.c,v 1.6 2007/01/09 00:27:55 imp Exp #include #include -extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen); +#include "sysctl_internal.h" + int -sysctl(name, namelen, oldp, oldlenp, newp, newlen) - int *name; - u_int namelen; - void *oldp, *newp; - size_t *oldlenp, newlen; +sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) +__attribute__((disable_tail_calls)) { if (name[0] != CTL_USER) { if (namelen == 2 && name[0] == CTL_KERN && name[1] == KERN_EXEC) { @@ -79,7 +76,15 @@ sysctl(name, namelen, oldp, oldlenp, newp, newlen) *oldlenp = 2; return 0; } - return (__sysctl(name, namelen, oldp, oldlenp, newp, newlen)); + + + int error = __sysctl(name, namelen, oldp, oldlenp, newp, newlen); + if (error < 0) { + return error; + } + + + return error; } if (newp != NULL) {