Implement Linux mincore() system call.

This is necessary for the upcoming drm-next.

Suggested by:	hselasky@
MFC after:	1 month
This commit is contained in:
Dmitry Chagin 2017-03-25 15:47:29 +00:00
parent 8c1960d506
commit 6c2a934b79
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315957
4 changed files with 14 additions and 3 deletions

View File

@ -59,7 +59,6 @@ UNIMPLEMENTED(tuxcall);
UNIMPLEMENTED(uselib);
UNIMPLEMENTED(vserver);
DUMMY(mincore);
DUMMY(sendfile);
DUMMY(syslog);
DUMMY(setfsuid);

View File

@ -79,7 +79,6 @@ DUMMY(sendfile);
DUMMY(setfsuid);
DUMMY(setfsgid);
DUMMY(pivot_root);
DUMMY(mincore);
DUMMY(ptrace);
DUMMY(lookup_dcookie);
DUMMY(remap_file_pages);

View File

@ -2534,3 +2534,17 @@ linux_getrandom(struct thread *td, struct linux_getrandom_args *args)
return (read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK));
}
int
linux_mincore(struct thread *td, struct linux_mincore_args *args)
{
struct mincore_args bsd_args;
/* Needs to be page-aligned */
if (args->start & PAGE_MASK)
return (EINVAL);
bsd_args.addr = PTRIN(args->start);
bsd_args.len = args->len;
bsd_args.vec = args->vec;
return (sys_mincore(td, &bsd_args));
}

View File

@ -82,7 +82,6 @@ DUMMY(sendfile); /* different semantics */
DUMMY(setfsuid);
DUMMY(setfsgid);
DUMMY(pivot_root);
DUMMY(mincore);
DUMMY(lookup_dcookie);
DUMMY(remap_file_pages);
DUMMY(mbind);