I am attempting to build a unix based application on Gentoo Prefix running on Interix v3.5 on Windows XP pro SP3. The build is failing due to the functions ::mlock() and ::munlock() being undefined. These functions originate from mman.h, however, to my understanding Interix v3.5 does not provide these functions.

The alternative, it seems, is to use windows.h memory functions such as vLock. But when building within gentoo, It doesn't look like I have access to those either, it being a unix environment.

Does anyone have experience trying to work around such issues? Any suggestions as to how to proceed?

Probably they are implemented as windows kernel calls at some level. Would it be possible to write wrapper functions using inline assembly (or a more convenient mechanism if possible) to do direct kernel calls to accomplish them?