esound r513 - trunk
- From: jmouette svn gnome org
- To: svn-commits-list gnome org
- Subject: esound r513 - trunk
- Date: Tue, 18 Nov 2008 20:12:20 +0000 (UTC)
Author: jmouette
Date: Tue Nov 18 20:12:20 2008
New Revision: 513
URL: http://svn.gnome.org/viewvc/esound?rev=513&view=rev
Log:
* esddsp.c: (mmap64): ship an implementation of mmap64.
Modified:
trunk/ChangeLog
trunk/esddsp.c
Modified: trunk/esddsp.c
==============================================================================
--- trunk/esddsp.c (original)
+++ trunk/esddsp.c Tue Nov 18 20:12:20 2008
@@ -680,6 +680,33 @@
return (void *)-1;
}
+void *
+mmap64 (void *start, size_t length, int prot, int flags, int fd, off64_t offset)
+{
+ static void *(*func) (void *, size_t, int, int, int, off64_t) = NULL;
+
+ if (!func)
+ func = (void * (*) (void *, size_t, int, int, int, off64_t)) dlsym (REAL_LIBC, "mmap64");
+
+ if(fd != sndfd || sndfd == -1)
+ return (*func)(start,length,prot,flags,fd,offset);
+ else
+ {
+ DPRINTF ("esddsp: mmap64 - start = %x, length = %d, prot = %d\n",
+ start, length, prot);
+ DPRINTF (" flags = %d, fd = %d, offset = %lld\n",flags, fd,offset);
+ if(mmapemu)
+ {
+ mmapemu_osize = length;
+ mmapemu_obuffer = malloc(length);
+ mmapemu_ocount.ptr = mmapemu_ocount.blocks = mmapemu_ocount.bytes = 0;
+ return mmapemu_obuffer;
+ }
+ else DPRINTF ("esddsp: /dev/dsp mmap64 (unsupported, try -m option)...\n");
+ }
+ return (void *)-1;
+}
+
int
munmap (void *start, size_t length)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]