From 80ed64e2245d6604b0052d4fe3c8e537e7975e76 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 4 Jan 2012 19:08:45 +0530 Subject: c_pgms/threaded_io: changes to take arguments from user Changes to take the working directory and the time duration for which the test has to run from the user. Change-Id: I2d56b0b0b640675dd52f4f3a6f17229e3cdf5d1a Signed-off-by: Raghavendra Bhat --- c_pgms/threaded_io/thread_fops.h | 52 ++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 20 deletions(-) (limited to 'c_pgms/threaded_io/thread_fops.h') diff --git a/c_pgms/threaded_io/thread_fops.h b/c_pgms/threaded_io/thread_fops.h index 44479e6..545145d 100644 --- a/c_pgms/threaded_io/thread_fops.h +++ b/c_pgms/threaded_io/thread_fops.h @@ -9,6 +9,8 @@ #include #include #include +#include +#include void * open_thread (void *); void * fstat_thread (void *); @@ -68,28 +70,38 @@ typedef struct open_fstat oft; } \ } while (0); +#ifndef UNIX_PATH_MAX +#define UNIX_PATH_MAX 4096 +#endif + typedef struct info { pthread_mutex_t mutex; - unsigned int num_open; - unsigned int num_open_success; - unsigned int flocks; - unsigned int flocks_success; - unsigned int fcntl_locks; - unsigned int fcntl_locks_success; - unsigned int read; - unsigned int read_success; - unsigned int write; - unsigned int write_success; - unsigned int fstat; - unsigned int fstat_success; - unsigned int truncate; - unsigned int truncate_success; - unsigned int chown; - unsigned int chown_success; - unsigned int opendir; - unsigned int opendir_success; - unsigned int readdir; - unsigned int readdir_success; + unsigned long long num_open; + unsigned long long num_open_success; + unsigned long long flocks; + unsigned long long flocks_success; + unsigned long long fcntl_locks; + unsigned long long fcntl_locks_success; + unsigned long long read; + unsigned long long read_success; + unsigned long long write; + unsigned long long write_success; + unsigned long long fstat; + unsigned long long fstat_success; + unsigned long long truncate; + unsigned long long truncate_success; + unsigned long long chown; + unsigned long long chown_success; + unsigned long long opendir; + unsigned long long opendir_success; + unsigned long long readdir; + unsigned long long readdir_success; } info_t; +typedef struct +{ + char directory[UNIX_PATH_MAX]; + unsigned long long time; +} thread_config_t; + info_t info = {0,}; -- cgit