GSP
Quick Navigator

Search Site

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

Support
Customer Portal
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
UFS_DISK_CLOSE(3) FreeBSD Library Functions Manual UFS_DISK_CLOSE(3)

ufs_disk_close, ufs_disk_fillout, ufs_disk_fillout_blank, ufs_disk_writeopen and close userland UFS disks

UFS File System Access Library (libufs, -lufs)

#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);

The () function closes a disk and frees internal memory related to it. It does not free the disk structure.

The () and () functions open a disk specified by name and populate the structure pointed to by disk. The structure referenced by the disk pointer must be aligned to at least the alignment specified by LIBUFS_ALIGN that is defined in the <libufs.h> header file. 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 () function attempts to re-open a disk as writable if it is not currently.

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). Additionally, 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.

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

Juli Mallett <jmallett@FreeBSD.org>

November 17, 2023 FreeBSD 15.1-RELEASE-p1

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 ManDoc.