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!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!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> From: Mark Lorenzen Date: 29 Jan 2005 17:20:27 +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: 1107015627 dtext02.news.tele.dk 169 80.165.177.219:42159 X-Complaints-To: abuse@post.tele.dk Xref: g2news1.google.com comp.lang.ada:8068 Date: 2005-01-29T17:20:27+01:00 List-Id: "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. > > I open a device and read the device with the following procedures, Open > and Map_Image as below. In Procedure Map_Image, I make a call to > Map_Memory (POSIX.Memory_Mapping) and raise an exception: > > POSIX.POSIX_ERROR : PERMISSION_DENIED > > ----------------------------------------------------------------------- [cut] > 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. Maybe thats the case of the exception. Do you have to be root in order to open the device at all? [cut] > Adrian Hoe - Mark Lorenzen