ipc.h revision f2fc321be9b4df7748e8c31a5edd154b0177b139
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FB_IPC_H
#define _FB_IPC_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include "config.h"
#include <pthread.h>
#include "procflow.h"
#include "threadflow.h"
#include "fileobj.h"
#include "fileset.h"
#include "flowop.h"
#include "filebench.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef USE_PROCESS_MODEL
#define FILEBENCH_MEMSIZE 4096
#else
#define FILEBENCH_MEMSIZE 2048
#endif /* USE_PROCESS_MODEL */
#define FILEBENCH_NFILEOBJS FILEBENCH_MEMSIZE
#define FILEBENCH_NFILESETS FILEBENCH_MEMSIZE
#define FILEBENCH_NVARS FILEBENCH_MEMSIZE
#define FILEBENCH_FILEOBJ 0
#define FILEBENCH_PROCFLOW 1
#define FILEBENCH_THREADFLOW 2
#define FILEBENCH_FLOWOP 3
#define FILEBENCH_INTEGER 4
#define FILEBENCH_STRING 5
#define FILEBENCH_VARIABLE 6
#define FILEBENCH_FILESET 7
#define FILEBENCH_FILESETENTRY 8
#define FILEBENCH_TYPES 9
#define FILEBENCH_NSEMS 128
typedef struct filebench_shm {
char *string_ptr;
char *path_ptr;
int debug_level;
int bequiet;
int seminit;
int semid_seq;
int utid;
int log_fd;
int dump_fd;
char dump_filename[MAXPATHLEN];
int eventgen_hz;
int eventgen_q;
char fscriptname[1024];
int shm_id;
char *shm_ptr;
int allrunning;
int f_abort;
int marker;
char *string_ptrs[FILEBENCH_NVARS];
char strings[FILEBENCH_STRINGMEMORY];
char semids[FILEBENCH_NSEMS];
extern char *shmpath;
void ipc_init(void);
void *ipc_malloc(int type);
pthread_mutexattr_t *ipc_mutexattr(void);
pthread_condattr_t *ipc_condattr(void);
int ipc_semidalloc(void);
void ipc_semidfree(int semid);
char *ipc_stralloc(char *string);
char *ipc_pathalloc(char *string);
void ipc_seminit(void);
void ipc_ismdelete(void);
void ipc_cleanup(void);
extern filebench_shm_t *filebench_shm;
#ifdef __cplusplus
}
#endif
#endif /* _FB_IPC_H */