SCHED_GETPARAM(3POSIX)
π SCHED_GETPARAM(3POSIX) π
okay bestie so this one is from the POSIX Programmer's Manual (that's the manual name, keep it in your notes π) and we're about to learn how to peek at a process's scheduling parameters. no cap, it's shorter than you think.
πΈ PROLOG πΈ
This manual page is part of the POSIX Programmer's Manual. Heads up though β the Linux implementation of this interface may differ, so go check the corresponding Linux manual page for the deets on Linux behavior. or likeβ¦ the interface might not even be implemented on Linux at all π. vibe check accordingly.
β¨ NAME β¨
sched_getparam β get scheduling parameters (REALTIME)
π SYNOPSIS π
#include <sched.h>
int sched_getparam(pid_t pid, struct sched_param *param);
π¦ DESCRIPTION π¦
So the sched_getparam() function shall return the scheduling parameters of a process specified by pid, and it drops them into the sched_param structure pointed to by param. it's giving "here's your info, queen" π
If a process specified by pid exists, and the calling process has permission, then the scheduling parameters for the process whose process ID equals pid shall be returned. permission check first though, always.
If pid is zero, then the scheduling parameters for the calling process shall be returned. cute, self-love π«Ά.
β οΈ But ifpidis negative, the behavior ofsched_getparam()is unspecified. like, we literally do not know what happens. don't do it. that's not a vibe. π
π RETURN VALUE π
Upon successful completion, sched_getparam() shall return zero. slay, zero, the good number β¨
If the call is unsuccessful, the function shall return a value of -1 and set errno to indicate the error. classic. iconic even.
π ERRORS π
The sched_getparam() function shall fail if:
EPERMβ The requesting process does not have permission to obtain the scheduling parameters of the specified process. like, no access babes, sorry πESRCHβ No process can be found corresponding to that specified bypid. that process? doesn't exist. gone. never was. π
The following sections are informative.
π EXAMPLES π
None.
(yes, literally none. we're on our own bestie.)
π§ APPLICATION USAGE π§
None.
π RATIONALE π
None.
β FUTURE DIRECTIONS β
None.
π₯ SEE ALSO π₯
sched_getscheduler()sched_setparam()sched_setscheduler()
The Base Definitions volume of POSIX.1β2017, <sched.h>
π COPYRIGHT π
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!! brought to you by IEEE/The Open Group, 2017 β the year this little SCHED_GETPARAM(3POSIX) baddie got stamped π
go forth and check your scheduling params responsibly β¨π
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms