OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / 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 .TH STRNLEN 3  1999-07-25 "GNU" "Linux Programmer's Manual"
12 .SH NAME
13 strnlen \- determine the length of a fixed-size string
14 .SH SYNOPSIS
15 .nf
16 .B #define _GNU_SOURCE
17 .sp
18 .B #include <string.h>
19 .sp
20 .BI "size_t strnlen(const char *" s ", size_t " maxlen );
21 .fi
22 .SH DESCRIPTION
23 The
24 .BR strnlen ()
25 function returns the number of characters in the string
26 pointed to by \fIs\fP, not including the terminating \(aq\\0\(aq character,
27 but at most \fImaxlen\fP.
28 In doing this,
29 .BR strnlen ()
30 looks only at the first
31 \fImaxlen\fP characters at \fIs\fP and never beyond \fIs+maxlen\fP.
32 .SH "RETURN VALUE"
33 The
34 .BR strnlen ()
35 function returns \fIstrlen(s)\fP, if that is less than
36 \fImaxlen\fP, or \fImaxlen\fP
37 if there is no \(aq\\0\(aq character among the first
38 \fImaxlen\fP characters pointed to by \fIs\fP.
39 .SH "CONFORMING TO"
40 This function is a GNU extension.
41 .SH "SEE ALSO"
42 .BR strlen (3),
43 .BR feature_test_macros (7)