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_SOURCE at the top? that is NOT optional, babes. that's your ✨feature test macro✨ (go read feature_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 and strfry() 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms