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 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!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail From: "Adrian Hoe" Newsgroups: comp.lang.ada Subject: Re: POSIX.Memory_Mapping.Map_Memory Date: 30 Jan 2005 08:02:33 -0800 Organization: http://groups.google.com Message-ID: <1107100953.572623.128530@f14g2000cwb.googlegroups.com> References: <1107014307.952357.216870@f14g2000cwb.googlegroups.com> <1107016260.265640.138990@z14g2000cwz.googlegroups.com> <1107053159.644479.173850@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: 219.95.187.180 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1107100957 8961 127.0.0.1 (30 Jan 2005 16:02:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 30 Jan 2005 16:02:37 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=219.95.187.180; posting-account=LKUaWwwAAABzCo8SD2jIIt5LtkPzH8ot Xref: g2news1.google.com comp.lang.ada:8078 Date: 2005-01-30T08:02:33-08:00 List-Id: 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 (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