Logo 
Search:

Unix / Linux / Ubuntu FAQ

Submit Interview FAQ
Home » Interview FAQ » Unix / Linux / UbuntuRSS Feeds

How do you create special files like named pipes and device files?

  Shared By: Adah Miller    Date: Jan 25    Category: Unix / Linux / Ubuntu    Views: 185

Answer:

The system call mknod creates special files in the following sequence.
1. kernel assigns new inode,
2. sets the file type to indicate that the file is a pipe, directory or special file,
3. If it is a device file, it makes the other entries like major, minor device numbers.
For example:
If the device is a disk, major device number refers to the disk controller and minor device number is the disk.

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: