debian man page for buffer_mmapread

Query: buffer_mmapread

OS: debian

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

buffer_mmapread(3)					     Library Functions Manual						buffer_mmapread(3)

NAME
buffer_mmapread - create read-only memory-mapped file buffer
SYNTAX
#include <buffer.h> int buffer_mmapread(buffer &b,const char* filename);
DESCRIPTION
buffer_mmapread opens filename for reading and fills b so that the contents of the file can be read from it. Using mmap is more efficient than reading through a real buffer, but you have to call buffer_close to unmap the memory in the end.
EXAMPLE
#include <buffer.h> #include <open.h> buffer input; char x; buffer_mmapread(&input,"/etc/passwd"); while (buffer_get(&input,&x,1)==1) { buffer_put(buffer_1,&x,1); if (x==' ') break; } buffer_flush(buffer_1); buffer_close(&input);
RETURN VALUE
buffer_mmapread returns 0 if everything was fine, -1 on error (setting errno).
SEE ALSO
buffer_flush(3), buffer(3) buffer_mmapread(3)
Related Man Pages
buffer_get_token_sa(3) - debian
ungetc(3s) - hpux
fmemopen(3) - netbsd
ungetc_unlo(3s) - hpux
create_sub_zbuffer(3alleg4) - centos
Similar Topics in the Unix Linux Community
Adding the individual columns of a matrix.
Installing Dash Shell on OS X Lion
How can I do this in VI editor?
A (ksh) Library For and From UNIX.com
My first PERL incarnation... Audio Oscillograph