Skip to content

Instantly share code, notes, and snippets.

@kerie
Created November 19, 2010 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerie/706805 to your computer and use it in GitHub Desktop.
Save kerie/706805 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<stdlib.h>
#include<sys/unistd.h>
#include<fcntl.h>
int main()
{
char yourmsg[1000];
int h=open("/dev/rwbuf", O_RDONLY);
if(h<0)
printf("Error opening the device.\n");
int n=read(h, yourmsg, sizeof(yourmsg));
if(n<0)
printf("Error reading the device.\n")
int i;
for(i=0; i<8; i++)
printf("%c ", yourmsg[i]);
close(h);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment