HPlogo MPE/iX System Utilities Reference Manual > Chapter 14 MKNOD

MKNOD Operation

MPE documents

Complete PDF
Table of Contents
Index

MKNOD determines how to create the files based on the arguments passed to the program. When creating a device link or streams (character-type) file, you must enter both the major and minor numbers. To create a device link file, enter a major number of 0 and the LDEV number of the device as the minor number. To create a streams file, enter a major number greater than 0.

Syntax

  mknod "name c|p major minor [link_name]"

Parameters
name

Creates a special or fifo file including the program name in the pathname.

c|p

Creates a device link file or streams file if this argument is 'c' (character type).

Creates a fifo file or pipe if this argument is 'p'.

major

Major number. The following major numbers are valid:

0

Creates a device link. The minor number represents the LDEV number.

1-254

Creates a streams file.

minor

Minor device type. This is used in conjunction with the major number option to provide a UNIX compatible device specification. The interpretion of the minor number is dependent on the value of the major number. If the major number is 0, then this number represents a LDEV number. If the major number is > 0, then this number represents a streams connection to a driver.

link_name

Creates the streams file with a link_name. This name is an eight-character MPE link_name (from the NMMGR link screen).

When the special file is created, it can be accessed through the HPFOPEN intrinsic and the C library "open" interface. The 0_NONBLOCK option can be specified using open.

MKNOD sets a CI variable mknodvar with the value 0 if successful. If errors occur, it returns the file system error status.

To create a fifo file called MYFIFO:

  mknod "myfifo p"

To create a device link file for LDEV 7:

  mknod "/dev/tape7 c,0,7"

To create a streams file with a link_name of DTSLINK, a major number of 1, and a minor number of 10:

  mknod "strmfile c,1,10,dtslink"

You can use the LISTFILE command to display special files. For example:

 :LISTFILE /dev/@,2
  PATH= /dev/./
  
  CODE  -------------LOGICAL RECORD----------------SPACE----- FILENAME
          SIZE  TYPE        EOF     LIMIT  R/B  SECTORS #X MX

          128W  FBf          0          1    1       0   0  * MYFIFO
          128W  FBs          0          1    1       0   0  * STRMFILE
          128W  FBd          0          1    1       0   0  * tape7

 :LISTFILE /dev/tape7,5
  **********************
  FILE: /dev/tape7
 
  FILE CODE : 0              FOPTIONS: BINARY,FIXED,NOCCTL,DEVICE LINK
  BLK FACTOR: 1              OWNER   : **
  REC SIZE: 256 (BYTES)      GROUP ID: **
  BLK SIZE: 256 (BYTES)      SECURITY--READ   :
  EXT SIZE: 0 (SECT)                   WRITE  :
  NUM REC: 0                           APPEND :
  NUM SEC: 0                           LOCK   :
  NUM EXT: 0                           EXECUTE:
  MAX REC: 1                         **SECURITY IS ON
                             FLAGS   : NO ACCESSORS
  NUM LABELS: 0              CREATED : THU, AUG 24, 1993 3:12 PM
  MAX LABELS: 0              MODIFIED: THU, AUG 24, 1993 3:12 PM
  DISC DEV #: 1              ACCESESED:THU, AUG 24, 1993 3:12 PM
  SEC OFFSET: 0              LABEL ADDR: **
  VOLNAME   : MPEXL_SYSTEM_VOUME_SET:MEMBER1
  
  DEV TYPE  : DEVICE LINK
  LDEV      : 7              IO CLASS: TAPE

Additional Discussion


For more information on streams and device link files, refer to the HPDEVCREATE intrinsic in the MPE/iX Intrinsics Reference Manual.




Chapter 14 MKNOD


Chapter 15 N7MF8CNV