Created
November 19, 2010 17:10
-
-
Save kerie/706805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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