Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5d6365d0
Commit
5d6365d0
authored
Jul 08, 2005
by
petr@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply Guilhem's patch (mmap->my_mmap, munmap->my_munmap in ha_tina) to improve
portability.
parent
e98959df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
sql/examples/ha_tina.cc
sql/examples/ha_tina.cc
+10
-9
No files found.
sql/examples/ha_tina.cc
View file @
5d6365d0
...
...
@@ -79,7 +79,8 @@ static byte* tina_get_key(TINA_SHARE *share,uint *length,
int
get_mmap
(
TINA_SHARE
*
share
,
int
write
)
{
DBUG_ENTER
(
"ha_tina::get_mmap"
);
if
(
share
->
mapped_file
&&
munmap
(
share
->
mapped_file
,
share
->
file_stat
.
st_size
))
if
(
share
->
mapped_file
&&
my_munmap
(
share
->
mapped_file
,
share
->
file_stat
.
st_size
))
DBUG_RETURN
(
1
);
if
(
my_fstat
(
share
->
data_file
,
&
share
->
file_stat
,
MYF
(
MY_WME
))
==
-
1
)
...
...
@@ -88,13 +89,13 @@ int get_mmap(TINA_SHARE *share, int write)
if
(
share
->
file_stat
.
st_size
)
{
if
(
write
)
share
->
mapped_file
=
(
byte
*
)
m
map
(
NULL
,
share
->
file_stat
.
st_size
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
share
->
data_file
,
0
);
share
->
mapped_file
=
(
byte
*
)
m
y_mmap
(
NULL
,
share
->
file_stat
.
st_size
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
share
->
data_file
,
0
);
else
share
->
mapped_file
=
(
byte
*
)
m
map
(
NULL
,
share
->
file_stat
.
st_size
,
PROT_READ
,
MAP_PRIVATE
,
share
->
data_file
,
0
);
share
->
mapped_file
=
(
byte
*
)
m
y_mmap
(
NULL
,
share
->
file_stat
.
st_size
,
PROT_READ
,
MAP_PRIVATE
,
share
->
data_file
,
0
);
if
((
share
->
mapped_file
==
(
caddr_t
)
-
1
))
{
/*
...
...
@@ -202,7 +203,7 @@ static int free_share(TINA_SHARE *share)
if
(
!--
share
->
use_count
){
/* Drop the mapped file */
if
(
share
->
mapped_file
)
munmap
(
share
->
mapped_file
,
share
->
file_stat
.
st_size
);
m
y_m
unmap
(
share
->
mapped_file
,
share
->
file_stat
.
st_size
);
result_code
=
my_close
(
share
->
data_file
,
MYF
(
0
));
hash_delete
(
&
tina_open_tables
,
(
byte
*
)
share
);
thr_lock_delete
(
&
share
->
lock
);
...
...
@@ -760,7 +761,7 @@ int ha_tina::rnd_end()
if
(
my_chsize
(
share
->
data_file
,
length
,
0
,
MYF
(
MY_WME
)))
DBUG_RETURN
(
-
1
);
if
(
munmap
(
share
->
mapped_file
,
length
))
if
(
m
y_m
unmap
(
share
->
mapped_file
,
length
))
DBUG_RETURN
(
-
1
);
/* We set it to null so that get_mmap() won't try to unmap it */
...
...
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