CFLAGS= -D_GNU_SOURCE
-CFLAGS+= -I/usr/include/dlog -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0
-CFLAGS+= -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -L/usr/lib
+CFLAGS+=`pkg-config --cflags glib-2.0 dbus-1 gio-2.0`
CFLAGS+=-Wall -O2 -g
-LDFLAGS= -lglib-2.0 -lgobject-2.0 -lgio-2.0 -lgmodule-2.0 -ldbus-1 -lgthread-2.0 -lpthread -lrt -lpcre
-LDFLAGS+=-lm
+LDFLAGS=`pkg-config --libs glib-2.0 dbus-1 gio-2.0`
+LDFLAGS+=-lpthread -lrt -lm
DFTSRC=benchmark/common.c
all:
const gchar *property_name,
GError **error,
gpointer user_data)
-{ }
+{ return NULL; }
static gboolean handle_set_property (GDBusConnection *connection,
const gchar *sender,
GVariant *value,
GError **error,
gpointer user_data)
-{ }
+{ return TRUE; }
static void handle_method_call (GDBusConnection *connection,
const gchar *sender,
return;
}
close(ready_fd);
- ready_ptr[0] = "n";
+ *ready_ptr = 'n';
for(int i = 0; i < nprocs/2; i++) {
if(pipe(returnp[i]) == -1) {
close(p[child/2][0]);
// Wait for parent
- while(ready_ptr[0] == "n") {
+ while (*ready_ptr == 'n') {
}
if(child % 2 == 0) {
usleep(100000);
close(p[0][1]);
- ready_ptr[0] = "y";
+ *ready_ptr = 'y';
Receive(0, p[0][0], msize, false);
close(p[0][0]);
void Receive(void *r1, register char *r2, register int size, bool is_lt)
{
static int bw_cnt = 0;
- unsigned long long start;
+ unsigned long long start = 0;
unsigned long long end;
struct timespec clock;
register char read_cnt = 0;
return;
}
close(ready_fd);
- ready_ptr[0] = "n";
+ *ready_ptr = 'n';
for(int i = 0; i < nprocs/2; i++) {
sprintf(name, "bwsharedmem%d", i);
}
// Wait for parent
- while(ready_ptr[0] == "n") {
+ while (*ready_ptr == 'n') {
}
if(child % 2 == 0) {
}
sleep(1);
- ready_ptr[0] = "y";
+ *ready_ptr = 'y';
Receive(NULL, shm_ptr[0], msize, false);
for(int child = 1; child < nprocs; child++) {
return;
}
close(ready_fd);
- ready_ptr[0] = "n";
+ *ready_ptr = 'n';
for(int i = 0; i < nprocs/2; i++) {
if(pipe(returnp[i]) == -1) {
}
// Wait for parent
- while(ready_ptr[0] == "n") {
+ while (*ready_ptr == 'n') {
}
if(child % 2 == 0) {
}
sleep(1);
- ready_ptr[0] = "y";
+ *ready_ptr = 'y';
Receive(0, fd[0][1], msize, false);
close(fd[0][1]);