- The mkostemp function is documented as accepting additional flags for the open call. In fact, the documentation I have states that the only flags acceptable to this call are O_APPEND, O_SHLOCK, O_EXLOCK and O_CLOEXEC. However, the current VMS implementation requires that all of the flags needed by open be specified.
- mkostemp(fn, O_CLOEXEC) vs.
- mkostemp(fn, O_EXCL | O_CREAT | O_RDWR | O_CLOEXEC)
- Both mkostemp and open accept the O_CLOEXEC flag but do not honor it. Closing a channel opened this way does not delete the file.
- Many of the open source packages I have worked with open a temporary file (usually with mkstemp) and then call fdopen to get a file pointer. Usually, this call includes the 'b' flag but VMS does not currently open temporary files in binary mode so the fdopen fails. A way to specify binary mode would be greatly appreciated. Something like allowing mkostemp(flags, rms settings) would seem to be ideal.
- Systems that support O_CLOEXEC also seem to support an 'e' flag (the equivalent of O_CLOEXEC) on calls that take the 'rwb+' flags. Can such support be added?
MariaDB is a mix of C and C++ code. It needs to all be compiled with clang because the routines share structures that include both long and size_t items. Standard atomic instructions work fine in C++ code, but what atomic instructions are available for C code? So far, all of my attempts to search for documentation only return results for C++ code. At the moment, all I need are equivalent functions for __LOCK_LONG and __UNLOCK_LONG.
How do I make the following work:
inline void mtr_t::memset(const buf_block_t *b, ulint ofs, ulint len, byte val)
{
lib$signal(SS$_DEBUG);
ut_ad(ofs <= ulint(srv_page_size));
ut_ad(ofs + len <= ulint(srv_page_size));
::memset(ofs + b->page.frame, val, len);
memset(*b, ofs, len, val);
}
While the code compiles fine, it generates a mangled name that resolves to lib$signal(int) which, of course, does not exist in the RTL. I've explicitly defined the function as extern "C" but I haven't been able to convince the compiler to generate a reference to lib$signal instead of _Z10lib$signali.
Any answers or hints anyone can provide will be greatly appreciated.