tags:

views:

25

answers:

0

I have a small JNI program that uses shared memory to update NTP on a Linux server. The C portion of the code has three functions: attach the shared memory, set the time stored in the shared memory, and detach the shared memory. I would like to be able to run this program in Windows, while keeping the C code at least somewhat portable. (There shouldn't be any problem moving the java code over.) The problem I'm running into is that I can't use #include <sys/time.h> or #include <sys/shm.h> on Windows.

First question is, can I set shared memory in Windows that NTP can read from using Meinberg NTP software for Windows? Does the Windows version even support the shared memory driver?

Second, if the first is possible, what would be the best approach for writing the C code? Should I try to keep all of my existing code and #ifdef chunks of it, or just create new .c and .h files specific to Windows? What differences between the shared memory models of Linux and Windows should I be aware of before undertaking this?

Thanks in advance for the help.