SCHED_GETSCHEDULER(3POSIX)
π SCHED_GETSCHEDULER(3POSIX) β POSIX Programmer's Manual π
okay bestie, welcome to the POSIX Programmer's Manual β¨ quick lil heads up before we dive in: this page lives in the POSIX manual, and the Linux version of this interface might act a little different from what's written here (so like, go check the matching Linux man page for the Linux tea β), or honestly it might not even be implemented on Linux at all. no cap. π
πΈ PROLOG πΈ
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β consult the corresponding Linux manual page for details on Linux behavior β or the interface may not be implemented on Linux.
π NAME π
sched_getscheduler β get scheduling policy (REALTIME)
β¨ SYNOPSIS β¨
#include <sched.h>
int sched_getscheduler(pid_t pid);
π¦ DESCRIPTION π¦
So like, what does sched_getscheduler() actually do? It shall return the scheduling policy of the process specified by pid. that's it, that's the whole gig π
β οΈ but wait β if the value ofpidis negative, the behavior ofsched_getscheduler()is unspecified. we don't do that here, bestie. undefined-ish territory, stay safe. π
The values that sched_getscheduler() can hand back to you are defined in the <sched.h> header. π
If a process specified by pid exists, and if the calling process has permission, the scheduling policy shall be returned for the process whose process ID is equal to pid. (permission check first, always π₯)
And if pid is zero? then the scheduling policy shall be returned for the calling process itself. main character energy, honestly. π
π«Ά RETURN VALUE π«Ά
Slay, so if everything goes right: upon successful completion, sched_getscheduler() shall return the scheduling policy of the specified process. π
If it's unsuccessful? the function shall return -1 and set errno to indicate the error. not the vibe, but at least it tells you why. π
π ERRORS π
The sched_getscheduler() function shall fail if:
EPERMβ The requesting process does not have permission to determine the scheduling policy of the specified process. (you're not on the list, bestie π)ESRCHβ No process can be found corresponding to that specified bypid. (ghosted, literally π»)
The following sections are informative. π§ (yes, all of them. informational only, no rules here.)
π EXAMPLES π
None.
π APPLICATION USAGE π
None.
β RATIONALE β
None.
π₯ FUTURE DIRECTIONS π₯
None.
πΈ SEE ALSO πΈ
sched_getparam()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!! π«Ά this one came to you from IEEE/The Open Group, 2017, and the page name on the tin is SCHED_GETSCHEDULER(3POSIX). go get those scheduling policies, you icon. π
β¨
π¦ 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