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

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

?? select.2

?? eCos/RedBoot for勤研ARM AnywhereII(4510) 含全部源代碼
?? 2
字號:
.\"	$OpenBSD: select.2,v 1.20 2001/09/04 08:04:08 deraadt Exp $
.\"	$NetBSD: select.2,v 1.5 1995/06/27 22:32:28 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)select.2	8.2 (Berkeley) 3/25/94
.\"
.Dd March 25, 1994
.Dt SELECT 2
.Os
.Sh NAME
.Nm select
.Nd synchronous I/O multiplexing
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sys/time.h>
.Fd #include <unistd.h>
.Ft int
.Fn select "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set *exceptfds" "struct timeval *timeout"
.Fn FD_SET fd &fdset
.Fn FD_CLR fd &fdset
.Fn FD_ISSET fd &fdset
.Fn FD_ZERO &fdset
.Sh DESCRIPTION
.Fn select
examines the I/O descriptor sets whose addresses are passed in
.Fa readfds ,
.Fa writefds ,
and
.Fa exceptfds
to see if some of their descriptors
are ready for reading, are ready for writing, or have an exceptional
condition pending, respectively.
The first
.Fa nfds
descriptors are checked in each set;
i.e., the descriptors from 0 through
.Fa nfds Ns No -1
in the descriptor sets are examined.
On return,
.Fn select
replaces the given descriptor sets
with subsets consisting of those descriptors that are ready
for the requested operation.
.Fn select
returns the total number of ready descriptors in all the sets.
.Pp
The descriptor sets are stored as bit fields in arrays of integers.
The following macros are provided for manipulating such descriptor sets:
.Fn FD_ZERO &fdset
initializes a descriptor set
.Fa fdset
to the null set.
.Fn FD_SET fd &fdset
includes a particular descriptor
.Fa fd
in
.Fa fdset .
.Fn FD_CLR fd &fdset
removes
.Fa fd
from
.Fa fdset .
.Fn FD_ISSET fd &fdset
is non-zero if
.Fa fd
is a member of
.Fa fdset ,
zero otherwise.
The behavior of these macros is undefined if
a descriptor value is less than zero or greater than or equal to
.Dv FD_SETSIZE ,
which is normally at least equal
to the maximum number of descriptors supported by the system.
.Pp
If
.Fa timeout
is a non-null pointer, it specifies a maximum interval to wait for the
selection to complete.
If
.Fa timeout
is a null pointer, the select blocks indefinitely.
To effect a poll, the
.Fa timeout
argument should be non-null, pointing to a zero-valued timeval structure.
.Fa timeout
is not changed by
.Fn select ,
and may be reused on subsequent calls; however, it is good style to
re-initialize it before each invocation of
.Fn select .
.Pp
Any of
.Fa readfds ,
.Fa writefds ,
and
.Fa exceptfds
may be given as null pointers if no descriptors are of interest.
.Sh RETURN VALUES
.Fn select
returns the number of ready descriptors that are contained in
the descriptor sets, or \-1 is an error occurred.
If the time limit expires,
.Fn select
returns 0.
If
.Fn select
returns with an error, including one due to an interrupted call,
the descriptor sets will be unmodified.
.Sh ERRORS
An error return from
.Fn select
indicates:
.Bl -tag -width Er
.It Bq Er EFAULT
One or more of
.Fa readfds ,
.Fa writefds ,
or
.Fa exceptfds
points outside the process's allocated address space.
.It Bq Er EBADF
One of the descriptor sets specified an invalid descriptor.
.It Bq Er EINTR
A signal was delivered before the time limit expired and
before any of the selected events occurred.
.It Bq Er EINVAL
The specified time limit is invalid.
One of its components is negative or too large.
.El
.Sh SEE ALSO
.Xr accept 2 ,
.Xr connect 2 ,
.Xr gettimeofday 2 ,
.Xr poll 2 ,
.Xr read 2 ,
.Xr recv 2 ,
.Xr send 2 ,
.Xr write 2 ,
.Xr getdtablesize 3
.Sh BUGS
Although the provision of
.Xr getdtablesize 3
was intended to allow user programs to be written independent
of the kernel limit on the number of open files, the dimension
of a sufficiently large bit field for select remains a problem.
The default bit size of
.Ft fd_set
is based on the symbol
.Dv FD_SETSIZE
(currently 256),
but that is somewhat smaller than the current kernel limit
to the number of open files.
However, in order to accommodate programs which might potentially
use a larger number of open files with select, it is possible
to increase this size within a program by providing
a larger definition of
.Dv FD_SETSIZE
before the inclusion of
.Aq Pa sys/types.h .
The kernel will cope, and the userland libraries provided with the
system are also ready for large numbers of file descriptors.
.Pp
Alternatively, to be really safe, it is possible to allocate
.Ft fd_set
bit-arrays dynamically.
The idea is to permit a program to work properly even if it is
.Xr execve 2 Ns 'd
with 4000 file descriptors pre-allocated.
The following illustrates the technique which is used by
userland libraries:
.Pp
.Bd -literal -offset indent -compact
	fd_set *fdsr;
	int max = fd;

	fdsr = (fd_set *)calloc(howmany(max+1, NFDBITS),
	    sizeof(fd_mask));
	if (fdsr == NULL) {
		...
		return (-1);
	}
	FD_SET(fd, fdsr);
	n = select(max+1, fdsr, NULL, NULL, &tv);
	...
	free(fdsr);
.Ed
.Pp
Alternatively, it is possible to use the
.Xr poll 2
interface.
.Xr poll 2
is more efficient when the size of
.Fn select Ns 's
.Ft fd_set
bit-arrays are very large, and for fixed numbers of
file descriptors one need not size and dynamically allocate a
memory object.
.Pp
.Fn select
should probably have been designed to return the time remaining from the
original timeout, if any, by modifying the time value in place.
Even though some systems stupidly act in this different way, it is
unlikely this semantic will ever be commonly implemented, as the
change causes massive source code compatibility problems.
Furthermore, recent new standards have dictated the current behaviour.
In general, due to the existence of those brain-damaged
non-conforming systems, it is unwise to assume that the timeout
value will be unmodified by the
.Fn select
call, and the caller should reinitialize it on each invocation.
Calculating the delta is easily done by calling
.Xr gettimeofday 2
before and after the call to
.Fn select Ns ,
and using
.Fn timersub
(as described in
.Xr getitimer 2 ) .
.Pp
Internally to the kernel,
.Fn select
works poorly if multiple processes wait on the same file descriptor.
Given that, it is rather surprising to see that many daemons are
written that way (i.e.,
.Xr httpd 8 ) .
.Sh HISTORY
The
.Fn select
function call appeared in
.Bx 4.2 .

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产激情91久久精品导航| 日韩一区二区中文字幕| 国产美女久久久久| 久久99久久精品欧美| 午夜精品视频一区| 日韩精品一卡二卡三卡四卡无卡| 亚洲激情网站免费观看| 亚洲天堂精品在线观看| 亚洲人成亚洲人成在线观看图片 | 99精品国产91久久久久久| 欧美成人a在线| 成人美女视频在线观看18| 国产二区国产一区在线观看| 国产剧情在线观看一区二区| 国产精品一色哟哟哟| 中文字幕亚洲区| 亚洲一区二区三区四区五区中文| 亚洲理论在线观看| 亚洲电影你懂得| 亚洲第一福利视频在线| 亚洲第一电影网| 国产福利一区二区三区视频| 九色综合国产一区二区三区| 粉嫩欧美一区二区三区高清影视| 99视频一区二区| 精品少妇一区二区三区 | 亚洲精品免费看| 久久国产剧场电影| 色婷婷国产精品| 国产女同互慰高潮91漫画| 亚洲国产综合色| 99精品国产一区二区三区不卡 | 久久久亚洲精品石原莉奈| 日韩美女视频一区| 国产一区二区看久久| 精品捆绑美女sm三区| 国产亚洲一区二区三区四区 | 亚洲国产成人精品视频| 成人精品视频一区| 精品日韩欧美一区二区| 亚洲大片在线观看| 欧美制服丝袜第一页| 国产精品短视频| 99久久精品国产一区| 国产免费观看久久| 国产ts人妖一区二区| 国产亚洲欧美色| 国产精品自在在线| 久久色在线观看| 精品一区二区三区久久| 精品久久人人做人人爱| 精品一区二区影视| 久久综合色播五月| 国v精品久久久网| 1区2区3区精品视频| 欧美日韩国产乱码电影| 蜜臀久久99精品久久久久宅男 | 91老师片黄在线观看| 一区二区三区视频在线看| av高清久久久| 亚洲午夜影视影院在线观看| 337p亚洲精品色噜噜| 国产一区91精品张津瑜| 中文字幕在线观看一区二区| 91九色02白丝porn| 久久草av在线| 亚洲天堂中文字幕| 欧美电影影音先锋| 国产精品亚洲成人| 亚洲不卡一区二区三区| 国产精品久久久久国产精品日日| 欧美自拍偷拍一区| 狠狠色丁香久久婷婷综合_中| 日韩一区中文字幕| 欧美精品一区二区久久婷婷| 99精品久久只有精品| 国产一区二区三区四区五区入口| 伊人开心综合网| 亚洲一区在线观看免费观看电影高清 | 久久青草欧美一区二区三区| 欧美在线看片a免费观看| 日本韩国欧美国产| 欧美日韩aaaaaa| 欧美综合久久久| 色综合久久久久综合体| 国产麻豆精品视频| 国产一区在线观看麻豆| 麻豆精品一区二区| 日韩国产欧美三级| 日韩av电影免费观看高清完整版 | 日日夜夜精品视频天天综合网| 亚洲天堂免费看| 亚洲欧美日韩国产综合| 亚洲天堂a在线| 亚洲欧美激情插| 亚洲电影一级黄| 视频一区国产视频| 久久精品99国产精品| 九色综合国产一区二区三区| 日本不卡一二三区黄网| 99久久久久久| 色欧美片视频在线观看在线视频| 色一情一乱一乱一91av| 欧美影院精品一区| 在线综合+亚洲+欧美中文字幕| 日韩视频一区在线观看| 国产欧美日韩另类视频免费观看| 国产精品高潮呻吟| 亚洲五月六月丁香激情| 蜜桃久久久久久| av在线播放不卡| 欧美一区日本一区韩国一区| 国产人成一区二区三区影院| 中文字幕在线免费不卡| 肉色丝袜一区二区| 成人高清av在线| 欧美一区二区三区电影| 国产女主播在线一区二区| 亚洲国产另类精品专区| 国内久久婷婷综合| 成人午夜免费电影| 欧美一区二区三区啪啪| 亚洲乱码国产乱码精品精可以看| 免费成人在线观看| 欧美午夜一区二区三区| 中文子幕无线码一区tr| 久久成人av少妇免费| 91麻豆精品国产91久久久久| 国产精品久久久久一区| 国产在线精品不卡| 日韩午夜小视频| 国产最新精品精品你懂的| 日韩欧美中文字幕制服| 亚洲免费在线播放| 色综合 综合色| 亚洲靠逼com| 色久综合一二码| 亚洲精品视频在线观看网站| 成人av免费在线播放| 国产性天天综合网| 成人午夜av影视| 国产精品无人区| 99vv1com这只有精品| 亚洲男人的天堂av| 欧美三级一区二区| 午夜精品久久久久影视| 91精品国产黑色紧身裤美女| 琪琪久久久久日韩精品| 精品国产一区久久| av在线不卡免费看| 午夜精品福利在线| 久久综合九色综合97婷婷 | 日日夜夜精品免费视频| 日韩视频中午一区| 国产不卡在线一区| 亚洲桃色在线一区| 91精品国产入口| 精品一区二区在线观看| 久久久国产精华| 不卡一区在线观看| 一区二区欧美视频| 久久这里只有精品6| 粉嫩av亚洲一区二区图片| 亚洲一卡二卡三卡四卡| 亚洲精品一区二区三区福利| 91丨porny丨在线| 午夜日韩在线观看| 自拍偷在线精品自拍偷无码专区| 欧美精品aⅴ在线视频| 不卡的av在线| 国内精品久久久久影院薰衣草| 亚洲国产成人av网| 国产精品久久久久9999吃药| 精品久久久久久久久久久久久久久 | 色噜噜夜夜夜综合网| 国产精品1区2区3区在线观看| 手机精品视频在线观看| 中文字幕乱码亚洲精品一区| 精品国产污污免费网站入口 | 三级欧美在线一区| 亚洲午夜免费电影| 中文字幕一区二区三区乱码在线| 国产亚洲精品资源在线26u| 精品国产91乱码一区二区三区 | 亚洲gay无套男同| 亚洲裸体在线观看| 亚洲夂夂婷婷色拍ww47| 亚洲高清不卡在线观看| 亚洲mv大片欧洲mv大片精品| 一区二区三区四区蜜桃| 日产欧产美韩系列久久99| 日韩和欧美的一区| 男女性色大片免费观看一区二区 | 26uuu国产电影一区二区| 国产精品久久久久影院色老大| 亚洲国产aⅴ天堂久久| 国产精品一区一区三区| 欧美日韩国产高清一区二区| 久久久夜色精品亚洲| 亚洲成人7777|