Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148859211
D10143.id26842.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10143.id26842.diff
View Options
Index: head/sys/sys/syscallsubr.h
===================================================================
--- head/sys/sys/syscallsubr.h
+++ head/sys/sys/syscallsubr.h
@@ -152,6 +152,7 @@
int kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg,
struct timeval *tptr, enum uio_seg tptrseg);
int kern_madvise(struct thread *td, uintptr_t addr, size_t len, int behav);
+int kern_mincore(struct thread *td, uintptr_t addr, size_t len, char *vec);
int kern_mkdirat(struct thread *td, int fd, char *path,
enum uio_seg segflg, int mode);
int kern_mkfifoat(struct thread *td, int fd, char *path,
Index: head/sys/vm/vm_mmap.c
===================================================================
--- head/sys/vm/vm_mmap.c
+++ head/sys/vm/vm_mmap.c
@@ -711,11 +711,17 @@
int
sys_mincore(struct thread *td, struct mincore_args *uap)
{
+
+ return (kern_mincore(td, (uintptr_t)uap->addr, uap->len, uap->vec));
+}
+
+int
+kern_mincore(struct thread *td, uintptr_t addr0, size_t len, char *vec)
+{
vm_offset_t addr, first_addr;
vm_offset_t end, cend;
pmap_t pmap;
vm_map_t map;
- char *vec;
int error = 0;
int vecindex, lastvecindex;
vm_map_entry_t current;
@@ -732,17 +738,12 @@
* Make sure that the addresses presented are valid for user
* mode.
*/
- first_addr = addr = trunc_page((vm_offset_t) uap->addr);
- end = addr + (vm_size_t)round_page(uap->len);
+ first_addr = addr = trunc_page(addr0);
+ end = addr + (vm_size_t)round_page(len);
map = &td->td_proc->p_vmspace->vm_map;
if (end > vm_map_max(map) || end < addr)
return (ENOMEM);
- /*
- * Address of byte vector
- */
- vec = uap->vec;
-
pmap = vmspace_pmap(td->td_proc->p_vmspace);
vm_map_lock_read(map);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 21, 2:19 PM (19 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30069382
Default Alt Text
D10143.id26842.diff (1 KB)
Attached To
Mode
D10143: Add kern_mincore() and use it in compat.
Attached
Detach File
Event Timeline
Log In to Comment