POSIX_S...HEDPARAM(3POSIX)

πŸ’… PROLOG πŸ’…

okay so real talk first bestie β€” this page is part of the POSIX Programmer's Manual, and the Linux version of this interface might not match it exactly (like, if you're on Linux, go read the Linux man page for the actual tea β˜•). or honestly? the interface might just not exist on Linux at all. πŸ’€

This one is POSIX_S...HEDPARAM(3POSIX) from the POSIX Programmer's Manual, and she's a baddie. let's get into it 🫢


✨ NAME ✨

posix_spawnattr_getschedparam, posix_spawnattr_setschedparam β€” get and set the spawn-schedparam attribute of a spawn attributes object (ADVANCED REALTIME) πŸ‘‘


🌸 SYNOPSIS 🌸

#include <spawn.h>
#include <sched.h>

int posix_spawnattr_getschedparam(const posix_spawnattr_t
    *restrict attr, struct sched_param *restrict schedparam);
int posix_spawnattr_setschedparam(posix_spawnattr_t *restrict attr,
    const struct sched_param *restrict schedparam);

πŸ’– DESCRIPTION πŸ’–

so posix_spawnattr_getschedparam() shall obtain the value of the spawn-schedparam attribute from the attributes object that attr is pointing at. reading the vibes, basically. πŸ‘€

and posix_spawnattr_setschedparam() shall set the spawn-schedparam attribute inside an initialized attributes object that attr points to. giving it a whole new personality. ✨

now what IS the spawn-schedparam attribute, you ask? it represents the scheduling parameters that get assigned to the new process image in a spawn operation β€” but only if POSIX_SPAWN_SETSCHEDULER or POSIX_SPAWN_SETSCHEDPARAM is set in the spawn-flags attribute. no flag, no scheduling glow-up. πŸ™ˆ

the default value of this attribute is unspecified. yeah. mysterious. it's giving "we're not telling you." πŸ’€

πŸŽ€ RETURN VALUE πŸŽ€

when everything goes right, posix_spawnattr_getschedparam() shall return zero and store the value of the spawn-schedparam attribute of attr into the object that the schedparam parameter references. otherwise? an error number gets returned to indicate the error. no cap. 😭

and when everything goes right, posix_spawnattr_setschedparam() shall return zero; otherwise, again, an error number gets returned to indicate the error. that's it, that's the whole vibe check. πŸ’…


πŸ”₯ ERRORS πŸ”₯

these functions may fail if:

  • EINVAL β€” the value specified by attr is invalid. 🚫

and posix_spawnattr_setschedparam() may fail if:

  • EINVAL β€” the value of the attribute being set is not valid. nope, not valid, try again bestie. 😭
heads up: the following sections are informative. they're the bonus content, not the rules. πŸ“

🌈 EXAMPLES 🌈

None. moving on, nothing to see here. πŸ™ˆ


πŸ¦‹ APPLICATION USAGE πŸ¦‹

these functions are part of the Spawn and Process Scheduling options, so like β€” they don't have to exist on every implementation. it's optional, iykyk. ⭐


πŸ’œ RATIONALE πŸ’œ

None. iconic of them honestly. periodt. πŸ’…


🌸 FUTURE DIRECTIONS 🌸

None. the future is a mystery, but this page isn't going anywhere. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

  • posix_spawn()
  • posix_spawnattr_destroy()
  • posix_spawnattr_getsigdefault()
  • posix_spawnattr_getflags()
  • posix_spawnattr_getpgroup()
  • posix_spawnattr_getschedpolicy()
  • posix_spawnattr_getsigmask()

also, from the Base Definitions volume of POSIX.1‐2017: <sched.h> and <spawn.h> πŸ“š


okay legal bestie, here's the fine print and we keep ALL of it:

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie!! this little icon came to you courtesy of IEEE/The Open Group, 2017 β€” go off, 2017, you ate. πŸŽ€βœ¨πŸ¦‹