* how to get around memory mapped file in Ultrix
@ 1993-04-28 14:09 Howard Wai-Chun Yeung
1993-04-29 0:07 ` Alan Rollow - Alan's Home for Wayward Tumbleweeds.
0 siblings, 1 reply; 4+ messages in thread
From: Howard Wai-Chun Yeung @ 1993-04-28 14:09 UTC (permalink / raw)
I post my previous question about the c compiler problem.
I get the following response from a DEC person.
>>ccom: Warning: genimg.c, line 218: illegal combination of pointer and integer,>>op =
>>inmapped=mmap((caddr_t)0, (dimx*dimy*dimz*bits)-1 , 0x1 , 1 , fd, (off_t)
>>0);
>> ------------------------------------------------------------------------------------------------
>>--^
>The warning is likely due to the fact that mmap is declared as returning
>caddr_t on SGI and not at all under MIPS Ultrix (which I assume your using,
>because on DEC OSF/1 Alpha it *is* declared as returning caddr_t).
>>My program doesn't run on DEC.
>>
>>Do anyone know why?
>What are you trying to mmap ? If that's a file, that doesn't work
>at all under Ultrix, because Ultrix doesn't have memory mapped files.
That's not a good news to me.
Actually, the program isn't written by me. I guess the original
author is trying to map a protion of memeory to an output file.
Is there an equivalent function in Ultrix c which do the same
thing, or any ways to get around this?
On SGI the prototype of the function is:
extern void *mmap(void *, int, int, int, int, off_t);
Appreciate your help.
Howard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to get around memory mapped file in Ultrix
1993-04-28 14:09 how to get around memory mapped file in Ultrix Howard Wai-Chun Yeung
@ 1993-04-29 0:07 ` Alan Rollow - Alan's Home for Wayward Tumbleweeds.
1993-04-29 1:58 ` Marcus J Ranum
1993-05-03 8:29 ` Ron Jarrell
0 siblings, 2 replies; 4+ messages in thread
From: Alan Rollow - Alan's Home for Wayward Tumbleweeds. @ 1993-04-29 0:07 UTC (permalink / raw)
In article <1993Apr28.140912.4403@alw.nih.gov>, howardy@freud.nia.nih.gov (Howard Wai-Chun Yeung) writes:
>
> [ I believe this is the original author who has discovered that
> ULTRIX doesn't support mmap and family. ]
>
>That's not a good news to me.
>Actually, the program isn't written by me. I guess the original
>author is trying to map a protion of memeory to an output file.
>
>Is there an equivalent function in Ultrix c which do the same
>thing, or any ways to get around this?
It depends exactly what "this" is. If the intent is to have a
chunk of what's in memory end up in a file, then the good old
fashioned way is likely to work:
if((fd = open("file", O_WRONLY)) == -1 )
/* handle error */
else {
rc = write(fd, buffer, size) ;
if( rc != WHAT_IS_EXPECTED )
/* handle that error */
if( close(fd) == -1 )
/* Handle that error */
}
If there is more going on than simply moving bytes of memory to a file,
then a more complex solution may be necessary.
>
>
--
Alan Rollow alan@nabeth.cxo.dec.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1993-05-03 8:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-04-28 14:09 how to get around memory mapped file in Ultrix Howard Wai-Chun Yeung
1993-04-29 0:07 ` Alan Rollow - Alan's Home for Wayward Tumbleweeds.
1993-04-29 1:58 ` Marcus J Ranum
1993-05-03 8:29 ` Ron Jarrell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox