Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

iob_write(3) [debian man page]

iob_write(3)						     Library Functions Manual						      iob_write(3)

NAME
iob_write - send I/O batch through callback SYNTAX
#include <iob.h> typedef int64 (*io_write_callback)(int64 s,const void* buf,uint64 n); int64 iob_write(int64 s,io_batch* b,io_write_callback cb); DESCRIPTION
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 error. NOTE
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)

Check Out this Related Man Page

io_tryread(3)						     Library Functions Manual						     io_tryread(3)

NAME
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. UNIX for Dummies Questions & Answers

Creating a batch file.

I'm very new to unix and for the most part make my way around but I need to know how to create a batch file that can be ran at scheduled time. The main function of the file will be to copy files to different locations then FTP to a different server. Please help. I you have an example that would be... (2 Replies)
Discussion started by: spotanddot
2 Replies

2. Programming

batch file

what is a command to call a batch file from a c++ program when called with the argument which is a text file, then how to print that text file on a printer. please help me with code if possible (3 Replies)
Discussion started by: ramneek
3 Replies

3. Windows & DOS: Issues & Discussions

batch file--bunch of commands

I have a batch file that takes 2 parameters--source file location and target file location. I want to create another batch file that contains all the commands with the file locations so that I dont have to enter the ifnromation every time individually. For eg: to execute command com1.bat... (3 Replies)
Discussion started by: alfredo123
3 Replies

4. UNIX for Dummies Questions & Answers

Append value(batch number) to start of records

Hi all, I am new to unix shell scripting and I am trying to append batch number that comes in Trailer record to the detailed record. TR|20080312|22881 |000000005|20080319|2202 LN|20080312|077777722220 |0000100000017|ABS LN|20080312|000799439326 |0000709943937|AA TR|20080313|22897 ... (6 Replies)
Discussion started by: kiran_418
6 Replies

5. Shell Programming and Scripting

removing items from a file with batch

Please assist with awk scirpts: I need to remove items from a file in a batch: The file that I will remove from has the following format: abc00tef:10.81.12.3 abc01tef:10.81.12.3 abc02tef:10.81.12.3 abc03tef:10.81.12.3 abc04tef:10.81.12.3 abc05tef:10.81.12.3 I have a file which... (5 Replies)
Discussion started by: amir07
5 Replies

6. Shell Programming and Scripting

Unique batch and sequence creation

Hi Everyone, I am working on Sun solaris. I would like to know that ,do we any way to create unique batch in shell scripts.Basically i want to create a batch and want to create a sequence to process the records. Regards, gehlnar (3 Replies)
Discussion started by: gehlnar
3 Replies

7. Windows & DOS: Issues & Discussions

Creating a batch file..

Hello, this is my first post and i hope you can solve my problem. I need to create a batch file that will copy folder from hard drive on to usb stick on daily basis. Can you help me and write that file and explaine me what to do next. Folder's location is: c\windows\desktop\2009 Thank... (5 Replies)
Discussion started by: hule
5 Replies

8. Programming

How to use we use int64?

Recently my project needs int64 variables. However my os and computer are both 32bits. So how can i use int64 as a parameter in a function. and is int64 a structure as user-defined structures..... ??? thanx i am waiting for ur answer:rolleyes: (2 Replies)
Discussion started by: macroideal
2 Replies

9. Shell Programming and Scripting

How to call a batch file in Make file?

Hii I wanna call a batch file from a make file. Doesn't work , what is the procedure to do this.? Any idea thanks:eek: (2 Replies)
Discussion started by: krishnampkkm
2 Replies

10. Windows & DOS: Issues & Discussions

Adding or subtracting days from current date in batch script

Hi, I'm writing an batch file to create report In the batch file iam passing two arguments:startdate and finishdate Ex: startdate=07-sep-2009 finishdate=07-sep-2011 I need to have script that takes command line argument as input and gives me out currentdate last year and current date... (2 Replies)
Discussion started by: anand1773
2 Replies

11. Shell Programming and Scripting

Ordering batch number

Hi, Could some one please help to order the batch number in sequence. I will be getting bunch of files with batch number in folder1 which are not in sequence. I need to move all files from folder1 to folder2 with batch number in sequence. Header record looks like PROCESS1... (8 Replies)
Discussion started by: zooby
8 Replies

12. Shell Programming and Scripting

Execute Shell script via Plink

I am trying to create a bat file with the below piece of code. plink.exe -l username -pw password -P 22 -2 -ssh servername sudo su - devuser cd /opt/sample echo 3 | ./Script.sh It executes only the first line and not the rest of the lines. Can you please help me where am I doing wrong? (5 Replies)
Discussion started by: lingu85
5 Replies

13. Shell Programming and Scripting

sed batch file issue

Hi!! I want to create a batch file so the sh file could change a file on a specific time. I made this config: sed -i 's/range 192.168.1.200 192.168.1.220;/option POLYCOM "tftp://10.20.1.10";/g' /etc/dhcp3/dhcpd.conf My issue is that the sed does not accept the :// character.... (2 Replies)
Discussion started by: jocas9
2 Replies

14. Shell Programming and Scripting

How to use gpg to encrypt data in batch/non-interactive mode?

Hello, I have to encrypt data using a script in batch mode without being prompted. I can successfully encrypt data but it prompts me to enter (y/N) as shown below. I tried batch flags without no success. I need to automate this without any prompts. Appreciate your inputs. Thanks, C. $... (2 Replies)
Discussion started by: calredd
2 Replies

15. Shell Programming and Scripting

Perl error in batch command but works one at a time

In the below perl executes if one file is processed perfect. However, when multiple files are processed in batch which is preferred I get the below error that I can not seem to fix it as the '' necessary for the command to execute, but seem to only work for one -arg option. Thank you :). ... (2 Replies)
Discussion started by: cmccabe
2 Replies