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

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

?? select.2

?? 嵌入式操作系統ECOS的網絡開發包
?? 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一区二区三区免费野_久草精品视频
免费视频最近日韩| 极品尤物av久久免费看| 日韩毛片视频在线看| 久久久综合九色合综国产精品| 欧美一区二区精品| 欧美喷水一区二区| 欧美日韩国产精品自在自线| 欧美日韩一区二区三区在线看| 色婷婷综合在线| 在线免费观看视频一区| 色呦呦一区二区三区| 91国偷自产一区二区三区观看| 色婷婷综合久久久久中文| 91蜜桃在线免费视频| 成人精品gif动图一区| 91影视在线播放| 欧美性欧美巨大黑白大战| 欧美色爱综合网| 7777女厕盗摄久久久| 欧美日韩国产一级片| 欧美日韩高清在线| 日韩免费看网站| 国产亚洲女人久久久久毛片| 国产精品美女一区二区| 悠悠色在线精品| 亚洲va天堂va国产va久| 久久激情五月婷婷| 国产毛片精品国产一区二区三区| 成人精品国产一区二区4080| 在线中文字幕不卡| 91精品国产麻豆国产自产在线| 精品国精品国产尤物美女| 国产日韩欧美综合在线| 一区二区三区在线免费观看| 丝袜诱惑亚洲看片| 久久99久久99| av高清不卡在线| 在线不卡的av| 国产视频在线观看一区二区三区| 亚洲免费观看高清完整版在线观看熊| 性欧美疯狂xxxxbbbb| 国产精品香蕉一区二区三区| 91在线视频免费观看| 91麻豆精品91久久久久同性| 国产亚洲欧洲一区高清在线观看| 一区二区三区高清不卡| 免费日本视频一区| 99麻豆久久久国产精品免费| 欧美图片一区二区三区| 久久久久久久一区| 一区二区三区国产精品| 国产一区二区三区久久久| 91浏览器在线视频| 精品久久久久久久久久久久久久久久久| 中文在线一区二区| 日本亚洲最大的色成网站www| 国产99久久久国产精品潘金网站| 精品视频1区2区3区| 国产午夜一区二区三区| 亚洲成人av一区| www.成人在线| 精品国产乱码久久久久久久久| 亚洲乱码日产精品bd| 精品一区二区三区蜜桃| 欧美亚洲尤物久久| 欧美激情一区二区在线| 日本欧美一区二区三区乱码| 99亚偷拍自图区亚洲| 精品久久一二三区| 亚洲第一福利视频在线| 成人av电影在线网| 久久新电视剧免费观看| 日韩在线观看一区二区| 91网站最新网址| 久久久一区二区三区| 日日夜夜精品视频免费| 97久久精品人人做人人爽50路| 精品成人一区二区三区四区| 亚洲与欧洲av电影| 蜜臀精品久久久久久蜜臀| 欧美中文字幕不卡| 国产精品久久久久天堂| 国产精品一区二区久久不卡| 欧美日韩精品电影| 国产精品激情偷乱一区二区∴| 国产在线视频一区二区| 制服丝袜成人动漫| 亚洲成人av在线电影| 在线精品亚洲一区二区不卡| 国产精品美女一区二区三区 | 成人网在线免费视频| 日韩欧美在线123| 亚洲成人激情自拍| 欧美性色欧美a在线播放| 亚洲人成精品久久久久久| 丁香五精品蜜臀久久久久99网站| 久久一区二区三区四区| 毛片av一区二区| 欧美成人国产一区二区| 久久国产三级精品| 日韩精品一区二区三区四区 | 成人a区在线观看| 久久久精品免费免费| 国产一区二区免费看| 精品久久久久一区| 国产精品资源站在线| 久久影音资源网| 国产一区中文字幕| 欧美国产欧美综合| 成人午夜激情在线| 国产精品免费久久| proumb性欧美在线观看| 亚洲欧美在线aaa| 91丝袜美腿高跟国产极品老师 | 国产老妇另类xxxxx| 久久久久久久久伊人| 国产成人精品一区二区三区网站观看 | 在线影视一区二区三区| 亚洲国产成人va在线观看天堂| 欧美日韩中文一区| 日韩精品三区四区| 精品理论电影在线| 国产夫妻精品视频| 中文字幕欧美一区| 欧洲精品一区二区三区在线观看| 亚洲18女电影在线观看| 91精品免费在线| 国产一区二区三区在线观看精品| 国产精品免费看片| 欧美色爱综合网| 久久99国产精品麻豆| 中文字幕五月欧美| 欧美日韩国产免费一区二区 | 91精品国产一区二区三区| 久久草av在线| 国产精品高潮久久久久无| 欧美日韩在线一区二区| 另类小说综合欧美亚洲| 国产精品久久午夜| 在线观看网站黄不卡| 卡一卡二国产精品| 国产精品久久久久久久岛一牛影视| 91蜜桃免费观看视频| 日韩影院精彩在线| 欧美激情资源网| 欧美三级三级三级爽爽爽| 国产一区欧美日韩| 亚洲精品国产a| www一区二区| 欧美性受xxxx| 国产乱妇无码大片在线观看| 亚洲高清三级视频| 精品国产乱码久久久久久浪潮 | 精品久久人人做人人爱| 色综合视频一区二区三区高清| 日本欧美一区二区在线观看| 中文字幕久久午夜不卡| 欧美人牲a欧美精品| 国产成人欧美日韩在线电影| 三级亚洲高清视频| 亚洲欧美影音先锋| 精品国产欧美一区二区| 日本乱码高清不卡字幕| 国产一区二区三区av电影 | av亚洲产国偷v产偷v自拍| 秋霞午夜av一区二区三区| 国产精品丝袜一区| 欧美一区二区三区不卡| 99久久精品国产精品久久| 久久99日本精品| 亚洲国产va精品久久久不卡综合| 国产欧美一区二区精品性色超碰| 欧美日韩国产一区二区三区地区| 波多野结衣中文字幕一区二区三区 | 中文字幕一区二区三区色视频| 日韩精品专区在线| 欧美性受xxxx| 岛国av在线一区| 久久精品国产**网站演员| 亚洲国产成人91porn| 亚洲免费大片在线观看| 国产欧美日韩三区| 精品久久久久久最新网址| 欧美精选一区二区| 日本乱码高清不卡字幕| 99麻豆久久久国产精品免费优播| 国产高清不卡二三区| 美日韩一级片在线观看| 香蕉成人伊视频在线观看| 一区二区三区视频在线观看| 国产精品麻豆网站| 精品国产一区二区三区久久影院| 欧美精品亚洲二区| 在线观看不卡一区| www.久久精品| av不卡免费在线观看| 风间由美一区二区三区在线观看 | 亚洲成年人网站在线观看| 亚洲最大成人综合| 亚洲欧美激情一区二区|