boostorg / interprocess

Boost.org interprocess module
http://boost.org/libs/interprocess
132 stars 117 forks source link

shared_memory_object::truncate() fails on AIX #154

Closed kalikin closed 2 years ago

kalikin commented 2 years ago

Hi. I just tried a small example on AIX and found that shared_memory_object::truncate() always fails:

shared_memory_object shdmem(open_or_create, "test", read_write);
shdmem.truncate(1024);

It looks like truncate() actually makes these two calls: posix_fallocate and ftruncate. And posix_fallocate, which was introduced in #106, returns ENODEV error code, which means "The fd parameter does not refer to a regular file", according to docs.

igaztanaga commented 2 years ago

Thanks for the report. Let me know if the commit fixes the problem in AIX, I have no access to that OS