Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
darshan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
72
Issues
72
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
darshan
darshan
Commits
904b6dbc
Commit
904b6dbc
authored
May 23, 2016
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewind wrapper
parent
0289d4ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
darshan-runtime/lib/darshan-stdio.c
darshan-runtime/lib/darshan-stdio.c
+29
-1
darshan-runtime/share/ld-opts/darshan-stdio-ld-opts
darshan-runtime/share/ld-opts/darshan-stdio-ld-opts
+1
-0
No files found.
darshan-runtime/lib/darshan-stdio.c
View file @
904b6dbc
...
...
@@ -64,7 +64,7 @@
* int fseeko64(FILE *, off_t, int); DONE
* int fsetpos(FILE *, const fpos_t *); DONE
* int fsetpos64(FILE *, const fpos_t *); DONE
* void rewind(FILE *);
* void rewind(FILE *);
DONE
* int ungetc(int, FILE *);
*
* Omissions: _unlocked() variants of the various flush, read, and write
...
...
@@ -125,6 +125,7 @@ DARSHAN_FORWARD_DECL(fseeko, int, (FILE *stream, off_t offset, int whence));
DARSHAN_FORWARD_DECL
(
fseeko64
,
int
,
(
FILE
*
stream
,
off_t
offset
,
int
whence
));
DARSHAN_FORWARD_DECL
(
fsetpos
,
int
,
(
FILE
*
stream
,
const
fpos_t
*
pos
));
DARSHAN_FORWARD_DECL
(
fsetpos64
,
int
,
(
FILE
*
stream
,
const
fpos_t
*
pos
));
DARSHAN_FORWARD_DECL
(
rewind
,
void
,
(
FILE
*
stream
));
/* The stdio_file_runtime structure maintains necessary runtime metadata
* for the STDIO file record (darshan_stdio_record structure, defined in
...
...
@@ -744,6 +745,33 @@ char* DARSHAN_DECL(fgets)(char *s, int size, FILE *stream)
}
void
DARSHAN_DECL
(
rewind
)(
FILE
*
stream
)
{
struct
stdio_file_runtime
*
file
;
double
tm1
,
tm2
;
MAP_OR_FAIL
(
rewind
);
tm1
=
darshan_core_wtime
();
__real_rewind
(
stream
);
tm2
=
darshan_core_wtime
();
STDIO_LOCK
();
stdio_runtime_initialize
();
file
=
stdio_file_by_stream
(
stream
);
if
(
file
)
{
file
->
offset
=
0
;
DARSHAN_TIMER_INC_NO_OVERLAP
(
file
->
file_record
->
fcounters
[
STDIO_F_META_TIME
],
tm1
,
tm2
,
file
->
last_meta_end
);
file
->
file_record
->
counters
[
STDIO_SEEKS
]
+=
1
;
}
STDIO_UNLOCK
();
return
;
}
int
DARSHAN_DECL
(
fseek
)(
FILE
*
stream
,
long
offset
,
int
whence
)
{
int
ret
;
...
...
darshan-runtime/share/ld-opts/darshan-stdio-ld-opts
View file @
904b6dbc
...
...
@@ -25,3 +25,4 @@
--wrap=putw
--wrap=fsetpos
--wrap=fsetpos64
--wrap=rewind
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