20 #include "pedigree/native/ipc/Ipc.h" 28 int main(
int argc,
char *argv[])
30 printf(
"IPC Test: Server, daemonising\n");
35 printf(
"Forking failed.");
41 createEndpoint(
"ipc-test");
42 IpcEndpoint *pEndpoint = getEndpoint(
"ipc-test");
44 klog(LOG_NOTICE,
"IPC Test: Server started and entering message loop.");
50 if (!recv(pEndpoint, &pRecv,
false))
54 "IPC Test: Server failed to receive a message.");
60 LOG_NOTICE,
"IPC Test: Server got message '%s'.",
66 pResponse->initialise();
67 char *pBuffer =
reinterpret_cast<char *
>(pResponse->getBuffer());
70 klog(LOG_WARNING,
"IPC Test: Server message creation failed.");
75 LOG_NOTICE,
"IPC Test: Server is writing into message %x",
78 sprintf(pBuffer,
"Server received message successfully!\n");
80 if (!send(pEndpoint, pResponse,
false))
82 LOG_WARNING,
"IPC Test: Server failed to send a response.");
89 printf(
"Successfully forked, child has PID %d\n",
id);
A standard IPC message that is less than 4 KB in size.