GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
buffer_mmapread(3) FreeBSD Library Functions Manual buffer_mmapread(3)

buffer_mmapread - create read-only memory-mapped file buffer

#include <libowfat/buffer.h>

int buffer_mmapread(buffer &b,const char* filename);

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.

#include <libowfat/buffer.h> #include <libowfat/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);

buffer_mmapread returns 0 if everything was fine, -1 on error (setting errno).

buffer_flush(3), buffer(3)

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.