Scheduling.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef HEADER_Scheduling
  2. #define HEADER_Scheduling
  3. /*
  4. htop - Scheduling.h
  5. (C) 2023 htop dev team
  6. Released under the GNU GPLv2+, see the COPYING file
  7. in the source distribution for its full text.
  8. */
  9. #include <sched.h>
  10. #include <stdbool.h>
  11. #include "Object.h"
  12. #include "Panel.h"
  13. #include "Process.h"
  14. #include "Row.h"
  15. #if defined(HAVE_SCHED_SETSCHEDULER) && defined(HAVE_SCHED_GETSCHEDULER)
  16. #define SCHEDULER_SUPPORT
  17. typedef struct {
  18. const char* name;
  19. int id;
  20. bool prioritySupport;
  21. } SchedulingPolicy;
  22. #define SCHEDULINGPANEL_INITSELECTEDPOLICY SCHED_OTHER
  23. #define SCHEDULINGPANEL_INITSELECTEDPRIORITY 50
  24. Panel* Scheduling_newPolicyPanel(int preSelectedPolicy);
  25. void Scheduling_togglePolicyPanelResetOnFork(Panel* schedPanel);
  26. Panel* Scheduling_newPriorityPanel(int policy, int preSelectedPriority);
  27. typedef struct {
  28. int policy;
  29. int priority;
  30. } SchedulingArg;
  31. bool Scheduling_rowSetPolicy(Row* proc, Arg arg);
  32. const char* Scheduling_formatPolicy(int policy);
  33. void Scheduling_readProcessPolicy(Process* proc);
  34. #endif
  35. #endif /* HEADER_Scheduling */