emulate SOCK_CLOEXEC and SOCK_NONBLOCK for old (pre-2.6.27) kernels
[oweals/musl.git] / src / string / strchr.c
1 #include <string.h>
2
3 char *__strchrnul(const char *, int);
4
5 char *strchr(const char *s, int c)
6 {
7         char *r = __strchrnul(s, c);
8         return *(unsigned char *)r == (unsigned char)c ? r : 0;
9 }