UFS_DISK_CLOSE(3)
π UFS_DISK_CLOSE(3) π
okay so this is the UFS_DISK_CLOSE(3) page from the Library Functions Manual, and we're about to talk about opening and closing userland UFS disks. stay with me bestie, it's giving very niche but very iconic π
β¨ 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) β that's the library, periodt. π¦
π» 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 π«Ά
Okay so ufs_disk_close() closes a disk and frees the internal memory related to it. the way it does not free the disk structure, tho β that part is important, bestie. it just handles the disk and its internal memory, not the uufsd struct itself. π
ufs_disk_fillout() and ufs_disk_fillout_blank() 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, which 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. π
ufs_disk_fillout() assumes there is a valid superblock and will fail if not, whereas ufs_disk_fillout_blank() makes no assumptions of that sort. so one is like "superblock check bestie" and the other is "no thoughts, just open" β but like, technically, not literally. πΈ
ufs_disk_write() attempts to re-open a disk as writable if it is not currently. that's the whole lil mission. π₯
π ERRORS π
ufs_disk_close()has no failure points. icon behavior, honestly. β¨ufs_disk_fillout()may fail for any of the reasonsufs_disk_fillout_blank()might, as well as for any reasonsbread(3)might. πufs_disk_fillout_blank()may fail and seterrnofor any of the errors specified for the library functionsopen(2),strdup(3). additionally, it may follow thelibufs(3)error methodologies in situations where no device could be found to open. π«Άufs_disk_write()may fail and seterrnofor any of the errors specified for the library functionsopen(2)andstat(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> π
xoxo, this page is from Debian, dated November 17, 2023 β mwah, bestie π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms