[Mono-dev] Syscall.mmap problem

Robert Jordan robertj at gmx.net
Sun Oct 28 07:31:42 EDT 2007


Mauricio Henriquez wrote:
> Please guys help me a little with this!!!, I realy need to solve this 
> weird thing to help in the Video4Linux.Net proyect....
> ..or at least tell me what kind of test do you need to help you to find 
> the source problem.

You've got an answers, so please check your SPAM folder or
look at:

http://lists.ximian.com/pipermail/mono-devel-list/2007-October/thread.html

Robert


> 
> In advance, thank you very much
> 
> Mauricio
> 
> Mauricio Henriquez wrote:
>> 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
>>>
>>>   
>>>     
>> _______________________________________________
>> 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