SCHED_GETSCHEDULER(3P)
π SCHED_GETSCHEDULER(3P) β POSIX Programmer's Manual π
okay bestie, welcome to the POSIX Programmer's Manual β¨ this one's a 3P page, which means it's the POSIX-flavoured version of things. quick heads up before we dive in:
PROLOG: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so pls consult the corresponding Linux manual page for the deets on Linux behavior), or the interface may not even be implemented on Linux at all. π
π NAME π
sched_getscheduler β get scheduling policy (REALTIME)
like. it gets the scheduler. the name ate, honestly. π₯
β¨ SYNOPSIS β¨
#include <sched.h>
int sched_getscheduler(pid_t pid);
πΈ DESCRIPTION πΈ
so the whole vibe here is: sched_getscheduler() shall return the scheduling policy of the process specified by pid. that's it, that's the function. π
now, plot twist β if the value of pid is negative, the behavior of the sched_getscheduler() function is unspecified. not me handing you a negative pid and getting chaos back π don't do that.
the values that can be returned by sched_getscheduler() are defined in the <sched.h> header. go look, they're in there, iykyk.
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? the scheduling policy shall be returned for the calling process. it's giving main character energy β you're asking about yourself. π
π¦ RETURN VALUE π¦
upon successful completion, the sched_getscheduler() function shall return the scheduling policy of the specified process. slay. β¨
if unsuccessful, the function shall return -1 and set errno to indicate the error. classic. that's the move. π
π 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. bestie you are not on the list. π«ESRCHβ no process can be found corresponding to that specified bypid. it's not there. ghosted fr fr. π»
the following sections are informative β meaning they're not normative requirements, they're just vibes. π§
π EXAMPLES π
None.
literally none. the page said "no thoughts, head empty" π
β APPLICATION USAGE β
None.
again β nothing. we're keeping it minimal. π
π RATIONALE π
None.
the reasoning? nonexistent. iconic behavior honestly. π
πΈ FUTURE DIRECTIONS πΈ
None.
the future? unbothered. π
π SEE ALSO π
sched_getparam()sched_setparam()sched_setscheduler()- The Base Definitions volume of POSIX.1β2017,
<sched.h>
go read those next, bestie, they're the whole friend group π«Ά
π 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, SCHED_GETSCHEDULER(3P) β go forth and schedule responsibly π β¨
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms