check transfer  0.1
Check data transfer for SDAccell OpenCL application
Functions
ipc.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <error.h>
#include <time.h>
#include <sys/ioctl.h>

Go to the source code of this file.

Functions

void IPC_delay (int ms)
 
int IPC_getch (void)
 
int IPC_getche (void)
 
long IPC_getTickCount ()
 
int IPC_kbhit (void)
 

Function Documentation

◆ IPC_delay()

void IPC_delay ( int  ms)

Definition at line 16 of file ipc.cpp.

Referenced by main().

17 {
18  struct timeval tv = {0, 0};
19  tv.tv_usec = 1000*ms;
20 
21  select(0,NULL,NULL,NULL,&tv);
22 }

◆ IPC_getch()

int IPC_getch ( void  )

Definition at line 26 of file ipc.cpp.

Referenced by IPC_getche(), and main().

27 {
28  int ch;
29 
30  while(1)
31  {
32  size_t size = 0;
33  if (ioctl(STDIN_FILENO, FIONREAD, &size) == -1)
34  size = 0;
35  if(size)
36  {
37  ch = getchar();
38  //read(0, &ch, 1);
39  //DEBUG_PRINT("%s(): ch = %d\n", __FUNCTION__, ch );
40  break;
41  }
42  }
43  return ch;
44 }

◆ IPC_getche()

int IPC_getche ( void  )

Definition at line 48 of file ipc.cpp.

References IPC_getch().

49 {
50  return IPC_getch();
51 }
int IPC_getch(void)
Definition: ipc.cpp:26

◆ IPC_getTickCount()

long IPC_getTickCount ( )

Definition at line 66 of file ipc.cpp.

Referenced by main().

67 {
68  return time(NULL) * 1000;
69 }

◆ IPC_kbhit()

int IPC_kbhit ( void  )

Definition at line 55 of file ipc.cpp.

Referenced by main().

56 {
57  size_t size = 0;
58  if (ioctl(STDIN_FILENO, FIONREAD, &size) == -1)
59  return 0;
60 
61  //DEBUG_PRINT("%s(): size = %d\n", __FUNCTION__, size );
62 
63  return size;
64 }