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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? server.c

?? gcc-2.95.3 Linux下最常用的C編譯器
?? C
字號:
/* *  server.c  Set up and handle communications with a server process. * *  Server Handling copyright 1992-1999 The Free Software Foundation * *  Server Handling is free software. *  You may redistribute it and/or modify it under the terms of the *  GNU General Public License, as published by the Free Software *  Foundation; either version 2, or (at your option) any later version. * *  Server Handling is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with Server Handling.  See the file "COPYING".  If not, *  write to:  The Free Software Foundation, Inc., *             59 Temple Place - Suite 330, *             Boston,  MA  02111-1307, USA. * * As a special exception, The Free Software Foundation gives * permission for additional uses of the text contained in his release * of ServerHandler. * * The exception is that, if you link the ServerHandler library with other * files to produce an executable, this does not by itself cause the * resulting executable to be covered by the GNU General Public License. * Your use of that executable is in no way restricted on account of * linking the ServerHandler library code into it. * * This exception does not however invalidate any other reasons why * the executable file might be covered by the GNU General Public License. * * This exception applies only to the code released by The Free * Software Foundation under the name ServerHandler.  If you copy code * from other sources under the General Public License into a copy of * ServerHandler, as the General Public License permits, the exception * does not apply to the code that you add in this way.  To avoid * misleading anyone as to the status of such modified files, you must * delete this exception notice from them. * * If you write modifications of your own for ServerHandler, it is your * choice whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. */#include "auto-host.h"#include "gansidecl.h"#include "system.h"#include <signal.h>#include "server.h"/* If this particular system's header files define the macro `MAXPATHLEN',   we happily take advantage of it; otherwise we use a value which ought   to be large enough.  */#ifndef MAXPATHLEN# define MAXPATHLEN     4096#endif#ifndef STDIN_FILENO# define STDIN_FILENO	0#endif#ifndef STDOUT_FILENO# define STDOUT_FILENO	1#endif#ifdef DEBUG#define STATIC#else#define STATIC static#endif#ifndef tSCC#define tSCC static const char#endif#ifndef NUL#define NUL '\0'#endif#if !defined(volatile) && !defined(HAVE_VOLATILE)# define volatile#endifSTATIC volatile bool read_pipe_timeout;static t_pchar def_args[] ={ (char *) NULL, (char *) NULL };STATIC t_pf_pair server_pair ={ (FILE *) NULL, (FILE *) NULL };STATIC pid_t server_id = NULLPROCESS;/* *  Arbitrary text that should not be found in the shell output. *  It must be a single line and appear verbatim at the start of *  the terminating output line. */tSCC z_done[] = "ShElL-OuTpUt-HaS-bEeN-cOmPlEtEd";STATIC t_pchar p_cur_dir = (char *) NULL;/* *  load_data * *  Read data from a file pointer (a pipe to a process in this context) *  until we either get EOF or we get a marker line back. *  The read data are stored in a malloc-ed string that is truncated *  to size at the end.  Input is assumed to be an ASCII string. */static char *load_data (fp)     FILE *fp;{  char *pz_text;  size_t text_size;  char *pz_scan;  char z_line[1024];  text_size = sizeof (z_line) * 2;  pz_scan = pz_text = malloc (text_size);  if (pz_text == (char *) NULL)    return (char *) NULL;  for (;;)    {      size_t used_ct;      alarm (10);      read_pipe_timeout = BOOL_FALSE;      if (fgets (z_line, sizeof (z_line), fp) == (char *) NULL)        break;      if (strncmp (z_line, z_done, sizeof (z_done) - 1) == 0)        break;      strcpy (pz_scan, z_line);      pz_scan += strlen (z_line);      used_ct = (size_t) (pz_scan - pz_text);      if (text_size - used_ct < sizeof (z_line))        {          size_t off = (size_t) (pz_scan - pz_text);          void *p;	            text_size += 4096;          p = realloc ((void *) pz_text, text_size);          if (p == (void *) NULL)            {              fprintf (stderr, "Failed to get 0x%08lX bytes\n",                      (long) text_size);              free ((void *) pz_text);              return (char *) NULL;            }          pz_text = (char *) p;          pz_scan = pz_text + off;        }    }  alarm (0);  if (read_pipe_timeout)    {      free ((void *) pz_text);      return (char *) NULL;    }  while ((pz_scan > pz_text) && isspace (pz_scan[-1]))    pz_scan--;  *pz_scan = NUL;  return realloc ((void *) pz_text, strlen (pz_text) + 1);}/* *  close_server * *  Make certain the server process is dead, close the  *  pipes to it and from it, finally NULL out the file pointers */voidclose_server (){  if (server_id != NULLPROCESS)    {      kill ((pid_t) server_id, SIGKILL);      server_id = NULLPROCESS;      fclose (server_pair.pf_read);      fclose (server_pair.pf_write);      server_pair.pf_read = server_pair.pf_write = (FILE *) NULL;    }}/* *  sig_handler really only handles the timeout and pipe signals. *  This ensures that we do not wait forever on a request *  to our server, and also that if the server dies, we do not *  die from a sigpipe problem. */static voidsig_handler (signo)     int signo;{#ifdef DEBUG  /* FIXME: this is illegal to do in a signal handler.  */  fprintf (stderr,          "fixincl ERROR:  sig_handler: killed pid %ld due to %s\n",          (long) server_id, signo == SIGPIPE ? "SIGPIPE" : "SIGALRM");#endif  close_server ();  read_pipe_timeout = BOOL_TRUE;}/* *  server_setup  Establish the signal handler for PIPE and ALARM. *  Also establishes the current directory to give to the *  server process at the start of every server command. */static voidserver_setup (){  static int atexit_done = 0;    if (atexit_done++ == 0)    atexit (&close_server);  signal (SIGPIPE, sig_handler);  signal (SIGALRM, sig_handler);  fputs ("trap : 1\n", server_pair.pf_write);  fflush (server_pair.pf_write);  p_cur_dir = getcwd ((char *) NULL, MAXPATHLEN + 1);}/* *  run_shell * *  Run a shell command on the server.  The command string *  passed in is wrapped inside the sequence: * *     cd <original directory> *     <command string> *     echo *     echo <end-of-command-marker> * *  This ensures that all commands start at a known place in *  the directory structure, that any incomplete output lines *  are completed and that our special marker sequence appears on *  a line by itself.  We have chosen a marker that is *  excessively unlikely to be reproduced in normal output: * *     "ShElL-OuTpUt-HaS-bEeN-cOmPlEtEd" */char *run_shell (pz_cmd)     const char *pz_cmd;{  /*  IF the shell server process is not running yet,      THEN try to start it.  */  if (server_id == NULLPROCESS)    {      server_id = proc2_fopen (&server_pair, def_args);      if (server_id > 0)        server_setup ();    }  /*  IF it is still not running, THEN return the nil string.  */  if (server_id <= 0)    {      char *pz = (char *) malloc (1);            if (pz != (char *) NULL)        *pz = '\0';      return pz;    }  /*  Make sure the process will pay attention to us, send the     supplied command, and then have it output a special marker that     we can find.  */  fprintf (server_pair.pf_write, "cd %s\n%s\n\necho\necho %s\n",           p_cur_dir, pz_cmd, z_done);  fflush (server_pair.pf_write);  /*  IF the server died and we received a SIGPIPE,      THEN return an empty string.  */  if (server_id == NULLPROCESS)    {      char *pz = (char *) malloc (1);            if (pz != (char *) NULL)        *pz = '\0';      return pz;    }  /*  Now try to read back all the data.  If we fail due to either a     sigpipe or sigalrm (timeout), we will return the nil string.  */  {    char *pz = load_data (server_pair.pf_read);        if (pz == (char *) NULL)      {        fprintf (stderr, "CLOSING SHELL SERVER - command failure:\n\t%s\n",                 pz_cmd);        close_server ();        pz = (char *) malloc (1);        if (pz != (char *) NULL)          *pz = '\0';      }    return pz;  }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
奇米色一区二区| 一区二区三区欧美日| 精品一区二区三区的国产在线播放| 欧美午夜精品一区| 三级影片在线观看欧美日韩一区二区| 欧美精品乱码久久久久久 | 国产精品欧美久久久久一区二区| 国产成人精品一区二| 国产精品国产三级国产aⅴ入口 | 欧美一二三区在线观看| 久久超级碰视频| 国产欧美日韩三级| 欧美亚洲综合一区| 久久91精品久久久久久秒播| 国产网红主播福利一区二区| 色婷婷精品大在线视频 | 久久国产精品免费| 国产精品久久久久久久久快鸭| 一本久久a久久精品亚洲| 亚洲成人动漫一区| 久久久精品蜜桃| 91久久精品一区二区三区| 国产精品天美传媒| 欧美精品久久久久久久多人混战 | 奇米精品一区二区三区四区| 久久久久一区二区三区四区| 在线一区二区三区做爰视频网站| 免费不卡在线观看| 成人免费在线观看入口| 欧美一区二区视频免费观看| 岛国av在线一区| 热久久免费视频| 亚洲日本在线看| 欧美一区日韩一区| 91在线精品一区二区| 免费成人深夜小野草| 亚洲欧美日韩中文字幕一区二区三区| 日韩欧美成人午夜| 91国产免费看| 成人一区在线看| 毛片av一区二区三区| 亚洲欧美日韩精品久久久久| 精品国产1区二区| 欧美群妇大交群中文字幕| 成人美女视频在线观看| 精品一区二区免费视频| 亚洲成人免费在线| 最好看的中文字幕久久| 2021久久国产精品不只是精品| 欧美三级蜜桃2在线观看| 国产成人免费视频网站高清观看视频| 三级不卡在线观看| 亚洲狼人国产精品| 国产精品国产三级国产aⅴ原创| 欧美精品一区二区不卡 | 色综合久久中文字幕| 国产伦精品一区二区三区视频青涩| 亚洲大型综合色站| 一区二区在线看| 国产精品动漫网站| 国产视频一区二区在线| 精品日产卡一卡二卡麻豆| 欧美日本在线播放| 欧美性猛交xxxx乱大交退制版| 不卡欧美aaaaa| 成人99免费视频| 国产高清不卡一区二区| 国产在线不卡视频| 久久精品99国产国产精| 日本不卡高清视频| 免费观看91视频大全| 天堂一区二区在线免费观看| 亚洲第一福利一区| 亚洲1区2区3区视频| 亚洲成人先锋电影| 日韩精品乱码免费| 日本少妇一区二区| 九九热在线视频观看这里只有精品 | 99视频一区二区| 91性感美女视频| 日本精品一区二区三区高清 | 日本不卡不码高清免费观看| 日本欧美一区二区在线观看| 乱一区二区av| 国内精品不卡在线| 成人免费视频视频| 日本韩国欧美国产| 在线播放中文字幕一区| 欧美一区二区三区精品| 精品国产欧美一区二区| 久久久久久久久久久黄色| 国产精品天干天干在观线| 亚洲欧洲99久久| 亚洲成a天堂v人片| 蜜臀av在线播放一区二区三区| 国模套图日韩精品一区二区| 国产成人在线网站| 91麻豆精品秘密| 欧美久久久一区| 国产日韩欧美制服另类| 亚洲男人的天堂在线aⅴ视频| 亚洲亚洲人成综合网络| 日韩国产欧美三级| 国产一区二区不卡在线| 97精品国产露脸对白| 欧美色涩在线第一页| 精品久久久久久综合日本欧美| 国产偷国产偷精品高清尤物| 一区二区三区资源| 久久成人精品无人区| 91最新地址在线播放| 91精品国产麻豆国产自产在线| 亚洲国产精品国自产拍av| 亚洲制服丝袜av| 国产一区二区中文字幕| 色综合久久久久综合体桃花网| 制服丝袜亚洲色图| 日韩美女精品在线| 久久99国内精品| 欧美亚洲高清一区| 麻豆一区二区三| 99综合电影在线视频| 91精品国产综合久久久久久久久久| 欧美经典一区二区三区| 五月综合激情婷婷六月色窝| 成人小视频免费观看| 91精品国产综合久久婷婷香蕉| 国产精品网曝门| 精品制服美女久久| 欧美区视频在线观看| 亚洲婷婷国产精品电影人久久| 蜜桃精品视频在线| 在线观看日韩一区| 国产精品久久久久久久第一福利 | 国产欧美日韩麻豆91| 五月婷婷综合网| 99久久久国产精品免费蜜臀| 精品sm在线观看| 日韩激情av在线| 欧美午夜精品久久久久久超碰| 国产欧美一区二区精品仙草咪| 免费成人av在线| 精品婷婷伊人一区三区三| 国产精品对白交换视频 | 日韩一区二区三区在线| 伊人一区二区三区| 97久久精品人人做人人爽| 国产日本欧美一区二区| 狠狠色伊人亚洲综合成人| 欧美丰满一区二区免费视频| 亚洲精品老司机| 色综合天天综合网天天看片| 中文字幕精品一区二区精品绿巨人| 激情综合网最新| 91精选在线观看| 日韩av不卡在线观看| 欧美人妖巨大在线| 视频在线观看91| 欧美日韩国产欧美日美国产精品| 亚洲免费资源在线播放| 91麻豆产精品久久久久久| 国产精品久久久久久久久免费丝袜 | 国产精品久久一卡二卡| 国产成人久久精品77777最新版本| 亚洲精品一区二区三区四区高清| 老司机精品视频在线| 91精品国产综合久久久久久久| 日韩精品欧美成人高清一区二区| 欧美日韩和欧美的一区二区| 亚洲国产成人av网| 欧美精品欧美精品系列| 日韩av电影免费观看高清完整版| 在线成人av影院| 精品亚洲欧美一区| 久久久久久电影| 成人av中文字幕| 亚洲欧美国产77777| 欧美午夜理伦三级在线观看| 天堂va蜜桃一区二区三区| 717成人午夜免费福利电影| 老司机精品视频线观看86| 久久久精品一品道一区| 99这里只有久久精品视频| 一区二区三区在线观看动漫| 欧美区视频在线观看| 九九九久久久精品| 国产精品日韩成人| 欧美性高清videossexo| 蜜桃久久久久久| 欧美国产成人精品| 欧美性videosxxxxx| 麻豆传媒一区二区三区| 国产精品麻豆欧美日韩ww| 色噜噜久久综合| 久久电影国产免费久久电影| 中文字幕第一页久久| 欧美日韩国产影片| 风流少妇一区二区| 亚洲小说欧美激情另类| 久久久久久久久蜜桃|