[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] map a file to rtl space.
On Thu, 2 Mar 2000, Mario Teijeiro Otero wrote:
> 21/02/2000. I asked about the subject of this mail. I do this solution.
>
> On linux space:
> [...]
> flength=lseek(fd,0,SEEK_END);
> p=(char*)mbuff_alloc(M_PTR_MC,flength);
> [ if error...]
> pfichero=mmap((caddr_t)p,flength, PROT_READ,MAP_SHARED|MAP_FIXED|MAP_LOCKED,fd,0);
>
> and on rtlinux space:
> pteroMC=(char*)mbuff_alloc(M_PTR_MC,sizeMC);
> if(pteroMC==NULL){
> [....]
WHAT!? And it works?
Could you tell us what are you really trying to do?
what is "fd" - which file have you opened?
mbuff_alloc in user space returns pointer to the already mmaped area, I have
no idea what the second mmap will do.
Is it that you want to access disk file in rtl(kernel space) as a memory
mapped area? This is not going to work, or at least I would be very suprised.
Best regards,
--
Tomek