aboutsummaryrefslogtreecommitdiffstats
path: root/man3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2008-11-07 20:31:15 -0500
committerMichael Kerrisk <mtk.manpages@gmail.com>2008-11-07 20:31:15 -0500
commit7acf73dc3700f39ec009cf3efe30806e861ee5a1 (patch)
treeb7d875bb099dd9a71cd1ca82df31fda9d4a9f006 /man3
parentc6ec368541cca9847e45adef3e6ef44423d2599b (diff)
downloadman-pages-7acf73dc3700f39ec009cf3efe30806e861ee5a1.tar.gz
makecontext.3: Add text on use of pointer arguments to makecontext()
Passing pointer arguments to makecontext() is possible, but only on some architectures, and with no guarantees of portability. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504699 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com> Reported-by: Paul Evans <leonerd@leonerd.org.uk>
Diffstat (limited to 'man3')
-rw-r--r--man3/makecontext.318
1 files changed, 17 insertions, 1 deletions
diff --git a/man3/makecontext.3 b/man3/makecontext.3
index 1815b227de..0a6a96dddb 100644
--- a/man3/makecontext.3
+++ b/man3/makecontext.3
@@ -22,7 +22,7 @@
.\" the source, must acknowledge the copyright and authors of this work.
.\" 2006-08-02, mtk, Added example program
.\"
-.TH MAKECONTEXT 3 2008-08-06 "GNU" "Linux Programmer's Manual"
+.TH MAKECONTEXT 3 2008-11-07 "GNU" "Linux Programmer's Manual"
.SH NAME
makecontext, swapcontext \- manipulate user context
.SH SYNOPSIS
@@ -113,6 +113,22 @@ to be used as the stack, regardless of the direction of growth of
the stack.
Thus, it is not necessary for the user program to
worry about this direction.
+
+On architectures where
+.I int
+and pointer types are the same size
+(e.g., x86-32, where both types are 32 bits),
+you may be able to get away with passing pointers as arguments to
+.BR makecontext ()
+following
+.IR argc .
+However, doing this is not guaranteed to be portable,
+is undefined according to the standards,
+and won't work on architectures where pointers are larger than
+.IR int s.
+Nevertheless, starting with version 2.8 glibc makes some changes to
+.BR makecontext (3),
+to permit this on some 64-bit architectures (e.g., x86-64).
.SH EXAMPLE
.PP
The example program below demonstrates the use of