免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3157 | 回复: 2
打印 上一主题 下一主题

[故障求助] 跪求AIX下毫秒级的延迟C语言函数 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-04-19 15:33 |只看该作者 |倒序浏览
各位大GG, 大JJ,
在下跪求AIX下毫秒级的延迟C语言函数, 谢谢了!

论坛徽章:
0
2 [报告]
发表于 2004-04-19 15:55 |只看该作者

跪求AIX下毫秒级的延迟C语言函数

[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]
Technical Reference: Communications, Volume 1
select Subroutine Interface for Data Link Control (DLC) Devices

Purpose
Allows data to be sent using a file descriptor.

Syntax

#include <sys/select.h>;

int select (nfdsmsgs, readlist, writelist, exceptlist, timeout)
Description
The select subroutine checks the specified file descriptor and message queues to see if they are ready for reading (receiving) or writing (sending), or if they have an exception condition pending.

Note
Generic data link control (GDLC) does not support transmit for nonblocked notification in the full sense. If the writelist parameter is specified in the select call, GDLC always returns as if transmit is available. There is no checking to see if internal buffering is available or if internal control-block locks are free. These resources are much too dynamic, and tests for their availability can be done reasonably only at the time of use.
The readlist and exceptlist parameters are fully supported. Whenever the selection criteria specified by the SelType parameter is true, the file system returns a value that indicates the total number of file descriptors and message queues that satisfy the selection criteria. The fdsmask bit masks are modified so that bits set to a value of 1 indicate file descriptors that meet the criteria. The msgids arrays are altered so that message queue identifiers that do not meet the criteria are replaced with a value of -1. If the selection is not satisfied, the calling process is put to sleep waiting on a selwakeup subroutine at a later time.

Each GDLC supports the select subroutine interface via its dlcselect entry point. This subroutine can be called from the process environment only.

Parameters

nfdsmsgs Specifies the number of file descriptors and message queues to check.
sellist The readlist, writelist, and exceptlist parameters specify what to check for during reading, writing, and exceptions, respectively. Each sellist is a structure that contains a file descriptor bit mask (fdsmask) and message queue identifiers (msgids).
The writelist criterion is always set to True by GDLC.

timeout Points to a structure that specifies the maximum length of time to wait for at least one of the selection criteria to be met (if the timeout parameter is not a null pointer).

Return Values
Upon successful completion, the select subroutine returns a value that indicates the total number of file descriptors and message queues that satisfy the selection criteria. The return value is similar to the nfdsmsgs parameter in that the low-order 16 bits give the number of file descriptors. Also, the high-order 16 bits give the number of message queue identifiers. These values indicate the sum total that meet each of the read and exception criteria.

If the time limit specified by the timeout parameter expires, then the select subroutine returns a value of 0 (zero).

If an error occurs, a value of -1 is returned with one of the following error values available using the errno global variable, as defined in the /usr/include/sys/errno.h file:

EBADF Indicates a bad file number.
EINTR Indicates that a signal interrupted the subroutine before it found any of the selected events.
EINVAL Indicates that one of the parameters contained an invalid value.

Related Information
The select subroutine.

Select/Poll Logic for ddwrite and ddread Routines in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.

Generic Data Link Control (GDLC) Environment Overview in AIX 5L Version 5.2 Communications Programming Concepts.


[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

论坛徽章:
0
3 [报告]
发表于 2009-04-09 15:14 |只看该作者
napms:


用法:
napms(500);
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP