hi,anybody,
I make a character special file device under /dev/ , then I invoke 'open'
fanction to open this special file ,but every time I can get open error(-1
value ):
process :
#mknod /dev/igwate c 127 0
#./test /dev/igwate
open error ,return value[-1]
#./test /dev/console
open ok,return value[3]
test.c file :
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc,char* argv[])
{
int fp;
if ( argc < 2 )
{
printf("please input parameter\n");
return 0;
}
if( (fp = open(argv[1],O_RDONLY)) < 0 )
printf("open error,return value[%d]\n");
else
{
printf("open ok,return value[%d]\n");
close(fp);
}
return 0;
}
/dev/igwate info: crw-r--r-- root 127 0
why don't I open '/dev/igwate'? must I need to do other thing ? please someone
tells me or give me a clue ,thank you in advance
cookie
advan
2007-07-31
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev