*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: strlen | Section: 3 | Source: Digital UNIX | File: strlen.3.gz
strlen(3) Library Functions Manual strlen(3) NAME strlen - Finds the length of a string LIBRARY Standard C Library (libc.so, libc.a) SYNOPSIS #include <string.h> size_t strlen( const char *s); STANDARDS Interfaces documented on this reference page conform to industry stan- dards as follows: strlen(): ISO C, XPG4 Refer to the standards(5) reference page for more information about in- dustry standards and associated tags. PARAMETERS Specifies the string. DESCRIPTION The strlen() function returns the number of bytes in the string pointed to by the s parameter. The string length value does not include the terminating null character. Note If you pass a NULL pointer as the const char * parameter to the strlen function, the function generates a segmentation violation. To avoid the segmentation violation and cause the function to return 0 (zero), change the NULL pointer treatment for the process before issuing the call to the strlen function, as follows: Include the system header file sys/uswitch.h. Call the uswitch function, as described in the uswitch(3) reference page. The following program illustrates this procedure: #include <stdio.h> #include <sys/types.h> #include <sys/uswitch.h> main() { size_t retval; int uswitch_val; uswitch_val = uswitch(USC_GET,0); uswitch(USC_SET, uswitch_val | USW_NULLP); retval = strlen(NULL); RETURN VALUES On successful completion, the strlen() function returns the number of characters (bytes) in the string to which the s parameter points. Cur- rent industry standards specify that no value be reserved to indicate an error. RELATED INFORMATION Functions: string(3), uswitch(3), wcslen(3) Standards: standards(5) delim off strlen(3)

Navigation Options