[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

fp_getdevno Kernel Service

Purpose

Gets the device number or channel number for a device.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/file.h>
int fp_getdevno ( fp, devp, chanp)
struct file *fp;
dev_t *devp;
chan_t *chanp;

Parameters

fp Points to a file structure returned by the fp_open or fp_opendev service.
devp Points to a location where the device number is to be returned.
chanp Points to a location where the channel number is to be returned.

Description

The fp_getdevno service finds the device number and channel number for an open device that is associated with the file pointer specified by the fp parameter. If the value of either devp or chanp parameter is null, this service does not attempt to return any value for the argument.

Execution Environment

The fp_getdevno kernel service can be called from the process environment only.

Return Values

0 Indicates a successful operation.
EINVAL Indicates that the pointer specified by the fp parameter does not point to a file structure for an open device.

Related Information

Logical File System Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]