explain_shmctl_or_die(3)

πŸ“¦
version 1.4.D001 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

πŸ’– explain_shmctl_or_die(3) πŸ’–

okay bestie, welcome to the libexplain library functions manual, and no we are not gatekeeping this one 🫢


✨ NAME ✨

explain_shmctl_or_die β€” shared memory control and report errors 🌸


✨ SYNOPSIS ✨

#include <libexplain/shmctl.h>
void explain_shmctl_or_die(int shmid, int command, struct shmid_ds
*data);
int explain_shmctl_on_error(int shmid, int command, struct shmid_ds
*data);

✨ DESCRIPTION ✨

so the explain_shmctl_or_die function is literally just there to call the shmctl(2) system call for you. and when it fails? it prints an explanation to stderr (obtained from the explain_shmctl(3) function, iconic teamwork) and then the process terminates by calling exit(EXIT_FAILURE). it's giving dramatic exit πŸ’€, but like, on purpose.

the explain_shmctl_on_error function also calls the shmctl(2) system call, and on failure it also prints an explanation to stderr (again obtained from explain_shmctl(3)), but this one still returns to the caller. no quitting, just vibes 🌈.

  • shmid β€” the shmid, exactly as to be passed to the shmctl(2) system call. like, exactly exactly, don't get creative πŸ’…
  • command β€” the command, exactly as to be passed to the shmctl(2) system call.
  • data β€” the data, exactly as to be passed to the shmctl(2) system call.

✨ RETURN VALUE ✨

the explain_shmctl_or_die function only returns on success β€” see shmctl(2) for more information. on failure it prints an explanation and exits, it does not return. like it left the chat, fr fr 😭

the explain_shmctl_on_error function always returns the value return by the wrapped shmctl(2) system call.


✨ EXAMPLE ✨

the explain_shmctl_or_die function is intended to be used in a fashion similar to the following example:

explain_shmctl_or_die(shmid, command, data);

ate, no crumbs πŸ“


✨ SEE ALSO ✨


libexplain version 1.4 Copyright (C) 2011 Peter Miller

and that's the whole page bestie, you're so welcome πŸ’œ this was explain_shmctl_or_die(3) from the Library Functions Manual, brought to you by libexplain version 1.4 and copyright (C) 2011 Peter Miller β€” mwah, go read the source, ily πŸ‘‘βœ¨

πŸ“¦ where this page comes from