---
name: "blkdev_get_by_path"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/blkdev_get_by_path"
---

# blkdev\_get\_by\_path(9)

open a block device by name

## NAME

blkdev\_get\_by\_path - open a block device by name

## SYNOPSIS

**struct block\_device \* blkdev\_get\_by\_path(const char \*** *path***, fmode\_t** *mode***, void \*** *holder***);**

## ARGUMENTS

*path*

path to the block device to open

*mode*

FMODE\_\* mask

*holder*

exclusive holder identifier

## DESCRIPTION

Open the blockdevice described by the device file at *path*. *mode* and *holder* are identical to **blkdev\_get**.

On success, the returned block\_device has reference count of one.

## CONTEXT

Might sleep.

## RETURN

Pointer to block\_device on success, ERR\_PTR(-errno) on failure.

## COPYRIGHT
