comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Lorenzen <mark.lorenzen@ofir.dk>
Subject: Re: POSIX.Memory_Mapping.Map_Memory
Date: 30 Jan 2005 17:36:48 +0100
Date: 2005-01-30T17:36:48+01:00	[thread overview]
Message-ID: <m3fz0ic1r3.fsf@0x5358c0df.boanxx18.adsl-dhcp.tele.dk> (raw)
In-Reply-To: m3oef6c2ke.fsf@0x5358c0df.boanxx18.adsl-dhcp.tele.dk

Mark Lorenzen <mark.lorenzen@ofir.dk> writes:

> "Adrian Hoe" <byhoe@greenlime.com> writes:
> 
> > Mark Lorenzen wrote:
> > >
> > > I corrected the above mentioned problem and successfully opened and
> > > mapped a file. Strange.
> > 
> > Yes. I made a mistake. It should be:
> > 
> > if (buf == MAP_FAILED)
> > 
> > and it gave me error as well. And the strace says:
> > 
> > open("/dev/video0", O_RDWR)             = 3
> > mmap2(NULL, 230400, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = -1 EINVAL
> 
> I was just wondering: Is it allowed to map a device file as shared
> memory? Try to use MAP_PRIVATE instead of MAP_SHARED.

Furthermore: I do not think that it is possible to map character
special files, since it only allows sequential access. You can
probably only map block special files.

> 
> > (Invalid argument)
> > fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
> > m
> > 
> > mmap gives EINVAL in my C and Ada programs.
> > --
> > Adrian Hoe
> 
> - Mark Lorenzen



  reply	other threads:[~2005-01-30 16:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-29 15:58 POSIX.Memory_Mapping.Map_Memory Adrian Hoe
2005-01-29 16:20 ` POSIX.Memory_Mapping.Map_Memory Mark Lorenzen
2005-01-29 16:31   ` POSIX.Memory_Mapping.Map_Memory Adrian Hoe
2005-01-29 18:44     ` POSIX.Memory_Mapping.Map_Memory Mark Lorenzen
2005-01-30  2:45       ` POSIX.Memory_Mapping.Map_Memory Adrian Hoe
2005-01-30  2:48         ` POSIX.Memory_Mapping.Map_Memory Adrian Hoe
2005-01-30 15:39         ` POSIX.Memory_Mapping.Map_Memory Mark Lorenzen
2005-01-30 16:02           ` POSIX.Memory_Mapping.Map_Memory Adrian Hoe
2005-01-30 16:19             ` POSIX.Memory_Mapping.Map_Memory Mark Lorenzen
2005-01-30 16:36               ` Mark Lorenzen [this message]
2005-01-30 18:51                 ` POSIX.Memory_Mapping.Map_Memory Florian Weimer
2005-02-27  6:59                   ` POSIX.Memory_Mapping.Map_Memory Adrian Hoe
2005-02-27 13:03                     ` POSIX.Memory_Mapping.Map_Memory Mark Lorenzen
2005-01-30 16:05           ` POSIX.Memory_Mapping.Map_Memory Adrian Hoe
2005-01-30 16:22             ` POSIX.Memory_Mapping.Map_Memory Mark Lorenzen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox