Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
8be12026
Commit
8be12026
authored
Jun 23, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmap: use a 64-bit signed type `off64_t` for mmap
Prefer `off64_t` to `git_off_t` for internal visibility.
parent
7e1cc296
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
7 deletions
+19
-7
src/futils.c
+1
-1
src/futils.h
+1
-1
src/map.h
+1
-1
src/posix.c
+1
-1
src/posix.h
+12
-0
src/win32/map.c
+3
-3
No files found.
src/futils.c
View file @
8be12026
...
...
@@ -307,7 +307,7 @@ int git_futils_mv_withpath(const char *from, const char *to, const mode_t dirmod
return
0
;
}
int
git_futils_mmap_ro
(
git_map
*
out
,
git_file
fd
,
git_off
_t
begin
,
size_t
len
)
int
git_futils_mmap_ro
(
git_map
*
out
,
git_file
fd
,
off64
_t
begin
,
size_t
len
)
{
return
p_mmap
(
out
,
len
,
GIT_PROT_READ
,
GIT_MAP_SHARED
,
fd
,
begin
);
}
...
...
src/futils.h
View file @
8be12026
...
...
@@ -290,7 +290,7 @@ extern mode_t git_futils_canonical_mode(mode_t raw_mode);
extern
int
git_futils_mmap_ro
(
git_map
*
out
,
git_file
fd
,
git_off
_t
begin
,
off64
_t
begin
,
size_t
len
);
/**
...
...
src/map.h
View file @
8be12026
...
...
@@ -40,7 +40,7 @@ typedef struct { /* memory mapped buffer */
assert((prot & GIT_PROT_WRITE) || (prot & GIT_PROT_READ)); \
assert((flags & GIT_MAP_FIXED) == 0); } while (0)
extern
int
p_mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
git_off
_t
offset
);
extern
int
p_mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
off64
_t
offset
);
extern
int
p_munmap
(
git_map
*
map
);
#endif
src/posix.c
View file @
8be12026
...
...
@@ -235,7 +235,7 @@ int git__mmap_alignment(size_t *alignment)
}
int
p_mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
git_off
_t
offset
)
int
p_mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
off64
_t
offset
)
{
GIT_MMAP_VALIDATE
(
out
,
len
,
prot
,
flags
);
...
...
src/posix.h
View file @
8be12026
...
...
@@ -89,6 +89,18 @@
#define EAFNOSUPPORT (INT_MAX-1)
#endif
/* Provide a 64-bit size for offsets. */
#if defined(_MSC_VER)
typedef
__int64
off64_t
;
#elif defined(__HAIKU__)
typedef
__haiku_std_int64
off64_t
;
#elif defined(__APPLE__)
typedef
__int64_t
off64_t
;
#else
typedef
int64_t
off64_t
;
#endif
typedef
int
git_file
;
/**
...
...
src/win32/map.c
View file @
8be12026
...
...
@@ -50,7 +50,7 @@ int git__mmap_alignment(size_t *page_size)
return
0
;
}
int
p_mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
git_off
_t
offset
)
int
p_mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
off64
_t
offset
)
{
HANDLE
fh
=
(
HANDLE
)
_get_osfhandle
(
fd
);
DWORD
alignment
=
get_allocation_granularity
();
...
...
@@ -58,8 +58,8 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
DWORD
view_prot
=
0
;
DWORD
off_low
=
0
;
DWORD
off_hi
=
0
;
git_off
_t
page_start
;
git_off
_t
page_offset
;
off64
_t
page_start
;
off64
_t
page_offset
;
GIT_MMAP_VALIDATE
(
out
,
len
,
prot
,
flags
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment