假如要编写 IPC 的程序, 那么首先需要再去运行那个 setup 程序。
在 Admin 的选项下面, 选择安装 cygrunsrv: NT/W2K service initiator.
然后运行 cygwin ( Win 7 下面,需要以“管理员身份”运行 cygwin)
然后进入 /usr/bin 目录下,运行 cygserver-config
/usr/bin
$ cygserver-config
Overwrite existing /etc/cygserver.conf file? (yes/no) yes
Generating /etc/cygserver.conf file
Warning: The following function requires administrator privileges!
Do you want to install cygserver as service?
(Say "no" if it's already installed as service) (yes/no) yes
The service has been installed under LocalSystem account.
To start it, call `net start cygserver' or `cygrunsrv -S cygserver'.
Further configuration options are available by editing the configuration
file /etc/cygserver.conf. Please read the inline information in that
file carefully. The best option for the start is to just leave it alone.
Basic Cygserver configuration finished. Have fun!
----- 在 ipc 服务没有启动的情况下, 运行 ipcs , 结果会提示 “Bad system call”
/usr/bin
$ ipcs
Bad system call
----- 运行 cygrunsrv -S cygserver 来启动服务.
/usr/bin
$ cygrunsrv -S cygserver
-- 再次查看 ipcs, 不抱 “Bad system call” 错了.
/usr/bin
$ ipcs
Message Queues:
T ID KEY MODE OWNER GROUP
Shared Memory:
T ID KEY MODE OWNER GROUP
Semaphores:
T ID KEY MODE OWNER GROUP
这样就可以开始编写 / 运行 ipc 的相关 C 程序了。