summaryrefslogtreecommitdiffstats
path: root/usr.bin/gcore
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /usr.bin/gcore
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip
FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Diffstat (limited to 'usr.bin/gcore')
-rw-r--r--usr.bin/gcore/aoutcore.c18
-rw-r--r--usr.bin/gcore/gcore.c18
2 files changed, 28 insertions, 8 deletions
diff --git a/usr.bin/gcore/aoutcore.c b/usr.bin/gcore/aoutcore.c
index c61bad8..5f17bf9 100644
--- a/usr.bin/gcore/aoutcore.c
+++ b/usr.bin/gcore/aoutcore.c
@@ -223,7 +223,10 @@ core(efd, fd, ki)
{
union {
struct user user;
- char ubytes[ctob(UPAGES)];
+ struct {
+ char uabytes[ctob(UAREA_PAGES)];
+ char ksbytes[ctob(KSTACK_PAGES)];
+ } bytes;
} uarea;
int tsize = ki->ki_tsize;
int dsize = ki->ki_dsize;
@@ -231,9 +234,16 @@ core(efd, fd, ki)
int cnt;
/* Read in user struct */
- cnt = kvm_read(kd, (u_long)ki->ki_addr, &uarea, sizeof(uarea));
- if (cnt != sizeof(uarea))
- errx(1, "read user structure: %s",
+ cnt = kvm_read(kd, (u_long)ki->ki_addr, uarea.bytes.uabytes,
+ ctob(UAREA_PAGES));
+ if (cnt != ctob(UAREA_PAGES))
+ errx(1, "read upages structure: %s",
+ cnt > 0 ? strerror(EIO) : strerror(errno));
+
+ cnt = kvm_read(kd, (u_long)ki->ki_kstack, uarea.bytes.ksbytes,
+ ctob(KSTACK_PAGES));
+ if (cnt != ctob(KSTACK_PAGES))
+ errx(1, "read kstack structure: %s",
cnt > 0 ? strerror(EIO) : strerror(errno));
/*
diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c
index c61bad8..5f17bf9 100644
--- a/usr.bin/gcore/gcore.c
+++ b/usr.bin/gcore/gcore.c
@@ -223,7 +223,10 @@ core(efd, fd, ki)
{
union {
struct user user;
- char ubytes[ctob(UPAGES)];
+ struct {
+ char uabytes[ctob(UAREA_PAGES)];
+ char ksbytes[ctob(KSTACK_PAGES)];
+ } bytes;
} uarea;
int tsize = ki->ki_tsize;
int dsize = ki->ki_dsize;
@@ -231,9 +234,16 @@ core(efd, fd, ki)
int cnt;
/* Read in user struct */
- cnt = kvm_read(kd, (u_long)ki->ki_addr, &uarea, sizeof(uarea));
- if (cnt != sizeof(uarea))
- errx(1, "read user structure: %s",
+ cnt = kvm_read(kd, (u_long)ki->ki_addr, uarea.bytes.uabytes,
+ ctob(UAREA_PAGES));
+ if (cnt != ctob(UAREA_PAGES))
+ errx(1, "read upages structure: %s",
+ cnt > 0 ? strerror(EIO) : strerror(errno));
+
+ cnt = kvm_read(kd, (u_long)ki->ki_kstack, uarea.bytes.ksbytes,
+ ctob(KSTACK_PAGES));
+ if (cnt != ctob(KSTACK_PAGES))
+ errx(1, "read kstack structure: %s",
cnt > 0 ? strerror(EIO) : strerror(errno));
/*
OpenPOWER on IntegriCloud