semget() API fails when run from CMD.exe but works from SH.exe
Mon Dec 16 09:56:00 GMT 2013
On Dec 14 08:04, Steven Bardwell wrote:
> I would like my Cygwin programs to work from a DOS (CMD.exe) window, but I
> having problems with some API calls. Here is a simple program that tries to
> a semaphore it works fine when it is run from sh.exe (or in a mintty
> window), but
> it crashes when run in a DOS window. (The Cygwin service is running.)
> Is there a way to make it work in both environments?
That's not the intention of the IPC calls. They usually only work
if you set up a matching environment.
XSI IPC requires cygserver to run. The XSI IPC structures are only kept
in memory and "something" has to keep them around and coordinate their
rather complex mechanics. If cygserver isn't running, the XSI IPC calls
If you need persistent semaphores, message queues or shared memory,
consider switching to POSIX IPC (sem_open, mq_open, shm_open and
friends). They are backed by the filesystem, namely the Cygwin
directories /dev/mqueue and /dev/shm. This makes them easier to work
with from a DOS shell.
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: not available
More information about the Cygwin