*/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <mach/mach.h>
#include <mach_debug/mach_debug.h>
#include <mach/mach_error.h>
+#include <libutil.h>
+#include <errno.h>
#define streql(a, b) (strcmp((a), (b)) == 0)
#define strneql(a, b, n) (strncmp((a), (b), (n)) == 0)
exit(1);
}
+int
main(argc, argv)
int argc;
char *argv[];
unsigned int infoCnt = sizeof info_buf/sizeof info_buf[0];
char *zname = NULL;
- int znamelen;
+ int znamelen = 0;
kern_return_t kr;
int i, j;
+ if (0 != reexec_to_match_kernel()) {
+ fprintf(stderr, "Could not re-execute: %d\n", errno);
+ exit(1);
+ }
+
program = strrchr(argv[0], '/');
if (program == NULL)
program = argv[0];
{
unsigned int used, size;
- printf("%.*s zone:\n", sizeof name->zn_name, name->zn_name);
+ printf("%.*s zone:\n", (int)sizeof name->zn_name, name->zn_name);
printf("\tcur_size: %dK bytes (%d elements)\n",
info->zi_cur_size/1024,
info->zi_cur_size/info->zi_elem_size);
zone_info_t *info;
{
char *name = zone_name->zn_name;
- int j, namewidth, retval;
+ int j, namewidth;
unsigned int used, size;
namewidth = 25;