how to show the device attribute?

hello everyone:

  i have a problem : i want to use this command (file or this function stat() ) to get device attribute.

  for do this what should i do in my device driver? if use method handle

IO_STAT message ,please give me a example code.

oh,other question why when i use procmgr_daemon() function can't print data to /dev/null, why?

thank you

What do you mean by can’t print data to /dev/null?

For the stat stuff, just do the iofunc_attr_init with the appropriate permissions and use the default iofunc_stat call

eg iofunc_attr_init(&attr, S_IFNAM | 0666, 0, 0);

to mario: e.g. in my programme i used printf(“come /dev/null”) , so when i use procmgr_daemon() let the programme run in the background, only the arg setting is right ,it should be print “come /dev/null” in /dev/null.
is it right?
now my programme is i can’t get “come /dev/null” string from /dev/null
thanks your help

to cburqess:
i used iofunc_attr_init(&attr, S_IFNAM | 0666, 0, 0), but it can’t show the right attribute, now i want to it show “character IO … " string when i use file command, but it always show " invalid …” . if i need to
assign dev_t this data? but i didn’t find its member. what should i do?

thanks for your help

Perhaps your /dev/null is broken. :wink:

No, seriously:


You should use S_IFCHR for character special

to SmeeAgain:
yes it is that. i also find some article about it. e.g. /dev/null /dev/zero …

to cburqess:
i will try!

thank you!