Example #1
0
int FCGX_OpenSocket(const char *path, int backlog)
{
	int rc = OS_CreateLocalIpcFd(path, backlog);
	if (rc == FCGI_LISTENSOCK_FILENO && isFastCGI == 0) {
		/* XXX probably need to call OS_LibInit() again for Win */
		isFastCGI = 1;
	}
	return rc;
}
Example #2
0
static void FCGI_Start(char *bindPath, char *appPath, int nServers)
{
    int listenFd, i;

    /* @@@ Should be able to pick up the backlog as an arg */
    if((listenFd = OS_CreateLocalIpcFd(bindPath, 5)) == -1) {
        exit(OS_Errno);
    }

    if(access(appPath, X_OK) == -1) {
	fprintf(stderr, "%s is not executable\n", appPath);
	exit(1);
    }

    /*
     * Create the server processes
     */
    for(i = 0; i < nServers; i++) {
        if(OS_SpawnChild(appPath, listenFd) == -1) {
            exit(OS_Errno);
	}
    }
    OS_Close(listenFd);
}