summaryrefslogtreecommitdiff
path: root/libexec/ld.so/library_mquery.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2003-04-28 21:32:09 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2003-04-28 21:32:09 +0000
commitc106c73dfd41f77fe797883162069614720a47f9 (patch)
tree181c1749c1f858436214069f2ce9f027ed804691 /libexec/ld.so/library_mquery.c
parent2050ddbc7001fceb763e62efe6d646ef12228f05 (diff)
Change mquery() function call signature to be the same a mmap(). It
needs the prot/flags info and passing the addresses via arg/return allows it to be traced via ktrace better than an in/out paramter. This adds a new mquery syscall and renames the old one to omquery. New kernel _MUST_ be built, booted, and 'make includes' before building ld.so with this change.
Diffstat (limited to 'libexec/ld.so/library_mquery.c')
-rw-r--r--libexec/ld.so/library_mquery.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libexec/ld.so/library_mquery.c b/libexec/ld.so/library_mquery.c
index 2a3cb267dd5..2ed736bd541 100644
--- a/libexec/ld.so/library_mquery.c
+++ b/libexec/ld.so/library_mquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library_mquery.c,v 1.5 2003/04/25 20:32:07 drahn Exp $ */
+/* $OpenBSD: library_mquery.c,v 1.6 2003/04/28 21:32:08 drahn Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -445,7 +445,6 @@ retry:
for (ld = lowld; ld != NULL; ld = ld->next) {
off_t foff;
int fd, flags;
- int error;
/*
* We don't want to provide the fd/off hint for anything
@@ -473,13 +472,13 @@ retry:
* adjust the base mapping address to match this free mapping
* and restart the process again.
*/
- error = _dl_mquery(flags, &ld->start, ROUND_PG(ld->size), fd,
- foff);
- if (_dl_check_error(error)) {
+ ld->start = _dl_mquery(ld->start, ROUND_PG(ld->size), ld->prot,
+ flags, fd, foff);
+ if (_dl_check_error(ld->start)) {
ld->start = (void *)(LOFF + ld->moff);
- error = _dl_mquery(0, &ld->start, ROUND_PG(ld->size),
- fd, foff);
- if (_dl_check_error(error))
+ ld->start = _dl_mquery(ld->start, ROUND_PG(ld->size),
+ ld->prot, flags & ~MAP_FIXED, fd, foff);
+ if (_dl_check_error(ld->start))
goto fail;
}