[FFmpeg-devel] [PATCH] libswscale: Fix the anonymous memory mapping in sws_GetContext for NetBSD when MMX2 optimisations are enabled.

Michael Niedermayer michaelni
Fri Aug 20 00:37:36 CEST 2010


On Thu, Aug 19, 2010 at 12:47:22PM +0200, Grant Carver wrote:
> > On Thu, Aug 19, 2010 at 08:19:24AM +0200, Grant Carver wrote:
> > > Hi there
> > >
> > > Creation of a swscale context was failing on NetBSD due to the
> > > anonymous mmap call failing. It seems that if the MAP_ANONYMOUS flag
> > > is specified some BSD flavours require the file descriptor to be -1,
> > > whilst on linux this parameter is just ignored.
> > 
> > where is this documented or is it a bug?
> 
> The man page for NetBSD
> (http://netbsd.gw.com/cgi-bin/man-cgi?mmap++NetBSD-current) and FreeBSD
> (http://nixdoc.net/man-pages/FreeBSD/mmap.2.html) contain the following:
> 
> ----
> mmap() will fail if:
> ....
> [EINVAL]  MAP_FIXED was specified and the addr parameter was not
>           page aligned or was outside of the valid address range
>           for a process.  MAP_ANON was specified and fd was not
>           -1.

ok, then chaning them to -1 is probably ok.
you might want to mail the linux mmap manpage maintainers they could add a
note about portability (or start a flamewar about which way is right :)))


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100820/017518d6/attachment.pgp>



More information about the ffmpeg-devel mailing list