streq(3)

streq3

Strings equal

Usage

#include <string.h>

bool streq(const char *s1, const char *s2);

Library

gnulib - The GNU Portability Library

Overview

streq() determines whether the strings s1 and s2 are equal, as if by calling memeq(3).

It is equivalent to both of the following expressions:

strcmp(s1, s2) == 0
memeq(s1, s2, MIN(strlen(s1),strlen(s2))+1)

Return value

See memeq(3).

Attributes

For an explanation of the terms used in this section, see attributes(7).

InterfaceAttributeValue
streq()Thread safetyMT-Safe

Standards

GNU.

History

gnulib 202601.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.