Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

io_nonblock(3) [debian man page]

io_nonblock(3)						     Library Functions Manual						    io_nonblock(3)

io_nonblock - switch to non-blocking I/O SYNTAX
#include <io.h> void io_nonblock(int64 fd); DESCRIPTION
io_nonblock puts UNIX descriptor fd into ``non-blocking mode.'' Calling io_nonblock(fd) before io_fd(fd) makes io_tryread and io_trywrite faster and more efficient. Actually, current UNIX kernels do not support non-blocking descriptors; they support non-blocking open files. Furthermore, many programs will break if they encounter non-blocking mode. This means that you must not use io_nonblock for a descriptor inherited from another pro- gram. io_nonblock has no return value; it always succeeds. If d is not the number of a UNIX descriptor, io_nonblock has no effect. If io_fd is given a descriptor in blocking mode, io_tryread and io_trywrite go through the following contortions to avoid blocking: 1 Stop if poll says that the descriptor is not ready. Otherwise there's a good chance, but not a guarantee: even if poll says the descrip- tor is ready, the descriptor might not be ready a moment later. (Furthermore, poll can fail on some systems.) 2 Catch SIGALRM. SIGALRM must not be blocked, and must not be used elsewhere in the program. 3 Set an interval timer so that any blocking call will be interrupted by SIGALRM within 10 milliseconds. (Current UNIX kernels do not allow any shorter interval.) Of course, this may still mean a 10-millisecond delay. If io_fd is given a descriptor in non-blocking mode (or a descriptor for a regular disk file), io_tryread and io_trywrite avoid these con- tortions. SEE ALSO
io_wait(3), io_canwrite(3) io_nonblock(3)

Check Out this Related Man Page

io_tryread(3)						     Library Functions Manual						     io_tryread(3)

io_tryread - read from a descriptor without blocking SYNTAX
#include <io.h> int io_tryread(int64 fd,char* buf,int64 len); DESCRIPTION
io_tryread tries to read len bytes of data from descriptor fd into buf[0], buf[1], ..., buf[len-1]. (The effects are undefined if len is 0 or smaller.) There are several possible results: o o_tryread returns an integer between 1 and len: This number of bytes was available for immediate reading; the bytes were read into the beginning of buf. Note that this number can be, and often is, smaller than len; you must not assume that io_tryread always succeeds in reading exactly len bytes. o io_tryread returns 0: No bytes were read, because the descriptor is at end of file. For example, this descriptor has reached the end of a disk file, or is reading an empty pipe that has been closed by all writers. o io_tryread returns -1, setting errno to EAGAIN: No bytes were read, because the descriptor is not ready. For example, the descriptor is reading an empty pipe that could still be written to. o io_tryread returns -3, setting errno to something other than EAGAIN: No bytes were read, because the read attempt encountered a persis- tent error, such as a serious disk failure (EIO), an unreachable network (ENETUNREACH), or an invalid descriptor number (EBADF). io_tryread does not pause waiting for a descriptor that is not ready. If you want to pause, use io_waitread or io_wait. You can make io_tryread faster and more efficient by making the socket non-blocking with io_nonblock(). SEE ALSO
io_nonblock(3), io_waitread(3), io_tryreadtimeout(3) io_tryread(3)
Man Page

15 More Discussions You Might Find Interesting

1. Cybersecurity

IP Block

I'm a newbie in UNIX system, and I must do some IP and port blocking... (ex: or yahoomessenger) How is the best way to do that?! If anyone could give me a step by step help! thanks (5 Replies)
Discussion started by: francisco
5 Replies

2. UNIX for Dummies Questions & Answers

basic UNIX questions

Can somebody please tell me a little about UNIX OS. For instance, is it ideal for digital media or how easy is it to get help and support? (3 Replies)
Discussion started by: buk5d
3 Replies

3. UNIX for Dummies Questions & Answers

Need Information Urgently.

Hi i dont know about the UNIX OS at all but now as my Project requires, i need to learn it as soon as possible. Could anybody please help me out in suggessting any good elementary book on UNIX OS so that atleast i can learn the commands for UNIX servers and at the same time within the short span... (3 Replies)
Discussion started by: sumit_krishan
3 Replies

4. UNIX for Dummies Questions & Answers

getting time in mili seconds

hi all UNIX Gurus, this is my first i posting this with great expectations:o...hoping to get the similar replies... my question is.... need to get timestamp with millisecond in UNIX. Date command gives Year,month day, hour,minute and second but it does not give millisecond. Any... (5 Replies)
Discussion started by: Bhups
5 Replies

5. UNIX for Dummies Questions & Answers

Need *ONLINE* UNIX Scripting Resource

Hello, Can any of your UNIX gurus recommend a good online resource for learning UNIX scripting? I'll be doing a little bit of it, but not enough for me to feel motivated enough to go out and buy a book on it. Well, that, and I'm cheap! dstins (3 Replies)
Discussion started by: dstinsman
3 Replies

6. UNIX for Dummies Questions & Answers

.z file compression

Hello, I have a .z file which i understand to be UNIX. I'm on PC (no UNIX boxes) and have tried many different unzipping programs to extract this .z file, but only PicoZip has allowed me to view what is inside (telling me, i think, that it's not corrupt), but i have not been able to extract... (3 Replies)
Discussion started by: Gonecat
3 Replies

7. HP-UX

Reuse disk from other HP-UX

Hello, I have 2 hp-ux both running 11.23, I have move one of a harddisk from "UNIX A" to "UNIX B", so how can I read back the data in "UNIX B"? Thanks (5 Replies)
Discussion started by: zetadhell
5 Replies

8. What is on Your Mind?

Site Performance II

I have updated the backend hosting for UNIX.COM and would appreciate feedback either in the form of a vote in the poll or a post so that we can plan for more changes if any are needed. In particular let me us know if you see any strange behavior from the site as there may still be some... (8 Replies)
Discussion started by: reborg
8 Replies

9. Windows & DOS: Issues & Discussions

UNIX/Linux for Windows? and a few other questions...

1) I want UNIX but I don't want to partition my hard drive. I have heard of programs that allow you to start UNIX from Windows but I don't know which one is good. Something like WinLinux (not too sure???) Anyone know which programs I'm talking about? 2) Is Linux UNIX? 3) How do you pronounce... (9 Replies)
Discussion started by: CornNuts
9 Replies

10. UNIX for Dummies Questions & Answers

Storage vs UNIX

Hi, I have a general question about storage vs. unix job I am currently a unix admin with 2 years experience in a major financial institute. I have a chance to move up one level (2nd level) in UNIX in the near future. But I am also interested in Storage, which we have an seperate team... (4 Replies)
Discussion started by: uuontario
4 Replies

11. What is on Your Mind?

How to become good UNIX engineer

Maybe my question is quite stupid , but how to become good UNIX engineer. What to read , how to practice ? What a good engineer must know to call himself engineer . :cool: (14 Replies)
Discussion started by: solaris_user
14 Replies

12. UNIX for Dummies Questions & Answers

Never touched UNIX before.. Where do I start?

I will be taking a UNIX course as a part of my college Data Com concentration curriculum. Just thought it would be a good idea to get a little head start, since this class will most likely be quite difficult for someone like me. I never did any programming and I never dealt with Unix or Linux short... (3 Replies)
Discussion started by: ibex333
3 Replies

13. UNIX for Advanced & Expert Users

Ignored signals & blocking system calls

If I explicity ignore a signal (for example, SIGALRM), and this signal is generated during a blocking system call (for example, a recvfrom() ), what happens to the system call? Does it abort, or does it remain blocked until its end? (2 Replies)
Discussion started by: hurricane
2 Replies

14. UNIX for Dummies Questions & Answers

Best way to learn UNIX

Hi, I am the ultimate noob when it comes to UNIX. Apart from a few basic thing like ls -l and mkdir (and that really is about as good as it gets) I know absolutely nothing about UNIX and I want to learn it and get better! I'm sure like with most things, just getting stuck in and trying... (3 Replies)
Discussion started by: thebdj
3 Replies

15. UNIX for Dummies Questions & Answers

Need Some Advice - Best Distro For My System

Hey guys, this is my first time posting here (although I've been reading the forums for a while now). I'm looking for a good UNIX (or UNIX based/UNIX-like) distro to install on an old Dell Dimension 2400 Destop. I've done ALOT of research on the different distros and I've tried a few out but I... (6 Replies)
Discussion started by: Pyramist
6 Replies

Featured Tech Videos