.\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk .\" .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2012 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2012-05-03, Akihiro MOTOKI .\" .TH PTHREAD_ATTR_SETSTACKADDR 3 2017\-09\-15 Linux "Linux Programmer's Manual" .SH 名前 pthread_attr_setstackaddr, pthread_attr_getstackaddr \- スレッド属性オブジェクトのスタックアドレス属性の設定/取得を行う .SH 書式 .nf \fB#include \fP .PP \fBint pthread_attr_setstackaddr(pthread_attr_t *\fP\fIattr\fP\fB, void *\fP\fIstackaddr\fP\fB);\fP \fBint pthread_attr_getstackaddr(const pthread_attr_t *\fP\fIattr\fP\fB,\fP \fB void **\fP\fIstackaddr\fP\fB);\fP .PP \fI\-pthread\fP でコンパイルしてリンクする。 .fi .SH 説明 これらの関数は廃止予定であり、\fB使用しないこと\fP。 代わりに \fBpthread_attr_setstack\fP(3) と \fBpthread_attr_getstack\fP(3) を使うこと。 .PP \fBpthread_attr_setstackaddr\fP() 関数は、 \fIattr\fP が参照するスレッド属性オブジェクトのスタックアドレス 属性を \fIstackaddr\fP で指定された値に設定する。 この属性により、スレッド属性オブジェクト \fIattr\fP を使って 作成されるスレッドが使用すべきスタックの位置が指定される。 .PP \fIstackaddr\fP は呼び出し側が割り当てたバッファー (大きさは 少なくとも \fBPTHREAD_STACK_MIN\fP バイト)を指すべきである。 割り当てられたバッファーのページは読み書き両方が可能なページと なっているべきである。 .PP \fBpthread_attr_getstackaddr\fP() は、 スレッド属性オブジェクト \fIattr\fP のスタックアドレス属性を \fIstackaddr\fP が指すバッファーに入れて返す。 .SH 返り値 成功すると、これらの関数は 0 を返す。 エラーの場合、0 以外のエラー番号を返す。 .SH エラー エラーは定義されていない (ただし、アプリケーションは正のエラーの 返り値を処理するようにすべきである)。 .SH バージョン これらの関数は glibc バージョン 2.1 以降で提供されている。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lbw28 lb lb l l l. インターフェース 属性 値 T{ \fBpthread_attr_setstackaddr\fP(), \fBpthread_attr_getstackaddr\fP() T} Thread safety MT\-Safe .TE .SH 準拠 POSIX.1\-2001 では、これらの関数が規定されているが、廃止予定となっている。 POSIX.1\-2008 では、これらの関数の規定は削除されている。 .SH 注意 \fIこれらの関数を使用しないこと!\fP これらの関数は移植性がある形では使用で きない。なぜなら、これらの関数ではスタック領域がどちらの方向に伸びるの かを指定する手段が提供されていないからである。 例えば、スタックが下向き (アドレスが小さい方向) に伸びるアーキテクチャー では、\fIstackaddr\fP には割り当てられたスタック領域の\fI最も大きな\fPアドレ スの次のアドレスを指定する。一方、スタックが上向き (アドレスが大きい 方向) に伸びるアーキテクチャーでは、\fIstackaddr\fP には割り当てられた スタック領域の\fI最も小さい\fPアドレスを指定する。これに対して、 \fBpthread_attr_setstack\fP(3) と \fBpthread_attr_getstack\fP(3) が使用する \fIstackaddr\fP は、常に割り当てられたスタック領域の最も小さいアドレス へのポインターである (\fIstacksize\fP 引数はスタックの範囲を指定する)。 .SH 関連項目 \fBpthread_attr_init\fP(3), \fBpthread_attr_setstack\fP(3), \fBpthread_attr_setstacksize\fP(3), \fBpthread_create\fP(3), \fBpthreads\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。