linux系统库函数之strlen
370 #ifndef __HAVE_ARCH_STRLEN
371 /**
372 * strlen - Find the length of a string
373 * @s: The string to be sized
374 */
375 size_t strlen(const char *s)
376 {
377 const char *sc;
378
379 for (sc = s; *sc != '\0'; ++sc)
380 /* nothing */;
381 return sc - s;
382 }
383 EXPORT_SYMBOL(strlen);
371 /**
372 * strlen - Find the length of a string
373 * @s: The string to be sized
374 */
375 size_t strlen(const char *s)
376 {
377 const char *sc;
378
379 for (sc = s; *sc != '\0'; ++sc)
380 /* nothing */;
381 return sc - s;
382 }
383 EXPORT_SYMBOL(strlen);
384 #endif
计算字符串的长度,不包括字符串的结束符'/0'。