OSSL_SLEEP(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’€ OSSL_SLEEP(3ossl) β€” the OpenSSL sleepy-time page πŸ’€

okay bestie, so this is a page from the OpenSSL manual β€” like, the 3ossl section, which is where all the library-function lore lives. it's a whole function whose entire personality is "go to sleep." let's get into it πŸ›Œβœ¨


🌸 NAME 🌸

OSSL_sleep β€” delay execution for a specified number of milliseconds. that's it. that's the gig. it makes your thread nap for millis milliseconds, no cap 😴


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <openssl/crypto.h>

void OSSL_sleep(uint64_t millis);

you gotta #include <openssl/crypto.h> first β€” the header is the vibe check. then it's just void OSSL_sleep(uint64_t millis); and honestly the signature is so clean, we love a no-frills icon πŸ‘‘


✨ DESCRIPTION ✨

OSSL_sleep() is a convenience function β€” literally just a little helper that delays execution of the calling thread for (at least) millis milliseconds. millis is a uint64_t, so it can hold a truly unhinged number of milliseconds if you want. dream big πŸ’–

here's the thing though β€” the delay is not guaranteed. like, it's giving "we'll try our best" energy. it may be affected by:

  • system activity (the computer has other stuff going on, bestie, it's busy πŸ’…)
  • the time spent processing the call itself (the function's gotta clock in before it clocks out)
  • limitation on the underlying system call parameter size
  • and system timer granularity (your timer's resolution is not infinite, sorry πŸŽ€)

and the specific limits? iconic, honestly:

  • on Windows, the maximum amount of time it will sleep is 49 days β€” that's it, that's the ceiling 🌈
  • on systems where the regular sleep(3) is used as the underlying system call, the maximum sleep time is about 136 years 🫢

yeah. one hundred and thirty-six years. not me setting a sleep that outlives everyone in this group chat πŸ˜­πŸ’€

so basically: it sleeps at least that long, subject to the whims of your OS, its timers, and its syscall parameter sizes. don't build a precision instrument on this and then get mad at it, iykyk.

πŸ‘‘ RETURN VALUES πŸ‘‘

OSSL_sleep() does not return any value. it's void fr fr β€” nothing comes back, no exit code, no little gift. it just sleeps and leaves πŸ’€


🧚 HISTORY 🧚

OSSL_sleep() was added in OpenSSL 3.2. baby of the family, fresh, new, slaying πŸŽ€


Copyright 2022-2023 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>.

no cap, read the license, it's the rules 🀝

🌸 okay that's the whole page, bestie 🌸 this one's from OpenSSL 3.5.6, dated 2026-04-07 β€” and it's OSSL_SLEEP(3ossl), we been knew πŸ’…πŸ«Ά go take a nap (for at least millis milliseconds) ⭐

πŸ“¦ where this page comes from