summaryrefslogtreecommitdiffstats
path: root/usr.bin/gcore
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-05-02 09:10:21 +0000
committerphk <phk@FreeBSD.org>1996-05-02 09:10:21 +0000
commit31f8db110dbb59d2108223c5363d545d78444b35 (patch)
tree24b9f62a2b9f2db23b8c40079bb5c5d0bfb4a205 /usr.bin/gcore
parent8b3eb1da82e3ae0e16d346d9a46700eee1e1b045 (diff)
downloadFreeBSD-src-31f8db110dbb59d2108223c5363d545d78444b35.zip
FreeBSD-src-31f8db110dbb59d2108223c5363d545d78444b35.tar.gz
NBPG -> PAGE_SIZE
Diffstat (limited to 'usr.bin/gcore')
-rw-r--r--usr.bin/gcore/aoutcore.c26
-rw-r--r--usr.bin/gcore/gcore.c26
2 files changed, 26 insertions, 26 deletions
diff --git a/usr.bin/gcore/aoutcore.c b/usr.bin/gcore/aoutcore.c
index 49149e8..aba1e21 100644
--- a/usr.bin/gcore/aoutcore.c
+++ b/usr.bin/gcore/aoutcore.c
@@ -227,12 +227,12 @@ datadump(efd, fd, p, addr, npage)
register int npage;
{
register int cc, delta;
- char buffer[NBPG];
+ char buffer[PAGE_SIZE];
delta = data_offset - addr;
while (--npage >= 0) {
- cc = kvm_uread(kd, p, addr, buffer, NBPG);
- if (cc != NBPG) {
+ cc = kvm_uread(kd, p, addr, buffer, PAGE_SIZE);
+ if (cc != PAGE_SIZE) {
/* Try to read the page from the executable. */
if (lseek(efd, (off_t)addr + delta, SEEK_SET) == -1)
err(1, "seek executable: %s", strerror(errno));
@@ -244,11 +244,11 @@ datadump(efd, fd, p, addr, npage)
else /* Assume untouched bss page. */
bzero(buffer, sizeof(buffer));
}
- cc = write(fd, buffer, NBPG);
- if (cc != NBPG)
+ cc = write(fd, buffer, PAGE_SIZE);
+ if (cc != PAGE_SIZE)
err(1, "write data segment: %s",
cc > 0 ? strerror(EIO) : strerror(errno));
- addr += NBPG;
+ addr += PAGE_SIZE;
}
}
@@ -260,18 +260,18 @@ userdump(fd, p, addr, npage)
register int npage;
{
register int cc;
- char buffer[NBPG];
+ char buffer[PAGE_SIZE];
while (--npage >= 0) {
- cc = kvm_uread(kd, p, addr, buffer, NBPG);
- if (cc != NBPG)
+ cc = kvm_uread(kd, p, addr, buffer, PAGE_SIZE);
+ if (cc != PAGE_SIZE)
/* Could be an untouched fill-with-zero page. */
- bzero(buffer, NBPG);
- cc = write(fd, buffer, NBPG);
- if (cc != NBPG)
+ bzero(buffer, PAGE_SIZE);
+ cc = write(fd, buffer, PAGE_SIZE);
+ if (cc != PAGE_SIZE)
err(1, "write stack segment: %s",
cc > 0 ? strerror(EIO) : strerror(errno));
- addr += NBPG;
+ addr += PAGE_SIZE;
}
}
diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c
index 49149e8..aba1e21 100644
--- a/usr.bin/gcore/gcore.c
+++ b/usr.bin/gcore/gcore.c
@@ -227,12 +227,12 @@ datadump(efd, fd, p, addr, npage)
register int npage;
{
register int cc, delta;
- char buffer[NBPG];
+ char buffer[PAGE_SIZE];
delta = data_offset - addr;
while (--npage >= 0) {
- cc = kvm_uread(kd, p, addr, buffer, NBPG);
- if (cc != NBPG) {
+ cc = kvm_uread(kd, p, addr, buffer, PAGE_SIZE);
+ if (cc != PAGE_SIZE) {
/* Try to read the page from the executable. */
if (lseek(efd, (off_t)addr + delta, SEEK_SET) == -1)
err(1, "seek executable: %s", strerror(errno));
@@ -244,11 +244,11 @@ datadump(efd, fd, p, addr, npage)
else /* Assume untouched bss page. */
bzero(buffer, sizeof(buffer));
}
- cc = write(fd, buffer, NBPG);
- if (cc != NBPG)
+ cc = write(fd, buffer, PAGE_SIZE);
+ if (cc != PAGE_SIZE)
err(1, "write data segment: %s",
cc > 0 ? strerror(EIO) : strerror(errno));
- addr += NBPG;
+ addr += PAGE_SIZE;
}
}
@@ -260,18 +260,18 @@ userdump(fd, p, addr, npage)
register int npage;
{
register int cc;
- char buffer[NBPG];
+ char buffer[PAGE_SIZE];
while (--npage >= 0) {
- cc = kvm_uread(kd, p, addr, buffer, NBPG);
- if (cc != NBPG)
+ cc = kvm_uread(kd, p, addr, buffer, PAGE_SIZE);
+ if (cc != PAGE_SIZE)
/* Could be an untouched fill-with-zero page. */
- bzero(buffer, NBPG);
- cc = write(fd, buffer, NBPG);
- if (cc != NBPG)
+ bzero(buffer, PAGE_SIZE);
+ cc = write(fd, buffer, PAGE_SIZE);
+ if (cc != PAGE_SIZE)
err(1, "write stack segment: %s",
cc > 0 ? strerror(EIO) : strerror(errno));
- addr += NBPG;
+ addr += PAGE_SIZE;
}
}
OpenPOWER on IntegriCloud