strfry(3)
π strfry(3) β bestie edition π
okay so like, hi. this is the <strfry> page from section 3 of the manual (library functions, iykyk), and we're gonna talk about the silliest little function in libc. no cap.
β¨ NAME β¨
strfry β string fry (obfuscate) π
like. it fries your string. that's genuinely the official word. iconic behaviour fr fr.
π LIBRARY π
Standard C library (libc, -lc)
yes bestie, it's just chilling in libc. you already have it. no extra linking drama.
πΈ SYNOPSIS πΈ
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <string.h>
char *strfry(char *string);
β οΈ okay important!! see that#define _GNU_SOURCEat the top? that is NOT optional, babes. that's your β¨feature test macroβ¨ (go readfeature_test_macros(7)if you want the lore) and without it this function simply does not exist for you. it's giving locked door energy. π
π DESCRIPTION π
so. the strfry() function randomizes the contents of string by randomly swapping characters in the string.
that's it. that's the whole thing. it shuffles your characters around like a deck of cards and hands it back.
and the result? the result is an anagram of string π« β same letters, brand new order. not me turning "hello" into "lloeh" and calling it self care.
π«Ά RETURN VALUE π«Ά
The strfry() functions returns a pointer to the randomized string.
(she returns a pointer!! to the randomized string!! yes the typo is in the original, we keep it, we're preserving the lore π )
lowkey convenient though β you don't even have to remember where your buffer was, she just hands it right back to you.
π ATTRIBUTES π
For an explanation of the terms used in this section, see attributes(7). real ones go read it.
here's the vibe check table, translated for the girlies:
- Interface:
strfry() - Attribute: Thread safety
- Value:
MT-Safe
that's right bestie β strfry() is MT-Safe β¨ you can call her from multiple threads and she will not start drama. the way that she's just thread safe with zero caveats. ate and left no crumbs. π½οΈ
(as always, the man page says see attributes(7) for what "MT-Safe" actually means β go look, don't @ me.)
π STANDARDS π
GNU.
just GNU. not POSIX, not ISO C, not gonna be portable out here in the wild, bestie. GNU or nothing. periodt.
π₯ SEE ALSO π₯
memfrob(3)β the other cursed little GNU goblin. its bestie fr fr.string(3)β the whole string function family reunion, go meet the relatives.
ngl though, quick vibe check before you run off andstrfry()everything: it's GNU-only and it needs_GNU_SOURCE. if you need it on a non-glibc system you're on your own, queen. also she mutates your string in place, so don't be passing her a string literal in read-only memory. π that's not a slay, that's a segfault.
okay that's the whole page, you understood all of it, I'm so proud of you π₯Ή mwah π
this cutie was brought to you by Linux man-pages 6.20, dated 2026-07-26, and yeah β we're in strfry(3), section 3, always and forever. byeeeee πβ¨ππ¦
π¦ 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 1993, David Metcalfe <david@prism.demon.co.uk>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms