GitLab maintenance scheduled for Today, 2019-12-05, from 17:00 to 18:00 CT - Services will be unavailable during this time.

Commit 29641b6a authored by Philip Carns's avatar Philip Carns

putw wrapper

parent d094097c
......@@ -53,7 +53,7 @@
* int fputs(const char *, FILE *); DONE
* size_t fwrite(const void *, size_t, size_t, FILE *); DONE
* int putc(int, FILE *); DONE
* int putw(int, FILE *);
* int putw(int, FILE *); DONE
*
* functions for changing file position
* --------------
......@@ -103,6 +103,7 @@ 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));
DARSHAN_FORWARD_DECL(fputc, int, (int c, FILE *stream));
DARSHAN_FORWARD_DECL(putw, int, (int w, FILE *stream));
DARSHAN_FORWARD_DECL(fputs, int, (const char *s, FILE *stream));
DARSHAN_FORWARD_DECL(fprintf, int, (FILE *stream, const char *format, ...));
DARSHAN_FORWARD_DECL(vfprintf, int, (FILE *stream, const char *format, va_list));
......@@ -443,6 +444,27 @@ int DARSHAN_DECL(fputc)(int c, FILE *stream)
return(ret);
}
int DARSHAN_DECL(putw)(int w, FILE *stream)
{
int ret;
double tm1, tm2;
MAP_OR_FAIL(putw);
tm1 = darshan_core_wtime();
ret = __real_putw(w, stream);
tm2 = darshan_core_wtime();
STDIO_LOCK();
stdio_runtime_initialize();
if(ret != EOF)
STDIO_RECORD_WRITE(stream, sizeof(int), tm1, tm2, 0);
STDIO_UNLOCK();
return(ret);
}
int DARSHAN_DECL(fputs)(const char *s, FILE *stream)
{
......
......@@ -19,3 +19,4 @@
--wrap=vfprintf
--wrap=fputc
--wrap=fputs
--wrap=putw
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment