I would not describe either Cygwin or MSYS2 as mere "tools", as they are entire software distributions each of which rely on a special runtime library. However, MSYS2 would not be a solution to your problem. Unlike Cygwin, the purpose of MSYS2 is not to provide a full POSIX emulation layer. See How does MSYS2 differ from Cygwin.
If you build your problem using the Cygwin toolchain you will have support for most common POSIX APIs, including sem_open
. However, your program will be dependent on the entire Cygwin runtime, so you must include with it cygwin1.dll, at the very least.
Alternatively, although you weren't exactly clear on what you're trying to do, you can implement named semaphores in your Windows port using the native Windows API for semaphore objects. Here's a nice little library that supplies (approximate; possibly good enough for your needs) POSIX semaphores implemented on top of Windows's native API, though I haven't used it so I make no guarantees as to its robustness, more just that it provides a good example.