|SBREAD(3)||FreeBSD Library Functions Manual||SBREAD(3)|
NAMEsbread, sbwrite — read and write superblocks of a UFS file system
LIBRARYUFS File System Access Library (libufs, -lufs)
SYNOPSIS#include < sys/param.h>
#include < sys/mount.h>
#include < ufs/ufs/ufsmount.h>
#include < ufs/ufs/dinode.h>
#include < ufs/ffs/fs.h>
#include < libufs.h>
sbread( struct uufsd *disk);
sbwrite( struct uufsd *disk, int all);
DESCRIPTIONThe sbread() and sbwrite() functions provide superblock reads and writes for libufs(3) consumers. The sbread() and sbwrite() functions operate on the superblock field, d_sb, associated with a given userland UFS disk structure. Additionally, the sbwrite() function will write to all superblock locations if the all value is non-zero.
RETURN VALUESThe sbread() and sbwrite() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
ERRORSThe function sbread() may fail and set errno for any of the errors specified for the library function bread(3). Additionally, it may follow the libufs(3) error methodologies in situations where no usable superblock could be found.
The function sbwrite() may fail and set errno for any of the errors specified for the library function bwrite(3).
HISTORYThese functions first appeared as part of libufs(3) in FreeBSD 5.0.
|June 4, 2003||FreeBSD|