Commit b2b9fcbe authored by Shane Snyder's avatar Shane Snyder

forgot new util files

parent 694c6a9a
/*
* (C) 2009 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#define _GNU_SOURCE
#include "darshan-util-config.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include "darshan-posix-logutils.h"
int darshan_log_get_posix_file(darshan_fd fd, struct darshan_posix_file *file)
{
int i;
int ret;
/* reset file record, so that diff compares against a zero'd out record
* if file is missing
*/
memset(file, 0, sizeof(*file));
ret = darshan_log_get_moddat(fd, DARSHAN_POSIX_MOD,
(void *)file, sizeof(*file));
if(ret == 1)
{
if(fd->swap_flag)
{
/* swap bytes if necessary */
DARSHAN_BSWAP64(&file->f_id);
DARSHAN_BSWAP64(&file->rank);
for(i=0; i<CP_NUM_INDICES; i++)
DARSHAN_BSWAP64(&file->counters[i]);
for(i=0; i<CP_F_NUM_INDICES; i++)
DARSHAN_BSWAP64(&file->fcounters[i]);
}
}
return(ret);
}
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
/*
* (C) 2009 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef __DARSHAN_POSIX_LOG_UTILS_H
#define __DARSHAN_POSIX_LOG_UTILS_H
#include "darshan-logutils.h"
#include "darshan-posix-log-format.h"
int darshan_log_get_posix_file(darshan_fd fd, struct darshan_posix_file *file);
#endif
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