parse_bool(9)
π parse_bool(9) β the kernel API manual, bestie edition π
okay so this is parse_bool, straight out of the Kernel API Manual, and honestly? she's a tiny little function with main character energy. all she does is take a string and turn it into a bool. that's it. that's the girl. β¨
πΈ NAME πΈ
parse_bool β literally just parse a two-valued option into a bool, no cap π
β¨ SYNOPSIS β¨
int parse_bool (const char *bool_str , const char *true_str , const char
*false_str , bool *bool_ptr );
like, four args, one int back. iconic. π¦
π«Ά ARGUMENTS π«Ά
bool_strβ the string value you're trying to convert into abool. the star of the show. the one getting vibe checked. πtrue_strβ the string value that should get converted totrue. like, ifbool_strmatches this, congrats, it'strue. πfalse_strβ the string value that should get converted tofalse. the other member of the duo. βbool_ptrβ a pointer to return theboolvalue in. she's the drop-off spot. the result goes here. π
π₯ RETURN π₯
VDO_SUCCESS β slay β or an error if bool_str is neither true_str nor false_str. like, if it's neither of the two things you said were valid, bestie, that's an error, and that's on periodt. π
π SEE ALSO π
okay this list is long long, so buckle up β everything below is a (9) reference, and the whole thing lives in the kernel file ./drivers/md/dm-vdo/dm-vdo-target.c. no i'm not skipping any of them, we don't do that here:
free_device_config(9)get_version_number(9)parse_memory(9)parse_slab_size(9)process_one_thread_config_spec(9)parse_one_thread_config_spec(9)parse_thread_config_string(9)process_one_key_value_pair(9)parse_one_key_value_pair(9)parse_key_value_pairs(9)parse_optional_arguments(9)handle_parse_error(9)parse_device_config(9)get_thread_id_for_phase(9)advance_phase(9)finish_operation_callback(9)decode_from_super_block(9)decode_vdo(9)pre_load_callback(9)get_bit_array_size(9)grow_bit_array(9)allocate_instance(9)check_may_grow_physical(9)grow_layout(9)validate_new_device_config(9)write_super_block_for_suspend(9)suspend_callback(9)was_new(9)requires_repair(9)get_load_type(9)load_callback(9)handle_load_error(9)write_super_block_for_resume(9)resume_callback(9)grow_logical_callback(9)handle_logical_growth_error(9)perform_grow_logical(9)copy_partition(9)grow_physical_callback(9)handle_physical_growth_error(9)perform_grow_physical(9)apply_new_vdo_configuration(9)
π friendly reminder: this page comes from ./drivers/md/dm-vdo and it's dated October 2026. if you're reading it in some other month... iykyk π
and that's the whole page, bestie β go forth and parse your bools responsibly. parse_bool(9), ./drivers/md/dm-vdo, October 2026. mwah ππ¦πΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms