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

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

?? library_24.html

?? linux_c函數,linux下編程必備的
?? 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| 欧美偷拍一区二区| 男男gaygay亚洲| 国产欧美日韩另类视频免费观看| 国产91富婆露脸刺激对白| 国产精品乱码妇女bbbb| 国产美女一区二区三区| 国产在线日韩欧美| 亚洲免费伊人电影| 日韩欧美国产一区在线观看| 国产宾馆实践打屁股91| 成人污污视频在线观看| 日韩高清不卡一区| 1024亚洲合集| 2021中文字幕一区亚洲| 欧美怡红院视频| 欧美日韩国产精选| 91精品国产综合久久精品性色| 国产成a人无v码亚洲福利| 国产91精品免费| 91免费观看视频| 国产一本一道久久香蕉| 99r国产精品| 国产精品性做久久久久久| 午夜精品久久久久久久久| 国产精品丝袜一区| 伊人一区二区三区| 中文字幕欧美激情| 久久精品欧美日韩| ww亚洲ww在线观看国产| 中文字幕在线一区二区三区| 一区二区三区免费| 中文字幕一区二区三区乱码在线| 亚洲影视在线播放| 一区二区三区日韩欧美精品| 日韩专区中文字幕一区二区| 国产成人在线色| 成人一区在线观看| 在线91免费看| 亚洲色图19p| 1000部国产精品成人观看| 亚洲一区二区三区在线| 另类专区欧美蜜桃臀第一页| 日韩激情视频在线观看| 成人黄色电影在线 | 日韩中文字幕亚洲一区二区va在线| 久久精品国产久精国产| 色婷婷国产精品| 91九色最新地址| 欧美色精品天天在线观看视频| 色综合久久久久久久久久久| 日韩精品专区在线影院观看| 最新不卡av在线| 国产成人自拍在线| 精品国产乱码久久久久久1区2区| 亚洲日本中文字幕区| 韩国女主播一区| 欧美一区二区播放| 久久亚洲一区二区三区四区| 亚洲国产精品久久久久秋霞影院| 亚洲国产一区在线观看| 不卡的电视剧免费网站有什么| 精品国产伦一区二区三区免费| 久久er99精品| 欧美日韩免费观看一区三区| 亚洲天堂免费看| 成人精品视频一区二区三区| 久久蜜桃一区二区| 中文字幕在线不卡国产视频| 国内精品伊人久久久久av一坑| 欧美一级xxx| 国产精品久久久久三级| 成人性色生活片| 国产精品网曝门| a美女胸又www黄视频久久| 欧美日韩一区二区在线观看| 玉米视频成人免费看| 色网综合在线观看| 亚洲高清视频在线| 欧美一区二区在线免费观看| 蜜臀国产一区二区三区在线播放 | 成人美女在线观看| 国产欧美一区二区精品忘忧草| 国产麻豆一精品一av一免费| 久久日一线二线三线suv| 国产乱一区二区| 久久精品在这里| av亚洲精华国产精华精华| 国产精品乱码久久久久久| 99久久精品国产网站| 亚洲伦理在线免费看| 91国内精品野花午夜精品| 午夜国产精品一区| 精品奇米国产一区二区三区| 亚洲曰韩产成在线| 欧美电影影音先锋| 亚洲欧洲成人av每日更新| 色综合一区二区| 久久久91精品国产一区二区精品 | 在线精品视频一区二区三四 | 岛国av在线一区| 有坂深雪av一区二区精品| 欧美一级片在线观看| 国产黑丝在线一区二区三区| 亚洲伦理在线免费看| 欧美一级理论片| 成人av高清在线| 日韩av网站在线观看| 久久久久久电影| 欧美三区免费完整视频在线观看| 美国十次了思思久久精品导航| 国产精品国产自产拍高清av | 色菇凉天天综合网| 日韩国产欧美在线视频| 国产日本欧美一区二区| 欧美在线综合视频| 韩国精品久久久| 亚洲午夜激情网页| 欧美激情一区二区三区| 制服.丝袜.亚洲.中文.综合| 成人黄色片在线观看| 免费观看一级特黄欧美大片| 日韩伦理免费电影| 26uuu国产电影一区二区| 色综合激情五月| 国产aⅴ综合色| 美女一区二区在线观看| 亚洲精品第一国产综合野| 久久久久久久久久久久久夜| 欧美高清一级片在线| 91在线精品秘密一区二区| 国产激情视频一区二区在线观看 | 欧美一级xxx| 欧美午夜在线观看| 91在线观看高清| 丰满白嫩尤物一区二区| 国产一区二区在线看| 美国十次综合导航| 免费av成人在线| 视频一区在线播放| 香蕉成人啪国产精品视频综合网| 欧美日韩一区二区三区在线| 99综合电影在线视频| 粉嫩欧美一区二区三区高清影视| 老司机一区二区| 日本亚洲三级在线| 亚洲成av人在线观看| 一二三四社区欧美黄| 亚洲黄色小视频| 亚洲欧洲制服丝袜| 中文字幕一区二区不卡| 中文字幕亚洲一区二区va在线| 久久只精品国产| 国产午夜亚洲精品不卡| 亚洲国产精品99久久久久久久久 | 国产精品福利一区| 中文字幕乱码久久午夜不卡| 亚洲国产精品高清| 国产精品欧美一区喷水| 成人免费在线观看入口| 亚洲手机成人高清视频| 亚洲欧洲精品一区二区精品久久久| 一区二区国产盗摄色噜噜| 亚洲丝袜自拍清纯另类| 一区二区三区四区视频精品免费| 亚洲免费色视频| 丝袜美腿亚洲一区| 久久成人免费网站| 国产成人av在线影院| 97久久精品人人澡人人爽| 色八戒一区二区三区| 欧美日韩1234| 久久综合久久综合九色| 国产精品第13页| 亚洲123区在线观看| 精品一区二区免费视频| 一区二区三区蜜桃| 另类小说视频一区二区| 成人精品高清在线| 欧美三级中文字| 精品国产伦一区二区三区免费| 中文字幕一区二| 人人精品人人爱| 国产**成人网毛片九色| 精品1区2区3区| 国产农村妇女毛片精品久久麻豆 | 不卡的av中国片| 在线电影国产精品| 久久久久国产精品厨房| 一区二区三区小说| 国产一区二区三区视频在线播放| 94色蜜桃网一区二区三区| 91精品国产手机| 悠悠色在线精品| 成人午夜看片网址| 欧美本精品男人aⅴ天堂| 亚洲欧美国产77777|