buffer_mmapread man page on Alpinelinux

Man page or keyword search:  
man Server   18016 pages
apropos Keyword Search (all sections)
Output format
Alpinelinux logo
[printable version]

buffer_mmapread(3)					    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 con‐
       tents 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=='\n') 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)
[top]

List of man pages available for Alpinelinux

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net