Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ufs_disk_write(3) [freebsd man page]

UFS_DISK_CLOSE(3)					   BSD Library Functions Manual 					 UFS_DISK_CLOSE(3)

NAME
ufs_disk_close, ufs_disk_fillout, ufs_disk_fillout_blank, ufs_disk_write -- open and close userland UFS disks 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 ufs_disk_close(struct uufsd *disk); int ufs_disk_fillout(struct uufsd *disk, const char *name); int ufs_disk_fillout_blank(struct uufsd *disk, const char *name); int ufs_disk_write(struct uufsd *disk); DESCRIPTION
The ufs_disk_close() function closes a disk and frees internal memory related to it. It does not free the disk structure. The ufs_disk_fillout() and ufs_disk_fillout_blank() functions open a disk specified by name and populate the structure pointed to by disk. The disk is opened read-only. The specified name may be either a mountpoint, a device name or a filesystem image. The ufs_disk_fillout() function assumes there is a valid superblock and will fail if not, whereas the ufs_disk_fillout_blank() function makes no assumptions of that sort. The ufs_disk_write() function attempts to re-open a disk as writable if it is not currently. ERRORS
The function ufs_disk_close() has no failure points. The function ufs_disk_fillout() may fail for any of the reasons ufs_disk_fillout_blank() might, as well as for any reason sbread(3) might. The ufs_disk_fillout_blank() may fail and set errno for any of the errors specified for the library functions open(2), strdup(3). Addition- ally, it may follow the libufs(3) error methodologies in situations where no device could be found to open. The function ufs_disk_write() may fail and set errno for any of the errors specified for the library functions open(2) and stat(2). Namely, it will fail if the disk in question may not be written to. SEE ALSO
open(2), getfsfile(3), libufs(3), sbread(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