UNIX nonblocking I/O: O_NONBLOCK vs. FIONBIO
|
In every example and discussion I run across in the context of BSD socket programming, it seems that the recommended way to set a file descriptor to nonblocking I/O mode is using the flag to
I've been doing network programming in UNIX for over ten years, and have always used the
Never really gave much thought to why. Just learned it that way. Does anyone have any commentary on the possible respective merits of one or the other? I imagine the portability locus differs somewhat, but do not know to what extent as
|
||
|
feedback
|
|
Prior to standardization there was POSIX addressed this with the introduction of New programs should use |
|||
|
feedback
|
|
I believe fnctl() is a POSIX function. Where as ioctl is a standard UNIX thing. Here is a list of POSIX io. ioctl() is a very kernel/driver/OS specific thing, but i am sure what you use works on most flavors of Unix. some other ioctl() stuff might only work on certain OS or even certain revs of it's kernel. |
|||
feedback
|
|
As @Sean said, |
posted on 2012-02-29 09:33 Richard.FreeBSD 阅读(897) 评论(0) 收藏 举报
浙公网安备 33010602011771号