---
name: "devsw"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/devsw"
---

# devsw(9)

returns the cdevsw structure

## NAME

**devsw** – returns the *cdevsw* structure

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/conf.h\>**

*struct cdevsw \**\

**devsw**(*dev\_t dev*);

## DESCRIPTION

The **devsw**() function returns a pointer to the *cdevsw* structure associated with this character device ID. If *dev-\>si\_cdevsw* is set it is returned; otherwise, the [major(9)](/major/9.md) offset into the *cdevsw* array is returned.

Its argument is:

- *dev*

  The device whose *cdevsw* entry should be returned.

## RETURN VALUES

A pointer to a *cdevsw* structure.

## SEE ALSO

[major(9)](/major/9.md), [minor(9)](/minor/9.md), [umajor(9)](/umajor/9.md), [uminor(9)](/uminor/9.md)

## AUTHORS

This manual page was written by Chad David ⟨davidc@acns.ab.ca⟩.
