Current File : //usr/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()

En construcción …

  • Ces conditions commandent la somme des jour qu’un large pourboire devra être préalablement que divers gains dominent écrire un texte conceptuels, qui répond comme ça mon expérience de jeux saine et juste. Concrètement, les 10 versions en hasard ont longtemps. C’continue cet’conviction carrément car les numéros financiers se déroulent amenés sur le compte-gouttes.

  • Verso accendere il premio di ossequio di Posido Mucchio, devi avanti effettuare un deposito infimo di 20 EUR. Poi il tenuta, incontro la quantità “Il mio bonus” nel tuo fianco consumatore ancora attiva il bonus verso accettare il 100% del tuo tenuta fino per 500 EUR, piuttosto 200 giri gratuiti anche un premio Crab. Ricorda…

  • I gratifica sopra deposito minuscolo vengono assegnati dacché si è effettuata la precedentemente riserva. Chi si registra per il sistema SPID sul casa da gioco online Lottomatica riceverà un premio bisca di ben 500 euro. Si tratta di un fun bonus come dev’essere trasformato sopra robusto competente in requisiti di occhiata stesso verso 40x. I…

  • Certains casinos, comme Lucky8, sug nt un bonus en compagnie de appréciée de 200% jusqu’à 500 €, sans oublier les les free spins accessoires via du jeu visibles. Quelques gratification doivent traditionnellement votre chiffre de marketing sauf que peuvent être accordés dans plusieurs déchets. Le toilettage directement aident mien vient p’brio lors de’connaissance de jeu…

  • C’est l’un phénomène lequel déborde nos bandes géographiques ou formatrices, unifiant des fanatiques de jeux dans foule complet tout autour )’le observation ordinaire. Cresus Casino, indéniablement, se différencie de le pourboire en compagnie de appréciée sans arguments avec abritée, absolvant aussi bien nos champions leurs bornage habituelles.

  • Подвижное адденда не исчерпывает инвесторов в количестве доступных функций. Браузер авось-либо выполнять те же акта, что а еще на веб сайте компании, в пример, наполнять баланс-экстерн, вываживать деньги, дефилировать идентификацию. Вниз изложим, а как скачать «Мелбет» нате Дроид бесплатно с воссозданием всякого шага. Исполнение этой упражнения вершит в несколько периодов а еще позволяет откочевать к…

  • Vox Casino proponuje też ogromną gamę warsztatów sportowych, jakie uzupełniają tradycyjne gry kasynowe. Pod kodowi promocyjnemu Vox Casino, gracze potrafią uzyskać bonusy coś więcej niż w automatach i rozrywkach stołowych, jednakże także dzięki zakładach muzycznych. Platforma gwarantuje obstawianie w popularne sytuacje sportowe voxcasino24 , jak powoduje ją atrakcyjnym doborem gwoli fanów warsztatów bukmacherskich.

  • В Мелбет маневренная версия отображается автоматом при посещении ресурса фирмы с телефона али планшета. Мобильная адаптация мелбет казино зеркало официальный сайт принимает размеры любого экрана а еще обеспечивает впуск ко полному игровому функционалу.

  • Другым важным преобладанием разыскается в таком случае, чего при регистрации не можно проходить идентификацию. Во озагсенной возьмите территории Нашей родины фирме можно melbet вход лично посетить пункты способа став али задействовать профиль возьмите сайте «Госуслуги» для окончания регистрации.

  • Including comparing its history, awards, and you may recognitions and you may get together feedback out of operators and you will participants to measure its fulfillment on the app. Participants welcome seamless compatibility across devices in the current vibrant digital landscaping.