thr_attr_getinheritsched.c revision 50476
1219820Sjeff/*
2219820Sjeff * Copyright (c) 1998 Daniel Eischen <eischen@vigrid.com>.
3219820Sjeff * All rights reserved.
4219820Sjeff *
5219820Sjeff * Redistribution and use in source and binary forms, with or without
6219820Sjeff * modification, are permitted provided that the following conditions
7219820Sjeff * are met:
8219820Sjeff * 1. Redistributions of source code must retain the above copyright
9219820Sjeff *    notice, this list of conditions and the following disclaimer.
10219820Sjeff * 2. Redistributions in binary form must reproduce the above copyright
11219820Sjeff *    notice, this list of conditions and the following disclaimer in the
12219820Sjeff *    documentation and/or other materials provided with the distribution.
13219820Sjeff * 3. All advertising materials mentioning features or use of this software
14219820Sjeff *    must display the following acknowledgement:
15219820Sjeff *	This product includes software developed by Daniel Eischen.
16219820Sjeff * 4. Neither the name of the author nor the names of any co-contributors
17219820Sjeff *    may be used to endorse or promote products derived from this software
18219820Sjeff *    without specific prior written permission.
19219820Sjeff *
20219820Sjeff * THIS SOFTWARE IS PROVIDED BY DANIEL EISCHEN AND CONTRIBUTORS ``AS IS'' AND
21219820Sjeff * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22219820Sjeff * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23219820Sjeff * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24219820Sjeff * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25219820Sjeff * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26219820Sjeff * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27219820Sjeff * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28219820Sjeff * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29219820Sjeff * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30219820Sjeff * SUCH DAMAGE.
31219820Sjeff *
32219820Sjeff * $FreeBSD: head/lib/libkse/thread/thr_attr_getinheritsched.c 50476 1999-08-28 00:22:10Z peter $
33219820Sjeff */
34219820Sjeff#include <errno.h>
35219820Sjeff#ifdef _THREAD_SAFE
36219820Sjeff#include <pthread.h>
37219820Sjeff#include "pthread_private.h"
38219820Sjeff
39219820Sjeffint
40219820Sjeffpthread_attr_getinheritsched(pthread_attr_t *attr, int *sched_inherit)
41219820Sjeff{
42219820Sjeff	int ret = 0;
43219820Sjeff
44219820Sjeff	if ((attr == NULL) || (*attr == NULL))
45219820Sjeff		ret = EINVAL;
46219820Sjeff	else
47219820Sjeff		*sched_inherit = (*attr)->sched_inherit;
48219820Sjeff
49219820Sjeff	return(ret);
50219820Sjeff}
51219820Sjeff#endif
52219820Sjeff