亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.c++

?? fax相關的東西
?? C++
字號:
/*	$Id: main.c++,v 1.7 2006/08/12 20:51:30 pfournier Exp $ *//* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. * HylaFAX is a trademark of Silicon Graphics * * Permission to use, copy, modify, distribute, and sell this software and  * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. *  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.   *  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE  * OF THIS SOFTWARE. */#include "port.h"#include "InetFaxServer.h"#if CONFIG_UNIXTRANSPORT#include "UnixFaxServer.h"#endif#ifdef OLDPROTO_SUPPORT#include "OldProtocol.h"#endif#ifdef SNPP_SUPPORT#include "SNPPServer.h"#endif#ifdef HTTP_SUPPORT#include "HTTPServer.h"#endif#include "Dispatcher.h"#include "Array.h"#include "Sys.h"#include "Socket.h"#include "config.h"static	jmp_buf problem;static voidsigCleanup(int sig){    logError("CAUGHT SIGNAL %d", sig);    longjmp(problem, 1);}static voidfatal(const char* fmt ...){    va_list ap;    va_start(ap, fmt);    vlogError(fmt, ap);    va_end(ap);    exit(-1);}#define	PATH_DEVNULL	"dev/null"#define	PATH_DEVTCP	"dev/tcp"#define	PATH_NETCONFIG	"etc/netconfig"#define	PATH_DEVSOCKSYS	"dev/socksys"/* * Verify and possibly setup the chroot'd filesystem as * required by the system.  Specifically, create a private * copy of /dev/null and any networking-related files * required by SVR4-based TCP/IP support.  We do this work * because the process runs chroot'd to the top of the * spooling area so normal files in the root filesystem * are inaccessible. * * NB: This work could be done once in a setup script but *     creating duplicates of character special device files *     is not simple from the shell. */static voidCheckSpoolingSetup(void){    struct stat sb;    uid_t ouid = geteuid();    (void) seteuid(0);    mode_t omask = umask(0);    /*     * Craft a private /dev/null in the chroot'd filesystem     * for use by syslog because some syslogs require this     * to function correctly.     */    if (!Sys::isCharSpecialFile(PATH_DEVNULL)) {	if (!Sys::isCharSpecialFile("/" PATH_DEVNULL, sb))	    fatal("stat(%s): %s", "/" PATH_DEVNULL, strerror(errno));	if (mknod(PATH_DEVNULL, sb.st_mode, sb.st_rdev) < 0)	    fatal("Could not create %s: %s", PATH_DEVNULL, strerror(errno));    }    /*     * If the system appears to support SVR4-style TCP/IP     * support then craft a private copy of the necessary     * files so that socket-related calls can be made after     * chroot'ing to the top of the spooling area.     *     * NB: It is assumed that the dev subdirectory is already     *     present (make install or similar should create it).     */    if (Sys::isCharSpecialFile("/" PATH_DEVTCP, sb) &&      !Sys::isCharSpecialFile(PATH_DEVTCP)) {	if (mknod(PATH_DEVTCP, sb.st_mode, sb.st_rdev) < 0)	    fatal("Could not create %s: %s", PATH_DEVTCP, strerror(errno));	/*	 * Copy /etc/netconfig if not already present.	 */	if (Sys::stat(PATH_NETCONFIG, sb) < 0) {	    int src = Sys::open("/" PATH_NETCONFIG, O_RDONLY);	    if (src >= 0) {		int dst = Sys::open(PATH_NETCONFIG, O_WRONLY|O_CREAT, 0444);		if (dst < 0)		    fatal("creat(%s): %s", PATH_NETCONFIG, strerror(errno));		char buf[4096];		int cc;		while ((cc = read(src, buf, sizeof (buf))) > 0)		    if (write(dst, buf, cc) < 0)			fatal("write(%s): %s", PATH_NETCONFIG, strerror(errno));		close(dst);		close(src);	    } else		logWarning("%s: Cannot open: %s",		    "/" PATH_NETCONFIG, strerror(errno));	}    }    /*     * SCO OS 5 apparently needs a /dev/socksys to implement     * setsockopt calls (sigh); create one in the chroot'd     * area if one exists in the root filesystem.     */    if (Sys::isCharSpecialFile("/" PATH_DEVSOCKSYS, sb) &&      !Sys::isCharSpecialFile(PATH_DEVSOCKSYS))	if (mknod(PATH_DEVSOCKSYS, sb.st_mode, sb.st_rdev) < 0)	    fatal("Could not create %s: %s", PATH_DEVSOCKSYS, strerror(errno));    (void) umask(omask);    seteuid(ouid);}/* * Break the association with the controlling tty. * Note that we do not close all the open file descriptors * because many systems cache open descriptors within libraries * for performance reasons and do not react well when you close * them w/o telling them about it (and some don't react well * even when you *DO* tell them).  Since we know we're called * very early on from main in all our apps we just assume that * we only need to remove the stdin+stdout+stderr before forking * and starting a new session. */static voiddetachFromTTY(void){    int fd = Sys::open(_PATH_DEVNULL, O_RDWR);    if (fd == -1)	fatal("Could not open null device file %s.", _PATH_DEVNULL);    dup2(fd, STDIN_FILENO);    dup2(fd, STDOUT_FILENO);    dup2(fd, STDERR_FILENO);    Sys::close(fd);    switch (fork()) {    case 0:	break;			// child, continue    case -1:	_exit(1);		// error    default:	_exit(0);		// parent, terminate    }    (void) setsid();}static voidusage(const char* appName){    fatal("usage: %s [-d] [-o port] [-O] [-h port] [-H] [-l bindaddress] [-i port] [-I] [-s port] [-S] [-u socket] [-q queue-directory]",	appName);}fxDECLARE_PtrArray(IOHandlerArray, IOHandler*)fxIMPLEMENT_PtrArray(IOHandlerArray, IOHandler*)static	IOHandlerArray handlers;static voidnewInetServer(void){    InetFaxServer* server = new InetFaxServer;    server->open();    handlers.append(server);}intmain(int argc, char** argv, char** envp){    const char *bindaddress = NULL;    HylaFAXServer::setLogFacility(LOG_FAX);    HylaFAXServer::setupLogging("HylaFAX");    HylaFAXServer::setupPermissions();    fxStr appName = argv[0];    u_int l = appName.length();    appName = appName.tokenR(l, '/');    optind = 1;    opterr = 0;    int c;    const char* opts = "dHh:Ii:Oo:q:Ss:u:l:";    /*     * Deduce the spooling directory and whether or not to     * detach the process from the controlling tty.  The     * latter is complicated by the fact that we run both     * as a master-server process and as a subprocess to     * inetd.  If we are to act as a master-server then we     * detach by default.  If we are invoked by inetd then     * do not detach.  If no arguments are specified then     * we imply a -I option (the new fax protocol) and do     * not want to detach.  The logic is a touch convoluted     * to do this correctly and is probably not worth the     * effort (except to reduce configuration errors).     */    fxStr queueDir(FAX_SPOOLDIR);    int detach = -1;			// unknown state    while ((c = Sys::getopt(argc, argv, opts)) != -1)	switch (c) {	case 'h': case 'i': case 'o': case 's': case 'u':	    if (detach == -1)		// detach unless explicitly specified		detach = true;	    break;	case 'H': case 'I': case 'O': case 'S':	    if (detach == -1)		// don't detach when invoked by inetd		detach = false;	    break;	case 'd': detach = false; break;	case 'q': queueDir = optarg; break;	case '?': usage(appName);	}    if (detach == -1)			// no protocol options means -I	detach = false;    if (Sys::chdir(queueDir) < 0)	fatal("Can not change directory to %s", (const char*)queueDir);    CheckSpoolingSetup();    if (detach)	detachFromTTY();    /*     * Rescan the arguments and create the appropriate     * protocol support threads.  We do this after the     * above work for reasons I can no longer remember.     */    optind = 1;    opterr = 0;    while ((c = Sys::getopt(argc, argv, opts)) != -1)	switch (c) {#ifdef OLDPROTO_SUPPORT	case 'o': handlers.append(new OldProtocolSuperServer(optarg)); break;	case 'O':	    { OldProtocolServer* server = new OldProtocolServer;	      server->open();	      handlers.append(server);	    }	    break;#else	case 'o': case 'O':	    fatal("No support for old protocol");	    /*NOTREACHED*/#endif#ifdef HTTP_SUPPORT	case 'h': handlers.append(new HTTPSuperServer(optarg)); break;	case 'H':	    { HTTPFaxServer* server = new HTTPFaxServer;	      server->open();	      handlers.append(server);	    }	    break;#else	case 'h': case 'H':	    fatal("No HTTP suport");	    /*NOTREACHED*/#endif	case 'l':	    bindaddress = strdup(optarg); break;	case 'i': {		InetSuperServer* iss;		iss = new InetSuperServer(optarg);		handlers.append(iss);		if ((iss!=NULL) && (bindaddress!=NULL))		    iss->setBindAddress(bindaddress);		}		break;	case 'I': newInetServer(); break;#ifdef SNPP_SUPPORT	case 's': handlers.append(new SNPPSuperServer(optarg)); break;	case 'S':	    { SNPPServer* server = new SNPPServer;	      server->open();	      handlers.append(server);	    }	    break;#else	case 's': case 'S':	    fatal("No SNPP support");	    /*NOTREACHED*/#endif#if CONFIG_UNIXTRANSPORT	case 'u': handlers.append(new UnixSuperServer(optarg)); break;#else	case 'u':	    fatal("No support for Unix domain sockets");	    /*NOTREACHED*/#endif	}    if (handlers.length() == 0)	newInetServer();    /*     * Startup protocol processing.     */    if (setjmp(problem) == 0) {	signal(SIGHUP, fxSIGHANDLER(sigCleanup));	signal(SIGINT, fxSIGHANDLER(sigCleanup));	signal(SIGQUIT, fxSIGHANDLER(sigCleanup));	signal(SIGILL, fxSIGHANDLER(sigCleanup));	signal(SIGKILL, fxSIGHANDLER(sigCleanup));	signal(SIGBUS, fxSIGHANDLER(sigCleanup));	signal(SIGSEGV, fxSIGHANDLER(sigCleanup));	for (;;)	    Dispatcher::instance().dispatch();    }    /*     * We explicitly destroy protocol threads so that any     * resources are reclaimed (e.g. Unix domain sockets).     */    for (u_int i = 0, n = handlers.length(); i < n; i++)	delete handlers[i];    return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品一区二区三区 | 在线免费观看成人短视频| 美女www一区二区| 天天av天天翘天天综合网| 亚洲一区二区三区爽爽爽爽爽| 亚洲欧洲99久久| 亚洲精品中文在线影院| 有坂深雪av一区二区精品| 亚洲一二三四在线| 日本不卡一二三区黄网| 国模冰冰炮一区二区| 成人中文字幕电影| av亚洲产国偷v产偷v自拍| 91在线视频在线| 欧美性大战久久久久久久| 欧美日韩综合一区| 久久综合资源网| 国产精品污www在线观看| 一区二区三区国产精品| 日韩电影免费在线看| 国产精品一区二区男女羞羞无遮挡| 成人一区在线看| 欧美日韩性生活| 欧美精品一区二区三区高清aⅴ| 欧美激情在线一区二区三区| 曰韩精品一区二区| 精彩视频一区二区三区| 91在线你懂得| 欧美一区二区在线免费观看| 国产三级精品三级| 亚洲成a人在线观看| 国产成人在线看| 欧美色成人综合| 亚洲国产精品二十页| 亚洲成av人影院| 成人做爰69片免费看网站| 欧美剧情电影在线观看完整版免费励志电影| 欧美精品1区2区3区| 国产精品乱人伦中文| 日韩精品亚洲一区| av亚洲产国偷v产偷v自拍| 欧美一区二区三区性视频| 亚洲欧美怡红院| 国产一二精品视频| 欧美一级日韩免费不卡| 日韩伦理av电影| 精品一区二区av| 欧美在线影院一区二区| 欧美极品少妇xxxxⅹ高跟鞋 | 国产日韩精品久久久| 日韩电影在线一区| 色婷婷综合久久| 欧美韩日一区二区三区| 久久国产综合精品| 欧美日韩卡一卡二| 亚洲精品国产品国语在线app| 国产综合一区二区| 日韩一区二区三区精品视频| 夜夜爽夜夜爽精品视频| 色成人在线视频| 成人一区二区三区| 精品国产91洋老外米糕| 亚洲一区二区三区爽爽爽爽爽| 日本最新不卡在线| av在线一区二区| 国产欧美一区二区三区在线老狼| 亚洲国产一区二区三区| 91亚洲精品久久久蜜桃| 国产视频一区在线播放| 久久精品国产在热久久| 日韩一区二区在线看| 丝袜亚洲另类欧美| 欧美日韩不卡一区| 日韩精品欧美精品| 欧美一区二区三区白人| 日韩精品亚洲一区| 精品国产欧美一区二区| 激情综合一区二区三区| 欧美哺乳videos| 国精品**一区二区三区在线蜜桃| 欧美精品一区二区三区很污很色的 | 国产九九视频一区二区三区| 日韩欧美在线影院| 精品一区在线看| 久久女同精品一区二区| 懂色一区二区三区免费观看| 国产精品欧美综合在线| 91丨porny丨首页| 亚洲午夜激情av| 91精品国产福利在线观看| 国产在线日韩欧美| 国产精品青草久久| 欧美视频一区在线| 美女任你摸久久| 国产人伦精品一区二区| 色婷婷激情久久| 亚洲成人一区二区在线观看| 日韩精品一区二区三区在线| 成人免费观看视频| 一区二区三区四区精品在线视频| 欧美精品久久天天躁| 麻豆精品在线播放| 中文字幕佐山爱一区二区免费| 欧美三级韩国三级日本一级| 国产又粗又猛又爽又黄91精品| 亚洲欧洲国产专区| 在线不卡免费av| 成人高清av在线| 日韩国产欧美三级| 亚洲视频在线观看三级| 日韩限制级电影在线观看| av高清不卡在线| 久久国产日韩欧美精品| 一区二区三区在线看| 日韩欧美一区二区免费| 91麻豆蜜桃一区二区三区| 秋霞电影一区二区| 一区二区三区四区精品在线视频| 欧美成人激情免费网| 在线影院国内精品| 国产.精品.日韩.另类.中文.在线.播放| 亚洲区小说区图片区qvod| 精品少妇一区二区三区在线播放| 91在线小视频| 成人激情免费视频| 国内久久精品视频| 麻豆国产91在线播放| 亚洲福利一区二区三区| 亚洲天堂免费看| 国产亚洲精品久| 日韩精品中文字幕一区二区三区| 色老综合老女人久久久| 成人污视频在线观看| 久久精品国产亚洲5555| 日韩精品福利网| 亚洲综合视频网| 亚洲人成网站精品片在线观看| 久久久久久久久免费| 日韩欧美二区三区| 91精品在线观看入口| 欧美日韩中文另类| 在线视频中文字幕一区二区| www.欧美.com| 99久久精品国产精品久久| 国产a久久麻豆| 成人做爰69片免费看网站| 国产成人精品一区二区三区四区 | 欧美国产成人在线| 久久久精品tv| 国产日产欧美一区二区视频| 欧美激情自拍偷拍| 国产精品久线在线观看| ...xxx性欧美| 亚洲精品日日夜夜| 亚洲国产毛片aaaaa无费看| 亚洲狠狠丁香婷婷综合久久久| 亚洲精品高清视频在线观看| 一区二区三区四区不卡在线| 亚洲自拍与偷拍| 日韩激情视频网站| 麻豆精品新av中文字幕| 国产伦精品一区二区三区免费 | 亚洲欧美偷拍三级| 亚洲免费观看高清完整版在线观看 | 欧美色手机在线观看| 欧美在线观看视频一区二区| 精品视频一区三区九区| 欧美成人激情免费网| 国产亚洲欧美日韩在线一区| 亚洲欧洲日本在线| 亚洲电影在线播放| 久久99国内精品| 成人动漫视频在线| 精品视频在线看| 久久久久久久久久久99999| 亚洲欧洲av色图| 日本中文一区二区三区| 国产原创一区二区| 9人人澡人人爽人人精品| 欧美最猛性xxxxx直播| 精品日韩99亚洲| 日韩毛片在线免费观看| 免费观看日韩电影| av在线不卡免费看| 日韩欧美一区二区久久婷婷| 中文成人综合网| 舔着乳尖日韩一区| 国产69精品久久久久毛片| 精品视频1区2区| 欧美激情在线看| 日本免费在线视频不卡一不卡二 | 色综合久久天天| 日韩一区二区三区免费看| 中文字幕一区二区三区四区 | 久久久久免费观看| 亚洲在线视频一区| 丰满白嫩尤物一区二区| 91麻豆精品国产91久久久久久| 国产精品三级av| 精品一区二区av|