streq(3) Library Functions Manual streq(3)

streq - strings equal

gnulib - The GNU Portability Library

#include <string.h>
bool streq(const char *s1, const char *s2);

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)

See memeq(3).

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

Interface Attribute Value
streq () Thread safety MT-Safe

GNU.

gnulib 202601.

string(3)

2026-08-10 Linux man-pages 6.19