dysize(3)

πŸ’– dysize(3) β€” it's giving calendar math, bestie πŸ’–

okay so this one's from dysize(3) in the Library Functions Manual, and it is literally the shortest little cutie in the whole time-handling friend group. come sit, I'll tell you everything πŸ’…


✨ NAME ✨

dysize β€” get number of days for a given year πŸ—“οΈ


πŸ“š LIBRARY πŸ“š

Standard C library β€” that's libc, link it with -lc 🫢


🌸 SYNOPSIS 🌸

#include <time.h>

int dysize(int year);

πŸŽ€ Feature Test Macro Requirements for glibc (see feature_test_macros(7)) πŸŽ€

dysize():

  • Since glibc 2.19:
    • _DEFAULT_SOURCE
  • glibc 2.19 and earlier:
    • _BSD_SOURCE || _SVID_SOURCE
yes bestie, the era of your glibc genuinely changes which macro you gotta define. check your version, don't just guess πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the whole entire plot: the function hands you back 365 for a normal year and 366 for a leap year. that's it. that's the function. no cap, it's a one-trick pony and it ate πŸ’…

the leap year math is based on this, verbatim:

(year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0)

and that exact same formula is defined in the macro __isleap(year), which you can also find chillin' in <time.h> ✨


πŸ‘‘ ATTRIBUTES πŸ‘‘

for an explanation of the terms used in this section, go peek at attributes(7) πŸ“–

  • Interface: dysize()
  • Attribute: Thread safety
  • Value: MT-Safe

so yeah, it's MT-Safe β€” you and your threads can all call it at once and nobody's gonna fight 🌈


🧚 STANDARDS 🧚

None. as in: no standard claims this one. she's untethered. free-spirited. not in POSIX, not in ISO C, just vibing 😭


πŸ’œ HISTORY πŸ’œ

  • SunOS 4.x. β€” that's where she came from, ancient lore fr fr

and straight from the source, no paraphrasing: this is a compatibility function only. Don't use it in new programs.

bestie I'm so serious 😭 if you're writing something new, this is NOT the main character. keep it around for the old stuff and move on. periodt πŸ’…

πŸ”₯ SEE ALSO πŸ”₯


that's the whole page!! no more lore, she's tiny and she knows it πŸŽ€

kisses, this was Linux man-pages 6.20, dated 2026-02-08 β€” and with that, dysize(3) is officially explained. slay, stay leap-year-aware, bye bestie πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms