Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
darshan
darshan
Commits
0461e398
Commit
0461e398
authored
May 23, 2016
by
Philip Carns
Browse files
freopen64 wrapper
parent
6c43ebe8
Changes
2
Show whitespace changes
Inline
Side-by-side
darshan-runtime/lib/darshan-stdio.c
View file @
0461e398
...
...
@@ -27,7 +27,7 @@
* FILE *fopen(const char *, const char *); DONE
* FILE *fopen64(const char *, const char *); DONE
* FILE *freopen(const char *, const char *, FILE *); DONE
* FILE *freopen64(const char *, const char *, FILE *);
* FILE *freopen64(const char *, const char *, FILE *);
DONE
*
* functions for closing streams
* --------------
...
...
@@ -103,6 +103,7 @@ DARSHAN_FORWARD_DECL(fopen, FILE*, (const char *path, const char *mode));
DARSHAN_FORWARD_DECL
(
fopen64
,
FILE
*
,
(
const
char
*
path
,
const
char
*
mode
));
DARSHAN_FORWARD_DECL
(
fdopen
,
FILE
*
,
(
int
fd
,
const
char
*
mode
));
DARSHAN_FORWARD_DECL
(
freopen
,
FILE
*
,
(
const
char
*
path
,
const
char
*
mode
,
FILE
*
stream
));
DARSHAN_FORWARD_DECL
(
freopen64
,
FILE
*
,
(
const
char
*
path
,
const
char
*
mode
,
FILE
*
stream
));
DARSHAN_FORWARD_DECL
(
fclose
,
int
,
(
FILE
*
fp
));
DARSHAN_FORWARD_DECL
(
fflush
,
int
,
(
FILE
*
fp
));
DARSHAN_FORWARD_DECL
(
fwrite
,
size_t
,
(
const
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
FILE
*
stream
));
...
...
@@ -357,6 +358,26 @@ FILE* DARSHAN_DECL(freopen)(const char *path, const char *mode, FILE *stream)
return
(
ret
);
}
FILE
*
DARSHAN_DECL
(
freopen64
)(
const
char
*
path
,
const
char
*
mode
,
FILE
*
stream
)
{
FILE
*
ret
;
double
tm1
,
tm2
;
MAP_OR_FAIL
(
freopen64
);
tm1
=
darshan_core_wtime
();
ret
=
__real_freopen64
(
path
,
mode
,
stream
);
tm2
=
darshan_core_wtime
();
STDIO_LOCK
();
stdio_runtime_initialize
();
STDIO_RECORD_OPEN
(
ret
,
path
,
tm1
,
tm2
);
STDIO_UNLOCK
();
return
(
ret
);
}
int
DARSHAN_DECL
(
fflush
)(
FILE
*
fp
)
{
double
tm1
,
tm2
;
...
...
darshan-runtime/share/ld-opts/darshan-stdio-ld-opts
View file @
0461e398
...
...
@@ -3,6 +3,7 @@
--wrap=fopen64
--wrap=fdopen
--wrap=freopen
--wrap=freopen64
--wrap=fflush
--wrap=fclose
--wrap=fwrite
...
...
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