GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  BREAD (3)

NAME

bread, bwrite - read and write blocks of a UFS file system

CONTENTS

Library
Synopsis
Description
Return Values
Errors
See Also
History
Authors

LIBRARY


.Lb libufs

SYNOPSIS


.In sys/param.h
.In sys/mount.h
.In ufs/ufs/ufsmount.h
.In ufs/ufs/dinode.h
.In ufs/ffs/fs.h
.In libufs.h ssize_t bread struct uufsd *disk ufs2_daddr_t blockno void *data size_t size ssize_t
.Fo bwrite struct uufsd *disk ufs2_daddr_t blockno const void *data size_t size
.Fc int
.Fo berase struct uufsd *disk ufs2_daddr_t blockno ufs2_daddr_t size
.Fc

DESCRIPTION

The bread, bwrite and berase functions provide a block read, write and erase API for libufs(3) consumers. They operate on a userland UFS disk structure, and perform the read and write at a given block address, which uses the current d_bsize value of the structure.

RETURN VALUES

The bread and bwrite functions return the amount read or written, or -1 in case of any error, including short read.

The berase function returns non-zero on error.

ERRORS

The function bread may fail and set errno for any of the errors specified for the library functions ufs_disk_write(3) or pread(2).

The function bwrite may fail and set errno for any of the errors specified for the library function pwrite(2).

The function berase may fail and set errno for any of the errors specified for the library function ioctl(2).

Additionally all three functions may follow the libufs(3) error methodologies in situations where the amount of data written is not equal to the amount requested, or in case of a device error.

SEE ALSO

libufs(3), ufs_disk_write(3)

HISTORY

These functions first appeared as part of libufs(3) in
.Fx 5.0 .

AUTHORS


.An Juli Mallett Aq jmallett@FreeBSD.org
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.