.\" Automatically generated by Pandoc 2.0.6 .\" .TH "PMEM2_BADBLOCK_NEXT" "3" "2022-08-25" "PMDK - pmem2 API version 1.0" "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2020, Intel Corporation .SH NAME .PP \f[B]pmem2_badblock_next\f[]() \- read the next bad block for the given bad block context \f[I]*bbctx\f[]. .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[] .fi .SH DESCRIPTION .PP The \f[B]pmem2_badblock_next\f[]() function reads the next bad block for the given bad block context \f[I]*bbctx\f[]. .PP It is not supported on Windows. .SH RETURN VALUE .PP The \f[B]pmem2_badblock_next\f[]() function returns 0 and stores the next bad block in \f[I]*bb\f[] 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[]. .SH ERRORS .PP \f[B]pmem2_badblock_next\f[]() can fail with the following error: .IP \[bu] 2 \f[B]PMEM2_E_NO_BAD_BLOCK_FOUND\f[] \- there are no more bad blocks for the given bad block context \f[I]*bbctx\f[], \f[I]*bb\f[] is undefined in this case. .IP \[bu] 2 \f[B]PMEM2_E_NOSUPP\f[] \- on Windows or when the OS does not support this functionality .SH SEE ALSO .PP \f[B]pmem2_badblock_context_new\f[](3), \f[B]pmem2_badblock_clear\f[](3), \f[B]libpmem2\f[](7) and \f[B]\f[]