From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7e32386ac8078f13 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!not-for-mail Sender: malo@0x50a5b1db.boanxx18.adsl-dhcp.tele.dk Newsgroups: comp.lang.ada Subject: Re: POSIX.Memory_Mapping.Map_Memory References: <1107014307.952357.216870@f14g2000cwb.googlegroups.com> <1107016260.265640.138990@z14g2000cwz.googlegroups.com> From: Mark Lorenzen Date: 29 Jan 2005 19:44:36 +0100 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: TDC Totalloesninger NNTP-Posting-Host: 80.165.177.219 X-Trace: 1107024276 dtext02.news.tele.dk 158 80.165.177.219:46874 X-Complaints-To: abuse@post.tele.dk Xref: g2news1.google.com comp.lang.ada:8072 Date: 2005-01-29T19:44:36+01:00 List-Id: "Adrian Hoe" writes: > Mark Lorenzen wrote: > > "Adrian Hoe" 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