2 * Copyright (c) 2009, 2011 Nicira Networks.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef STRING_WRAPPER_H
18 #define STRING_WRAPPER_H 1
20 #include_next <string.h>
22 /* Glibc 2.7 has a bug in strtok_r when compiling with optimization that can
23 * cause segfaults if the delimiters argument is a compile-time constant that
24 * has exactly 1 character:
26 * http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614
28 * The bug is only present in the inline version of strtok_r(), so force the
29 * out-of-line version to be used instead. */
36 #define strnlen rpl_strnlen
37 size_t strnlen(const char *, size_t maxlen);
40 #endif /* string.h wrapper */