[Midnightbsd-cvs] src: src/include: Note quite there yet, but let's save my work :)
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Sep 30 17:37:55 EDT 2008
Log Message:
-----------
Note quite there yet, but let's save my work :)
Modified Files:
--------------
src/include:
ar.h (r1.1.1.1 -> r1.2)
paths.h (r1.1.1.1 -> r1.2)
proc_service.h (r1.1.1.1 -> r1.2)
pthread.h (r1.1.1.1 -> r1.2)
pthread_np.h (r1.1.1.1 -> r1.2)
signal.h (r1.1.1.1 -> r1.2)
stdio.h (r1.1.1.2 -> r1.2)
tgmath.h (r1.1.1.1 -> r1.2)
time.h (r1.1.1.1 -> r1.2)
unistd.h (r1.1.1.1 -> r1.2)
wchar.h (r1.1.1.1 -> r1.2)
Added Files:
-----------
src/include:
mqueue.h (r1.1)
printf.h (r1.1)
res_update.h (r1.1)
-------------- next part --------------
Index: wchar.h
===================================================================
RCS file: /home/cvs/src/include/wchar.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/wchar.h -L include/wchar.h -u -r1.1.1.1 -r1.2
--- include/wchar.h
+++ include/wchar.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/include/wchar.h,v 1.45 2004/08/12 12:19:10 tjr Exp $
+ * $FreeBSD: src/include/wchar.h,v 1.46 2005/08/13 05:54:33 tjr Exp $
*/
/*-
@@ -214,6 +214,7 @@
wchar_t *fgetwln(struct __sFILE * __restrict, size_t * __restrict);
size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
size_t, mbstate_t * __restrict);
+wchar_t *wcsdup(const wchar_t *);
size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
size_t, mbstate_t * __restrict);
size_t wcslcat(wchar_t *, const wchar_t *, size_t);
Index: signal.h
===================================================================
RCS file: /home/cvs/src/include/signal.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/signal.h -L include/signal.h -u -r1.1.1.1 -r1.2
--- include/signal.h
+++ include/signal.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)signal.h 8.3 (Berkeley) 3/30/94
- * $FreeBSD: src/include/signal.h,v 1.24 2003/03/31 23:30:41 jeff Exp $
+ * $FreeBSD: src/include/signal.h,v 1.26 2005/10/16 22:23:03 davidxu Exp $
*/
#ifndef _SIGNAL_H_
@@ -77,15 +77,8 @@
#endif
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600
-#if 0
-/*
- * PR: 35924
- * XXX we don't actually have these. We set _POSIX_REALTIME_SIGNALS to
- * -1 to show that we don't have them, but this symbol is not necessarily
- * in scope (in the current implementation), so we can't use it here.
- */
int sigqueue(__pid_t, int, const union sigval);
-#endif
+
struct timespec;
int sigtimedwait(const sigset_t * __restrict, siginfo_t * __restrict,
const struct timespec * __restrict);
Index: time.h
===================================================================
RCS file: /home/cvs/src/include/time.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/time.h -L include/time.h -u -r1.1.1.1 -r1.2
--- include/time.h
+++ include/time.h
@@ -39,7 +39,7 @@
*/
/*
- * $FreeBSD: src/include/time.h,v 1.32 2005/04/02 12:33:27 das Exp $
+ * $FreeBSD: src/include/time.h,v 1.34 2006/04/15 03:08:55 jb Exp $
*/
#ifndef _TIME_H_
@@ -100,6 +100,14 @@
#define CLOCK_PROF 2
#endif
#define CLOCK_MONOTONIC 4
+#define CLOCK_UPTIME 5 /* FreeBSD-specific. */
+#define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */
+#define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */
+#define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */
+#define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */
+#define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */
+#define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */
+#define CLOCK_SECOND 13 /* FreeBSD-specific. */
#endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */
#if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112
@@ -139,7 +147,15 @@
size_t strftime(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict);
time_t time(time_t *);
-
+#if __POSIX_VISIBLE >= 200112
+struct sigevent;
+int timer_create(clockid_t, struct sigevent *__restrict, timer_t *__restrict);
+int timer_delete(timer_t);
+int timer_gettime(timer_t, struct itimerspec *);
+int timer_getoverrun(timer_t);
+int timer_settime(timer_t, int, const struct itimerspec *__restrict,
+ struct itimerspec *__restrict);
+#endif
#if __POSIX_VISIBLE
void tzset(void);
#endif
Index: ar.h
===================================================================
RCS file: /home/cvs/src/include/ar.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/ar.h -L include/ar.h -u -r1.1.1.1 -r1.2
--- include/ar.h
+++ include/ar.h
@@ -39,11 +39,15 @@
* SUCH DAMAGE.
*
* @(#)ar.h 8.2 (Berkeley) 1/21/94
+ *
+ * $FreeBSD: src/include/ar.h,v 1.2 2006/11/13 04:28:29 jkoshy Exp $
*/
#ifndef _AR_H_
#define _AR_H_
+#include <sys/cdefs.h>
+
/* Pre-4BSD archives had these magic numbers in them. */
#define OARMAG1 0177555
#define OARMAG2 0177545
@@ -62,6 +66,6 @@
char ar_size[10]; /* size in bytes */
#define ARFMAG "`\n"
char ar_fmag[2]; /* consistency check */
-};
+} __packed;
#endif /* !_AR_H_ */
--- /dev/null
+++ include/res_update.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium, Inc.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: res_update.h,v 1.2.18.1 2005/04/27 05:00:49 sra Exp $
+ * $FreeBSD: src/include/res_update.h,v 1.3 2007/06/03 17:20:25 ume Exp $
+ */
+
+#ifndef __RES_UPDATE_H
+#define __RES_UPDATE_H
+
+/*! \file */
+
+#include <sys/types.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+
+/*%
+ * This RR-like structure is particular to UPDATE.
+ */
+struct ns_updrec {
+ struct {
+ struct ns_updrec *prev;
+ struct ns_updrec *next;
+ } r_link, r_glink;
+ ns_sect r_section; /*%< ZONE/PREREQUISITE/UPDATE */
+ char * r_dname; /*%< owner of the RR */
+ ns_class r_class; /*%< class number */
+ ns_type r_type; /*%< type number */
+ u_int32_t r_ttl; /*%< time to live */
+ u_char * r_data; /*%< rdata fields as text string */
+ u_int r_size; /*%< size of r_data field */
+ int r_opcode; /*%< type of operation */
+ /* following fields for private use by the resolver/server routines */
+ struct databuf *r_dp; /*%< databuf to process */
+ struct databuf *r_deldp; /*%< databuf's deleted/overwritten */
+ u_int r_zone; /*%< zone number on server */
+};
+typedef struct ns_updrec ns_updrec;
+typedef struct {
+ ns_updrec *head;
+ ns_updrec *tail;
+} ns_updque;
+
+#define res_mkupdate __res_mkupdate
+#define res_update __res_update
+#define res_mkupdrec __res_mkupdrec
+#define res_freeupdrec __res_freeupdrec
+#define res_nmkupdate __res_nmkupdate
+#define res_nupdate __res_nupdate
+
+int res_mkupdate(ns_updrec *, u_char *, int);
+int res_update(ns_updrec *);
+ns_updrec * res_mkupdrec(int, const char *, u_int, u_int, u_long);
+void res_freeupdrec(ns_updrec *);
+int res_nmkupdate(res_state, ns_updrec *, u_char *, int);
+int res_nupdate(res_state, ns_updrec *, ns_tsig_key *);
+
+#endif /*__RES_UPDATE_H*/
+
+/*! \file */
Index: paths.h
===================================================================
RCS file: /home/cvs/src/include/paths.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/paths.h -L include/paths.h -u -r1.1.1.1 -r1.2
--- include/paths.h
+++ include/paths.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)paths.h 8.1 (Berkeley) 6/2/93
- * $FreeBSD: src/include/paths.h,v 1.25 2004/01/04 17:17:46 iedowse Exp $
+ * $FreeBSD: src/include/paths.h,v 1.26 2007/06/11 02:21:18 simokawa Exp $
*/
#ifndef _PATHS_H_
@@ -61,6 +61,7 @@
#define _PATH_DRUM "/dev/drum"
#define _PATH_ETC "/etc"
#define _PATH_FTPUSERS "/etc/ftpusers"
+#define _PATH_FWMEM "/dev/fwmem"
#define _PATH_HALT "/sbin/halt"
#define _PATH_IFCONFIG "/sbin/ifconfig"
#define _PATH_KMEM "/dev/kmem"
Index: unistd.h
===================================================================
RCS file: /home/cvs/src/include/unistd.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/unistd.h -L include/unistd.h -u -r1.1.1.1 -r1.2
--- include/unistd.h
+++ include/unistd.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)unistd.h 8.12 (Berkeley) 4/27/95
- * $FreeBSD: src/include/unistd.h,v 1.78 2005/05/13 16:27:30 delphij Exp $
+ * $FreeBSD: src/include/unistd.h,v 1.80 2006/12/14 21:42:03 pjd Exp $
*/
#ifndef _UNISTD_H_
@@ -103,12 +103,12 @@
* the POSIX standard; however, if the relevant sysconf() function
* returns -1, the functions may be stubbed out.
*/
-#define _POSIX_BARRIERS -1
+#define _POSIX_BARRIERS 200112L
#define _POSIX_READER_WRITER_LOCKS 200112L
#define _POSIX_REGEXP 1
#define _POSIX_SHELL 1
#define _POSIX_SPAWN -1
-#define _POSIX_SPIN_LOCKS -1
+#define _POSIX_SPIN_LOCKS 200112L
#define _POSIX_THREAD_ATTR_STACKADDR 200112L
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
#define _POSIX_THREAD_CPUTIME -1
@@ -294,6 +294,9 @@
#define _SC_NPROCESSORS_ONLN 58
#endif
+/* Extensions found in Solaris and Linux. */
+#define _SC_PHYS_PAGES 121
+
/* Keys for the confstr(3) function. */
#if __POSIX_VISIBLE >= 199209
#define _CS_PATH 1 /* default value of PATH */
--- /dev/null
+++ include/printf.h
@@ -0,0 +1,163 @@
+/*-
+ * Copyright (c) 2005 Poul-Henning Kamp
+ * 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/include/printf.h,v 1.4 2006/03/02 10:01:52 phk Exp $
+ */
+
+#ifndef _PRINTF_H_
+#define _PRINTF_H_
+
+#include <wchar.h>
+
+/*
+ * The API defined by glibc allows a renderer to take multiple arguments
+ * This is obviously usable for things like (ptr+len) pairs etc.
+ * But the do not actually provide support for it at the end of the day,
+ * they offer only one argument to the arginfo function, but do accept
+ * >1 returns, although the do not check the types of those arguments
+ * argument
+ * Be compatible for now.
+ */
+#define __PRINTFMAXARG 2
+
+struct printf_info {
+ /* GLIBC compatible */
+ int prec;
+ int width;
+ wchar_t spec;
+ unsigned is_long_double;
+ unsigned is_char;
+ unsigned is_short;
+ unsigned is_long;
+ unsigned alt;
+ unsigned space;
+ unsigned left;
+ unsigned showsign;
+ unsigned group;
+ unsigned extra;
+ unsigned wide;
+ wchar_t pad;
+
+ /* FreeBSD extensions */
+
+ unsigned is_quad;
+ unsigned is_intmax;
+ unsigned is_ptrdiff;
+ unsigned is_size;
+
+ /* private */
+ int sofar;
+ unsigned get_width;
+ unsigned get_prec;
+ const char *begin;
+ const char *end;
+ void *arg[__PRINTFMAXARG];
+};
+
+enum {
+ PA_INT = (1 << 0), /* int */
+ PA_CHAR = (1 << 1), /* int, cast to char */
+ PA_WCHAR = (1 << 2), /* wide char */
+ PA_STRING = (1 << 3), /* const char * (with '\0') */
+ PA_WSTRING = (1 << 4), /* const wchar_t * */
+ PA_POINTER = (1 << 5), /* void * */
+ PA_FLOAT = (1 << 6), /* float */
+ PA_DOUBLE = (1 << 7) /* double */
+};
+
+#define PA_FLAG_MASK 0xff0000
+#define PA_FLAG_LONG_LONG (1 << 16)
+#define PA_FLAG_LONG (1 << 17)
+#define PA_FLAG_SHORT (1 << 18)
+#define PA_FLAG_PTR (1 << 19)
+#define PA_FLAG_QUAD (1 << 20)
+#define PA_FLAG_INTMAX (1 << 21)
+#define PA_FLAG_SIZE (1 << 22)
+#define PA_FLAG_PTRDIFF (1 << 23)
+#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
+
+typedef int printf_arginfo_function(const struct printf_info *, size_t, int *);
+typedef int printf_function(FILE *, const struct printf_info *, const void *const *);
+
+/* FreeBSD extension */
+struct __printf_io;
+typedef int printf_render(struct __printf_io *, const struct printf_info *, const void *const *);
+
+/* vprintf.c */
+extern const char __lowercase_hex[17];
+extern const char __uppercase_hex[17];
+
+void __printf_flush(struct __printf_io *io);
+int __printf_puts(struct __printf_io *io, const void *ptr, int len);
+int __printf_pad(struct __printf_io *io, int n, int zero);
+int __printf_out(struct __printf_io *io, const struct printf_info *pi, const void *ptr, int len);
+
+int __xvprintf(FILE *fp, const char *fmt0, va_list ap);
+extern int __use_xprintf;
+
+/* GLIBC compat */
+int register_printf_function(int spec, printf_function *render, printf_arginfo_function *arginfo);
+
+/* FreeBSD */
+int register_printf_render(int spec, printf_render *render, printf_arginfo_function *arginfo);
+int register_printf_render_std(const unsigned char *specs);
+
+/* vprintf_errno.c */
+printf_arginfo_function __printf_arginfo_errno;
+printf_render __printf_render_errno;
+
+/* vprintf_float.c */
+printf_arginfo_function __printf_arginfo_float;
+printf_render __printf_render_float;
+
+/* vprintf_hexdump.c */
+printf_arginfo_function __printf_arginfo_hexdump;
+printf_render __printf_render_hexdump;
+
+/* vprintf_int.c */
+printf_arginfo_function __printf_arginfo_ptr;
+printf_arginfo_function __printf_arginfo_int;
+printf_render __printf_render_ptr;
+printf_render __printf_render_int;
+
+/* vprintf_quoute.c */
+printf_arginfo_function __printf_arginfo_quote;
+printf_render __printf_render_quote;
+
+/* vprintf_str.c */
+printf_arginfo_function __printf_arginfo_chr;
+printf_render __printf_render_chr;
+printf_arginfo_function __printf_arginfo_str;
+printf_render __printf_render_str;
+
+/* vprintf_time.c */
+printf_arginfo_function __printf_arginfo_time;
+printf_render __printf_render_time;
+
+/* vprintf_vis.c */
+printf_arginfo_function __printf_arginfo_vis;
+printf_render __printf_render_vis;
+
+#endif /* !_PRINTF_H */
Index: proc_service.h
===================================================================
RCS file: /home/cvs/src/include/proc_service.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/proc_service.h -L include/proc_service.h -u -r1.1.1.1 -r1.2
--- include/proc_service.h
+++ include/proc_service.h
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/include/proc_service.h,v 1.3 2005/05/31 09:43:03 dfr Exp $
+ * $FreeBSD: src/include/proc_service.h,v 1.4 2006/02/07 02:29:54 davidxu Exp $
*/
#ifndef _PROC_SERVICE_H_
@@ -56,6 +56,7 @@
ps_err_e ps_lsetxmmregs (struct ps_prochandle *, lwpid_t, const char *);
#endif
ps_err_e ps_lstop(struct ps_prochandle *, lwpid_t);
+ps_err_e ps_linfo(struct ps_prochandle *, lwpid_t, void *);
ps_err_e ps_pcontinue(struct ps_prochandle *);
ps_err_e ps_pdmodel(struct ps_prochandle *, int *);
ps_err_e ps_pglobal_lookup(struct ps_prochandle *, const char *, const char *,
Index: tgmath.h
===================================================================
RCS file: /home/cvs/src/include/tgmath.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/tgmath.h -L include/tgmath.h -u -r1.1.1.1 -r1.2
--- include/tgmath.h
+++ include/tgmath.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/include/tgmath.h,v 1.4 2004/09/03 23:44:09 stefanf Exp $
+ * $FreeBSD: src/include/tgmath.h,v 1.5 2007/02/02 18:30:23 schweikh Exp $
*/
#ifndef _TGMATH_H_
@@ -64,8 +64,8 @@
#define __tg_is_complex(e1, e2, e3) \
(__tg_type3(e1, e2, e3, float _Complex) || \
__tg_type3(e1, e2, e3, double _Complex) || \
- __tg_type3(e1, e2, e3, long double _Complex)) || \
- __tg_type3(e1, e2, e3, __typeof__(_Complex_I))
+ __tg_type3(e1, e2, e3, long double _Complex) || \
+ __tg_type3(e1, e2, e3, __typeof__(_Complex_I)))
#define __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) \
__builtin_choose_expr(__tg_type_corr(x, y, z, long double), \
Index: stdio.h
===================================================================
RCS file: /home/cvs/src/include/stdio.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L include/stdio.h -L include/stdio.h -u -r1.1.1.2 -r1.2
--- include/stdio.h
+++ include/stdio.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)stdio.h 8.5 (Berkeley) 4/29/95
- * $FreeBSD: src/include/stdio.h,v 1.56.8.1 2006/01/31 17:57:17 stefanf Exp $
+ * $FreeBSD: src/include/stdio.h,v 1.60 2007/04/07 16:02:30 pjd Exp $
*/
#ifndef _STDIO_H_
@@ -327,6 +327,7 @@
#if __BSD_VISIBLE
int asprintf(char **, const char *, ...) __printflike(2, 3);
char *ctermid_r(char *);
+void fcloseall(void);
char *fgetln(FILE *, size_t *);
__const char *fmtcheck(const char *, const char *) __format_arg(2);
int fpurge(FILE *);
Index: pthread.h
===================================================================
RCS file: /home/cvs/src/include/pthread.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/pthread.h -L include/pthread.h -u -r1.1.1.1 -r1.2
--- include/pthread.h
+++ include/pthread.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/include/pthread.h,v 1.36.2.1 2005/12/15 06:50:39 davidxu Exp $
+ * $FreeBSD: src/include/pthread.h,v 1.40.2.1 2007/11/14 01:10:11 kris Exp $
*/
#ifndef _PTHREAD_H_
#define _PTHREAD_H_
@@ -39,20 +39,20 @@
* Header files.
*/
#include <sys/cdefs.h>
-#include <sys/types.h>
#include <sys/_pthreadtypes.h>
-#include <sys/time.h>
-#include <sys/signal.h>
-#include <limits.h>
+#include <machine/_limits.h>
+#include <machine/_types.h>
+#include <sys/_sigset.h>
#include <sched.h>
+#include <time.h>
/*
* Run-time invariant values:
*/
#define PTHREAD_DESTRUCTOR_ITERATIONS 4
#define PTHREAD_KEYS_MAX 256
-#define PTHREAD_STACK_MIN MINSIGSTKSZ
-#define PTHREAD_THREADS_MAX ULONG_MAX
+#define PTHREAD_STACK_MIN __MINSIGSTKSZ
+#define PTHREAD_THREADS_MAX __ULONG_MAX
#define PTHREAD_BARRIER_SERIAL_THREAD -1
/*
@@ -98,6 +98,7 @@
* Static initialization values.
*/
#define PTHREAD_MUTEX_INITIALIZER NULL
+#define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP NULL
#define PTHREAD_COND_INITIALIZER NULL
#define PTHREAD_RWLOCK_INITIALIZER NULL
@@ -121,8 +122,6 @@
*
* PTHREAD_MUTEX_NORMAL
* PTHREAD_MUTEX_RECURSIVE
- * MUTEX_TYPE_FAST (deprecated)
- * MUTEX_TYPE_COUNTING_FAST (deprecated)
*
* will deviate from POSIX specified semantics.
*/
@@ -130,23 +129,20 @@
PTHREAD_MUTEX_ERRORCHECK = 1, /* Default POSIX mutex */
PTHREAD_MUTEX_RECURSIVE = 2, /* Recursive mutex */
PTHREAD_MUTEX_NORMAL = 3, /* No error checking */
- MUTEX_TYPE_MAX
+ PTHREAD_MUTEX_ADAPTIVE_NP = 4, /* Adaptive mutex, spins briefly before blocking on lock */
+ PTHREAD_MUTEX_TYPE_MAX
};
#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK
-#define MUTEX_TYPE_FAST PTHREAD_MUTEX_NORMAL
-#define MUTEX_TYPE_COUNTING_FAST PTHREAD_MUTEX_RECURSIVE
/*
* Thread function prototype definitions:
*/
__BEGIN_DECLS
-int pthread_atfork(void (*prepare)(void), void (*parent)(void),
- void (*child)(void));
+int pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
int pthread_attr_destroy(pthread_attr_t *);
int pthread_attr_getstack(const pthread_attr_t * __restrict,
- void ** __restrict stackaddr,
- size_t * __restrict stacksize);
+ void ** __restrict, size_t * __restrict);
int pthread_attr_getstacksize(const pthread_attr_t *, size_t *);
int pthread_attr_getguardsize(const pthread_attr_t *, size_t *);
int pthread_attr_getstackaddr(const pthread_attr_t *, void **);
@@ -167,14 +163,13 @@
int pthread_barrierattr_init(pthread_barrierattr_t *);
int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
void pthread_cleanup_pop(int);
-void pthread_cleanup_push(void (*) (void *), void *routine_arg);
+void pthread_cleanup_push(void (*) (void *), void *);
int pthread_condattr_destroy(pthread_condattr_t *);
-int pthread_condattr_init(pthread_condattr_t *);
+int pthread_condattr_getclock(const pthread_condattr_t *,
+ clockid_t *);
int pthread_condattr_getpshared(const pthread_condattr_t *, int *);
-int pthread_condattr_getclock(const pthread_condattr_t *,
- clockid_t *);
-int pthread_condattr_setclock(pthread_condattr_t *,
- clockid_t);
+int pthread_condattr_init(pthread_condattr_t *);
+int pthread_condattr_setclock(pthread_condattr_t *, clockid_t);
int pthread_condattr_setpshared(pthread_condattr_t *, int);
int pthread_cond_broadcast(pthread_cond_t *);
int pthread_cond_destroy(pthread_cond_t *);
@@ -197,9 +192,9 @@
int pthread_kill(pthread_t, int);
int pthread_mutexattr_init(pthread_mutexattr_t *);
int pthread_mutexattr_destroy(pthread_mutexattr_t *);
-int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *);
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *,
int *);
+int pthread_mutexattr_gettype(pthread_mutexattr_t *, int *);
int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
int pthread_mutex_destroy(pthread_mutex_t *);
@@ -230,7 +225,7 @@
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
pthread_t pthread_self(void);
int pthread_setspecific(pthread_key_t, const void *);
-int pthread_sigmask(int, const sigset_t *, sigset_t *);
+int pthread_sigmask(int, const __sigset_t *, __sigset_t *);
int pthread_spin_init(pthread_spinlock_t *, int);
int pthread_spin_destroy(pthread_spinlock_t *);
Index: pthread_np.h
===================================================================
RCS file: /home/cvs/src/include/pthread_np.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L include/pthread_np.h -L include/pthread_np.h -u -r1.1.1.1 -r1.2
--- include/pthread_np.h
+++ include/pthread_np.h
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/include/pthread_np.h,v 1.15 2003/01/07 21:43:30 fjoe Exp $
+ * $FreeBSD: src/include/pthread_np.h,v 1.16 2005/10/04 07:23:56 davidxu Exp $
*/
#ifndef _PTHREAD_NP_H_
#define _PTHREAD_NP_H_
@@ -57,6 +57,7 @@
int pthread_suspend_np(pthread_t);
int pthread_switch_add_np(pthread_switch_routine_t);
int pthread_switch_delete_np(pthread_switch_routine_t);
+int pthread_timedjoin_np(pthread_t, void **, const struct timespec *);
__END_DECLS
#endif
--- /dev/null
+++ include/mqueue.h
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2005 David Xu <davidxu 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/include/mqueue.h,v 1.3 2007/01/06 11:30:04 davidxu Exp $
+ */
+
+#ifndef _MQUEUE_H_
+#define _MQUEUE_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/mqueue.h>
+
+struct sigevent;
+struct timespec;
+
+__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, ...);
+ssize_t mq_receive(mqd_t, char *, size_t, unsigned *);
+int mq_send(mqd_t, const char *, size_t, unsigned);
+int mq_setattr(mqd_t, const struct mq_attr *__restrict,
+ struct mq_attr *__restrict);
+ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t,
+ unsigned *__restrict, const struct timespec *__restrict);
+int mq_timedsend(mqd_t, const char *, size_t, unsigned,
+ const struct timespec *);
+int mq_unlink(const char *);
+int __mq_oshandle(mqd_t mqd);
+
+__END_DECLS
+#endif
More information about the Midnightbsd-cvs
mailing list