.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
.\" <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.TH PTHREAD_SETSCHEDPARAM 3 2008-11-17 "Linux" "Linux Programmer's Manual"
.SH NAME
.BI " struct sched_param *" param );
.sp
Compile and link with \fI\-pthread\fP.
+.fi
.SH DESCRIPTION
The
.BR pthread_setschedparam ()
fpe("\-m<policy><prio> Set scheduling policy and priority on\\n");
fpe(" main thread before pthread_create() call\\n");
exit(EXIT_FAILURE);
-} /* usage */
+}
static int
get_policy(char p, int *policy)
case \(aqo\(aq: *policy = SCHED_OTHER; return 1;
default: return 0;
}
-} /* get_policy */
+}
static void
display_sched_attr(int policy, struct sched_param *param)
(policy == SCHED_OTHER) ? "SCHED_OTHER" :
"???",
param\->sched_priority);
-} /* display_sched_attr */
+}
static void
display_thread_sched_attr(char *msg)
printf("%s\\n", msg);
display_sched_attr(policy, ¶m);
-} /* display_thread_sched_attr */
+}
static void *
thread_start(void *arg)
display_thread_sched_attr("Scheduler attributes of new thread");
return NULL;
-} /* thread_start */
+}
int
main(int argc, char *argv[])
handle_error_en(s, "pthread_join");
exit(EXIT_SUCCESS);
-} /* main */
+}
.fi
.SH SEE ALSO
+.ad l
+.nh
.BR getrlimit (2),
.BR sched_get_priority_min (2),
.BR sched_setscheduler (2),
.BR pthread_attr_setinheritsched (3),
.BR pthread_attr_setschedparam (3),
.BR pthread_attr_setschedpolicy (3),
-.BR pthread_setschedprio (3),
.BR pthread_create (3),
.BR pthread_self (3),
+.BR pthread_setschedprio (3),
.BR pthreads (7)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.