Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3c/strlen.3c
Real path: /usr/share/man/man3c/strlen.3c
Zurück
'\" te .\" Portions Copyright (c) 2008, 2022, Oracle and/or its affiliates. .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Portions Copyright (c) 1994, Man-cgi 1.15, Panagiotis Christias (christia@softlab.ntua.gr) .\" Portions Copyright (c) 1996, 2008, Modified for NetBSD by Kimmo Suominen (kimmo@suominen.com) .\" Portions Copyright (c) 1992, The X/Open Company Ltd. All rights reserved. .\" Oracle gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .\" Portions of this manual page were derived from Linux documentation obtained from http://linux.die.net. .TH strlen 3C "28 Feb 2022" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME strlen, strnlen, strnlen_s \- string length operations .SH SYNOPSIS .LP .nf #include <string.h> \fBsize_t\fR \fBstrlen\fR(\fBconst char *\fR\fIs\fR); .fi .LP .nf \fBsize_t\fR \fBstrnlen\fR(\fBconst char *\fR\fIs\fR, \fBsize_t\fR \fIn\fR); .fi .SS "C11 Bounds Checking Interface" .LP .nf #define __STDC_WANT_LIB_EXT1__ 1 #include <string.h> \fBsize_t\fR \fBstrnlen_s\fR(\fBconst char *\fR\fIs\fR, \fBsize_t\fR \fImaxsize\fR); .fi .SH DESCRIPTION .sp .LP These functions calculate the length in bytes of strings (arrays of characters). Depending on the function, strings may be either terminated by a null character or bounded by a maximum length of \fIn\fR bytes. They are designed for use with encodings representing each character as a single byte, and all character counts are measured in individual bytes, even if a string with multibyte characters is used. They do not check for null pointers, and programs may crash if passing null or otherwise invalid pointers to these functions. .SS "\fBstrlen()\fR, \fBstrnlen()\fR" .sp .LP The \fBstrlen()\fR function returns the number of bytes in \fIs\fR, not including the terminating null character. .sp .LP The \fBstrnlen()\fR function returns the smaller of \fIn\fR or the number of bytes in \fIs\fR, not including the terminating null character. The \fBstrnlen()\fR function never examines more than \fIn\fR bytes of the string pointed to by \fIs\fR. .SS "C11 Bounds Checking Interface" .sp .LP The \fBstrnlen_s()\fR function is part of the C11 bounds checking interfaces specified in the C11 standard, Annex K. Each of these functions provides similar functionality to their respective non-bounds checking counterpart functions, but with additional safety checks in the form of explicit runtime constraints as defined in the C11 standard. See \fBruntime_constraint_handler\fR(3C) and INCITS/ISO/IEC 9899:2011. .sp .LP The \fBstrnlen_s()\fR function returns zero if \fIs\fR is a null pointer. Otherwise, the number of bytes preceding the terminating null character is returned. If there is no terminating null character in the first \fBmaxsize\fR characters pointed to by \fIs\fR, \fBstrnlen_s()\fR returns \fImaxsize\fR. There are no defined error conditions in which \fBstrnlen_s()\fR will invoke the runtime constraint handler. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level Async-Signal-Safe _ Standard See below .TE .sp .SS "Standard" .sp .LP See \fBstandards\fR(7) for descriptions of the following standards: .sp .TS tab( ) box; cw(2.44i) |cw(3.06i) lw(2.44i) |lw(3.06i) . INTERFACES APPLICABLE STANDARDS _ \fBstrlen()\fR T{ .br .in +2 C89 through C11, .in -2 .br .in +2 POSIX.1-1990 through 2008, .in -2 .br .in +2 SUS through SUSv4, .in -2 .br .in +2 XPG1 through XPG7 .in -2 T} _ \fBstrnlen()\fR T{ .br .in +2 POSIX.1-2008, .in -2 .br .in +2 SUSv4, .in -2 .br .in +2 XPG7 .in -2 T} _ \fBstrlen_s()\fR C11 Annex K .TE .sp .SH SEE ALSO .sp .LP \fBstring\fR(3C), \fBwcslen\fR(3C), \fBattributes\fR(7), \fBstandards\fR(7) .SH HISTORY .sp .LP The \fBstrlen_s()\fR function was added to Oracle Solaris in the Solaris 11.4.0 release. .sp .LP The \fBstrnlen()\fR function was added to Oracle Solaris in the Solaris 11.0.0 release. .sp .LP The \fBstrlen()\fR function has been included in all Sun and Oracle releases of Solaris.