Deleted Added
full compact
killall.c (132191) killall.c (132192)
1/*-
2 * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
3 * Copyright (c) 2000 Paul Saab <ps@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
3 * Copyright (c) 2000 Paul Saab <ps@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/usr.bin/killall/killall.c 132191 2004-07-15 07:26:20Z tjr $");
29__FBSDID("$FreeBSD: head/usr.bin/killall/killall.c 132192 2004-07-15 07:30:15Z tjr $");
30
31#include <sys/param.h>
32#include <sys/jail.h>
33#include <sys/stat.h>
34#include <sys/user.h>
35#include <sys/sysctl.h>
36#include <fcntl.h>
37#include <dirent.h>

--- 260 unchanged lines hidden (view full) ---

298 errx(1, "could not reallocate memory");
299 }
300 procs = newprocs;
301 st = sysctl(mib, miblen, procs, &size, NULL, 0);
302 } while (st == -1 && errno == ENOMEM);
303 if (st == -1)
304 err(1, "could not sysctl(KERN_PROC)");
305 if (size % sizeof(struct kinfo_proc) != 0) {
30
31#include <sys/param.h>
32#include <sys/jail.h>
33#include <sys/stat.h>
34#include <sys/user.h>
35#include <sys/sysctl.h>
36#include <fcntl.h>
37#include <dirent.h>

--- 260 unchanged lines hidden (view full) ---

298 errx(1, "could not reallocate memory");
299 }
300 procs = newprocs;
301 st = sysctl(mib, miblen, procs, &size, NULL, 0);
302 } while (st == -1 && errno == ENOMEM);
303 if (st == -1)
304 err(1, "could not sysctl(KERN_PROC)");
305 if (size % sizeof(struct kinfo_proc) != 0) {
306 fprintf(stderr, "proc size mismatch (%d total, %d chunks)\n",
306 fprintf(stderr, "proc size mismatch (%zu total, %zu chunks)\n",
307 size, sizeof(struct kinfo_proc));
308 fprintf(stderr, "userland out of sync with kernel, recompile libkvm etc\n");
309 exit(1);
310 }
311 nprocs = size / sizeof(struct kinfo_proc);
312 if (dflag)
313 printf("nprocs %d\n", nprocs);
314 mypid = getpid();

--- 98 unchanged lines hidden ---
307 size, sizeof(struct kinfo_proc));
308 fprintf(stderr, "userland out of sync with kernel, recompile libkvm etc\n");
309 exit(1);
310 }
311 nprocs = size / sizeof(struct kinfo_proc);
312 if (dflag)
313 printf("nprocs %d\n", nprocs);
314 mypid = getpid();

--- 98 unchanged lines hidden ---