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
71
Issues
71
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
9930d72a
Commit
9930d72a
authored
May 23, 2016
by
Philip Carns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fdopen wrapper
parent
11c80b44
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
darshan-runtime/lib/darshan-stdio.c
darshan-runtime/lib/darshan-stdio.c
+22
-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 @
9930d72a
...
...
@@ -15,6 +15,7 @@
* - POSIX_FREADS
* - POSIX_FWRITES
* - POSIX_FSEEKS
* - add regression test cases for all functions captured here
*/
/* catalog of stdio functions instrumented by this module
...
...
@@ -22,7 +23,7 @@
* functions for opening streams
* --------------
* FILE *fdopen(int, const char *); DONE
* FILE *fopen(const char *, const char *);
* FILE *fopen(const char *, const char *);
DONE
* FILE *freopen(const char *, const char *, FILE *);
*
* functions for closing streams
...
...
@@ -92,6 +93,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
(
fclose
,
int
,
(
FILE
*
fp
));
DARSHAN_FORWARD_DECL
(
fwrite
,
size_t
,
(
const
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
FILE
*
stream
));
DARSHAN_FORWARD_DECL
(
fread
,
size_t
,
(
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
FILE
*
stream
));
...
...
@@ -253,6 +255,25 @@ static void stdio_shutdown(void);
DARSHAN_TIMER_INC_NO_OVERLAP(file->file_record->fcounters[STDIO_F_WRITE_TIME], __tm1, __tm2, file->last_write_end); \
} while(0)
FILE
*
DARSHAN_DECL
(
fdopen
)(
int
fd
,
const
char
*
mode
)
{
FILE
*
ret
;
double
tm1
,
tm2
;
MAP_OR_FAIL
(
fdopen
);
tm1
=
darshan_core_wtime
();
ret
=
__real_fdopen
(
fd
,
mode
);
tm2
=
darshan_core_wtime
();
STDIO_LOCK
();
stdio_runtime_initialize
();
STDIO_RECORD_OPEN
(
ret
,
"UNKNOWN-FDOPEN"
,
tm1
,
tm2
);
STDIO_UNLOCK
();
return
(
ret
);
}
FILE
*
DARSHAN_DECL
(
fopen
)(
const
char
*
path
,
const
char
*
mode
)
{
FILE
*
ret
;
...
...
darshan-runtime/share/ld-opts/darshan-stdio-ld-opts
View file @
9930d72a
--undefined=__wrap_fopen
--wrap=fopen
--wrap=fopen64
--wrap=fdopen
--wrap=fclose
--wrap=fwrite
--wrap=fread
...
...
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