ERR_SET_MARK(3SSL)
๐ ERR_SET_MARK(3SSL) โ the OpenSSL err.h mark & pop gang ๐
okay bestie, welcome to the <openssl/err.h> manual, part of the OpenSSL 3SSL fam. this is the page about setting lil bookmarks in your error stack and popping stuff off the top. it's giving "annotate your chaos before you yeet it" energy and honestly? iconic. ๐
โจ NAME โจ
ERR_set_mark, ERR_clear_last_mark, ERR_pop_to_mark, ERR_count_to_mark, ERR_pop โ set a mark, clear a mark, pop errors until you hit a mark, and pop the last error. the whole mark-and-pop friendgroup, together at last ๐ซถ
๐ธ SYNOPSIS ๐ธ
#include <openssl/err.h>
int ERR_set_mark(void);
int ERR_pop_to_mark(void);
int ERR_clear_last_mark(void);
int ERR_count_to_mark(void);
int ERR_pop(void);
see how we love a consistent int-returning, no-argument queen? no args, no problems. ๐
๐ซ DESCRIPTION ๐ซ
okay so here's the tea, one function at a time:
ERR_set_mark() drops a mark on the current topmost error record โ if there actually is one. no error record? no mark. simple as. ๐
ERR_pop_to_mark() just keeps popping the top of the error stack until it finds a mark. once it finds it, the mark is removed too. and if there is NO mark at all? bestie. the whole stack gets removed. all of it. gone. ๐
ERR_clear_last_mark() removes the last mark that was added, if there is one. bye mark ๐
ERR_count_to_mark() tells you how many entries are sitting on the error stack above the most recently marked entry โ and no, that marked entry is not included in the count, it's not about to be counted, it has main character boundaries. if there's no mark in the error stack at all, you just get the total number of entries in the error stack. ๐งฎ
ERR_pop() unconditionally pops a single error entry off the top of the error stack. "unconditionally" is doing a lot of work here โ this is the entry you'd get via ERR_peek_last_error(3), and it's getting popped whether you're emotionally ready or not. ๐ฅ
๐ RETURN VALUES ๐
ERR_set_mark()โ returns0if the error stack is empty, otherwise1.ERR_clear_last_mark()andERR_pop_to_mark()โ return0if there was no mark in the error stack, which implies the stack became empty. otherwise1.ERR_count_to_mark()โ returns the number of error stack entries found above the most recent mark, if there is one, or the total number of error stack entries.ERR_pop()โ returns1if an error was popped, or0if the error stack was empty.
like, 0 keeps showing up as the "nope, nothing there" signal and honestly that's just its personality at this point. ๐ญ
๐ HISTORY ๐
ERR_count_to_mark()was added in OpenSSL 3.2.ERR_pop()was added in OpenSSL 3.3.
fresh-ish additions, we love to see the glow-up timeline. โจ
๐ COPYRIGHT ๐
Copyright 2003-2024 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
okay serious hat on for one sec: that license line is not a vibe, it's a requirement. don't skip it, don't "fix" it, don't paraphrase it. ๐ซก
aaaand that's the whole page bestie, we ate and left no crumbs ๐
โจ this was ERR_SET_MARK(3SSL) from OpenSSL 4.0.3, dated 2026-09-29. go set some marks on your error stack, you've got this ๐ฆ๐๐
๐ฆ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms