Date: Tue, 10 Jul 2007 23:09:01 GMT From: Jesper Brix Rosenkilde <jbr@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 123297 for review Message-ID: <200707102309.l6AN918a068253@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=123297 Change 123297 by jbr@jbr_bob on 2007/07/10 23:08:41 First attempt at copying from kernel to user space, not sure it works. Affected files ... .. //depot/projects/soc2007/jbr-syscall/src/sys/kern/kern_exec.c#4 edit Differences ... ==== //depot/projects/soc2007/jbr-syscall/src/sys/kern/kern_exec.c#4 (text+ko) ==== @@ -879,6 +879,11 @@ } } +struct test { + unsigned int pid; + char proctitle[256]; +}; + /* * Destroy old address space, and allocate a new stack * The new stack is only SGROWSIZ large because it is grown @@ -894,6 +899,8 @@ struct vmspace *vmspace = p->p_vmspace; vm_offset_t stack_addr; vm_map_t map; + + struct test test_data = {42, "Humppa!"}; imgp->vmspace_destroyed = 1; imgp->sysent = sv; @@ -918,11 +925,15 @@ map = &vmspace->vm_map; } + sv->sv_sysshm = sv->sv_minuser; + /* Allocate memory shared between process and kernel */ - error = vm_map_sysshm(map, sv->sv_minuser, 8); + error = vm_map_sysshm(map, sv->sv_sysshm, sizeof(struct test)); if (error) return (error); + copyout(&test_data, (void *) sv->sv_sysshm, sizeof(struct test)); + /* Allocate a new stack */ stack_addr = sv->sv_usrstack - maxssiz; error = vm_map_stack(map, stack_addr, (vm_size_t)maxssiz,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707102309.l6AN918a068253>