Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003791OCamlOCaml generalpublic2005-09-15 14:302007-02-21 16:19
Reporteradministrator 
Assigned Toxleroy 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.10+dev 
Summary0003791: Bug 0003790 - patch
DescriptionHi,

attached is a patch (against ocaml-3.08.3/otherlibs/bigarray/mmap_unix.c)
for the offset problem. It uses currpos of the file descriptor as
offset in mmap. But maybe it would be better to make a new function like
"bigarray_map_file_with_offset".

Best regards,

Christoph Bauer
Dipl. Inf.

LMS Deutschland GmbH
Luxemburgerstr. 7
D-67657 Kaiserslautern

T +49 631 303 22 152

mailto:Christoph.Bauer@lms-gmbh.de
http://www.lmsintl.com [^]


----------------
22d21
< #include "memory.h"
47c46
< long currpos, file_size, map_size;
---
> long currpos, file_size;
76,77d74
< map_size = file_size - currpos;
<
81c78
< if ((unsigned long) map_size % array_size != 0)
---
> if ((unsigned long) file_size % array_size != 0)
83,84c80,81
< dim[major_dim] = (unsigned long) map_size / array_size;
< array_size = map_size;
---
> dim[major_dim] = (unsigned long) file_size / array_size;
> array_size = file_size;
87c84
< if (map_size < 0 || map_size < array_size) {
---
> if (file_size < array_size) {
97c94
< addr = mmap(NULL, array_size, PROT_READ | PROT_WRITE, shared, fd, currpos);
---
> addr = mmap(NULL, array_size, PROT_READ | PROT_WRITE, shared, fd, 0);
103,107d99
< CAMLprim value ml_get_page_size( value unit ) {
< CAMLparam1( unit );
< CAMLreturn ( Val_int( getpagesize() ) );
< }
<

----------------
----------------
TagsNo tags attached.
Attached Files

- Relationships
child of 0003790closedxleroy Wish: Bigarray.*.map_file should set an offset 

-  Notes
(0003672)
xleroy (administrator)
2006-06-10 16:30

See PR#4024

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2005-11-29 13:12 doligez Relationship added child of 0003790
2005-12-15 14:07 doligez Assigned To => xleroy
2005-12-15 14:07 doligez Description Updated
2006-06-10 16:30 xleroy Note Added: 0003672
2006-06-10 16:30 xleroy Status acknowledged => resolved
2006-06-10 16:30 xleroy Resolution open => fixed
2007-02-21 16:19 xleroy Status resolved => closed
2007-02-21 16:19 xleroy Fixed in Version => 3.10+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker