explain_shmctl_or_die(3)
π 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 theshmctl(2)system call. like, exactly exactly, don't get creative πcommandβ the command, exactly as to be passed to theshmctl(2)system call.dataβ the data, exactly as to be passed to theshmctl(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 β¨
shmctl(2)β shared memory controlexplain_shmctl(3)β explainshmctl(2)errorsexit(2)β terminate the calling process
β¨ COPYRIGHT β¨
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
- debian bookworm: libexplain-dev 1.4.D001-12+b1 Β· LGPL-3.0-or-later
- debian trixie: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- ubuntu jammy: libexplain-dev 1.4.D001-12 Β· LGPL-3.0-or-later
- ubuntu noble: libexplain-dev 1.4.D001-13 Β· LGPL-3.0-or-later
- ubuntu resolute: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- Copyright (C) 2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms