LIBAST(3)

πŸ“¦ version 93vu, in opensuse-leap 16.0

welcome to LIBAST(3) from the Library Functions Manual shelf, bestie 🫢 this page is all about environment-variable business and it's lowkey iconic.

🌸 NAME 🌸

setenviron - set environment value πŸŽ€

✨ SYNOPSIS ✨

#include <ast.h>

char*     setenviron(const char* key);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so setenviron controls environment name=value pairs. It's giving environment-variable management, but make it cute πŸ’…

  • setenviron("name=value") β€” adds name to the environment and returns a pointer to a strdup(3) copy of name=value. yes, a whole duplicate, slay ✨
  • setenviron("name") β€” removes name from the environment and returns the empty string. poof, gone, no cap πŸ’¨
  • setenviron(0) β€” reserves a few slots in an internal array, and it's usually called by a parent process that expects many children. big parent-energy moment πŸ‘‘
  • 0 β€” returned on error. not the vibe, but we respect the truth πŸ’€

Also, setenviron preserves the ksh(1) convention of _ as the first environment variable name. shell heirloom behavior, iykyk 🐚

🌈 SEE ALSO 🌈

Also see env(1) and exec(2) β€” go peek, bestie πŸ’–

πŸ’€ BUGS πŸ’€

bug alert, bestie 🚨

POSIX will eventually settle on an interface. It has already picked a few of the names we did in .2 drafts. This is about the third name change for ours. literally naming drama 😭


Signed, sealed, and sparkling by LIBAST(3) β€” source/version mentioned in the footer, and the date is not shown there, so consider this your cute timestamp placeholder πŸŽ€πŸ’– bye bestie, go forth and set those environment variables ✨

πŸ“¦ where this page comes from