summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-11-28 13:47:41 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-11-28 13:47:41 +0000
commit4c46afe9f467831fba921bfa77a12903c4c39c7d (patch)
treeb755c95bf93b8cb384f911d3f70b96063188d78a /sys/compat
parent8a3355695ffa23bba7a2cb69d229a81ba3485bf9 (diff)
Sync in more uvm changes from NetBSD.
This time we're getting rid of KERN_* and VM_PAGER_* error codes and use errnos instead.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/svr4/svr4_misc.c18
-rw-r--r--sys/compat/vax1k/vax1k_subr.c8
2 files changed, 11 insertions, 15 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index b47cae762f5..99d911bdcf1 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_misc.c,v 1.37 2001/11/07 01:18:01 art Exp $ */
+/* $OpenBSD: svr4_misc.c,v 1.38 2001/11/28 13:47:39 art Exp $ */
/* $NetBSD: svr4_misc.c,v 1.42 1996/12/06 03:22:34 christos Exp $ */
/*
@@ -654,7 +654,7 @@ svr4_sys_break(p, v, retval)
struct svr4_sys_break_args *uap = v;
register struct vmspace *vm = p->p_vmspace;
vaddr_t new, old;
- int rv;
+ int error;
register int diff;
old = (vaddr_t) vm->vm_daddr;
@@ -674,23 +674,19 @@ svr4_sys_break(p, v, retval)
DPRINTF(("break(3): old %lx new %lx diff %x\n", old, new, diff));
if (diff > 0) {
- rv = uvm_map(&vm->vm_map, &old, diff, NULL, UVM_UNKNOWN_OFFSET,
+ error = uvm_map(&vm->vm_map, &old, diff, NULL, UVM_UNKNOWN_OFFSET,
0, UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_COPY,
UVM_ADV_NORMAL,
UVM_FLAG_AMAPPAD|UVM_FLAG_FIXED|
UVM_FLAG_OVERLAY|UVM_FLAG_COPYONW));
- if (rv != KERN_SUCCESS) {
- uprintf("sbrk: grow failed, return = %d\n", rv);
- return ENOMEM;
+ if (error) {
+ uprintf("sbrk: grow failed, return = %d\n", error);
+ return error;
}
vm->vm_dsize += btoc(diff);
} else if (diff < 0) {
diff = -diff;
- rv = uvm_deallocate(&vm->vm_map, new, diff);
- if (rv != KERN_SUCCESS) {
- uprintf("sbrk: shrink failed, return = %d\n", rv);
- return ENOMEM;
- }
+ uvm_deallocate(&vm->vm_map, new, diff);
vm->vm_dsize -= btoc(diff);
}
return 0;
diff --git a/sys/compat/vax1k/vax1k_subr.c b/sys/compat/vax1k/vax1k_subr.c
index b272219cf7f..6164197cf6d 100644
--- a/sys/compat/vax1k/vax1k_subr.c
+++ b/sys/compat/vax1k/vax1k_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vax1k_subr.c,v 1.1 2001/11/14 14:37:22 hugh Exp $ */
+/* $OpenBSD: vax1k_subr.c,v 1.2 2001/11/28 13:47:39 art Exp $ */
/* $NetBSD: vax1k_subr.c,v 1.2 1999/03/24 05:51:20 mrg Exp $ */
/*
@@ -59,7 +59,7 @@ vax1k_map_readvn(p, cmd)
int error;
if (cmd->ev_len == 0)
- return(KERN_SUCCESS); /* XXXCDC: should it happen? */
+ return (0);
oaddr = cmd->ev_addr;
cmd->ev_addr = trunc_page(cmd->ev_addr); /* required by uvm_map */
@@ -90,7 +90,7 @@ vax1k_map_readvn(p, cmd)
trunc_page(cmd->ev_addr),
round_page(cmd->ev_addr + cmd->ev_len),
cmd->ev_prot, FALSE));
- } else {
- return(KERN_SUCCESS);
}
+
+ return (0);
}