Re: Prozesspriorität erhöhen

"Schirmer, Manfred" <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Am Donnerstag, den 02.12.2004, 11:57 +0100 schrieb Andreas Kofler:
> On Thursday 02 December 2004 11:42, Hannes Bock wrote:
> Hallo,
> > ich würde gern in einem Programm die Prozesspriorität festlegen.
> > z.B. wenn man es als root ausführt das dann die Priorität bei 5 oder 0
> > liegt.
> > Gibt es denn da eine Möglichkeit das direkt im Quellcode zu machen?
> Jo,
> mit getpriority, setpriority, or nice Subroutine
> siehe man://getpriority  (2)
> 
> > Mit nice bzw. renice ist es etwas umständlich.
> > Und kann man die Priorität (vom Programm aus) auch auf 5 setzten wenn
> > man es nicht als root ausführt?
> Meines Wissens nicht.
> 
> ~ Andi
> 
Hi,

probier es doch mal mit getuid() bzw. geteuid(); root sollte uid=0
haben, abhängig davon dann setpriority() setzen
-- 
Manfred Schirmer
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBBrz/YxYiiBqhB1uMRAtK8AKDL30X/GC03HkEXoLie2eaCYG8PhgCgiSwE
kf0vhuDfpOQ2RrTTydy+jck=
=NpP+
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.