ERR_SET_MARK(3ossl)

πŸ’– ERR_SET_MARK πŸ’–

okay bestie, this is the OpenSSL manual page for ERR_set_mark(3ossl) and it's literally all about the error stack β€” marking it, unmarking it, popping it, counting it. it's giving ✨ bookmark energy ✨ for your errors. let's go πŸ¦‹


✨ NAME ✨

ERR_set_mark, ERR_clear_last_mark, ERR_pop_to_mark, ERR_count_to_mark, ERR_pop β€” set mark, clear mark, pop errors until mark and pop last error πŸ’…


🌸 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);

πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea on each one:

  • ERR_set_mark() β€” sets a mark on the current topmost error record, if there is one. if the stack's empty, no mark for you πŸ™ˆ
  • ERR_pop_to_mark() β€” will pop the top of the error stack until a mark is found. the mark is then removed. and if there is no mark? the whole stack is removed. yeah, all of it. that's not a drill bestie 😭
  • ERR_clear_last_mark() β€” removes the last mark added, if there is one. simple, clean, iconic ✨
  • ERR_count_to_mark() β€” returns the number of entries on the error stack above the most recently marked entry, not including that entry. if there is no mark in the error stack, the number of entries in the error stack is returned.
  • ERR_pop() β€” unconditionally pops a single error entry from the top of the error stack (which is the entry obtainable via ERR_peek_last_error(3)). "unconditionally" means it does not care, it does not ask, it just pops πŸ’…

⭐ RETURN VALUES ⭐

  • ERR_set_mark() returns 0 if the error stack is empty, otherwise 1.
  • ERR_clear_last_mark() and ERR_pop_to_mark() return 0 if there was no mark in the error stack, which implies that the stack became empty, otherwise 1.
  • ERR_count_to_mark() returns the number of error stack entries found above the most recent mark, if any, or the total number of error stack entries.
  • ERR_pop() returns 1 if an error was popped or 0 if the error stack was empty.

πŸ‘‘ HISTORY πŸ‘‘

  • ERR_count_to_mark() was added in OpenSSL 3.2. 🌈
  • ERR_pop() was added in OpenSSL 3.3. 🌈

they're the new girls. give them a warm welcome 🫢


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>.


and that's the whole page bestie, no cap πŸ’–

kisses from the OpenSSL manual, version 3.5.9, dated 2026-09-29 β€” ERR_SET_MARK(3ossl), periodt πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from