summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-06-26 18:36:57 +0000
committerjhb <jhb@FreeBSD.org>2006-06-26 18:36:57 +0000
commitd67400de73cbcc1a39ca12519a95f9c82c7b678b (patch)
treec0869f3321b4255cdee37ab96946601910e93c18 /sys/compat/svr4
parentddfdf64e37a4a67a6b62d78986136a71c1206bec (diff)
downloadFreeBSD-src-d67400de73cbcc1a39ca12519a95f9c82c7b678b.zip
FreeBSD-src-d67400de73cbcc1a39ca12519a95f9c82c7b678b.tar.gz
Change svr4_sys_break() to just call obreak() and mark it MPSAFE.
Not objected to by: alc
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_misc.c54
-rw-r--r--sys/compat/svr4/syscalls.master2
2 files changed, 4 insertions, 52 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index 5a585cf..affe6eb 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -792,58 +792,10 @@ svr4_sys_break(td, uap)
struct thread *td;
struct svr4_sys_break_args *uap;
{
- struct proc *p = td->td_proc;
- struct vmspace *vm = p->p_vmspace;
- vm_offset_t new, old, base, ns;
- int rv;
-
- base = round_page((vm_offset_t) vm->vm_daddr);
- ns = (vm_offset_t)uap->nsize;
- new = round_page(ns);
- if (new > base) {
- PROC_LOCK(p);
- if ((new - base) > (unsigned)lim_cur(p, RLIMIT_DATA)) {
- PROC_UNLOCK(p);
- return ENOMEM;
- }
- PROC_UNLOCK(p);
- if (new >= VM_MAXUSER_ADDRESS)
- return (ENOMEM);
- } else if (new < base) {
- /*
- * This is simply an invalid value. If someone wants to
- * do fancy address space manipulations, mmap and munmap
- * can do most of what the user would want.
- */
- return EINVAL;
- }
-
- old = base + ctob(vm->vm_dsize);
+ struct obreak_args ap;
- if (new > old) {
- vm_size_t diff;
- diff = new - old;
- PROC_LOCK(p);
- if (vm->vm_map.size + diff > lim_cur(p, RLIMIT_VMEM)) {
- PROC_UNLOCK(p);
- return(ENOMEM);
- }
- PROC_UNLOCK(p);
- rv = vm_map_find(&vm->vm_map, NULL, 0, &old, diff, FALSE,
- VM_PROT_ALL, VM_PROT_ALL, 0);
- if (rv != KERN_SUCCESS) {
- return (ENOMEM);
- }
- vm->vm_dsize += btoc(diff);
- } else if (new < old) {
- rv = vm_map_remove(&vm->vm_map, new, old);
- if (rv != KERN_SUCCESS) {
- return (ENOMEM);
- }
- vm->vm_dsize -= btoc(old - new);
- }
-
- return (0);
+ ap.nsize = uap->nsize;
+ return (obreak(td, &ap));
}
static __inline clock_t
diff --git a/sys/compat/svr4/syscalls.master b/sys/compat/svr4/syscalls.master
index f160208..4086a36 100644
--- a/sys/compat/svr4/syscalls.master
+++ b/sys/compat/svr4/syscalls.master
@@ -57,7 +57,7 @@
14 AUE_NULL MSTD { int svr4_sys_mknod(char* path, int mode, int dev); }
15 AUE_NULL MNOPROTO { int chmod(char *path, int mode); }
16 AUE_NULL MNOPROTO { int chown(char *path, uid_t uid, gid_t gid); }
-17 AUE_NULL STD { int svr4_sys_break(caddr_t nsize); }
+17 AUE_NULL MSTD { int svr4_sys_break(caddr_t nsize); }
18 AUE_NULL MSTD { int svr4_sys_stat(char* path, \
struct svr4_stat* ub); }
19 AUE_NULL MNOPROTO { int lseek(int filedes, off_t *offset, \
OpenPOWER on IntegriCloud