[Mono-dev] Syscall.mmap problem

Mauricio Henriquez mhenriquezs at terra.cl
Thu Oct 25 15:07:14 EDT 2007


about the Syscall.mmap function call, if I ask for the 
Mono.Unix.Native.Stdlib.GetLastError(), I get a
EOVERFLOW error message.
what can I do to solve this or give you a better bug report?

thanks

Mauricio

Mauricio Henriquez wrote:
> Hi to all:
>
> I trying to help to Tim Taubert in they implementation of 
> Video4Linux.Net and now I have problems with the Syscall.mmap function, 
> so I traslate a C mmap working example  code and allways crash, here is 
> my code:
>
>     int fdin;
>             IntPtr start;
>             Mono.Unix.Native.Stat statbuf;
>             long len;
>             if((fdin = Syscall.open("/pr.txt",  OpenFlags.O_RDONLY)) < 0)
>                 Console.WriteLine("open crash");
>             else
>                 Console.WriteLine("open fine");
>            
>             if((Syscall.fstat(fdin, out statbuf)) < 0)
>                 Console.WriteLine("fstat crash");
>             else
>                 Console.WriteLine("fstat ok");
>            
>             len = statbuf.st_size;
>             //file lenght is 6, I test this with a mmap C code
>             Console.WriteLine("length = {0}", len); //OK
>            
>             start = Syscall.mmap
>                 (IntPtr.Zero,
>                  (ulong)len,
>                  MmapProts.PROT_READ,
>                  MmapFlags.MAP_PRIVATE,
>                  fdin,
>                  0);
>             Console.WriteLine(start.ToString());
>             if (start == Syscall.MAP_FAILED)
>                 throw new Exception("mmap crash.");
>
> do you see some mistake?, I use Fedora 5 with mono-1.2.5.1, may be you 
> can send me a workin Mono.Posix or Mono.Unix dll, becouse I prefer don't 
> compile all mono stuff only for this dll, becouse all other stuff work 
> perfectly.
>
> In advance, thank you very much.
>
> Mauricio Henriquez
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>   




More information about the Mono-devel-list mailing list