01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MKNOD (2) MKNOD (2)<br />

NAME<br />

mknod - make a directory, or a special or ordinary file<br />

SYNOPSIS<br />

int mknod (path, mode, dev)<br />

char *path;<br />

int mode, dev;<br />

DESCRIPTION<br />

Mknod creates a new file named by the path name pointed to by<br />

path . The mode of the new file is initialized from mode, where<br />

the value of mode is interpreted as follows:<br />

0170000 file type; one of the following:<br />

0010000 fifo special<br />

0020000 character special<br />

0040000 directory<br />

0060000 block special<br />

0100000 or 0000000 ordinary file<br />

0004000 set user ID on execution<br />

0002000 set group ID on execution<br />

0001000 save text image after execution<br />

0000777 access permissions; constructed from the following<br />

0000400 read by owner<br />

0000200 write by owner<br />

0000100 execute (search on directory) by owner<br />

0000070 read, write, execute (search) by group<br />

0000007 read, write, execute (search) by others<br />

The file's owner ID is set to the process's effective user ID. The<br />

file's group ID is set to the process's effective group ID.<br />

'<br />

Values of mode other than those above are undefined and should<br />

not be used. The low-order 9 bits of mode are modified by the<br />

process's file mode creation mask: all bits set in the process's file<br />

mode creation mask are cleared. See umask(2). If mode indicates<br />

a block or character special file, dev is a configuration dependent<br />

specification of a character or block I/0 device. If mode does not<br />

indicate a block special or character special device, dev is ignored.<br />

Mknod may be invoked only by the super-user for file types other<br />

than FIFO special.<br />

Mknod will fail and the new file will not be created if one or more<br />

of the following are true:<br />

The process's effective user ID is not super-user. [EPERMI<br />

A component of the path prefix is not a directory.<br />

[ENOTDffij<br />

A component of the path prefix does not exist. [ENOENTI<br />

The directory in which the file is to be created is located<br />

on a read-only file system. [EROFSj<br />

The named file exists. [EEXISTI<br />

Path points outside the process's allocated address space.<br />

[EFAULTj<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!