diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/gcore/aoutcore.c | 10 | ||||
-rw-r--r-- | usr.bin/gcore/gcore.c | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/usr.bin/gcore/aoutcore.c b/usr.bin/gcore/aoutcore.c index 3f8ccb9..46ef21e 100644 --- a/usr.bin/gcore/aoutcore.c +++ b/usr.bin/gcore/aoutcore.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)gcore.c 8.2 (Berkeley) 9/23/93"; #endif static const char rcsid[] = - "$Id: gcore.c,v 1.6 1997/07/08 11:04:17 charnier Exp $"; + "$Id: gcore.c,v 1.7 1997/11/18 03:50:25 jdp Exp $"; #endif /* not lint */ /* @@ -162,6 +162,14 @@ main(argc, argv) errx(1, "%s exec header: %s", argv[0], cnt > 0 ? strerror(EIO) : strerror(errno)); + /* check the text segment size of the executable and the process */ + if (exec.a_text != ptoa(ki->kp_eproc.e_vm.vm_tsize)) + errx(1, + "The executable %s does not belong to process %d!\n" + "Text segment size (in bytes): executable %d, process %d", + argv[0], pid, exec.a_text, + ptoa(ki->kp_eproc.e_vm.vm_tsize)); + data_offset = N_DATOFF(exec); if (sflag && kill(pid, SIGSTOP) < 0) diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c index 3f8ccb9..46ef21e 100644 --- a/usr.bin/gcore/gcore.c +++ b/usr.bin/gcore/gcore.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)gcore.c 8.2 (Berkeley) 9/23/93"; #endif static const char rcsid[] = - "$Id: gcore.c,v 1.6 1997/07/08 11:04:17 charnier Exp $"; + "$Id: gcore.c,v 1.7 1997/11/18 03:50:25 jdp Exp $"; #endif /* not lint */ /* @@ -162,6 +162,14 @@ main(argc, argv) errx(1, "%s exec header: %s", argv[0], cnt > 0 ? strerror(EIO) : strerror(errno)); + /* check the text segment size of the executable and the process */ + if (exec.a_text != ptoa(ki->kp_eproc.e_vm.vm_tsize)) + errx(1, + "The executable %s does not belong to process %d!\n" + "Text segment size (in bytes): executable %d, process %d", + argv[0], pid, exec.a_text, + ptoa(ki->kp_eproc.e_vm.vm_tsize)); + data_offset = N_DATOFF(exec); if (sflag && kill(pid, SIGSTOP) < 0) |