Deleted Added
full compact
gcore.c (203532) gcore.c (210063)
1/*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

38#endif /* not lint */
39
40#if 0
41#ifndef lint
42static char sccsid[] = "@(#)gcore.c 8.2 (Berkeley) 9/23/93";
43#endif /* not lint */
44#endif
45#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

38#endif /* not lint */
39
40#if 0
41#ifndef lint
42static char sccsid[] = "@(#)gcore.c 8.2 (Berkeley) 9/23/93";
43#endif /* not lint */
44#endif
45#include <sys/cdefs.h>
46__FBSDID("$FreeBSD: head/usr.bin/gcore/gcore.c 203532 2010-02-05 18:28:43Z mjacob $");
46__FBSDID("$FreeBSD: head/usr.bin/gcore/gcore.c 210063 2010-07-14 17:16:25Z attilio $");
47
48/*
49 * Originally written by Eric Cooper in Fall 1981.
50 * Inspired by a version 6 program by Len Levin, 1978.
51 * Several pieces of code lifted from Bill Joy's 4BSD ps.
52 * Most recently, hacked beyond recognition for 4.4BSD by Steven McCanne,
53 * Lawrence Berkeley Laboratory.
54 *

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

66#include <err.h>
67#include <fcntl.h>
68#include <stdio.h>
69#include <stdlib.h>
70#include <string.h>
71#include <unistd.h>
72
73#include "extern.h"
47
48/*
49 * Originally written by Eric Cooper in Fall 1981.
50 * Inspired by a version 6 program by Len Levin, 1978.
51 * Several pieces of code lifted from Bill Joy's 4BSD ps.
52 * Most recently, hacked beyond recognition for 4.4BSD by Steven McCanne,
53 * Lawrence Berkeley Laboratory.
54 *

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

66#include <err.h>
67#include <fcntl.h>
68#include <stdio.h>
69#include <stdlib.h>
70#include <string.h>
71#include <unistd.h>
72
73#include "extern.h"
74int sflag;
74int pflags;
75
76static void killed(int);
77static void usage(void) __dead2;
78
79static pid_t pid;
80
81SET_DECLARE(dumpset, struct dumpers);
82
83int
84main(int argc, char *argv[])
85{
86 int ch, efd, fd, name[4];
87 char *binfile, *corefile;
88 char passpath[MAXPATHLEN], fname[MAXPATHLEN];
89 struct dumpers **d, *dumper;
90 size_t len;
91
75
76static void killed(int);
77static void usage(void) __dead2;
78
79static pid_t pid;
80
81SET_DECLARE(dumpset, struct dumpers);
82
83int
84main(int argc, char *argv[])
85{
86 int ch, efd, fd, name[4];
87 char *binfile, *corefile;
88 char passpath[MAXPATHLEN], fname[MAXPATHLEN];
89 struct dumpers **d, *dumper;
90 size_t len;
91
92 sflag = 0;
92 pflags = 0;
93 corefile = NULL;
93 corefile = NULL;
94 while ((ch = getopt(argc, argv, "c:s")) != -1) {
94 while ((ch = getopt(argc, argv, "c:fs")) != -1) {
95 switch (ch) {
96 case 'c':
97 corefile = optarg;
98 break;
95 switch (ch) {
96 case 'c':
97 corefile = optarg;
98 break;
99 case 'f':
100 pflags |= PFLAGS_FULL;
101 break;
99 case 's':
102 case 's':
100 sflag = 1;
103 pflags |= PFLAGS_RESUME;
101 break;
102 default:
103 usage();
104 break;
105 }
106 }
107 argv += optind;
108 argc -= optind;

--- 70 unchanged lines hidden ---
104 break;
105 default:
106 usage();
107 break;
108 }
109 }
110 argv += optind;
111 argc -= optind;

--- 70 unchanged lines hidden ---