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
d15b0b57
Commit
d15b0b57
authored
May 05, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB portability fix: new function os_file_set_eof()
parent
e51887b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
6 deletions
+27
-6
innobase/include/os0file.h
innobase/include/os0file.h
+8
-0
innobase/os/os0file.c
innobase/os/os0file.c
+17
-0
innobase/srv/srv0srv.c
innobase/srv/srv0srv.c
+1
-5
sql/ha_innodb.cc
sql/ha_innodb.cc
+1
-1
No files found.
innobase/include/os0file.h
View file @
d15b0b57
...
...
@@ -227,6 +227,14 @@ os_file_set_size(
size */
ulint
size_high
);
/* in: most significant 32 bits of size */
/***************************************************************************
Truncates a file at its current position. */
ibool
os_file_set_eof
(
/*============*/
/* out: TRUE if success */
FILE
*
file
);
/* in: file to be truncated */
/***************************************************************************
Flushes the write buffers of a given file to the disk. */
ibool
...
...
innobase/os/os0file.c
View file @
d15b0b57
...
...
@@ -1031,6 +1031,23 @@ os_file_set_size(
return
(
FALSE
);
}
/***************************************************************************
Truncates a file at its current position. */
ibool
os_file_set_eof
(
/*============*/
/* out: TRUE if success */
FILE
*
file
)
/* in: file to be truncated */
{
#ifdef __WIN__
HANDLE
h
=
(
HANDLE
)
_get_osfhandle
(
fileno
(
file
));
return
(
SetEndOfFile
(
h
));
#else
/* __WIN__ */
return
(
!
ftruncate
(
fileno
(
file
),
ftell
(
file
)));
#endif
/* __WIN__ */
}
/***************************************************************************
Flushes the write buffers of a given file to the disk. */
...
...
innobase/srv/srv0srv.c
View file @
d15b0b57
...
...
@@ -1609,11 +1609,7 @@ srv_lock_timeout_and_monitor_thread(
mutex_enter
(
&
srv_monitor_file_mutex
);
rewind
(
srv_monitor_file
);
srv_printf_innodb_monitor
(
srv_monitor_file
);
#ifdef __WIN__
chsize
(
fileno
(
srv_monitor_file
),
ftell
(
srv_monitor_file
));
#else
/* __WIN__ */
ftruncate
(
fileno
(
srv_monitor_file
),
ftell
(
srv_monitor_file
));
#endif
/* __WIN__ */
os_file_set_eof
(
srv_monitor_file
);
mutex_exit
(
&
srv_monitor_file_mutex
);
if
(
srv_print_innodb_tablespace_monitor
...
...
sql/ha_innodb.cc
View file @
d15b0b57
...
...
@@ -4648,7 +4648,7 @@ innodb_show_status(
rewind
(
srv_monitor_file
);
srv_printf_innodb_monitor
(
srv_monitor_file
);
flen
=
ftell
(
srv_monitor_file
);
my_chsize
(
fileno
(
srv_monitor_file
),
flen
,
0
,
MYF
(
0
)
);
os_file_set_eof
(
srv_monitor_file
);
if
(
flen
>
64000
-
1
)
{
flen
=
64000
-
1
;
}
...
...
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