.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "" "" "2023-05-26" "PMDK - " "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2020, Intel Corporation .SH NAME .PP \f[B]pmem2_badblock_next\f[R]() - read the next bad block for the given bad block context \f[I]*bbctx\f[R]. .SH SYNOPSIS .IP .nf \f[C] #include struct pmem2_badblock; struct pmem2_badblock_context; int pmem2_badblock_next( struct pmem2_badblock_context *bbctx, struct pmem2_badblock *bb); \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmem2_badblock_next\f[R]() function reads the next bad block for the given bad block context \f[I]*bbctx\f[R]. .PP It is not supported on Windows. .SH RETURN VALUE .PP The \f[B]pmem2_badblock_next\f[R]() function returns 0 and stores the next bad block in \f[I]*bb\f[R] on success or it returns a negative error code when there are no more bad blocks for the given bad block context \f[I]*bbctx\f[R]. .SH ERRORS .PP \f[B]pmem2_badblock_next\f[R]() can fail with the following error: .IP \[bu] 2 \f[B]PMEM2_E_NO_BAD_BLOCK_FOUND\f[R] - there are no more bad blocks for the given bad block context \f[I]*bbctx\f[R], \f[I]*bb\f[R] is undefined in this case. .IP \[bu] 2 \f[B]PMEM2_E_NOSUPP\f[R] - on Windows or when the OS does not support this functionality .SH SEE ALSO .PP \f[B]pmem2_badblock_context_new\f[R](3), \f[B]pmem2_badblock_clear\f[R](3), \f[B]libpmem2\f[R](7) and \f[B]\f[R]