bitwiseworks / libcx

kLIBC Extension Library
GNU Lesser General Public License v2.1
11 stars 1 forks source link

mcommit() implementation missing #16

Closed ydario closed 8 years ago

ydario commented 8 years ago

mcommit() is required for building Berkeley DB code, it is used to commit pages before passing buffers to read/write (OS/2 kernel requires committed pages in buffers).

dmik commented 8 years ago

Yuri, mcommit() looks to me like an OS/2 specific extension. At least, I can't find such an API elsewhere (and this is why I simply dropped it). It also doesn't appear to be necessary for the new mmap implementation from LIBCx as the allocated memory pages will be committed automatically as needed (no matter which code first accesses them — user or DOS functions, thanks to the mmap's own exception handler). So I guess that simply removing mcommit() usage from the Berkley DB code will solve your problem. If not, please reopen this issue with more details. (See also https://github.com/bitwiseworks/libcx/issues/11#issuecomment-244634984).

BTW, there is one hidden way to pre-commit mmap()'ed pages on OS/2 — call mprotect() on them with protection flags other than PROT_NONE. But this will work only for anonymous mappings not bound to files so far (see mprotect() notes in README.md and mprotect() source in mmap.c for more info). And I really doubt that pre-committing pages has any benefit than committing them on demand w/o any explicit code (as done now).

So closing this as "won't fix" too.