summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/man/man3/Makefile2
-rw-r--r--share/man/man3/stdarg.325
-rw-r--r--sys/alpha/include/stdarg.h3
-rw-r--r--sys/amd64/include/stdarg.h3
-rw-r--r--sys/i386/include/stdarg.h3
-rw-r--r--sys/ia64/include/stdarg.h3
-rw-r--r--sys/powerpc/include/stdarg.h3
-rw-r--r--sys/sparc64/include/stdarg.h3
8 files changed, 43 insertions, 2 deletions
diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile
index 196cda1..bea9924 100644
--- a/share/man/man3/Makefile
+++ b/share/man/man3/Makefile
@@ -71,7 +71,7 @@ MLINKS+=queue.3 TAILQ_PREV.3
MLINKS+=queue.3 TAILQ_REMOVE.3
MLINKS+=stdarg.3 varargs.3 stdarg.3 va_arg.3 stdarg.3 va_end.3
-MLINKS+=stdarg.3 va_start.3
+MLINKS+=stdarg.3 va_copy.3 stdarg.3 va_start.3
MLINKS+=timeradd.3 timersub.3 timeradd.3 timerclear.3 timeradd.3 timerisset.3
MLINKS+=timeradd.3 timercmp.3
diff --git a/share/man/man3/stdarg.3 b/share/man/man3/stdarg.3
index 354fc0a..e3f28e8 100644
--- a/share/man/man3/stdarg.3
+++ b/share/man/man3/stdarg.3
@@ -36,7 +36,7 @@
.\" @(#)stdarg.3 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd June 5, 1993
+.Dd September 18, 2002
.Dt STDARG 3
.Os
.Sh NAME
@@ -49,6 +49,8 @@
.Ft type
.Fn va_arg "va_list ap" type
.Ft void
+.Fn va_copy "va_list dest" "va_list src"
+.Ft void
.Fn va_end "va_list ap"
.Sh DESCRIPTION
A function may be called with a varying number of arguments of varying
@@ -132,6 +134,27 @@ Successive invocations return the values of the remaining
arguments.
.Pp
The
+.Fn va_copy
+macro copies a variable argument list, previously initialized by
+.Fn va_start ,
+from
+.Va src
+to
+.Va dest .
+The state is preserved such that it is equivalent to calling
+.Fn va_start
+with the same second argument used with
+.Va src ,
+and calling
+.Fn va_arg
+the same number of times as called with
+.Va src .
+.Pp
+The
+.Fn va_copy
+macro returns no value.
+.Pp
+The
.Fn va_end
macro handles a normal return from the function whose variable argument
list was initialized by
diff --git a/sys/alpha/include/stdarg.h b/sys/alpha/include/stdarg.h
index 5ecd44b..b14b686 100644
--- a/sys/alpha/include/stdarg.h
+++ b/sys/alpha/include/stdarg.h
@@ -51,6 +51,9 @@ typedef __va_list va_list;
#define va_arg(ap, type) \
__builtin_va_arg((ap), type)
+#define va_copy(dest, src) \
+ __builtin_va_copy((dest), (src))
+
#define va_end(ap) \
__builtin_va_end(ap)
diff --git a/sys/amd64/include/stdarg.h b/sys/amd64/include/stdarg.h
index 4048d13..b7b1954 100644
--- a/sys/amd64/include/stdarg.h
+++ b/sys/amd64/include/stdarg.h
@@ -41,6 +41,9 @@ typedef __va_list va_list;
#define va_arg(ap, type) \
__builtin_va_arg((ap), type)
+#define va_copy(dest, src) \
+ __builtin_va_copy((dest), (src))
+
#define va_end(ap) \
__builtin_va_end(ap)
diff --git a/sys/i386/include/stdarg.h b/sys/i386/include/stdarg.h
index 1432c6c..3ce2f37 100644
--- a/sys/i386/include/stdarg.h
+++ b/sys/i386/include/stdarg.h
@@ -50,6 +50,9 @@ typedef __va_list va_list;
#define va_arg(ap, type) \
__builtin_va_arg((ap), type)
+#define va_copy(dest, src) \
+ __builtin_va_copy((dest), (src))
+
#define va_end(ap) \
__builtin_va_end(ap)
diff --git a/sys/ia64/include/stdarg.h b/sys/ia64/include/stdarg.h
index f48a20b..df9725d 100644
--- a/sys/ia64/include/stdarg.h
+++ b/sys/ia64/include/stdarg.h
@@ -50,6 +50,9 @@ typedef __va_list va_list;
#define va_arg(ap, type) \
__builtin_va_arg((ap), type)
+#define va_copy(dest, src) \
+ __builtin_va_copy((dest), (src))
+
#define va_end(ap) \
__builtin_va_end(ap)
diff --git a/sys/powerpc/include/stdarg.h b/sys/powerpc/include/stdarg.h
index f71971d..5b5bcb3 100644
--- a/sys/powerpc/include/stdarg.h
+++ b/sys/powerpc/include/stdarg.h
@@ -43,6 +43,9 @@ typedef __va_list va_list;
#define va_arg(ap, type) \
__builtin_va_arg((ap), type)
+#define va_copy(dest, src) \
+ __builtin_va_copy((dest), (src))
+
#define va_end(ap) \
__builtin_va_end(ap)
diff --git a/sys/sparc64/include/stdarg.h b/sys/sparc64/include/stdarg.h
index f81a67c..b148b71 100644
--- a/sys/sparc64/include/stdarg.h
+++ b/sys/sparc64/include/stdarg.h
@@ -53,6 +53,9 @@ typedef __va_list va_list;
#define va_arg(ap, type) \
__builtin_va_arg((ap), type)
+#define va_copy(dest, src) \
+ __builtin_va_copy((dest), (src))
+
#define va_end(ap) \
__builtin_va_end(ap)
OpenPOWER on IntegriCloud