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
- Copyright 2001, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms