OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/LDP_man-pages.git] / draft / man3 / strnlen.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 source code and manual
10 .\"
11 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
12 .\"         all rights reserved.
13 .\" Translated Tue Jan 11 00:55:48 JST 2000
14 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
15 .\"
16 .TH STRNLEN 3  2011-09-28 "GNU" "Linux Programmer's Manual"
17 .\"O .SH NAME
18 .SH Ì¾Á°
19 .\"O strnlen \- determine the length of a fixed-size string
20 strnlen \- ¸ÇÄêŤÎʸ»úÎó¤ÎŤµ¤òÄ´¤Ù¤ë
21 .\"O .SH SYNOPSIS
22 .SH ½ñ¼°
23 .nf
24 .B #include <string.h>
25 .sp
26 .BI "size_t strnlen(const char *" s ", size_t " maxlen );
27 .fi
28 .sp
29 .in -4n
30 .\"O Feature Test Macro Requirements for glibc (see
31 .\"O .BR feature_test_macros (7)):
32 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
33 .RB ( feature_test_macros (7)
34 »²¾È):
35 .in
36 .sp
37 .BR strnlen ():
38 .PD 0
39 .ad l
40 .RS 4
41 .TP 4
42 .\"O Since glibc 2.10:
43 glibc 2.10 °Ê¹ß:
44 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
45 .TP
46 .\"O Before glibc 2.10:
47 glibc 2.10 ¤è¤êÁ°:
48 _GNU_SOURCE
49 .RE
50 .ad
51 .PD
52 .\"O .SH DESCRIPTION
53 .SH ÀâÌÀ
54 .\"O The
55 .\"O .BR strnlen ()
56 .\"O function returns the number of characters in the string
57 .\"O- pointed to by \fIs\fP, not including the terminating \(aq\\0\(aq character,
58 .\"O+ pointed to by \fIs\fP, excluding the terminating null bye (\(aq\\0\(aq),
59 .\"O but at most \fImaxlen\fP.
60 .\"O In doing this,
61 .\"O .BR strnlen ()
62 .\"O looks only at the first
63 .\"O \fImaxlen\fP characters at \fIs\fP and never beyond \fIs+maxlen\fP.
64 .BR strnlen ()
65 ´Ø¿ô¤Ï \fIs\fP ¤¬»Ø¤¹Ê¸»úÎó¤ÎŤµ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£
66 Ťµ¤Ë¤Ï½ªÃ¼¤Î NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ï´Þ¤Þ¤Ê¤¤¡£
67 ¤Þ¤¿Ä¹¤µ¤ÏºÇÂç¤Ç \fImaxlen\fP ¤Þ¤Ç¤Ç¤¢¤ê¡¢
68 .BR strnlen ()
69 ¤Ï \fIs\fP ¤ÎºÇ½é¤Î \fImaxlen\fP ¥Ð¥¤¥È¤Î¤ß¤ò¸¡ºº¤·
70 \fIs+maxlen\fP ¤è¤êÀè¤ò¸¡ºº¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£
71 .\"O .SH "RETURN VALUE"
72 .SH ÊÖ¤êÃÍ
73 .\"O The
74 .\"O .BR strnlen ()
75 .\"O function returns \fIstrlen(s)\fP, if that is less than
76 .\"O \fImaxlen\fP, or \fImaxlen\fP
77 .\"O if there is no null byte (\(aq\\0\(aq) among the first
78 .\"O \fImaxlen\fP characters pointed to by \fIs\fP.
79 .BR strnlen ()
80 ´Ø¿ô¤Ï \fImaxlen\fP °Ê²¼¤Ê¤é¤Ð \fIstrlen(s)\fP ¤ÈƱ¤¸
81 ÃͤòÊÖ¤¹¡£\fIs\fP ¤Î»Ø¤¹Ê¸»úÎ󤬺ÇÂç \fImaxlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤Ë
82 NULL ¥Ð¥¤¥È (\(aq\\0\(aq) Ê¸»ú¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¤Ë¤Ï \fImaxlen\fP ¤òÊÖ¤¹¡£
83 .\"O .SH "CONFORMING TO"
84 .SH ½àµò
85 POSIX.1-2008.
86 .\"O .SH "SEE ALSO"
87 .SH ´ØÏ¢¹àÌÜ
88 .BR strlen (3)