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

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

?? jobs.c

?? android-w.song.android.widget
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* jobs.c - functions that make children, remember them, and handle their termination. *//* This file works with both POSIX and BSD systems.  It implements job   control. *//* Copyright (C) 1989-2010 Free Software Foundation, Inc.   This file is part of GNU Bash, the Bourne Again SHell.   Bash is free software: you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation, either version 3 of the License, or   (at your option) any later version.   Bash 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 Bash.  If not, see <http://www.gnu.org/licenses/>.*/#include "config.h"#include "bashtypes.h"#include "trap.h"#include <stdio.h>#include <signal.h>#include <errno.h>#if defined (HAVE_UNISTD_H)#  include <unistd.h>#endif#include "posixtime.h"#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_WAIT3) && !defined (_POSIX_VERSION) && !defined (RLIMTYPE)#  include <sys/resource.h>#endif /* !_POSIX_VERSION && HAVE_SYS_RESOURCE_H && HAVE_WAIT3 && !RLIMTYPE */#if defined (HAVE_SYS_FILE_H)#  include <sys/file.h>#endif#include "filecntl.h"#include <sys/ioctl.h>#include <sys/param.h>#if defined (BUFFERED_INPUT)#  include "input.h"#endif/* Need to include this up here for *_TTY_DRIVER definitions. */#include "shtty.h"/* Define this if your output is getting swallowed.  It's a no-op on   machines with the termio or termios tty drivers. *//* #define DRAIN_OUTPUT *//* For the TIOCGPGRP and TIOCSPGRP ioctl parameters on HP-UX */#if defined (hpux) && !defined (TERMIOS_TTY_DRIVER)#  include <bsdtty.h>#endif /* hpux && !TERMIOS_TTY_DRIVER */#include "bashansi.h"#include "bashintl.h"#include "shell.h"#include "jobs.h"#include "execute_cmd.h"#include "flags.h"#include "builtins/builtext.h"#include "builtins/common.h"#if !defined (errno)extern int errno;#endif /* !errno */#if !defined (HAVE_KILLPG)extern int killpg __P((pid_t, int));#endif#define DEFAULT_CHILD_MAX 32#if !defined (DEBUG)#define MAX_JOBS_IN_ARRAY 4096		/* production */#else#define MAX_JOBS_IN_ARRAY 128		/* testing */#endif/* Flag values for second argument to delete_job */#define DEL_WARNSTOPPED		1	/* warn about deleting stopped jobs */#define DEL_NOBGPID		2	/* don't add pgrp leader to bgpids *//* Take care of system dependencies that must be handled when waiting for   children.  The arguments to the WAITPID macro match those to the Posix.1   waitpid() function. */#if defined (ultrix) && defined (mips) && defined (_POSIX_VERSION)#  define WAITPID(pid, statusp, options) \	wait3 ((union wait *)statusp, options, (struct rusage *)0)#else#  if defined (_POSIX_VERSION) || defined (HAVE_WAITPID)#    define WAITPID(pid, statusp, options) \	waitpid ((pid_t)pid, statusp, options)#  else#    if defined (HAVE_WAIT3)#      define WAITPID(pid, statusp, options) \	wait3 (statusp, options, (struct rusage *)0)#    else#      define WAITPID(pid, statusp, options) \	wait3 (statusp, options, (int *)0)#    endif /* HAVE_WAIT3 */#  endif /* !_POSIX_VERSION && !HAVE_WAITPID*/#endif /* !(Ultrix && mips && _POSIX_VERSION) *//* getpgrp () varies between systems.  Even systems that claim to be   Posix.1 compatible lie sometimes (Ultrix, SunOS4, apollo). */#if defined (GETPGRP_VOID)#  define getpgid(p) getpgrp ()#else#  define getpgid(p) getpgrp (p)#endif /* !GETPGRP_VOID *//* If the system needs it, REINSTALL_SIGCHLD_HANDLER will reinstall the   handler for SIGCHLD. */#if defined (MUST_REINSTALL_SIGHANDLERS)#  define REINSTALL_SIGCHLD_HANDLER signal (SIGCHLD, sigchld_handler)#else#  define REINSTALL_SIGCHLD_HANDLER#endif /* !MUST_REINSTALL_SIGHANDLERS *//* Some systems let waitpid(2) tell callers about stopped children. */#if !defined (WCONTINUED) || defined (WCONTINUED_BROKEN)#  undef WCONTINUED#  define WCONTINUED 0#endif#if !defined (WIFCONTINUED)#  define WIFCONTINUED(s)	(0)#endif/* The number of additional slots to allocate when we run out. */#define JOB_SLOTS 8typedef int sh_job_map_func_t __P((JOB *, int, int, int));/* Variables used here but defined in other files. */extern int subshell_environment, line_number;extern int posixly_correct, shell_level;extern int last_command_exit_value, last_command_exit_signal;extern int loop_level, breaking;extern int executing_list;extern int sourcelevel;extern int running_trap;extern sh_builtin_func_t *this_shell_builtin;extern char *shell_name, *this_command_name;extern sigset_t top_level_mask;extern procenv_t wait_intr_buf;extern int wait_signal_received;extern WORD_LIST *subst_assign_varlist;static struct jobstats zerojs = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 };struct jobstats js = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 };struct bgpids bgpids = { 0, 0, 0 };/* The array of known jobs. */JOB **jobs = (JOB **)NULL;#if 0/* The number of slots currently allocated to JOBS. */int job_slots = 0;#endif/* The controlling tty for this shell. */int shell_tty = -1;/* The shell's process group. */pid_t shell_pgrp = NO_PID;/* The terminal's process group. */pid_t terminal_pgrp = NO_PID;/* The process group of the shell's parent. */pid_t original_pgrp = NO_PID;/* The process group of the pipeline currently being made. */pid_t pipeline_pgrp = (pid_t)0;#if defined (PGRP_PIPE)/* Pipes which each shell uses to communicate with the process group leader   until all of the processes in a pipeline have been started.  Then the   process leader is allowed to continue. */int pgrp_pipe[2] = { -1, -1 };#endif#if 0/* The job which is current; i.e. the one that `%+' stands for. */int current_job = NO_JOB;/* The previous job; i.e. the one that `%-' stands for. */int previous_job = NO_JOB;#endif/* Last child made by the shell.  */pid_t last_made_pid = NO_PID;/* Pid of the last asynchronous child. */pid_t last_asynchronous_pid = NO_PID;/* The pipeline currently being built. */PROCESS *the_pipeline = (PROCESS *)NULL;/* If this is non-zero, do job control. */int job_control = 1;/* Call this when you start making children. */int already_making_children = 0;/* If this is non-zero, $LINES and $COLUMNS are reset after every process   exits from get_tty_state(). */int check_window_size;/* Functions local to this file. */static sighandler wait_sigint_handler __P((int));static sighandler sigchld_handler __P((int));static sighandler sigcont_sighandler __P((int));static sighandler sigstop_sighandler __P((int));static int waitchld __P((pid_t, int));static PROCESS *find_pipeline __P((pid_t, int, int *));static PROCESS *find_process __P((pid_t, int, int *));static char *current_working_directory __P((void));static char *job_working_directory __P((void));static char *j_strsignal __P((int));static char *printable_job_status __P((int, PROCESS *, int));static PROCESS *find_last_proc __P((int, int));static pid_t find_last_pid __P((int, int));static int set_new_line_discipline __P((int));static int map_over_jobs __P((sh_job_map_func_t *, int, int));static int job_last_stopped __P((int));static int job_last_running __P((int));static int most_recent_job_in_state __P((int, JOB_STATE));static int find_job __P((pid_t, int, PROCESS **));static int print_job __P((JOB *, int, int, int));static int process_exit_status __P((WAIT));static int process_exit_signal __P((WAIT));static int set_job_status_and_cleanup __P((int));static WAIT job_signal_status __P((int));static WAIT raw_job_exit_status __P((int));static void notify_of_job_status __P((void));static void reset_job_indices __P((void));static void cleanup_dead_jobs __P((void));static int processes_in_job __P((int));static void realloc_jobs_list __P((void));static int compact_jobs_list __P((int));static int discard_pipeline __P((PROCESS *));static void add_process __P((char *, pid_t));static void print_pipeline __P((PROCESS *, int, int, FILE *));static void pretty_print_job __P((int, int, FILE *));static void set_current_job __P((int));static void reset_current __P((void));static void set_job_running __P((int));static void setjstatus __P((int));static int maybe_give_terminal_to __P((pid_t, pid_t, int));static void mark_all_jobs_as_dead __P((void));static void mark_dead_jobs_as_notified __P((int));static void restore_sigint_handler __P((void));#if defined (PGRP_PIPE)static void pipe_read __P((int *));#endifstatic struct pidstat *bgp_alloc __P((pid_t, int));static struct pidstat *bgp_add __P((pid_t, int));static int bgp_delete __P((pid_t));static void bgp_clear __P((void));static int bgp_search __P((pid_t));static void bgp_prune __P((void));#if defined (ARRAY_VARS)static int *pstatuses;		/* list of pipeline statuses */static int statsize;#endif/* Used to synchronize between wait_for and other functions and the SIGCHLD   signal handler. */static int sigchld;static int queue_sigchld;#define QUEUE_SIGCHLD(os)	(os) = sigchld, queue_sigchld++#define UNQUEUE_SIGCHLD(os) \	do { \	  queue_sigchld--; \	  if (queue_sigchld == 0 && os != sigchld) \	    waitchld (-1, 0); \	} while (0)static SigHandler *old_tstp, *old_ttou, *old_ttin;static SigHandler *old_cont = (SigHandler *)SIG_DFL;/* A place to temporarily save the current pipeline. */static PROCESS *saved_pipeline;static int saved_already_making_children;/* Set this to non-zero whenever you don't want the jobs list to change at   all: no jobs deleted and no status change notifications.  This is used,   for example, when executing SIGCHLD traps, which may run arbitrary   commands. */static int jobs_list_frozen;static char retcode_name_buffer[64];/* flags to detect pid wraparound */static pid_t first_pid = NO_PID;static int pid_wrap = -1;#if !defined (_POSIX_VERSION)/* These are definitions to map POSIX 1003.1 functions onto existing BSD   library functions and system calls. */#define setpgid(pid, pgrp)	setpgrp (pid, pgrp)#define tcsetpgrp(fd, pgrp)	ioctl ((fd), TIOCSPGRP, &(pgrp))pid_ttcgetpgrp (fd)     int fd;{  pid_t pgrp;  /* ioctl will handle setting errno correctly. */  if (ioctl (fd, TIOCGPGRP, &pgrp) < 0)    return (-1);  return (pgrp);}#endif /* !_POSIX_VERSION *//* Initialize the global job stats structure and other bookkeeping variables */voidinit_job_stats (){  js = zerojs;  first_pid = NO_PID;  pid_wrap = -1;}/* Return the working directory for the current process.  Unlike   job_working_directory, this does not call malloc (), nor do any   of the functions it calls.  This is so that it can safely be called   from a signal handler. */static char *current_working_directory (){  char *dir;  static char d[PATH_MAX];  dir = get_string_value ("PWD");  if (dir == 0 && the_current_working_directory && no_symbolic_links)    dir = the_current_working_directory;  if (dir == 0)    {      dir = getcwd (d, sizeof(d));      if (dir)	dir = d;    }  return (dir == 0) ? "<unknown>" : dir;}/* Return the working directory for the current process. */static char *job_working_directory (){  char *dir;  dir = get_string_value ("PWD");  if (dir)    return (savestring (dir));  dir = get_working_directory ("job-working-directory");  if (dir)    return (dir);  return (savestring ("<unknown>"));}voidmaking_children (){  if (already_making_children)    return;  already_making_children = 1;  start_pipeline ();}voidstop_making_children (){  already_making_children = 0;}voidcleanup_the_pipeline (){  PROCESS *disposer;  sigset_t set, oset;  BLOCK_CHILD (set, oset);  disposer = the_pipeline;  the_pipeline = (PROCESS *)NULL;  UNBLOCK_CHILD (oset);  if (disposer)    discard_pipeline (disposer);}voidsave_pipeline (clear)     int clear;{  saved_pipeline = the_pipeline;  if (clear)    the_pipeline = (PROCESS *)NULL;  saved_already_making_children = already_making_children;}voidrestore_pipeline (discard)     int discard;{  PROCESS *old_pipeline;  old_pipeline = the_pipeline;  the_pipeline = saved_pipeline;  already_making_children = saved_already_making_children;  if (discard && old_pipeline)    discard_pipeline (old_pipeline);}/* Start building a pipeline.  */voidstart_pipeline (){  if (the_pipeline)    {      cleanup_the_pipeline ();      pipeline_pgrp = 0;#if defined (PGRP_PIPE)      sh_closepipe (pgrp_pipe);#endif    }#if defined (PGRP_PIPE)  if (job_control)    {      if (pipe (pgrp_pipe) == -1)	sys_error (_("start_pipeline: pgrp pipe"));    }#endif}/* Stop building a pipeline.  Install the process list in the job array.   This returns the index of the newly installed job.   DEFERRED is a command structure to be executed upon satisfactory   execution exit of this pipeline. */intstop_pipeline (async, deferred)     int async;     COMMAND *deferred;{  register int i, j;  JOB *newjob;  sigset_t set, oset;  BLOCK_CHILD (set, oset);#if defined (PGRP_PIPE)  /* The parent closes the process group synchronization pipe. */  sh_closepipe (pgrp_pipe);#endif  cleanup_dead_jobs ();  if (js.j_jobslots == 0)    {      js.j_jobslots = JOB_SLOTS;      jobs = (JOB **)xmalloc (js.j_jobslots * sizeof (JOB *));      /* Now blank out these new entries. */      for (i = 0; i < js.j_jobslots; i++)	jobs[i] = (JOB *)NULL;      js.j_firstj = js.j_lastj = js.j_njobs = 0;    }  /* Scan from the last slot backward, looking for the next free one. */  /* XXX - revisit this interactive assumption */  /* XXX - this way for now */  if (interactive)    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产成人一区二区三区| 欧美久久久久免费| 国产精品久久久久久久裸模| 成人教育av在线| 亚洲柠檬福利资源导航| 在线国产亚洲欧美| 亚洲va在线va天堂| 精品黑人一区二区三区久久| 国产成人免费av在线| 综合分类小说区另类春色亚洲小说欧美| 大尺度一区二区| 一区二区三区日韩在线观看| 欧美日韩中文精品| 国内一区二区视频| 国产精品综合二区| 成人欧美一区二区三区1314 | 欧美成人官网二区| 国产一区在线视频| 亚洲欧美自拍偷拍色图| 欧美日韩国产高清一区二区| 激情成人综合网| 18欧美亚洲精品| 欧美一区二区三区爱爱| 懂色av中文一区二区三区 | 亚洲精品自拍动漫在线| 欧美欧美欧美欧美首页| 国产精品一区二区视频| 亚洲激情图片一区| 欧美精品一区二区三区在线播放 | 在线看一区二区| 美国一区二区三区在线播放| 亚洲视频一二区| 欧美成人猛片aaaaaaa| 99国产精品99久久久久久| 日本色综合中文字幕| ...xxx性欧美| 精品捆绑美女sm三区| 91原创在线视频| 国产一二三精品| 丝袜美腿亚洲一区二区图片| 国产精品人成在线观看免费 | 91成人免费网站| 国产高清在线精品| 日韩黄色小视频| 亚洲欧洲在线观看av| 日韩欧美一区二区视频| 欧美吻胸吃奶大尺度电影 | 麻豆国产精品官网| 亚洲一区在线看| 国产精品三级在线观看| 欧美一卡二卡三卡四卡| 色综合一区二区| 国产91在线观看丝袜| 精品一区二区三区在线播放视频| 亚洲永久免费av| 日韩一区日韩二区| 国产日韩欧美高清| 精品国产三级电影在线观看| 欧美日韩久久久| 在线亚洲免费视频| www.久久久久久久久| 久久国产日韩欧美精品| 色94色欧美sute亚洲线路一ni | 日本乱人伦aⅴ精品| 成人免费毛片a| 国产精品系列在线播放| 久草精品在线观看| 另类欧美日韩国产在线| 美女免费视频一区| 免费av网站大全久久| 五月天网站亚洲| 亚洲福利视频三区| 偷拍日韩校园综合在线| 亚洲一级二级三级| 亚洲成av人影院| 性感美女极品91精品| 亚洲aaa精品| 日韩国产欧美在线视频| 天堂影院一区二区| 蜜桃在线一区二区三区| 久久草av在线| 极品少妇xxxx偷拍精品少妇| 久久国产婷婷国产香蕉| 国产美女在线观看一区| 国产成人精品网址| zzijzzij亚洲日本少妇熟睡| 91视频一区二区三区| 99v久久综合狠狠综合久久| 91香蕉视频污| 欧美日韩精品一区二区三区蜜桃| 欧美一区二区视频观看视频| 日韩欧美综合一区| 国产欧美一区二区三区在线看蜜臀 | 日韩一二三区视频| 久久亚洲一区二区三区明星换脸| 欧美极品少妇xxxxⅹ高跟鞋| 国产精品三级av在线播放| 亚洲精品成人在线| 丝袜诱惑制服诱惑色一区在线观看 | 亚洲综合男人的天堂| 日本va欧美va精品发布| 国产精品一区二区无线| 色一情一乱一乱一91av| 91精品国产麻豆国产自产在线| 欧美大胆人体bbbb| 亚洲国产精品99久久久久久久久 | 欧美一区二区三区免费在线看| 精品人伦一区二区色婷婷| 国产精品久久久久aaaa樱花 | 成人激情免费网站| 亚洲欧洲三级电影| 亚洲线精品一区二区三区八戒| 日韩av网站免费在线| 国产精品一区二区在线观看网站 | 成人欧美一区二区三区1314| 亚洲 欧美综合在线网络| 韩国精品主播一区二区在线观看| 99久久婷婷国产综合精品| 制服丝袜亚洲色图| 中文字幕av一区 二区| 亚洲v中文字幕| 成人app软件下载大全免费| 4438x成人网最大色成网站| 国产精品久久久久久久久快鸭 | 91福利社在线观看| 久久久久一区二区三区四区| 亚洲一区二区三区不卡国产欧美| 国产精品中文字幕日韩精品| 7777精品伊人久久久大香线蕉完整版 | 337p粉嫩大胆噜噜噜噜噜91av| 亚洲免费观看高清在线观看| 精品一区二区在线播放| 欧美视频中文一区二区三区在线观看| 久久久精品国产99久久精品芒果| 亚洲1区2区3区4区| 91首页免费视频| 久久精品亚洲一区二区三区浴池| 午夜精品久久久久久久久| 97久久人人超碰| 国产香蕉久久精品综合网| 日本伊人午夜精品| 欧美最猛黑人xxxxx猛交| 国产精品福利电影一区二区三区四区| 天天综合色天天| 欧美亚洲一区二区三区四区| 中文字幕在线一区免费| 国产一二精品视频| 日韩欧美综合一区| 日本sm残虐另类| 欧美一区二区在线不卡| 亚洲一二三区在线观看| 色香蕉成人二区免费| 国产精品视频观看| 成人一区二区在线观看| 久久久久久97三级| 国内精品免费在线观看| 精品国产乱码久久久久久浪潮| 日韩国产欧美视频| 欧美日韩久久久| 偷拍自拍另类欧美| 91麻豆精品国产91久久久 | 五月天婷婷综合| 欧美日韩视频在线第一区 | 一本大道久久精品懂色aⅴ| 国产日韩成人精品| 粉嫩一区二区三区在线看| 久久久久久久国产精品影院| 狠狠色综合播放一区二区| 日韩欧美国产1| 久久99精品久久久久| 26uuu精品一区二区| 国产一区二区三区美女| 久久久久久久一区| 国产精品白丝jk黑袜喷水| 中文字幕av在线一区二区三区| 粉嫩蜜臀av国产精品网站| 欧美国产1区2区| 99久久久精品| 亚洲一区二区偷拍精品| 欧美日本精品一区二区三区| 偷拍一区二区三区四区| 精品少妇一区二区三区日产乱码 | 精品国产一区二区三区久久久蜜月 | 中文字幕在线播放不卡一区| 91麻豆福利精品推荐| 亚洲mv在线观看| 日韩欧美精品在线| 国产成人在线观看| 亚洲欧美另类小说视频| 欧美日韩一级二级三级| 另类小说图片综合网| 国产欧美中文在线| 在线观看日产精品| 免费在线欧美视频| 久久精品网站免费观看| 在线精品国精品国产尤物884a | 国产在线播放一区| 亚洲视频一区在线| 日韩一区二区三| 成人精品小蝌蚪|