From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,6152301aee98ab34 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1014db,6152301aee98ab34 X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 1993-04-28 17:15:50 PST Xref: gmd.de comp.sys.dec:7354 comp.lang.c:20745 Newsgroups: comp.sys.dec,comp.lang.c Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nabeth.cxo.dec.com!alan From: alan@nabeth.cxo.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.) Subject: Re: how to get around memory mapped file in Ultrix Message-ID: <1993Apr29.000705.26981@nntpd2.cxo.dec.com> Sender: usenet@nntpd2.cxo.dec.com (USENET News System) Reply-To: alan@nabeth.cxo.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.) Organization: Digital Equipment Corporation References: <1993Apr28.140912.4403@alw.nih.gov> Date: Thu, 29 Apr 1993 00:07:05 GMT 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