Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

posix_mknod(3) [php man page]

POSIX_MKNOD(3)								 1							    POSIX_MKNOD(3)

posix_mknod - Create a special or ordinary file (POSIX.1)

SYNOPSIS
bool posix_mknod (string $pathname, int $mode, [int $major], [int $minor]) DESCRIPTION
Creates a special or ordinary file. PARAMETERS
o $pathname - The file to create o $mode - This parameter is constructed by a bitwise OR between file type (one of the following constants: POSIX_S_IFREG, POSIX_S_IFCHR, POSIX_S_IFBLK, POSIX_S_IFIFO or POSIX_S_IFSOCK) and permissions. o $major - The major device kernel identifier (required to pass when using S_IFCHR or S_IFBLK). o $minor - The minor device kernel identifier. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 A posix_mknod(3) example <?php $file = '/tmp/tmpfile'; // file name $type = POSIX_S_IFBLK; // file type $permissions = 0777; // octal $major = 1; $minor = 8; // /dev/random if (!posix_mknod($file, $type | $permissions, $major, $minor)) { die('Error ' . posix_get_last_error() . ': ' . posix_strerror(posix_get_last_error())); } ?> SEE ALSO
posix_mkfifo(3). PHP Documentation Group POSIX_MKNOD(3)

Check Out this Related Man Page

MAKEDEV(3)						   BSD Library Functions Manual 						MAKEDEV(3)

NAME
makedev, major, minor -- device number conversion SYNOPSIS
#include <sys/types.h> dev_t makedev(int major, int minor); int major(dev_t dev); int minor(dev_t dev); DESCRIPTION
The makedev() macro allows a unique device number to be generated based on its major and minor number. The major() and minor() macros can be used to obtain the original numbers from the device number dev. In previous implementations of FreeBSD all block and character devices were uniquely identified by a pair of major and minor numbers. The major number referred to a certain device class (e.g. disks, TTYs) while the minor number identified an instance within the device class. Later versions of FreeBSD automatically generate a unique device number for each character device visible in /dev/. These numbers are not divided in device classes. On FreeBSD these macros are only used by utilities that need to exchange numbers with other operating systems that may use different encod- ings for dev_t, but also applications that present these numbers to the user in a more conventional way. RETURN VALUES
The major() macro returns a device major number that has a value between 0 and 255. The minor() macro returns a device minor number whose value can span the complete range of an int. SEE ALSO
mknod(2), devname(3), devfs(5) BSD
September 28, 2008 BSD
Man Page