I need help on major and minor numbers for character file

I need help on major and minor numbers for character file

Post by Jens.Toerr.. » Thu, 09 Aug 2001 21:40:18




Quote:> I try to create character special file with major and minor numbers.
> mknod() is working perfectly with errno=0;
> but I could not open that character file for RDWR.

I guess you created a device file (with mode S_IFCHR or S_IFBLK, other-
wise major and minor device number wouldn't make sense). Thich means
that the system expects that there is a driver that deals with accesses
to this file (open, close, read, write etc.). At least on Linux, but
probably also on other systems, the driver to invoke is determined from
the major device number. If you just create a device file with a random
major device number there probably is no driver for handling of accesses
to this file and so opening it will fail. Did you check errno for the
open() call and what did it say? Is it ENXIO or ENODEV?

                                      Regards, Jens
--
      _  _____  _____

  _  | |  | |    | |          AG Moebius, Institut fuer Molekuelphysik
 | |_| |  | |    | |          Fachbereich Physik, Freie Universitaet Berlin
  \___/ens|_|homs|_|oerring   Tel: ++49 (0)30 838 - 53394 / FAX: - 56046

 
 
 

1. I need help on major and minor numbers for character file

Hi All,
                I try to create character special file with major and minor
numbers.

mknod() is working perfectly with errno=0;

but I could not open that character file for RDWR.

Please tell me the better way......

Thanks
sastry

--
S.K.Sastry

Lucent Technologies
Bell Labs Development Center
Bangalore
Ph: 091-080- 5271771 Ext 2633

India

2. chatmud

3. How to get character special device file major and minor numbers?

4. mounting HD through ip address?

5. Major & minor numbers of /dev/*hd* needed.

6. select queue

7. HELP - /dev/fd0 has wrong major or minor number

8. ringd for user PPP

9. Help !! Anonymous FTP and major minor numbers

10. Major/minor device numbers

11. Slip device major/minor number?

12. Wrong major or minor number????

13. HPUX convert major/minor numbers to device name