MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / mincore

Method mincore

source/kernel/kprocess.cpp:1972–1986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1970}
1971
1972U32 KProcess::mincore(U32 address, U32 length, U32 vec) {
1973 U32 pages = (length+K_PAGE_SIZE+1)/K_PAGE_SIZE;
1974 U32 page = address >> K_PAGE_SHIFT;
1975
1976 for (U32 i=0;i<pages;i++) {
1977 if (page+i>=K_NUMBER_OF_PAGES)
1978 return -K_ENOMEM;
1979 if (this->memory->isPageAllocated(page+i))
1980 memory->writeb(vec, 1);
1981 else
1982 memory->writeb(vec, 0);
1983 vec++;
1984 }
1985 return 0;
1986}
1987
1988U32 KProcess::fcntrl(KThread* thread, FD fildes, U32 cmd, U32 arg) {
1989 KFileDescriptorPtr fd = this->getFileDescriptor(fildes);

Callers 1

syscall_mincoreFunction · 0.80

Calls 2

isPageAllocatedMethod · 0.45
writebMethod · 0.45

Tested by

no test coverage detected