Hi,everyone: The function mmap(....) appears several times in madplay.c and minimad.c .I don't know what the function will exactly do ,bu I think it's related with paging ? But I want to port mad to a simple system so there is no such complex function call available.My question is how can I write someting to replace mmap function call. Can I just allocate a mem buffer and read the file to the buffer and using the pointer to buffer as void * fdm in the main()? I try it but it seems to cause some error.When I decode to the almost end of a mp3 file ,it will sometimes report 0x0101 error.
/* fdm = mmap(0, stat.st_size, PROT_READ, MAP_SHARED, STDIN_FILENO, 0);*/ fdm = malloc(stat.st_size); inputstream = fdopen(STDIN_FILENO,"r"); fread(fdm,sizeof(char),stat.st_size,inputstream);
Can someone give me some help?
Many many thanks.