Bug 175687 - pthread_setschedparam(3) may fail for undocumented reason (EPERM)
Summary: pthread_setschedparam(3) may fail for undocumented reason (EPERM)
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Some People
Assignee: Mitchell Horne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-30 02:30 UTC by Mikhail T.
Modified: 2022-10-25 14:39 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2013-01-30 02:30:00 UTC
	The pthread_setschedparam(3) manual page lists the following
	possible reasons for the function's failure:

	     The pthread_setschedparam() function will fail if:

		     [EINVAL]        Invalid value for policy.
		     [ENOTSUP]       Invalid value for scheduling parameters.
		     [ESRCH]         Non-existent thread thread.

	However, the function may also fail -- with EPERM -- if an
	attempt is made to alter the scheduling policy of a thread.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:00 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-10-17 18:13:56 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=04620006b9116049e9e2f27d74417d2d84dc8d10

commit 04620006b9116049e9e2f27d74417d2d84dc8d10
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-10-17 18:11:13 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-10-17 18:12:12 +0000

    pthread_setschedparam(3): document EPERM return

    In kern_sched_setparam(), before setting any parameters, p_cansched() is
    called to check that the thread has appropriate privileges.

    PR:             175687
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D37020

 share/man/man3/pthread_schedparam.3 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-10-24 15:54:35 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4d31ad0a1f3539091268ea0f6934cc1a411b0468

commit 4d31ad0a1f3539091268ea0f6934cc1a411b0468
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-10-17 18:11:13 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-10-24 15:53:11 +0000

    pthread_setschedparam(3): document EPERM return

    In kern_sched_setparam(), before setting any parameters, p_cansched() is
    called to check that the thread has appropriate privileges.

    PR:             175687
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D37020

    (cherry picked from commit 04620006b9116049e9e2f27d74417d2d84dc8d10)

 share/man/man3/pthread_schedparam.3 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-10-24 15:58:38 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f18e56c17ae2cb6b190fe4cf53a3407201f9e3b0

commit f18e56c17ae2cb6b190fe4cf53a3407201f9e3b0
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2022-10-17 18:11:13 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-10-24 15:56:13 +0000

    pthread_setschedparam(3): document EPERM return

    In kern_sched_setparam(), before setting any parameters, p_cansched() is
    called to check that the thread has appropriate privileges.

    PR:             175687
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D37020

    (cherry picked from commit 04620006b9116049e9e2f27d74417d2d84dc8d10)

 share/man/man3/pthread_schedparam.3 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)