PMEMBLK_SET_ERROR(3)

πŸ“¦
version 1.13.1 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– PMEMBLK_SET_ERROR(3) πŸ’–

okay bestie, welcome to the PMDK Programmer's Manual ✨ this one's a lil bittersweet because it's giving retro, but we still gotta know it, so let's go 🫢


🌸 NAME 🌸

pmemblk_set_zero() (DEPRECATED), pmemblk_set_error() (DEPRECATED) β€” block management functions πŸŽ€


✨ SYNOPSIS ✨

#include <libpmemblk.h>

int pmemblk_set_zero(PMEMblkpool *pbp, long long blockno);
int pmemblk_set_error(PMEMblkpool *pbp, long long blockno);

πŸ¦‹ DESCRIPTION πŸ¦‹

so pmemblk_set_zero() writes zeros to block number blockno in the persistent memory resident array of blocks pbp ✨ and here's the slay part β€” using this function is faster than actually writing a block of zeros, because libpmemblk(7) uses metadata to indicate that the block should read back as zero. it's giving efficiency, it's giving icon, no cap πŸ’…

then pmemblk_set_error() sets the error state for block number blockno in the persistent memory resident array of blocks pbp. a block in the error state returns errno EIO when read 😭. but bestie, it's not forever β€” writing the block clears the error state and returns the block to normal use 🫢✨


⭐ RETURN VALUE ⭐

on success, pmemblk_set_zero() and pmemblk_set_error() return 0 πŸ’–

on error, they return -1 and set errno appropriately πŸ’€ (yes, check it, always check it, i'm literally begging)


🌈 SEE ALSO 🌈

libpmemblk(7) and <https://pmem.io> πŸ‘‘


⚠️ heads up queen: both of these are marked DEPRECATED in the original, so don't be out here building your whole main character arc on them, okay? just know them, that's the vibe πŸŽ€

that's the whole page, bestie!! mwah πŸ’œ this lil gem came to you courtesy of the PMDK Programmer's Manual, dated 2023-05-31 β€” yes, that's the source, version, and date all in one cute lil bow πŸŽ€ byeee, go write some blocks (or don't, it's deprecated) 🌸✨

πŸ“¦ where this page comes from