-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathengine_toggle.c
36 lines (27 loc) · 913 Bytes
/
engine_toggle.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* engine_toggle.c
*/
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/neutrino.h>
#include <sys/iofunc.h>
#include <sys/dispatch.h>
#include "engine.h" // defines messages between client and server
int main(void) {
engine_toggle_msg_t msg;
int server_coid;
char return_status[256];
printf("engine_toggle.c now attempting to connect to engine.c\n");
/* find our server to get a coid*/
if ((server_coid = name_open(SERVER_NAME, 0)) == -1) {
return EXIT_FAILURE;
}
printf("engine_toggle.c successfully connected to engine.c\n");
/* send a get message to the server to get a shared memory handle from the server */
msg.type = ENGINE_TOGGLE;
MsgSend(server_coid, &msg, sizeof(msg), return_status, sizeof(return_status));
printf("engine_toggle.c returned: %s\n", return_status);
return EXIT_SUCCESS;
}