summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2002-09-18 07:33:16 +0000
committerMike Barcroft <mike@FreeBSD.org>2002-09-18 07:33:16 +0000
commit86954511d26c1e6cc6d3f386e055458947f4baae (patch)
treed9550a771c43d65b540d4e46a2dadaefba483323
parent530bb9225d7a47f3fdf6193dff2eab8b87b51712 (diff)
Notes
-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 196cda1759bf..bea9924fc677 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 354fc0ae9fd2..e3f28e81913c 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 5ecd44b723a3..b14b68605bfa 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 4048d139d6ac..b7b1954e7bb9 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 1432c6c5e335..3ce2f376b387 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 f48a20b11394..df9725d4c829 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 f71971da42f6..5b5bcb38db12 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 f81a67cf9281..b148b71891a9 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)