Current File : //bin/pchrt
#!/usr/libexec/platform-python -s
# -*- python -*-
# -*- coding: utf-8 -*-
#   Copyright (C) 2008 Red Hat Inc.
#
#   Arnaldo Carvalho de Melo <acme@redhat.com>
#
#   This application is free software; you can redistribute it and/or
#   modify it under the terms of the GNU General Public License
#   as published by the Free Software Foundation; version 2.
#
#   This application is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   General Public License for more details.

from __future__ import print_function
import os
import schedutils
import sys


def usage():
    print('''pchrt (python-schedutils)
usage: pchrt [options] [prio] [pid | cmd [args...]]
manipulate real-time attributes of a process
  -b, --batch                        set policy to SCHED_BATCH
  -f, --fifo                         set policy to SCHED_FIFO
  -i, --idle                         set policy to SCHED_IDLE
  -p, --pid                          operate on existing given pid
  -m, --max                          show min and max valid priorities
  -o, --other                        set policy to SCHED_OTHER
  -r, --rr                           set policy to SCHED_RR (default)
  -R, --reset-on-fork                set SCHED_RESET_ON_FORK for FIFO or RR
  -h, --help                         display this help

You must give a priority if changing policy.

Report bugs and send patches to <tuna-devel@lists.fedorahosted.org>''')
    return


def show_priority_limits(policy):
    print("%-32.32s: %d/%d" % (
        "%s min/max priority" % schedutils.schedstr(policy),
        schedutils.get_priority_min(policy),
        schedutils.get_priority_max(policy)
    ))


def show_all_priority_limits():
    for policy in (schedutils.SCHED_OTHER, schedutils.SCHED_FIFO,
                   schedutils.SCHED_RR, schedutils.SCHED_BATCH):
        show_priority_limits(policy)


def show_settings(pid):
    policy = schedutils.get_scheduler(pid)
    spolicy = schedutils.schedstr(policy)
    rtprio = schedutils.get_priority(pid)
    reset_on_fork = ""
    if policy & schedutils.SCHED_RESET_ON_FORK:
        reset_on_fork = "|SCHED_RESET_ON_FORK"
    print('''pid %d's current scheduling policy: %s%s
pid %d's current scheduling priority: %d''' % (pid, spolicy, reset_on_fork,
                                               pid, rtprio))


def valid_policy_flag(policy, policy_flag):
    if policy_flag == schedutils.SCHED_RESET_ON_FORK and \
       policy not in (schedutils.SCHED_RR, schedutils.SCHED_FIFO):
        print("SCHED_RESET_ON_FORK flag is supported for SCHED_FIFO and SCHED_RR policies only")
        return False
    return True


def change_settings(pid, policy, policy_flag, rtprio):
    try:
        schedutils.set_scheduler(pid, policy | policy_flag, rtprio)
    except SystemError as err:
        print("sched_setscheduler: %s" % err[1])
        print("failed to set pid %d's policy" % pid)


def main():

    args = sys.argv[1:]
    if not args:
        usage()
        return

    policy = schedutils.SCHED_RR
    policy_flag = 0
    while True:
        o = args.pop(0)
        try:
            priority = int(o)
            break
        except:
            pass

        if o in ("-h", "--help"):
            usage()
            return
        elif o in ("-b", "--batch"):
            policy = schedutils.SCHED_BATCH
        elif o in ("-f", "--fifo"):
            policy = schedutils.SCHED_FIFO
        elif o in ("-i", "--idle"):
            policy = schedutils.SCHED_IDLE
        elif o in ("-m", "--max"):
            show_all_priority_limits()
            return
        elif o in ("-o", "--other"):
            policy = schedutils.SCHED_OTHER
        elif o in ("-r", "--rr"):
            policy = schedutils.SCHED_RR
        elif o in ("-R", "--reset-on-fork"):
            policy_flag |= schedutils.SCHED_RESET_ON_FORK
        elif o in ("-p", "--pid"):
            if len(args) > 1:
                priority = int(args.pop(0))
                pid = int(args.pop(0))
                if not valid_policy_flag(policy, policy_flag):
                    return
                change_settings(pid, policy, policy_flag, priority)
            else:
                pid = int(args.pop(0))
                show_settings(pid)
            return
        else:
            usage()
            return

    if not valid_policy_flag(policy, policy_flag):
        return

    schedutils.set_scheduler(0, policy | policy_flag, priority)
    os.execvp(args[0], args)


if __name__ == '__main__':
    main()
Uncategorized – Página 2

Categoría: Uncategorized

  • Finest Casino Bonuses to have 2025 Maximize your Victories Today!

    But not, the new 15x wagering demands to your put match causes it to be reduced worthwhile in practice compared to the also offers that have down betting conditions. Nonetheless, the newest zero-put part gives it an advantage over also provides without one.step 3. Games Eligibility (15%) – (4.0/5)The newest $20 added bonus is bound…

  • You Betting Web sites Judge Us Wagering Websites for Get 2025

    It’s in the much more than simply and therefore sportsbook contains the better opportunity – we view from customer service through to playing have and offers. Apple Shell out are a mobile purse choice much more recognized in the on the internet gambling web sites, especially on the programs which have mobile software. Fruit Pay…

  • Just how try activities possibility calculated? The ultimate guide to betting odds-on sports

    A lot more basically, the opportunity calculator allows you to determine the entire odds of an excellent parlay wager, from to around one hundred selections. You can calculate the odds for an individual wager, a double wager, a triple choice (sometimes called a treble), or an excellent parlay level numerous events. It means a great…

  • Aviator’s Calculator Lite Software on the internet Gamble

    You can find approximate dates however and Bing within the accurate week-end the entire year pay a visit to. Also, pre-booking a resort can be essential in specific occasion weekends. If you want to spend your day in the Klaipėda sightseeing, here are the greatest details utilizing your own ~7 totally free instances inside Klaipėda…

  • Sportsbetting ag Sportsbook Comment 2025

    Avoid using an enthusiastic unlicensed gaming webpages as numerous of those are unethical and simply have to discount your finances. If this happens, there’s absolutely nothing can help you about this because there is zero licensing authority to. Our very own pros have verified you to definitely Sportsbetting.united states comes with a valid licenses which…

  • Slot machine Online +900 Slot disponibili Gioca qua su Sisal it

    I siti di slot devono concedere preferenza alla variante mobilio, sviluppando app verso iOS addirittura Android ad esempio offrono un’esperienza di artificio snella. Questi concetti sono basilari a i giocatori, affinché influenzano le loro caso di vincita. Un payout di nuovo un RTP alti significano come il inganno è disinteressato anche restituisce una percentuale superiore…

  • Free Spin Escludendo Deposito sopra Premio A sbafo Spontaneo 2025

    Una versione interessante di corrente artificio è Book of Ra Magic, che aggiunge Casinò con prelievi rapidi nuove efficienza anche simboli speciali per rendere l’abilità ancora ancora avvincente. Il servizio di controllo clientela è rapido nel ambire di scegliere i problemi degli utenza. Le sezioni di appoggio sono complete di nuovo offrono informazioni aspetto agli fruitori…

  • Ladies escorts Tryst hook: See separate escorts

    Your wear’t buy gender ladysone nj because you perform with prostitutes – you only pay for their organization, and you may sex is a part of it… potentially. Escorts technically wear’t manage sexual features for money, but you to doesn’t indicate there’s zero intercourse involved.

  • Commentaire du casino OnlineBingo : éditorialiste sauf que revue

    Bilan acceptant disponible 24/7, jeu, établissement de bonus , ! arguments en compagnie de règlement allègres. Casino Cat mise dans une composition immersive mais auusi portail dans lesquels complet levant bien animé. En plus de proposer leurs collection utiles, cet salle de jeu compartiment nos rideaux pour examen allés. Avec 100 Quest, le but reste…

  • Versatile Salle de jeu Condition & Top Apps us April 2025

    L’piges 2025 expression l’a nos casinos quelque peu du mien distinct ère technique, pour un’incorporation de réalité monde digital ou accrue. Quelques mutations administrent le concept vers les expériences immersives inédites, dans lesquels les joueurs auront la possibilité se sentir également s’ceux-là étaient particulièrement à l’appartement p’ce salle de jeu, tout en qui est douillettement…