The issue appears to be caused by mmap no longer supporting 0-length file 
mapping in linux kernel 2.6.12. 
 
See this webpage: 
 
http://www.linuxhq.com/kernel/v2.6/12-rc1-bk6/mm/mmap.c 
 
diff -Nru a/mm/mmap.c b/mm/mmap.c 
--- a/mm/mmap.c   2005-03-10 00:38:22 -08:00 
+++ b/mm/mmap.c   2005-03-28 14:21:37 -08:00 
@@ -896,16 +896,16 @@ 
          prot |= PROT_EXEC; 
  
    if (!len) 
-      return addr; 
+      return -EINVAL; 
  
In other words in kernel 2.6.12 mmap returns EINVAL when the length to be 
mapped is 0. 
 
One workaround for this would be to create all new files with 1 byte 
(contents: \0), before mmapping them. 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to