bwrite Kernel Service

Purpose

Writes the specified buffer data.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/buf.h>

int bwrite ( bp)
struct buf  *bp;

Parameter

Item Description
bp Specifies the address of the buffer structure for the buffer to be written.

On a platform that supports storage keys, the passed in bp parameter must be in the KKEY_PUBLIC or KKEY_BLOCK_DEV protection domain.

Description

The bwrite kernel service writes the specified buffer data. If this is a synchronous request, the bwrite service waits for the I/O to complete.

"Block I/O Buffer Cache Kernel Services: Overview" in AIX® Version 7.1 Kernel Extensions and Device Support Programming Concepts describes how the three buffer-cache write routines work.

Execution Environment

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

Return Values

Item Description
0 Indicates a successful operation.
ERRNO Returns an error number from the /usr/include/sys/errno.h file on error.