Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sbread(3) [freebsd man page]

SBREAD(3)						   BSD Library Functions Manual 						 SBREAD(3)

NAME
sbread, sbwrite -- read and write superblocks of a UFS file system LIBRARY
UFS 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> int sbread(struct uufsd *disk); int sbwrite(struct uufsd *disk, int all); DESCRIPTION
The sbread() and sbwrite() functions provide superblock reads and writes for libufs(3) consumers. The sbread() and sbwrite() functions oper- ate 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 VALUES
The 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. ERRORS
The 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). SEE ALSO
bread(3), bwrite(3), libufs(3) HISTORY
These functions first appeared as part of libufs(3) in FreeBSD 5.0. AUTHORS
Juli Mallett <jmallett@FreeBSD.org> BSD
June 4, 2003 BSD

Check Out this Related Man Page

BREAD(3)						   BSD Library Functions Manual 						  BREAD(3)

NAME
bread, bwrite -- read and write blocks of a UFS file system LIBRARY
UFS 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> ssize_t bread(struct uufsd *disk, ufs2_daddr_t blockno, void *data, size_t size); ssize_t bwrite(struct uufsd *disk, ufs2_daddr_t blockno, const void *data, size_t size); int berase(struct uufsd *disk, ufs2_daddr_t blockno, ufs2_daddr_t size); 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 FreeBSD 5.0. AUTHORS
Juli Mallett <jmallett@FreeBSD.org> BSD
June 4, 2003 BSD
Man Page