我猜这个问题就是这么说的.
我想在Windows上分叉.什么是最相似的操作,我该如何使用它.
Windows 7中是否有可用的完整POSIX实现(我在考虑Windows Services for UNIX)?
它是否适用于每个版本的操作系统(似乎没有)?
它如何在以前的MS Windows POSIX实现中添加/改进或中断?
在哪里可以找到有关Windows 7中有关POSIX合规性的特定Microsoft方法和实现的更多信息?
我一直在关注Beej Networking指南,在服务器部分,有一部分代码叫做函数fork().
if (!fork()) { // this is the child process
close(sockfd); // child doesn't need the listener
if (send(new_fd, "Hello, world!", 13, 0) == -1)
perror("send");
close(new_fd);
exit(0);
Run Code Online (Sandbox Code Playgroud)
我在Windows机器上,不能让那部分工作.我能做些什么来解决这个问题?我的代码如下.
/* Server */
#define _WIN32_WINNT 0x501
#include <iostream>
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdio.h>
#include <sys/types.h>
using namespace std;
const int winsockVersion = 2;
#define BACKLOG 10
#define PORT "3000"
int main(void){
WSADATA wsadata;
if (WSAStartup(MAKEWORD(winsockVersion,0),&wsadata) == 0){
cout<<"-WSAStartup initialized..." << endl;
int status;
int sockfd, …Run Code Online (Sandbox Code Playgroud) 我们在fork()和CreateThread之间有任何关系吗?CreateThread内部调用fork()有什么?
我在Linux上运行的C中编写了一个小型自定义Web服务器应用程序.当应用程序收到请求时,它调用fork()并在一个单独的进程中处理请求,该进程被chroot到包含我想要提供的文件的特定目录中.
我想将应用程序移植到Windows,但是在这个平台上没有fork()和chroot(),并且似乎没有任何直接的等价物.你能指点我在Windows中提供这个功能的简单(并且写得最好)的代码示例吗?我的C并不是那么好,所以越简越好.
在http://code.google.com/p/modwsgi/上可以阅读此声明
的mod_wsgi的守护模式将然而,仅可在Apache 2.0或2.2 UNIX上运行,只有当基本的Apache Apache的运行时库已编制与线程支持.
在Windows下不支持守护进程模式的原因是什么?
在得到之后我发现了上述内容
Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module not included in the server configuration
Run Code Online (Sandbox Code Playgroud)
来自Apache的错误.模块的包含不是问题,因为WSGIScriptAlias指令工作正常.我想我得到的错误是由于mod_wsgi的wiki上描述的限制.