English 中文(简体)
在Cygwin下使用System V信号量:错误的系统调用
原标题:Using System V semaphores under Cygwin: Bad system call

我在Cygwin下的POSIX信号灯有问题,我尝试了以下方法:

$ semtool c 1
Attempting to create new semaphore set with 1 members
Bad system call
$

上面的semtool试图创建(通过semget、semctl等系统调用)一个新的信号量。但是它不起作用:错误的系统调用。

同样,使用semget()的极简主义测试C程序也无法输出相同的消息:错误的系统调用。

我在谷歌上搜索过:安装了cygserver,将环境变量CYGWIN定义为“server”,但没有任何帮助。我的cygwin版本非常新:

$ cygcheck -c | grep cygwin
base-cygwin                     3.0-1                OK
cygwin                          1.7.9-1              OK
cygwin-doc                      1.7-1                OK
cygwin-x-doc                    1.1.1-1              OK
$

有什么想法/暗示可能还缺少什么吗?

现在尝试使用附加导出:

$ export CYGWIN=server

服务正在运行

$ net start | grep -i cyg
   CYGWIN cygserver
$

不再出现错误:

$ semtool c 1
Attempting to create new semaphore set with 1 members
$

现在似乎起作用了!

最佳回答

cygserver正在运行吗?

更新:这在Windows 7下对我有效:

  1. Ran cygserver-config (as administrator), answered "yes" when prompted.
  2. Started "CYGWIN cygserver" service.
  3. Executed "export CYGWIN=server" in cygwin shell.

此时,我可以运行semtool来创建/锁定/解锁信号量,也可以运行semstat来显示其状态。

问题回答

暂无回答




相关问题
cygwin file path tab completion not working

How can I set up Cygwin to have tab completion? Actually, I do have it automatically, but it does not seem to complete paths. How do I set it up to complete paths?

cygwin version of idle has erroneous I/O handling

I am using idle (python 2.5) via cygwin on a windows vista machine and when I try to open an already existing .py file I see the full file path /home/aaron/C:/cygwin/home/aaron/script.py on the ...

Trying to get a terminal to work in Emacs

I ve been having a lot of problems with emacs and trying to get the terminal to work with: M-x term I installed cygwin and I fixed up my .emacs to include the paths: (setenv "PATH" (concat "...

Piping Cygwin into a Python program

As a i m new to the whole Piping thing and Python I had recently encountered a problem trying to pipe Cygwin s stdin & stdout into a python program usin Python s subprocess moudle. for example I ...

Unable to chdir() on Git/Cygwin

I installed Git via Cygwin on Windows Server. It works out very well. However there s a small issue that when I clone a repo use the command as following: $git clone git@myserver:project.git I ...

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7. I am looking for seting-up a ...

Cygwin/Git/Gitosis unable to push new repository

I ve recently set up cygwin, git, and gitosis on my Windows Server 2003 box and am having troubles. I ve followed just about every tutorial I can find to the letter, and have confirmed that my git ...

热门标签