comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Lorenzen <mark.lorenzen@ofir.dk>
Subject: Re: POSIX.Memory_Mapping.Map_Memory
Date: 29 Jan 2005 19:44:36 +0100
Date: 2005-01-29T19:44:36+01:00	[thread overview]
Message-ID: <m3fz0kkrcb.fsf@0x50a5b1db.boanxx18.adsl-dhcp.tele.dk> (raw)
In-Reply-To: 1107016260.265640.138990@z14g2000cwz.googlegroups.com

"Adrian Hoe" <byhoe@greenlime.com> writes:

> Mark Lorenzen wrote:
> > "Adrian Hoe" <byhoe@greenlime.com> writes:
> >
> > > Hi,
> > >
> > > I am working on video_device with Video_4_Linux based on the work
> of
> > > Anders Gidenstam. According to latest V4L documentation, capturing
> with
> > > Read has been deprecated and the only method now is by the use of
> mmap.
> >
> 
> >>>> snip <<<<
> 
> 
> > > Device.Fd := Open (To_POSIX_String (File_Name),
> > > Read_Only);
> >
> > You open the device in read-only.
> >
> > [cut]
> >
> > >
> > > -- Permission Denied exception was raised here at the line below!!!
> > > Map := Map_Memory (System.Storage_Elements.Storage_Offset
> > > (Buf_Size),
> > > POSIX.Memory_Mapping.Allow_Read +
> > > POSIX.Memory_Mapping.Allow_Write,
> > > POSIX.Memory_Mapping.Map_Shared,
> > > Device.Fd,
> > > 0);
> >
> > But you try to map it in read/write mode.
> 
> I open with Read_Write option and raised POSIX.POSIX_ERROR :
> INVALID_ARGUMENT at the same line.

In the way you are using Map_Memeory, it is probably because the value
of Offset (i.e. 0) is not page aligned.

On many implementations, you can only map a multiple of the page size
and the memory has to be page aligned.

> 
> > Maybe thats the case of the exception. Do you have to be root in
> order
> > to open the device at all?
> 
> 
> No, I don't have to be root to open the device. Some applications are
> able to open it and the camera and video card work.
> 
> 
> 
> --
> Adrian Hoe

- Mark Lorenzen



  reply	other threads:[~2005-01-29 18:44 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     ` Mark Lorenzen [this message]
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               ` POSIX.Memory_Mapping.Map_Memory Mark Lorenzen
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