'\" t .\" Title: register_blkdev .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Block Devices .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "REGISTER_BLKDEV" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Block Devices" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" register_blkdev \- register a new block device .SH "SYNOPSIS" .HP \w'int\ register_blkdev('u .BI "int register_blkdev(unsigned\ int\ " "major" ", const\ char\ *\ " "name" ");" .SH "ARGUMENTS" .PP \fImajor\fR .RS 4 the requested major device number [1\&.\&.255]\&. If \fImajor\fR=0, try to allocate any unused major number\&. .RE .PP \fIname\fR .RS 4 the name of the new block device as a zero terminated string .RE .SH "DESCRIPTION" .PP The \fIname\fR must be unique within the system\&. .PP The return value depends on the \fImajor\fR input parameter\&. \- if a major device number was requested in range [1\&.\&.255] then the function returns zero on success, or a negative error code \- if any unused major number was requested with \fImajor\fR=0 parameter then the return value is the allocated major number in range [1\&.\&.255] or a negative error code otherwise .SH "COPYRIGHT" .br