Re: Unable set the priority for a pthread through pthread_setschedparam

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Srinivas G. wrote:

> I have written a small thread program in C using the pthreads. I am able
> to set the threads priority with pthread_setschedparam API when I login
> as ROOT. If I login as a normal user other than ROOT, then the API
> returns the error number 1 (EPERM). 
> 
> Please let me know whether a normal user can set the pthreads priority
> with pthread_setschedparam API or not.

Yes, subject to certain restrictions, which are detailed in the
sched_setscheduler(2) manpage.

In particular, a non-privileged process cannot set the real-time
priority higher than its RLIMIT_RTPRIO setting. You can change this
with an "rtprio" entry in /etc/security/limits.conf (settings are
applied on login, so changes won't affect existing login sessions).

Privilege is determined by the CAP_SYS_NICE capability.

-- 
Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux