httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@ast.cam.ac.uk (David Robinson)
Subject Re: mmap alt?
Date Fri, 09 Feb 1996 11:50:00 GMT
>Some systems have a tmpfs (memory filesystem, or ramdisk) and do not have 
>mmap(), if that is the case, open a file on the ram disk/memory filesystem.
>
>Cliff

But that's right back where we started; a file in /tmp !

I haven't heard of _mfopen on any other system.
It isn't clear to me that it could be used for shared memory.

 David.

>On Thu, 8 Feb 1996, Garey Smiley wrote:

> Does any other platform besides OS/2 support the following function? It might
> be used instead of mmap() for a faster scoreboard.
> 
>   Prototype: 
> 
>   FILE *_mfopen (char *buf, const char *mode, size_t size, int inc); 
>   
>   Description: 
> 
>   Open a memory file.  All output to a memory file goes to a buffer in memory.>  The
stream returned by _mfopen()  can be used with fprintf(), fputc(),
> ftell() and fwrite().  If buf is non-NULL, output goes to the array of size
> bytes pointed to by buf.  inc must be zero.  If buf is NULL, output goes to a
> buffer allocated with malloc() and resized with realloc().  The initial size
> of the buffer is size bytes (which can be zero).  inc must be non-zero.  If
> inc is positive, the buffer size is increased by inc bytes whenever it is
> full.  If inc is -2, the buffer size is doubled whenever the buffer is full. 
> If size is 0 and inc is -2, the initial buffer size is 512 bytes, the buffer
> will be allocated on the first output to the stream.  Currently, mode must
> point to "wb".  On error, _mfopen() returns NULL.  Do not use fclose() on a
> stream created by _mfopen(), use _mfclose() instead.  Do not read from a
> stream created by _mfopen(). 
> 
>   Return value: 
> 
>   _mfopen() returns a new stream.  On error, _mfopen() returns NULL. 
> 
>   Restrictions: 
> 
>   _fsetmode() doesn't work, newline characters written to the stream are not
> expanded to CR/LF. 
> 
>   See also: fopen(), _mfclose(), sprintf() 
> 
>   Example: See /emx/test/mftest.c 

Mime
View raw message