Closed Bug 362246 Opened 18 years ago Closed 18 years ago

Support large files (>= 2GB) on Mac OS X.

Categories

(NSPR :: NSPR, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

NSPR should support large files (>= 2GB) on Mac OS X.

If the type off_t is 8 bytes on all versions of Mac OS
X, this should be as simple as defining
_PR_HAVE_LARGE_OFF_T instead of _PR_NO_LARGE_FILES in
mozilla/nsprpub/pr/include/md/_darwin.h.
Attached patch Proposed patchSplinter Review
All, please start running Firefox and Thunderbird with this
patch on Mac OS X.

Mark, if you don't want to trace the NSPR Unix file I/O code,
I suggest that you review this patch this way:
1. verify that the type off_t is 8 bytes on all versions
of Mac OS X.
2. http://lxr.mozilla.org/nspr/search?string=_PR_HAVE_LARGE_OFF_T
shows that OSF1 and Linux (on Alpha and IA-64 only) are the only
two platforms that define _PR_HAVE_LARGE_OFF_T.  Study _osf1.h
and _linux.h to convince yourself that there are no other related
macros that we need to define.
Attachment #246954 - Flags: review?(mark)
once I did a make clean and then make in nsprpub, this patch fixed the problems I was having with > 2GB files on OS/X, 10.4
Status: NEW → ASSIGNED
Target Milestone: --- → 4.6.5
QA Contact: wtchang → nspr
Comment on attachment 246954 [details] [diff] [review]
Proposed patch

Mark, David, could you review this patch?  Thanks.

The _PR_HAVE_LARGE_OFF_T macro means 'the off_t type is 64-bit'.
We just need to verify that this is the case on all versions of
Mac OS X.
Attachment #246954 - Flags: superreview?(bienvenu)
Comment on attachment 246954 [details] [diff] [review]
Proposed patch

The _PR_NO_LARGE_FILES macro means "the off_t type is 32-bit
and there is no off64_t type".

Each Unix platform must define one of _PR_NO_LARGE_FILES,
__PR_HAVE_OFF64_T, and  _PR_HAVE_LARGE_OFF_T.
Comment on attachment 246954 [details] [diff] [review]
Proposed patch

this looks fine to me, but I've only tried it on OS/X 10.4 - for the 1.8.1 branch, as I understand it, it would need to work for 10.2,3, and 4, and for the trunk, 10.3 and up.
Attachment #246954 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 246954 [details] [diff] [review]
Proposed patch

off_t has always been 64 bits on Mac OS X for all architectures.

This looks like all that's needed to me.
Attachment #246954 - Flags: review?(mark) → review+
Thank you for the code review.

I checked in the patch on the NSPR trunk (NSPR 4.7), NSPR_4_6_BRANCH
(NSPR 4.6.5), and NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla 1.9 Alpha 2).

Checking in _darwin.h;
/cvsroot/mozilla/nsprpub/pr/include/md/_darwin.h,v  <--  _darwin.h
new revision: 3.20; previous revision: 3.19
done

Checking in _darwin.h;
/cvsroot/mozilla/nsprpub/pr/include/md/_darwin.h,v  <--  _darwin.h
new revision: 3.18.2.2; previous revision: 3.18.2.1
done

Checking in _darwin.h;
/cvsroot/mozilla/nsprpub/pr/include/md/_darwin.h,v  <--  _darwin.h
new revision: 3.10.4.10; previous revision: 3.10.4.9
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: