According the bsd/sys/proc.h
(link):
/* this routine returns error if the process is not one with super user privileges */
int proc_suser(proc_t p);
So a return of 0
means the process has root privileges or non-zero otherwise.
You want:
static boolean_t is_root() {
proc_t p = proc_self();
int error = proc_suser(p);
proc_rele(p);
return error == 0;
}