Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Driver Entry Pointsstrategy(9E)


NAME

 strategy - perform block I/O

SYNOPSIS

 
#include <sys/types.h>
#include <sys/buf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
int prefixstrategy(struct buf *bp);

INTERFACE LEVEL

 

Architecture independent level 1 (DDI/DKI). This entry point is required for block devices.

PARAMETERS

 
bp
Pointer to the buf(9S) structure.

DESCRIPTION

 

The strategy() routine is called indirectly (through cb_ops(9S)) by the kernel to read and write blocks of data on the block device. strategy() may also be called directly or indirectly to support the raw character interface of a block device ( read(9E), write(9E) and ioctl(9E)). The strategy() routine's responsibility is to set up and initiate the transfer.

RETURN VALUES

 

The strategy() routine should always return 0. On an error condition, it should call bioerror(9f) to set b_flags to the proper error code, and call biodone(9f). Note that a partial transfer is not considered to be an error.

SEE ALSO

 

ioctl(9E), read(9E), write(9E), biodone(9F), bioerror(9F), buf(9S), cb_ops(9S)

Writing Device Drivers


SunOS 5.9Go To TopLast Changed 09 Aug 1998

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.