[Midnightbsd-cvs] src: sys/posix4: Move these

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Sep 12 20:52:31 EDT 2008


Log Message:
-----------
Move these

Removed Files:
-------------
    src/sys/posix4:
        _semaphore.h
        ksched.c
        ksem.h
        mqueue.h
        p1003_1b.c
        posix4.h
        posix4_mib.c
        sched.h
        semaphore.h

-------------- next part --------------
--- sys/posix4/sched.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * Copyright (c) 1996, 1997
- *	HD Associates, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by HD Associates, Inc
- *	and Jukka Antero Ukkonen.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/posix4/sched.h,v 1.7 2002/10/03 06:27:50 mike Exp $
- */
-
-/* sched.h: POSIX 1003.1b Process Scheduling header */
-
-#ifndef _SCHED_H_
-#define _SCHED_H_
-
-#include <sys/_types.h>
-
-#ifndef _PID_T_DECLARED
-typedef	__pid_t		pid_t;
-#define	_PID_T_DECLARED
-#endif
-
-/*
- * Scheduling policies
- */
-#define	SCHED_FIFO	1
-#define	SCHED_OTHER	2
-#define	SCHED_RR	3
-
-struct sched_param {
-	int	sched_priority;
-};
-
-#ifndef _KERNEL
-#include <sys/cdefs.h>
-
-struct timespec;
-
-__BEGIN_DECLS
-int	sched_get_priority_max(int);
-int	sched_get_priority_min(int);
-int	sched_getparam(pid_t, struct sched_param *);
-int	sched_getscheduler(pid_t);
-int	sched_rr_get_interval(pid_t, struct timespec *);
-int	sched_setparam(pid_t, const struct sched_param *);
-int	sched_setscheduler(pid_t, int, const struct sched_param *);
-int	sched_yield(void);
-__END_DECLS
-
-#endif
-
-#endif /* !_SCHED_H_ */
--- sys/posix4/posix4_mib.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*-
- * Copyright (c) 1998
- *	HD Associates, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by HD Associates, Inc
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/posix4/posix4_mib.c,v 1.9 2004/12/01 23:16:37 phk Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/queue.h>
-#include <sys/sysctl.h>
-#include <sys/vnode.h>
-#include <posix4/posix4.h>
-
-static int facility[CTL_P1003_1B_MAXID - 1];
-static int facility_initialized[CTL_P1003_1B_MAXID - 1];
-
-/* OID_AUTO isn't working with sysconf(3).  I guess I'd have to
- * modify it to do a lookup by name from the index.
- * For now I've left it a top-level sysctl.
- */
-
-#if 1
-
-SYSCTL_DECL(_p1003_1b);
-
-#define P1B_SYSCTL(num, name)  \
-SYSCTL_INT(_p1003_1b, num, \
-	name, CTLFLAG_RD, facility + num - 1, 0, "");
-
-#else
-
-SYSCTL_DECL(_kern_p1003_1b);
-
-#define P1B_SYSCTL(num, name)  \
-SYSCTL_INT(_kern_p1003_1b, OID_AUTO, \
-	name, CTLFLAG_RD, facility + num - 1, 0, "");
-SYSCTL_NODE(_kern, OID_AUTO, p1003_1b, CTLFLAG_RW, 0, "P1003.1B");
-
-#endif
-
-SYSCTL_INT(_p1003_1b, CTL_P1003_1B_ASYNCHRONOUS_IO, \
-	asynchronous_io, CTLFLAG_RD, &async_io_version, 0, "");
-P1B_SYSCTL(CTL_P1003_1B_MAPPED_FILES, mapped_files);
-P1B_SYSCTL(CTL_P1003_1B_MEMLOCK, memlock);
-P1B_SYSCTL(CTL_P1003_1B_MEMLOCK_RANGE, memlock_range);
-P1B_SYSCTL(CTL_P1003_1B_MEMORY_PROTECTION, memory_protection);
-P1B_SYSCTL(CTL_P1003_1B_MESSAGE_PASSING, message_passing);
-P1B_SYSCTL(CTL_P1003_1B_PRIORITIZED_IO, prioritized_io);
-P1B_SYSCTL(CTL_P1003_1B_PRIORITY_SCHEDULING, priority_scheduling);
-P1B_SYSCTL(CTL_P1003_1B_REALTIME_SIGNALS, realtime_signals);
-P1B_SYSCTL(CTL_P1003_1B_SEMAPHORES, semaphores);
-P1B_SYSCTL(CTL_P1003_1B_FSYNC, fsync);
-P1B_SYSCTL(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, shared_memory_objects);
-P1B_SYSCTL(CTL_P1003_1B_SYNCHRONIZED_IO, synchronized_io);
-P1B_SYSCTL(CTL_P1003_1B_TIMERS, timers);
-P1B_SYSCTL(CTL_P1003_1B_AIO_LISTIO_MAX, aio_listio_max);
-P1B_SYSCTL(CTL_P1003_1B_AIO_MAX, aio_max);
-P1B_SYSCTL(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, aio_prio_delta_max);
-P1B_SYSCTL(CTL_P1003_1B_DELAYTIMER_MAX, delaytimer_max);
-P1B_SYSCTL(CTL_P1003_1B_MQ_OPEN_MAX, mq_open_max);
-P1B_SYSCTL(CTL_P1003_1B_PAGESIZE, pagesize);
-P1B_SYSCTL(CTL_P1003_1B_RTSIG_MAX, rtsig_max);
-P1B_SYSCTL(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max);
-P1B_SYSCTL(CTL_P1003_1B_SEM_VALUE_MAX, sem_value_max);
-P1B_SYSCTL(CTL_P1003_1B_SIGQUEUE_MAX, sigqueue_max);
-P1B_SYSCTL(CTL_P1003_1B_TIMER_MAX, timer_max);
-
-#define P31B_VALID(num)	((num) >= 1 && (num) < CTL_P1003_1B_MAXID)
-
-/* p31b_setcfg: Set the configuration
- */
-void
-p31b_setcfg(int num, int value)
-{
-
-	if (P31B_VALID(num)) {
-		facility[num - 1] = value;
-		facility_initialized[num - 1] = 1;
-	}
-}
-
-int
-p31b_getcfg(int num)
-{
-
-	if (P31B_VALID(num))
-		return (facility[num - 1]);
-	return (0);
-}
-
-int
-p31b_iscfg(int num)
-{
-
-	if (P31B_VALID(num))
-		return (facility_initialized[num - 1]);
-	return (0);
-}
-
-/*
- * Turn on indications for standard (non-configurable) kernel features.
- */
-static void
-p31b_set_standard(void *dummy)
-{
-	/* ??? p31b_setcfg(CTL_P1003_1B_FSYNC, 1); */
-	p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 1);
-	p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 1);
-	p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE);
-	if (!p31b_iscfg(CTL_P1003_1B_AIO_LISTIO_MAX))
-		p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, -1);
-	if (!p31b_iscfg(CTL_P1003_1B_AIO_MAX))
-		p31b_setcfg(CTL_P1003_1B_AIO_MAX, -1);
-	if (!p31b_iscfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX))
-		p31b_setcfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, -1);
-}
-
-SYSINIT(p31b_set_standard, SI_SUB_P1003_1B, SI_ORDER_ANY, p31b_set_standard, 
-	0);
-
--- sys/posix4/ksched.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*-
- * Copyright (c) 1996, 1997
- *	HD Associates, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by HD Associates, Inc
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* ksched: Soft real time scheduling based on "rtprio".
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/posix4/ksched.c,v 1.26 2005/01/07 02:29:19 imp Exp $");
-
-#include "opt_posix.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/lock.h>
-#include <sys/mutex.h>
-#include <sys/proc.h>
-#include <sys/resource.h>
-#include <sys/sched.h>
-
-#include <posix4/posix4.h>
-
-/* ksched: Real-time extension to support POSIX priority scheduling.
- */
-
-struct ksched {
-	struct timespec rr_interval;
-};
-
-int ksched_attach(struct ksched **p)
-{
-	struct ksched *ksched= p31b_malloc(sizeof(*ksched));
-
-	ksched->rr_interval.tv_sec = 0;
-	ksched->rr_interval.tv_nsec = 1000000000L / sched_rr_interval();
-
-	*p = ksched;
-	return 0;
-}
-
-int ksched_detach(struct ksched *ks)
-{
-	p31b_free(ks);
-
-	return 0;
-}
-
-/*
- * XXX About priorities
- *
- *	POSIX 1003.1b requires that numerically higher priorities be of
- *	higher priority.  It also permits sched_setparam to be
- *	implementation defined for SCHED_OTHER.  I don't like
- *	the notion of inverted priorites for normal processes when
- *  you can use "setpriority" for that.
- *
- *	I'm rejecting sched_setparam for SCHED_OTHER with EINVAL.
- */
-
-/* Macros to convert between the unix (lower numerically is higher priority)
- * and POSIX 1003.1b (higher numerically is higher priority)
- */
-
-#define p4prio_to_rtpprio(P) (RTP_PRIO_MAX - (P))
-#define rtpprio_to_p4prio(P) (RTP_PRIO_MAX - (P))
-
-/* These improve readability a bit for me:
- */
-#define P1B_PRIO_MIN rtpprio_to_p4prio(RTP_PRIO_MAX)
-#define P1B_PRIO_MAX rtpprio_to_p4prio(RTP_PRIO_MIN)
-
-static __inline int
-getscheduler(register_t *ret, struct ksched *ksched, struct thread *td)
-{
-	struct rtprio rtp;
-	int e = 0;
-
-	mtx_lock_spin(&sched_lock);
-	pri_to_rtp(td->td_ksegrp, &rtp);
-	mtx_unlock_spin(&sched_lock);
-	switch (rtp.type)
-	{
-		case RTP_PRIO_FIFO:
-		*ret = SCHED_FIFO;
-		break;
-
-		case RTP_PRIO_REALTIME:
-		*ret = SCHED_RR;
-		break;
-
-		default:
-		*ret = SCHED_OTHER;
-		break;
-	}
-
-	return e;
-}
-
-int ksched_setparam(register_t *ret, struct ksched *ksched,
-	struct thread *td, const struct sched_param *param)
-{
-	register_t policy;
-	int e;
-
-	e = getscheduler(&policy, ksched, td);
-
-	if (e == 0)
-	{
-		if (policy == SCHED_OTHER)
-			e = EINVAL;
-		else
-			e = ksched_setscheduler(ret, ksched, td, policy, param);
-	}
-
-	return e;
-}
-
-int ksched_getparam(register_t *ret, struct ksched *ksched,
-	struct thread *td, struct sched_param *param)
-{
-	struct rtprio rtp;
-
-	mtx_lock_spin(&sched_lock);
-	pri_to_rtp(td->td_ksegrp, &rtp);
-	mtx_unlock_spin(&sched_lock);
-	if (RTP_PRIO_IS_REALTIME(rtp.type))
-		param->sched_priority = rtpprio_to_p4prio(rtp.prio);
-
-	return 0;
-}
-
-/*
- * XXX The priority and scheduler modifications should
- *     be moved into published interfaces in kern/kern_sync.
- *
- * The permissions to modify process p were checked in "p31b_proc()".
- *
- */
-int ksched_setscheduler(register_t *ret, struct ksched *ksched,
-	struct thread *td, int policy, const struct sched_param *param)
-{
-	int e = 0;
-	struct rtprio rtp;
-	struct ksegrp *kg = td->td_ksegrp;
-
-	switch(policy)
-	{
-		case SCHED_RR:
-		case SCHED_FIFO:
-
-		if (param->sched_priority >= P1B_PRIO_MIN &&
-		param->sched_priority <= P1B_PRIO_MAX)
-		{
-			rtp.prio = p4prio_to_rtpprio(param->sched_priority);
-			rtp.type = (policy == SCHED_FIFO)
-				? RTP_PRIO_FIFO : RTP_PRIO_REALTIME;
-
-			mtx_lock_spin(&sched_lock);
-			rtp_to_pri(&rtp, kg);
-			FOREACH_THREAD_IN_GROUP(kg, td) { /* XXXKSE */
-				if (TD_IS_RUNNING(td)) {
-					td->td_flags |= TDF_NEEDRESCHED;
-				} else if (TD_ON_RUNQ(td)) {
-					if (td->td_priority > kg->kg_user_pri) {
-						sched_prio(td, kg->kg_user_pri);
-					}
-				}
-			}
-			mtx_unlock_spin(&sched_lock);
-		}
-		else
-			e = EPERM;
-
-
-		break;
-
-		case SCHED_OTHER:
-		{
-			rtp.type = RTP_PRIO_NORMAL;
-			rtp.prio = p4prio_to_rtpprio(param->sched_priority);
-			mtx_lock_spin(&sched_lock);
-			rtp_to_pri(&rtp, kg);
-
-			/* XXX Simply revert to whatever we had for last
-			 *     normal scheduler priorities.
-			 *     This puts a requirement
-			 *     on the scheduling code: You must leave the
-			 *     scheduling info alone.
-			 */
-			FOREACH_THREAD_IN_GROUP(kg, td) {
-				if (TD_IS_RUNNING(td)) {
-					td->td_flags |= TDF_NEEDRESCHED;
-				} else if (TD_ON_RUNQ(td)) {
-					if (td->td_priority > kg->kg_user_pri) {
-						sched_prio(td, kg->kg_user_pri);
-					}
-				}
-				
-			}
-			mtx_unlock_spin(&sched_lock);
-		}
-		break;
-		
-		default:
-			e = EINVAL;
-			break;
-	}
-
-	return e;
-}
-
-int ksched_getscheduler(register_t *ret, struct ksched *ksched, struct thread *td)
-{
-	return getscheduler(ret, ksched, td);
-}
-
-/* ksched_yield: Yield the CPU.
- */
-int ksched_yield(register_t *ret, struct ksched *ksched)
-{
-	mtx_lock_spin(&sched_lock);
-	curthread->td_flags |= TDF_NEEDRESCHED;
-	mtx_unlock_spin(&sched_lock);
-	return 0;
-}
-
-int ksched_get_priority_max(register_t*ret, struct ksched *ksched, int policy)
-{
-	int e = 0;
-
-	switch (policy)
-	{
-		case SCHED_FIFO:
-		case SCHED_RR:
-		*ret = RTP_PRIO_MAX;
-		break;
-
-		case SCHED_OTHER:
-		*ret =  PRIO_MAX;
-		break;
-
-		default:
-		e = EINVAL;
-	}
-
-	return e;
-}
-
-int ksched_get_priority_min(register_t *ret, struct ksched *ksched, int policy)
-{
-	int e = 0;
-
-	switch (policy)
-	{
-		case SCHED_FIFO:
-		case SCHED_RR:
-		*ret = P1B_PRIO_MIN;
-		break;
-
-		case SCHED_OTHER:
-		*ret =  PRIO_MIN;
-		break;
-
-		default:
-		e = EINVAL;
-	}
-
-	return e;
-}
-
-int ksched_rr_get_interval(register_t *ret, struct ksched *ksched,
-	struct thread *td, struct timespec *timespec)
-{
-	*timespec = ksched->rr_interval;
-
-	return 0;
-}
--- sys/posix4/posix4.h
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef _P1003_1B_P1003_1B_H_
-#define _P1003_1B_P1003_1B_H_
-/*-
- * Copyright (c) 1996, 1997, 1998
- *	HD Associates, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by HD Associates, Inc
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/posix4/posix4.h,v 1.13 2003/02/19 05:47:42 imp Exp $
- */
-
-#include <sys/param.h>
-#include <sys/ioccom.h>
-#include <sys/malloc.h>
-#include <posix4/sched.h>
-
-/* Generate syscall stubs for when something is optionally
- * loadable as a module.  References "syscall_not_present". 
- * XXX Good candidate for sys/syscall.h
- */
-struct proc;
-struct nosys_args;
-extern int syscall_not_present(struct thread *, const char *, struct nosys_args *);
-
-#define SYSCALL_NOT_PRESENT_GEN(SC) \
-int SC (struct thread *td, struct SC##_args *uap) \
-{ \
-	return syscall_not_present(td, #SC , (struct nosys_args *)uap); \
-}
-
-
-MALLOC_DECLARE(M_P31B);
-
-#define p31b_malloc(SIZE) malloc((SIZE), M_P31B, M_WAITOK)
-#define p31b_free(P) free((P), M_P31B)
-
-int p31b_proc(struct proc *, pid_t, struct proc **);
-
-void p31b_setcfg(int, int);
-int p31b_getcfg(int);
-int p31b_iscfg(int);
-
-#ifdef _KPOSIX_PRIORITY_SCHEDULING
-
-/* 
- * KSCHED_OP_RW is a vector of read/write flags for each entry indexed
- * by the enum ksched_op.
- *
- * 1 means you need write access, 0 means read is sufficient.
- */
-
-enum ksched_op {
-
-#define KSCHED_OP_RW { 1, 0, 1, 0, 0, 0, 0, 0 }
-
-	SCHED_SETPARAM,
-	SCHED_GETPARAM,
-	SCHED_SETSCHEDULER,
-	SCHED_GETSCHEDULER,
-	SCHED_YIELD,
-	SCHED_GET_PRIORITY_MAX,
-	SCHED_GET_PRIORITY_MIN,
-	SCHED_RR_GET_INTERVAL,
-	SCHED_OP_MAX
-};
-
-struct ksched;
-
-int ksched_attach(struct ksched **);
-int ksched_detach(struct ksched *);
-
-int ksched_setparam(register_t *, struct ksched *,
-	struct thread *, const struct sched_param *);
-int ksched_getparam(register_t *, struct ksched *,
-	struct thread *, struct sched_param *);
-
-int ksched_setscheduler(register_t *, struct ksched *,
-	struct thread *, int, const struct sched_param *);
-int ksched_getscheduler(register_t *, struct ksched *, struct thread *);
-
-int ksched_yield(register_t *, struct ksched *);
-
-int ksched_get_priority_max(register_t *, struct ksched *, int);
-int ksched_get_priority_min(register_t *, struct ksched *, int);
-
-int ksched_rr_get_interval(register_t *, struct ksched *,
-	struct thread *, struct timespec *);
-
-#endif /* _KPOSIX_PRIORITY_SCHEDULING */
-
-#endif /* _P1003_1B_P1003_1B_H_ */
--- sys/posix4/p1003_1b.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*-
- * Copyright (c) 1996, 1997, 1998
- *	HD Associates, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by HD Associates, Inc
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* p1003_1b: Real Time common code.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/posix4/p1003_1b.c,v 1.24 2005/03/31 22:54:48 jhb Exp $");
-
-#include "opt_posix.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/lock.h>
-#include <sys/module.h>
-#include <sys/mutex.h>
-#include <sys/proc.h>
-#include <sys/syscallsubr.h>
-#include <sys/sysctl.h>
-#include <sys/sysent.h>
-#include <sys/syslog.h>
-#include <sys/sysproto.h>
-
-#include <posix4/posix4.h>
-
-MALLOC_DEFINE(M_P31B, "p1003.1b", "Posix 1003.1B");
-
-/* The system calls return ENOSYS if an entry is called that is
- * not run-time supported.  I am also logging since some programs
- * start to use this when they shouldn't.  That will be removed if annoying.
- */
-int
-syscall_not_present(struct thread *td, const char *s, struct nosys_args *uap)
-{
-	log(LOG_ERR, "cmd %s pid %d tried to use non-present %s\n",
-			td->td_proc->p_comm, td->td_proc->p_pid, s);
-
-	/* a " return nosys(p, uap); " here causes a core dump.
-	 */
-
-	return ENOSYS;
-}
-
-#if !defined(_KPOSIX_PRIORITY_SCHEDULING)
-
-/* Not configured but loadable via a module:
- */
-
-static int sched_attach(void)
-{
-	return 0;
-}
-
-SYSCALL_NOT_PRESENT_GEN(sched_setparam)
-SYSCALL_NOT_PRESENT_GEN(sched_getparam)
-SYSCALL_NOT_PRESENT_GEN(sched_setscheduler)
-SYSCALL_NOT_PRESENT_GEN(sched_getscheduler)
-SYSCALL_NOT_PRESENT_GEN(sched_yield)
-SYSCALL_NOT_PRESENT_GEN(sched_get_priority_max)
-SYSCALL_NOT_PRESENT_GEN(sched_get_priority_min)
-SYSCALL_NOT_PRESENT_GEN(sched_rr_get_interval)
-
-#else
-
-/* Configured in kernel version:
- */
-static struct ksched *ksched;
-
-static int sched_attach(void)
-{
-	int ret = ksched_attach(&ksched);
-
-	if (ret == 0)
-		p31b_setcfg(CTL_P1003_1B_PRIORITY_SCHEDULING, 1);
-
-	return ret;
-}
-
-/* 
- * MPSAFE
- */
-int sched_setparam(struct thread *td,
-	struct sched_setparam_args *uap)
-{
-	struct thread *targettd;
-	struct proc *targetp;
-	int e;
-	struct sched_param sched_param;
-
-	e = copyin(uap->param, &sched_param, sizeof(sched_param));
-	if (e)
-		return (e);
-
-	mtx_lock(&Giant);
-	if (uap->pid == 0) {
-		targetp = td->td_proc;
-		targettd = td;
-		PROC_LOCK(targetp);
-	} else {
-		targetp = pfind(uap->pid);
-		if (targetp == NULL) {
-			e = ESRCH;
-			goto done2;
-		}
-		targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
-	}
-
-	e = p_cansched(td, targetp);
-	PROC_UNLOCK(targetp);
-	if (e == 0) {
-		e = ksched_setparam(&td->td_retval[0], ksched, targettd,
-			(const struct sched_param *)&sched_param);
-	}
-done2:
-	mtx_unlock(&Giant);
-	return (e);
-}
-
-/* 
- * MPSAFE
- */
-int sched_getparam(struct thread *td,
-	struct sched_getparam_args *uap)
-{
-	int e;
-	struct sched_param sched_param;
-	struct thread *targettd;
-	struct proc *targetp;
-
-	mtx_lock(&Giant);
-	if (uap->pid == 0) {
-		targetp = td->td_proc;
-		targettd = td;
-		PROC_LOCK(targetp);
-	} else {
-		targetp = pfind(uap->pid);
-		if (targetp == NULL) {
-			e = ESRCH;
-			goto done2;
-		}
-		targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
-	}
-
-	e = p_cansee(td, targetp);
-	PROC_UNLOCK(targetp);
-	if (e)
-		goto done2;
-
-	e = ksched_getparam(&td->td_retval[0], ksched, targettd, &sched_param);
-	if (e == 0)
-		e = copyout(&sched_param, uap->param, sizeof(sched_param));
-done2:
-	mtx_unlock(&Giant);
-	return (e);
-}
-
-/* 
- * MPSAFE
- */
-int sched_setscheduler(struct thread *td,
-	struct sched_setscheduler_args *uap)
-{
-	int e;
-	struct sched_param sched_param;
-	struct thread *targettd;
-	struct proc *targetp;
-
-	e = copyin(uap->param, &sched_param, sizeof(sched_param));
-	if (e)
-		return (e);
-
-	mtx_lock(&Giant);
-	if (uap->pid == 0) {
-		targetp = td->td_proc;
-		targettd = td;
-		PROC_LOCK(targetp);
-	} else {
-		targetp = pfind(uap->pid);
-		if (targetp == NULL) {
-			e = ESRCH;
-			goto done2;
-		}
-		targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
-	}
-
-	e = p_cansched(td, targetp);
-	PROC_UNLOCK(targetp);
-	if (e == 0) {
-		e = ksched_setscheduler(&td->td_retval[0], ksched, targettd,
-			uap->policy, (const struct sched_param *)&sched_param);
-	}
-done2:
-	mtx_unlock(&Giant);
-	return (e);
-}
-
-/* 
- * MPSAFE
- */
-int sched_getscheduler(struct thread *td,
-	struct sched_getscheduler_args *uap)
-{
-	int e;
-	struct thread *targettd;
-	struct proc *targetp;
-
-	mtx_lock(&Giant);
-	if (uap->pid == 0) {
-		targetp = td->td_proc;
-		targettd = td;
-		PROC_LOCK(targetp);
-	} else {
-		targetp = pfind(uap->pid);
-		if (targetp == NULL) {
-			e = ESRCH;
-			goto done2;
-		}
-		targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
-	}
-
-	e = p_cansee(td, targetp);
-	PROC_UNLOCK(targetp);
-	if (e == 0)
-		e = ksched_getscheduler(&td->td_retval[0], ksched, targettd);
-
-done2:
-	mtx_unlock(&Giant);
-	return (e);
-}
-
-/* 
- * MPSAFE
- */
-int sched_yield(struct thread *td,
-	struct sched_yield_args *uap)
-{
-	int error;
-
-	mtx_lock(&Giant);
-	error = ksched_yield(&td->td_retval[0], ksched);
-	mtx_unlock(&Giant);
-	return (error);
-}
-
-/* 
- * MPSAFE
- */
-int sched_get_priority_max(struct thread *td,
-	struct sched_get_priority_max_args *uap)
-{
-	int error;
-
-	mtx_lock(&Giant);
-	error = ksched_get_priority_max(&td->td_retval[0], ksched, uap->policy);
-	mtx_unlock(&Giant);
-	return (error);
-}
-
-/* 
- * MPSAFE
- */
-int sched_get_priority_min(struct thread *td,
-	struct sched_get_priority_min_args *uap)
-{
-	int error;
-
-	mtx_lock(&Giant);
-	error = ksched_get_priority_min(&td->td_retval[0], ksched, uap->policy);
-	mtx_unlock(&Giant);
-	return (error);
-}
-
-/* 
- * MPSAFE
- */
-int sched_rr_get_interval(struct thread *td,
-	struct sched_rr_get_interval_args *uap)
-{
-	struct timespec timespec;
-	int error;
-
-	error = kern_sched_rr_get_interval(td, uap->pid, &timespec);
-	if (error == 0)
-		error = copyout(&timespec, uap->interval, sizeof(timespec));
-	return (error);
-}
-
-int kern_sched_rr_get_interval(struct thread *td, pid_t pid,
-    struct timespec *ts)
-{
-	int e;
-	struct thread *targettd;
-	struct proc *targetp;
-
-	mtx_lock(&Giant);
-	if (pid == 0) {
-		targettd = td;
-		targetp = td->td_proc;
-		PROC_LOCK(targetp);
-	} else {
-		targetp = pfind(pid);
-		if (targetp == NULL) {
-			mtx_unlock(&Giant);
-			return (ESRCH);
-		}
-		targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
-	}
-
-	e = p_cansee(td, targetp);
-	if (e == 0)
-		e = ksched_rr_get_interval(&td->td_retval[0], ksched, targettd,
-			ts);
-	PROC_UNLOCK(targetp);
-	mtx_unlock(&Giant);
-	return (e);
-}
-
-#endif
-
-static void p31binit(void *notused)
-{
-	(void) sched_attach();
-	p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE);
-}
-
-SYSINIT(p31b, SI_SUB_P1003_1B, SI_ORDER_FIRST, p31binit, NULL);
--- sys/posix4/_semaphore.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * Copyright (c) 2002 Alfred Perlstein <alfred at FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	$FreeBSD: src/sys/posix4/_semaphore.h,v 1.4 2005/01/07 02:29:19 imp Exp $
- */
-#ifndef __SEMAPHORE_H_
-#define __SEMAPHORE_H_
-
-typedef intptr_t semid_t;
-struct timespec;
-
-#ifndef _KERNEL
-
-#include <sys/cdefs.h>
-
-/*
- * Semaphore definitions.
- */
-struct sem {
-#define SEM_MAGIC       ((u_int32_t) 0x09fa4012)
-        u_int32_t       magic;
-        pthread_mutex_t lock;
-        pthread_cond_t  gtzero;
-        u_int32_t       count;
-        u_int32_t       nwaiters;
-#define SEM_USER        (NULL)
-        semid_t         semid;  /* semaphore id if kernel (shared) semaphore */
-        int             syssem; /* 1 if kernel (shared) semaphore */
-        LIST_ENTRY(sem) entry;
-        struct sem      **backpointer;
-};
-
-__BEGIN_DECLS
-
-int ksem_close(semid_t id);
-int ksem_post(semid_t id);
-int ksem_wait(semid_t id);
-int ksem_trywait(semid_t id);
-int ksem_timedwait(semid_t id, struct timespec *abstime);
-int ksem_init(semid_t *idp, unsigned int value);
-int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode,
-    unsigned int value);
-int ksem_unlink(const char *name);
-int ksem_getvalue(semid_t id, int *val);
-int ksem_destroy(semid_t id);
-
-__END_DECLS
-
-#endif /* !_KERNEL */
-
-#endif /* __SEMAPHORE_H_ */
--- sys/posix4/ksem.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*-
- * Copyright (c) 2002 Alfred Perlstein <alfred at FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/posix4/ksem.h,v 1.2 2005/05/04 10:39:14 rwatson Exp $
- */
-
-#ifndef _POSIX4_KSEM_H_
-#define	_POSIX4_KSEM_H_
-
-#ifndef _KERNEL
-#error "no user-servicable parts inside"
-#endif
-
-#include <sys/condvar.h>
-#include <sys/queue.h>
-
-struct kuser {
-	pid_t ku_pid;
-	LIST_ENTRY(kuser) ku_next;
-};
-
-struct ksem {
-	LIST_ENTRY(ksem) ks_entry;	/* global list entry */
-	int ks_onlist;			/* boolean if on a list (ks_entry) */
-	char *ks_name;			/* if named, this is the name */
-	int ks_ref;			/* number of references */
-	mode_t ks_mode;			/* protection bits */
-	uid_t ks_uid;			/* creator uid */
-	gid_t ks_gid;			/* creator gid */
-	unsigned int ks_value;		/* current value */
-	struct cv ks_cv;		/* waiters sleep here */
-	int ks_waiters;			/* number of waiters */
-	LIST_HEAD(, kuser) ks_users;	/* pids using this sem */
-	struct label *ks_label;		/* MAC label */
-};
-
-#endif /* !_POSIX4_KSEM_H_ */
--- sys/posix4/semaphore.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * Copyright (c) 1996, 1997
- *	HD Associates, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by HD Associates, Inc
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/posix4/semaphore.h,v 1.11 2004/02/03 22:27:03 deischen Exp $
- */
-
-/* semaphore.h: POSIX 1003.1b semaphores */
-
-#ifndef _SEMAPHORE_H_
-#define _SEMAPHORE_H_
-
-/* Opaque type definition. */
-struct sem;
-typedef	struct sem *	sem_t;
-
-#define	SEM_FAILED	((sem_t *)0)
-#define	SEM_VALUE_MAX	(~0U)		/* Equivalent to UINT_MAX. */
-
-#ifndef _KERNEL
-#include <sys/cdefs.h>
-
-struct timespec;
-
-__BEGIN_DECLS
-int	 sem_close(sem_t *);
-int	 sem_destroy(sem_t *);
-int	 sem_getvalue(sem_t * __restrict, int * __restrict);
-int	 sem_init(sem_t *, int, unsigned int);
-sem_t	*sem_open(const char *, int, ...);
-int	 sem_post(sem_t *);
-int	 sem_timedwait(sem_t * __restrict, const struct timespec * __restrict);
-int	 sem_trywait(sem_t *);
-int	 sem_unlink(const char *);
-int	 sem_wait(sem_t *);
-__END_DECLS
-
-#endif
-
-#endif /* !_SEMAPHORE_H_ */
--- sys/posix4/mqueue.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * Copyright (c) 1996, 1997
- *	HD Associates, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by HD Associates, Inc
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/posix4/mqueue.h,v 1.6 2002/09/20 17:54:34 mike Exp $
- */
-
-/* mqueue.h: POSIX 1003.1b Message Queues */
-
-#ifndef _MQUEUE_H_
-#define	_MQUEUE_H_
-
-#include <sys/_posix.h>
-
-#ifdef _P1003_1B_INCLUDE_MAYBES
-#include <sys/types.h>
-#include <fcntl.h>
-#include <time.h>
-#include <signal.h>
-#else
-struct sigevent;
-#endif
-
-typedef	int		mqd_t;	/* message queue descriptors */
-
-struct mq_attr {
-	long	mq_flags;	/* message queue flags */
-	long	mq_maxmsg;	/* maximum number of messages */
-	long	mq_msgsize;	/* maximum message size */
-	long	mq_curmsgs;	/* number of messages currently queued */
-};
-
-#ifndef _KERNEL
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-int	 mq_close(mqd_t);
-int	 mq_getattr(mqd_t, struct mq_attr *);
-int	 mq_notify(mqd_t, const struct sigevent *);
-mqd_t	 mq_open(const char *, int oflag, ...);
-ssize_t	 mq_receive(mqd_t, char *, size_t, unsigned int *);
-int	 mq_send(mqd_t, const char *, size_t, unsigned int);
-int	 mq_setattr(mqd_t, const struct mq_attr *, struct mq_attr *);
-int	 mq_unlink(const char *);
-__END_DECLS
-
-#endif
-
-#endif /* !_MQUEUE_H_ */


More information about the Midnightbsd-cvs mailing list