1.\" Author: Juli Mallett <jmallett@FreeBSD.org> 2.\" Date: June 04, 2003 3.\" Description: 4.\" Manual page for libufs functions: 5.\" sbread(3) 6.\" sbwrite(3) 7.\" 8.\" This file is in the public domain. 9.\" 10.\" $FreeBSD$ 11.\" 12.Dd June 4, 2003 13.Dt SBREAD 3 14.Os 15.Sh NAME 16.Nm sbread , sbwrite 17.Nd read and write superblocks of a UFS filesystem 18.Sh LIBRARY 19.Lb libufs 20.Sh SYNOPSIS 21.In sys/param.h 22.In sys/mount.h 23.In ufs/ufs/ufsmount.h 24.In ufs/ufs/dinode.h 25.In ufs/ffs/fs.h 26.In libufs.h 27.Ft int 28.Fn sbread "struct uufsd *disk" 29.Ft int 30.Fn sbwrite "struct uufsd *disk" "int all" 31.Sh DESCRIPTION 32The 33.Fn sbread 34and 35.Fn sbwrite 36functions provide superblock reads and writes for 37.Xr libufs 3 38consumers. 39The 40.Fn sbread 41and 42.Fn sbwrite 43functions operate on the superblock field, 44.Fa d_sb , 45associated with a given userland UFS disk structure. 46Additionally, the 47.Fn sbwrite 48function will write to all superblock locations if the 49.Fa all 50value is non-zero. 51.Pp 52The 53.Fn sbread 54and 55.Fn sbwrite 56functions return 0 on success or -1 on error. 57.Sh ERRORS 58The function 59.Fn sbread 60may fail and set 61.Va errno 62for any of the errors specified for the library function 63.Xr bread 3 . 64Additionally, it may follow the 65.Xr libufs 3 66error methodologies in situations where no usable superblock could be 67found. 68.Pp 69The function 70.Fn sbwrite 71may fail and set 72.Va errno 73for any of the errors specified for the library function 74.Xr bwrite 3 . 75.Sh SEE ALSO 76.Xr bread 3 , 77.Xr bwrite 3 , 78.Xr libufs 3 79.Sh HISTORY 80These functions first appeared as part of 81.Xr libufs 3 82in 83.Fx 5.0 . 84.Sh AUTHORS 85.An Juli Mallett Aq jmallett@FreeBSD.org 86