OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[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 2010-10-31 "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 but at most \fImaxlen\fP.
59 .\"O In doing this,
60 .\"O .BR strnlen ()
61 .\"O looks only at the first
62 .\"O \fImaxlen\fP characters at \fIs\fP and never beyond \fIs+maxlen\fP.
63 .BR strnlen ()
64 ´Ø¿ô¤Ï \fIs\fP ¤¬»Ø¤¹Ê¸»úÎó¤ÎŤµ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£
65 Ťµ¤Ë¤Ï½ªÃ¼¤Î \(aq\\0\(aq Ê¸»ú¤ò´Þ¤Þ¤Ê¤¤¡£
66 ¤Þ¤¿Ä¹¤µ¤ÏºÇÂç¤Ç \fImaxlen\fP ¤Þ¤Ç¤Ç¤¢¤ê¡¢
67 .BR strnlen ()
68 ¤Ï \fIs\fP ¤ÎºÇ½é¤Î \fImaxlen\fP ¥Ð¥¤¥È¤Î¤ß¤ò¸¡ºº¤·
69 \fIs+maxlen\fP ¤è¤êÀè¤ò¸¡ºº¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£
70 .\"O .SH "RETURN VALUE"
71 .SH ÊÖ¤êÃÍ
72 .\"O The
73 .\"O .BR strnlen ()
74 .\"O function returns \fIstrlen(s)\fP, if that is less than
75 .\"O \fImaxlen\fP, or \fImaxlen\fP
76 .\"O if there is no \(aq\\0\(aq character among the first
77 .\"O \fImaxlen\fP characters pointed to by \fIs\fP.
78 .BR strnlen ()
79 ´Ø¿ô¤Ï \fImaxlen\fP °Ê²¼¤Ê¤é¤Ð \fIstrlen(s)\fP ¤ÈƱ¤¸
80 ÃͤòÊÖ¤¹¡£\fIs\fP ¤Î»Ø¤¹Ê¸»úÎ󤬺ÇÂç \fImaxlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤Ë
81 \(aq\\0\(aq Ê¸»ú¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¤Ë¤Ï \fImaxlen\fP ¤òÊÖ¤¹¡£
82 .\"O .SH "CONFORMING TO"
83 .SH ½àµò
84 .\"O This function is a GNU extension.
85 ¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£
86 .\"O .SH "SEE ALSO"
87 .SH ´ØÏ¢¹àÌÜ
88 .BR strlen (3)