io_wait(3) Library Functions Manual io_wait(3)NAME
io_wait - wait for events
io_wait() checks the descriptors that the program is interested in to see whether any of them are ready. If none of them are ready,
io_wait() tries to pause until one of them is ready, so that it does not take time away from other programs running on the same computer.
io_wait pays attention to timeouts: if a descriptor reaches its timeout, and the program is interested in reading or writing that descrip-
tor, io_wait will return promptly.
Under some circumstances, io_wait will return even though no interesting descriptors are ready. Do not assume that a descriptor is ready
merely because io_wait has returned.
io_wait is not interrupted by the delivery of a signal. Programs that expect interruption are unreliable: they will block if the same sig-
nal is delivered a moment before io_wait. The correct way to handle signals is with the self-pipe trick.
SEE ALSO io_waituntil(3), io_check(3), io_wantread(3), io_wantwrite(3), io_fd(3)io_wait(3)
Check Out this Related Man Page
iob_write(3) Library Functions Manual iob_write(3)NAME
iob_write - send I/O batch through callback
typedef int64 (*io_write_callback)(int64 s,const void* buf,uint64 n);
int64 iob_write(int64 s,io_batch* b,io_write_callback cb);
iob_write sends the (rest of) b through the callback cb, passing s as first argument. cb is expected to behave like io_trywrite(2).
This interface is intended to send an I/O batch through a filter, for example to encrypt or compress it. If you just want to send an I/O
batch to a socket, use iob_send instead.
iob_write returns the number of bytes written, 0 if there were no more bytes to be written in the batch, -1 for EAGAIN, or -3 for a perma-
nent error (for example "connection reset by peer").
The normal usage pattern is using io_wait to know when a descriptor is writable, and then calling iob_write until it returns 0, -1 or -3.
If it returns 0, terminate the loop (everything was written OK). If it returns -1, call io_wait again. If it returned -3, signal an
iob_write will continue to call your callback until it returns an error. So if you are in a state machine, for example a web server using
this for SSL support, make sure to write at most n bytes at a time (e.g. 64k) and the next time you are called return -1. Otherwise
iob_write might not return until the whole file is served.
SEE ALSO iob_send(3)iob_write(3)
I want to write a script that tells me if the tape device is ready, if the answer is not yes ($?is not 0) i get an answer that the tape_device is not ready. If the tape is ready i can do a
tar -cvf $tape1 * .
How can i write a script to control if the tapedevice is ready or not?
How can i... (1 Reply)
I am writing a simple script and want to keep the user in a fuction until they are ready to get out. For some (probably stupid) reason, it doesn't seem to be working. You guys see anything that I'm overlooking?
echo 'run another? \c'
... (1 Reply)
If we want to determine that amongst many descriptors which one is set ready for reading , ready for writing or has an error condition pending we use the select () utility.I would like to know can we have some technique by which we will be able to determine which amongst many IPC ids is ready for... (0 Replies)
I think I am ready for the 310-014 exam but not quite ready for the 310-015 exam as I still have a lot of study and practice to do to prepare for it..
Do most people sit the 014 exam and then prepare for the second exam?
Any advice on how to tackle these is appreciated.. (3 Replies)
I have a requirement like, where a file gets generated in a particular dir and once the file is ready and available then I want to execute rest of the script, because untill and unless the file exists and is available there is no use of running rest of the commands in that script.
... (5 Replies)