.\" Automatically generated by Pandoc 2.0.6 .\" .TH "PMEMBLK_SET_ZERO" "3" "2022-08-25" "PMDK - pmemblk API version 1.1" "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2017-2018, Intel Corporation .SH NAME .PP \f[B]pmemblk_set_zero\f[](), \f[B]pmemblk_set_error\f[]() \- block management functions .SH SYNOPSIS .IP .nf \f[C] #include\ int\ pmemblk_set_zero(PMEMblkpool\ *pbp,\ long\ long\ blockno); int\ pmemblk_set_error(PMEMblkpool\ *pbp,\ long\ long\ blockno); \f[] .fi .SH DESCRIPTION .PP The \f[B]pmemblk_set_zero\f[]() function writes zeros to block number \f[I]blockno\f[] in persistent memory resident array of blocks \f[I]pbp\f[]. Using this function is faster than actually writing a block of zeros since \f[B]libpmemblk\f[](7) uses metadata to indicate the block should read back as zero. .PP The \f[B]pmemblk_set_error\f[]() function sets the error state for block number \f[I]blockno\f[] in persistent memory resident array of blocks \f[I]pbp\f[]. A block in the error state returns \f[I]errno\f[] \f[B]EIO\f[] when read. Writing the block clears the error state and returns the block to normal use. .SH RETURN VALUE .PP On success, \f[B]pmemblk_set_zero\f[]() and \f[B]pmemblk_set_error\f[]() return 0. On error, they return \-1 and set \f[I]errno\f[] appropriately. .SH SEE ALSO .PP \f[B]libpmemblk\f[](7) and \f[B]\f[]