OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man3 / confstr.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\" License.
23 .\" Modified Sat Jul 24 19:53:02 1993 by Rik Faith (faith@cs.unc.edu)
24 .\" FIXME Many more values for 'name' are supported, some of which
25 .\"     are documented under 'info confstr'.
26 .\"     See <bits/confname.h> for the rest.
27 .\"     These should all be added to this page.
28 .\"     See also the POSIX.1-2001 specification of confstr()
29 .\"
30 .\" Japanese Version Copyright (c) 1997 Hiroaki Nagoya
31 .\"         all rights reserved.
32 .\" Translated by Hiroaki Nagoya <nagoya@is.titech.ac.jp>
33 .\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
34 .\" Updated 2006-07-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.36
35 .\"
36 .TH CONFSTR 3  2010-02-03 "GNU" "Linux Programmer's Manual"
37 .SH Ì¾Á°
38 confstr \- ¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¤Ë°Í¸¤·¤¿Ê¸»úÎóÊÑ¿ô¤Î¼èÆÀ
39 .SH ½ñ¼°
40 .nf
41 .B #include <unistd.h>
42 .sp
43 .BI "size_t confstr(int " "name" ", char *" buf ", size_t " len );
44 .fi
45 .sp
46 .in -4n
47 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
48 .RB ( feature_test_macros (7)
49 »²¾È):
50 .in
51 .sp
52 .BR confstr ():
53 _POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE
54 .SH ÀâÌÀ
55 .BR confstr ()
56 ¤Ï¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¤Ë°Í¸¤·¤¿Ê¸»úÎóÊÑ¿ô¤ÎÃͤò¼èÆÀ¤¹¤ë¡£
57 .PP
58 °ú¤­¿ô
59 .I name
60 ¤Ï¡¢Ì䤤¹ç¤ï¤»ÆâÍƤòɽ¤¹¥·¥¹¥Æ¥àÊÑ¿ô¤Ç¤¢¤ë¡£
61 °Ê²¼¤ÎÊÑ¿ô¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£
62 .TP
63 .BR _CS_GNU_LIBC_VERSION " (GNU C library ¸ÂÄê; glibc 2.3.2 °Ê¹ß)"
64 ¤½¤Î¥·¥¹¥Æ¥à¤Î GNU C ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¼¨¤¹Ê¸»úÎó
65 (Î㤨¤Ð "glibc 2.3.4")¡£
66 .TP
67 .BR _CS_GNU_LIBPTHREAD_VERSION " (GNU C library ¸ÂÄê; glibc 2.3.2 °Ê¹ß)"
68 ¤½¤Î C ¥é¥¤¥Ö¥é¥ê¤¬Ä󶡤·¤Æ¤¤¤ë POSIX ¼ÂÁõ¤ò¼¨¤¹Ê¸»úÎó
69 (Î㤨¤Ð "NPTL 2.3.4" ¤ä "linuxthreads-0.10")¡£
70 .TP
71 .B _CS_PATH
72 ¤¹¤Ù¤Æ¤Î POSIX.2 É¸½à¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤¬¸«¤Ä¤«¤ë¤è¤¦¤Ê
73 .B PATH
74 ¤ÎÃÍ¡£
75 .PP
76 .I buf
77 ¤¬ NULL ¤Ç¤Ê¤¯¡¢¤«¤Ä
78 .I len
79 ¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð
80 .BR confstr ()
81 ¤Ï¼èÆÀ¤·¤¿Ê¸»úÎó¤ÎÆâÍƤò
82 .I buf
83 ¤Ë¥³¥Ô¡¼¤¹¤ë¡£É¬Íפʤé¤ÐŤµ¤Ï
84 .I len \- 1
85 ʸ»ú¤ËÀÚ¤ê¼Î¤Æ¤é¤ì¤Æ¡¢NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ç½ªÃ¼¤µ¤ì¤ë¡£
86 ËöÈø¤¬ÀÚ¤ê¼Î¤Æ¤é¤ì¤¿¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤Ë¤Ï¡¢
87 .BR confstr ()
88 ¤ÎÊÖ¤êÃͤò
89 .I len
90 ¤ÈÈæ³Ó¤¹¤ì¤Ð¤è¤¤¡£
91 .PP
92 .I len
93 ¤¬ 0 ¤Ç
94 .I buf
95 ¤¬ NULL ¤Ê¤é¤Ð¡¢
96 .BR confstr ()
97 ¤Ï°Ê²¼¤ÇÄêµÁ¤µ¤ì¤¿ÃÍ (ÌõÃí: ÀÚ¤ê¼Î¤Æ¤ëÁ°¤Î¡¢¼èÆÀ¤·¤¿Ê¸»úÎó¤ÎŤµ) ¤òÊÖ¤¹¡£
98 .SH ÊÖ¤êÃÍ
99 .I name
100 ¤¬Í­¸ú¤Ê¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥óÊÑ¿ô¤Î¾ì¹ç¡¢
101 .BR confstr ()
102 ¤Ï¤½¤ÎÊÑ¿ô¤ÎÃÍÁ´ÂΤòÊÝ»ý¤¹¤ë¤Î¤ËɬÍפǤ¢¤Ã¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹
103 (ʸ»úÎó½ªÃ¼¤Î¥Ì¥ë¥Ð¥¤¥È¤â´Þ¤à)¡£¤³¤ÎÃͤÏ
104 .I len
105 ¤è¤êÂ礭¤¤¤³¤È¤â¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ë¤Ï¡¢
106 .I buf
107 ¤Ë³ÊǼ¤µ¤ì¤¿ÃͤÎËöÈø¤¬ÀÚ¤êµÍ¤á¤é¤ì¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
108
109 .I name
110 ¤¬Í­¸ú¤Ê¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥óÊÑ¿ô¤À¤¬¡¢
111 ÊÑ¿ô¤¬Ãͤò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
112 .BR confstr ()
113 ¤Ï 0 ¤òÊÖ¤¹¡£
114 .I name
115 ¤¬Í­¸ú¤Ê¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥óÊÑ¿ô¤ËÂбþ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
116 .BR confstr ()
117 ¤Ï 0 ¤òÊÖ¤·¡¢
118 .I errno
119 ¤Ë
120 .B EINVAL
121 ¤òÀßÄꤹ¤ë¡£
122 .SH ¥¨¥é¡¼
123 .TP
124 .B EINVAL
125 .I name
126 ¤ÎÃͤ¬ÉÔÀµ¤Ç¤¢¤ë¡£
127 .SH ½àµò
128 POSIX.1-2001.
129 .SH Îã
130 ¼¡¤ÎÉôʬŪ¤Ê¥³¡¼¥É¤Ï¡¢ POSIX.2 ¥·¥¹¥Æ¥à¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤¬¤¢¤ë¥Ñ¥¹
131 ¤ò¼èÆÀ¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£
132 .br
133 .nf
134 .in +4n
135
136 char *pathbuf;
137 size_t n;
138
139 n = confstr(_CS_PATH,NULL,(size_t) 0);
140 pathbuf = malloc(n);
141 if (pathbuf == NULL)
142     abort();
143 confstr(_CS_PATH, pathbuf, n);
144 .in
145 .fi
146 .SH ´ØÏ¢¹àÌÜ
147 .BR sh (1),
148 .BR exec (3),
149 .BR system (3)