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

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

?? library_24.html

?? Glibc的中文手冊
?? HTML
?? 第 1 頁 / 共 4 頁
字號:
continued jobs.  The definitions of these functions were given in
section <A HREF="library_24.html#SEC421" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_24.html#SEC421">Foreground and Background</A>.  When continuing a stopped job, a
nonzero value is passed as the <VAR>cont</VAR> argument to ensure that the
<CODE>SIGCONT</CODE> signal is sent and the terminal modes reset, as
appropriate.
<P>
This leaves only a function for updating the shell's internal bookkeeping
about the job being continued:
<P>
<PRE>
/* Mark a stopped job J as being running again.  */

void
mark_job_as_running (job *j)
{
  Process *p;

  for (p = j-&#62;first_process; p; p = p-&#62;next)
    p-&#62;stopped = 0;
  j-&#62;notified = 0;
}

/* Continue the job J.  */

void
continue_job (job *j, int foreground)
{
  mark_job_as_running (j);
  if (foreground)
    put_job_in_foreground (j, 1);
  else
    put_job_in_background (j, 1);
}
</PRE>
<P>
<H3><A NAME="SEC424" HREF="library_toc.html#SEC424" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC424">The Missing Pieces</A></H3>
<P>
The code extracts for the sample shell included in this chapter are only
a part of the entire shell program.  In particular, nothing at all has
been said about how <CODE>job</CODE> and <CODE>program</CODE> data structures are
allocated and initialized.
<P>
Most real shells provide a complex user interface that has support for
a command language; variables; abbreviations, substitutions, and pattern
matching on file names; and the like.  All of this is far too complicated
to explain here!  Instead, we have concentrated on showing how to 
implement the core process creation and job control functions that can
be called from such a shell.
<P>
Here is a table summarizing the major entry points we have presented:
<P>
<DL COMPACT>
<DT><CODE>void init_shell (void)</CODE>
<DD>Initialize the shell's internal state.  See section <A HREF="library_24.html#SEC419" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_24.html#SEC419">Initializing the Shell</A>.
<P>
<DT><CODE>void launch_job (job *<VAR>j</VAR>, int <VAR>foreground</VAR>)</CODE>
<DD>Launch the job <VAR>j</VAR> as either a foreground or background job.
See section <A HREF="library_24.html#SEC420" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_24.html#SEC420">Launching Jobs</A>.
<P>
<DT><CODE>void do_job_notification (void)</CODE>
<DD>Check for and report any jobs that have terminated or stopped.  Can be
called synchronously or within a handler for <CODE>SIGCHLD</CODE> signals.
See section <A HREF="library_24.html#SEC422" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_24.html#SEC422">Stopped and Terminated Jobs</A>.
<P>
<DT><CODE>void continue_job (job *<VAR>j</VAR>, int <VAR>foreground</VAR>)</CODE>
<DD>Continue the job <VAR>j</VAR>.  See section <A HREF="library_24.html#SEC423" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_24.html#SEC423">Continuing Stopped Jobs</A>.
</DL>
<P>
Of course, a real shell would also want to provide other functions for
managing jobs.  For example, it would be useful to have commands to list
all active jobs or to send a signal (such as <CODE>SIGKILL</CODE>) to a job.
<P>
<A NAME="IDX1759"></A>
<A NAME="IDX1760"></A>
<H2><A NAME="SEC425" HREF="library_toc.html#SEC425" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC425">Functions for Job Control</A></H2>
<P>
This section contains detailed descriptions of the functions relating
to job control.
<P>
<A NAME="IDX1761"></A>
<H3><A NAME="SEC426" HREF="library_toc.html#SEC426" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC426">Identifying the Controlling Terminal</A></H3>
<P>
You can use the <CODE>ctermid</CODE> function to get a file name that you can
use to open the controlling terminal.  In the GNU library, it returns
the same string all the time: <CODE>"/dev/tty"</CODE>.  That is a special
"magic" file name that refers to the controlling terminal of the
current process (if it has one).  The function <CODE>ctermid</CODE> is
declared in the header file <TT>`stdio.h'</TT>.
<A NAME="IDX1762"></A>
<P>
<A NAME="IDX1763"></A>
<U>Function:</U> char * <B>ctermid</B> <I>(char *<VAR>string</VAR>)</I><P>
The <CODE>ctermid</CODE> function returns a string containing the file name of
the controlling terminal for the current process.  If <VAR>string</VAR> is
not a null pointer, it should be an array that can hold at least
<CODE>L_ctermid</CODE> characters; the string is returned in this array.
Otherwise, a pointer to a string in a static area is returned, which
might get overwritten on subsequent calls to this function.
<P>
An empty string is returned if the file name cannot be determined for
any reason.  Even if a file name is returned, access to the file it
represents is not guaranteed.
<P>
<A NAME="IDX1764"></A>
<U>Macro:</U> int <B>L_ctermid</B><P>
The value of this macro is an integer constant expression that
represents the size of a string large enough to hold the file name
returned by <CODE>ctermid</CODE>.
<P>
See also the <CODE>isatty</CODE> and <CODE>ttyname</CODE> functions, in 
section <A HREF="library_16.html#SEC269" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_16.html#SEC269">Identifying Terminals</A>.
<P>
<H3><A NAME="SEC427" HREF="library_toc.html#SEC427" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC427">Process Group Functions</A></H3>
<P>
Here are descriptions of the functions for manipulating process groups.
Your program should include the header files <TT>`sys/types.h'</TT> and
<TT>`unistd.h'</TT> to use these functions.
<A NAME="IDX1766"></A>
<A NAME="IDX1765"></A>
<P>
<A NAME="IDX1767"></A>
<U>Function:</U> pid_t <B>setsid</B> <I>(void)</I><P>
The <CODE>setsid</CODE> function creates a new session.  The calling process
becomes the session leader, and is put in a new process group whose
process group ID is the same as the process ID of that process.  There
are initially no other processes in the new process group, and no other
process groups in the new session.
<P>
This function also makes the calling process have no controlling terminal.
<P>
The <CODE>setsid</CODE> function returns the new process group ID of the
calling process if successful.  A return value of <CODE>-1</CODE> indicates an
error.  The following <CODE>errno</CODE> error conditions are defined for this
function:
<P>
<DL COMPACT>
<DT><CODE>EPERM</CODE>
<DD>The calling process is already a process group leader, or there is
already another process group around that has the same process group ID.
</DL>
<P>
The <CODE>getpgrp</CODE> function has two definitions: one derived from BSD
Unix, and one from the POSIX.1 standard.  The feature test macros you
have selected (see section <A HREF="library_1.html#SEC12" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_1.html#SEC12">Feature Test Macros</A>) determine which definition
you get.  Specifically, you get the BSD version if you define
<CODE>_BSD_SOURCE</CODE>; otherwise, you get the POSIX version if you define
<CODE>_POSIX_SOURCE</CODE> or <CODE>_GNU_SOURCE</CODE>.  Programs written for old
BSD systems will not include <TT>`unistd.h'</TT>, which defines
<CODE>getpgrp</CODE> specially under <CODE>_BSD_SOURCE</CODE>.  You must link such
programs with the <CODE>-lbsd-compat</CODE> option to get the BSD definition.<A NAME="IDX1769"></A>
<A NAME="IDX1770"></A>
<A NAME="IDX1768"></A>
<P>
<A NAME="IDX1771"></A>
<U>POSIX.1 Function:</U> pid_t <B>getpgrp</B> <I>(void)</I><P>
The POSIX.1 definition of <CODE>getpgrp</CODE> returns the process group ID of
the calling process.
<P>
<A NAME="IDX1772"></A>
<U>BSD Function:</U> pid_t <B>getpgrp</B> <I>(pid_t <VAR>pid</VAR>)</I><P>
The BSD definition of <CODE>getpgrp</CODE> returns the process group ID of the
process <VAR>pid</VAR>.  You can supply a value of <CODE>0</CODE> for the <VAR>pid</VAR>
argument to get information about the calling process.
<P>
<A NAME="IDX1773"></A>
<U>Function:</U> int <B>setpgid</B> <I>(pid_t <VAR>pid</VAR>, pid_t <VAR>pgid</VAR>)</I><P>
The <CODE>setpgid</CODE> function puts the process <VAR>pid</VAR> into the process
group <VAR>pgid</VAR>.  As a special case, either <VAR>pid</VAR> or <VAR>pgid</VAR> can
be zero to indicate the process ID of the calling process.
<P>
This function fails on a system that does not support job control.
See section <A HREF="library_24.html#SEC413" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_24.html#SEC413">Job Control is Optional</A>, for more information.
<P>
If the operation is successful, <CODE>setpgid</CODE> returns zero.  Otherwise
it returns <CODE>-1</CODE>.  The following <CODE>errno</CODE> error conditions are
defined for this function:
<P>
<DL COMPACT>
<DT><CODE>EACCES</CODE>
<DD>The child process named by <VAR>pid</VAR> has executed an <CODE>exec</CODE>
function since it was forked.
<P>
<DT><CODE>EINVAL</CODE>
<DD>The value of the <VAR>pgid</VAR> is not valid.
<P>
<DT><CODE>ENOSYS</CODE>
<DD>The system doesn't support job control.
<P>
<DT><CODE>EPERM</CODE>
<DD>The process indicated by the <VAR>pid</VAR> argument is a session leader,
or is not in the same session as the calling process, or the value of
the <VAR>pgid</VAR> argument doesn't match a process group ID in the same
session as the calling process.
<P>
<DT><CODE>ESRCH</CODE>
<DD>The process indicated by the <VAR>pid</VAR> argument is not the calling
process or a child of the calling process.
</DL>
<P>
<A NAME="IDX1774"></A>
<U>Function:</U> int <B>setpgrp</B> <I>(pid_t <VAR>pid</VAR>, pid_t <VAR>pgid</VAR>)</I><P>
This is the BSD Unix name for <CODE>setpgid</CODE>.  Both functions do exactly
the same thing.
<P>
<H3><A NAME="SEC428" HREF="library_toc.html#SEC428" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC428">Functions for Controlling Terminal Access</A></H3>
<P>
These are the functions for reading or setting the foreground
process group of a terminal.  You should include the header files
<TT>`sys/types.h'</TT> and <TT>`unistd.h'</TT> in your application to use
these functions.
<A NAME="IDX1776"></A>
<A NAME="IDX1775"></A>
<P>
Although these functions take a file descriptor argument to specify
the terminal device, the foreground job is associated with the terminal
file itself and not a particular open file descriptor.
<P>
<A NAME="IDX1777"></A>
<U>Function:</U> pid_t <B>tcgetpgrp</B> <I>(int <VAR>filedes</VAR>)</I><P>
This function returns the process group ID of the foreground process
group associated with the terminal open on descriptor <VAR>filedes</VAR>.
<P>
If there is no foreground process group, the return value is a number
greater than <CODE>1</CODE> that does not match the process group ID of any
existing process group.  This can happen if all of the processes in the
job that was formerly the foreground job have terminated, and no other
job has yet been moved into the foreground.
<P>
In case of an error, a value of <CODE>-1</CODE> is returned.  The
following <CODE>errno</CODE> error conditions are defined for this function:
<P>
<DL COMPACT>
<DT><CODE>EBADF</CODE>
<DD>The <VAR>filedes</VAR> argument is not a valid file descriptor.
<P>
<DT><CODE>ENOSYS</CODE>
<DD>The system doesn't support job control.
<P>
<DT><CODE>ENOTTY</CODE>
<DD>The terminal file associated with the <VAR>filedes</VAR> argument isn't the
controlling terminal of the calling process.
</DL>
<P>
<A NAME="IDX1778"></A>
<U>Function:</U> int <B>tcsetpgrp</B> <I>(int <VAR>filedes</VAR>, pid_t <VAR>pgid</VAR>)</I><P>
This function is used to set a terminal's foreground process group ID.
The argument <VAR>filedes</VAR> is a descriptor which specifies the terminal;
<VAR>pgid</VAR> specifies the process group.  The calling process must be a
member of the same session as <VAR>pgid</VAR> and must have the same
controlling terminal.
<P>
For terminal access purposes, this function is treated as output.  If it
is called from a background process on its controlling terminal,
normally all processes in the process group are sent a <CODE>SIGTTOU</CODE>
signal.  The exception is if the calling process itself is ignoring or
blocking <CODE>SIGTTOU</CODE> signals, in which case the operation is
performed and no signal is sent.
<P>
If successful, <CODE>tcsetpgrp</CODE> returns <CODE>0</CODE>.  A return value of
<CODE>-1</CODE> indicates an error.  The following <CODE>errno</CODE> error
conditions are defined for this function:
<P>
<DL COMPACT>
<DT><CODE>EBADF</CODE>
<DD>The <VAR>filedes</VAR> argument is not a valid file descriptor.
<P>
<DT><CODE>EINVAL</CODE>
<DD>The <VAR>pgid</VAR> argument is not valid.
<P>
<DT><CODE>ENOSYS</CODE>
<DD>The system doesn't support job control.
<P>
<DT><CODE>ENOTTY</CODE>
<DD>The <VAR>filedes</VAR> isn't the controlling terminal of the calling process.
<P>
<DT><CODE>EPERM</CODE>
<DD>The <VAR>pgid</VAR> isn't a process group in the same session as the calling
process.
</DL>
<P>
<P>Go to the <A HREF="library_23.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_23.html">previous</A>, <A HREF="library_25.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_25.html">next</A> section.<P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷精品久久二区二区蜜臀av| 日韩一区二区影院| 91精品视频网| 欧美国产一区在线| 亚洲成人免费影院| 99久久久国产精品免费蜜臀| 日韩欧美久久久| 亚洲成av人综合在线观看| 成人av在线影院| 久久综合久久综合久久综合| 伊人色综合久久天天| 国产成人精品影视| 欧美成人一区二区三区| 亚洲成人午夜电影| 91精品福利在线| 国产精品久久久久久亚洲伦| 久久精品999| 欧美色图片你懂的| 亚洲精品日韩一| 99久久精品国产毛片| 国产精品美女一区二区| 国产福利精品一区二区| 精品国产sm最大网站| 蜜桃久久精品一区二区| 91精品国产综合久久久久久久久久| 有码一区二区三区| 色就色 综合激情| 亚洲美女屁股眼交3| 9色porny自拍视频一区二区| 日本一区二区三区国色天香| 国产一区二区91| 久久久久久免费网| 国产揄拍国内精品对白| 久久久久久免费| 福利91精品一区二区三区| 日本一区二区三区免费乱视频| 风间由美性色一区二区三区| 国产精品色在线观看| 国产suv精品一区二区三区| 中文字幕电影一区| 成人av综合一区| 亚洲精品大片www| 欧美精品视频www在线观看| 亚洲国产欧美在线| 欧美福利电影网| 精品一二三四在线| 国产精品你懂的| 色88888久久久久久影院野外| 亚洲欧美精品午睡沙发| 欧美色男人天堂| 久草热8精品视频在线观看| 欧美激情在线免费观看| 色综合av在线| 久久精品久久综合| 国产欧美精品一区二区色综合朱莉| 成人av在线影院| 亚洲一区二区精品3399| 91麻豆精品国产自产在线| 国产米奇在线777精品观看| 2023国产精品| 99精品视频一区二区三区| 亚洲精品国产a久久久久久 | 欧美电影在哪看比较好| 久久国产精品99精品国产| 国产精品视频一二三区| 欧美日韩午夜精品| 国产毛片精品国产一区二区三区| 一区二区在线免费观看| 精品sm捆绑视频| 91免费观看在线| 国产在线麻豆精品观看| 亚洲精品视频在线看| 欧美精品一区二区在线播放| eeuss影院一区二区三区| 日本欧美加勒比视频| 亚洲欧美综合另类在线卡通| 91精品国产一区二区三区| 成人看片黄a免费看在线| 视频一区视频二区中文字幕| 国产欧美一区二区三区沐欲| 欧美日韩高清影院| 不卡一区二区在线| 激情偷乱视频一区二区三区| 一区二区三区四区视频精品免费 | 波多野结衣精品在线| 麻豆专区一区二区三区四区五区| 国产精品国产三级国产普通话三级| 在线播放91灌醉迷j高跟美女 | 在线视频国产一区| 久久电影网电视剧免费观看| 一区二区视频免费在线观看| 久久色在线视频| 日韩欧美亚洲国产另类| 欧美三级电影在线看| 99久久久久免费精品国产| 国产在线精品一区二区三区不卡| 性感美女久久精品| 亚洲免费在线视频一区 二区| 久久免费精品国产久精品久久久久| 精品婷婷伊人一区三区三| 91麻豆蜜桃一区二区三区| 国产ts人妖一区二区| 国产激情一区二区三区桃花岛亚洲| 日本aⅴ精品一区二区三区| 午夜天堂影视香蕉久久| 亚洲一区二区三区国产| 亚洲精品国产一区二区精华液| 亚洲欧洲成人自拍| 中文字幕中文字幕一区| 国产精品色哟哟| 中文字幕在线不卡一区二区三区| 国产日本欧美一区二区| 国产午夜亚洲精品理论片色戒| 日韩精品专区在线| 欧美电视剧免费全集观看| 日韩视频免费观看高清完整版在线观看 | 色综合激情久久| 91国产丝袜在线播放| 91女神在线视频| 欧美亚洲综合一区| 欧美猛男gaygay网站| 这里只有精品免费| 精品国产一区二区国模嫣然| 日韩免费一区二区| 久久久久久久久久看片| 国产精品―色哟哟| 又紧又大又爽精品一区二区| 亚洲一区二区三区影院| 日韩国产一二三区| 国产乱人伦偷精品视频不卡| 成人免费高清视频| 欧美在线一二三| 91精品国产综合久久久久久| 欧美xxxxx裸体时装秀| 欧美激情综合五月色丁香小说| 国产精品久久久久aaaa樱花| 亚洲精品国久久99热| 亚洲成人1区2区| 精品在线免费观看| 成人高清视频在线观看| 欧美在线不卡视频| 日韩一区二区高清| 中文字幕第一区二区| 亚洲国产精品久久久久秋霞影院| 丝瓜av网站精品一区二区| 国产资源精品在线观看| 成人成人成人在线视频| 欧美视频在线观看一区| 欧美刺激脚交jootjob| 中文无字幕一区二区三区| 一个色在线综合| 黄色资源网久久资源365| 97se亚洲国产综合自在线| 8x福利精品第一导航| 国产欧美日韩激情| 婷婷成人激情在线网| 国产精品99久久久久久有的能看| 91高清视频在线| 欧美精品一区二区高清在线观看 | 婷婷夜色潮精品综合在线| 国产福利视频一区二区三区| 在线精品视频免费播放| 日韩午夜激情免费电影| 中文字幕一区av| 国产麻豆午夜三级精品| 欧美日韩日日夜夜| 日韩毛片视频在线看| 极品美女销魂一区二区三区 | 久久综合久久综合九色| 夜夜亚洲天天久久| 波多野结衣一区二区三区 | 亚洲高清久久久| 波多野结衣的一区二区三区| www国产精品av| 日韩专区中文字幕一区二区| 一本到一区二区三区| 国产精品热久久久久夜色精品三区| 理论电影国产精品| 欧美日韩美少妇| 一级女性全黄久久生活片免费| 99这里只有久久精品视频| 欧美xxxxxxxx| 免费看黄色91| 欧美日韩国产欧美日美国产精品| 亚洲精品在线电影| 九九在线精品视频| 欧美日韩另类国产亚洲欧美一级| 久久精品在线观看| 国产成人精品免费视频网站| 欧美乱妇15p| 亚洲国产精品一区二区www| 色综合久久中文综合久久牛| 欧美xfplay| 日韩av在线发布| 欧美一区二区三区男人的天堂| 亚洲精选免费视频| 波多野结衣亚洲| 91精品在线一区二区| 亚洲一区二区三区四区中文字幕| 成人一二三区视频|