When a function has the "restrict" keyword, it is usually mentioned in the manpage. Some man pages omit it. For example, strtok: strok has the signature [1]: char *strtok(char * __restrict, const char * __restrict); The manpage lists it as [2]: char * strtok(char *str, const char *sep); It should be: char * strtok(char * restrict str, const char * restrict sep); [1] https://github.com/freebsd/freebsd/blob/b8aaa2c367f1038f28506521674b9b40b8a51352/include/string.h#L119 [2] https://github.com/freebsd/freebsd/blob/b8aaa2c367f1038f28506521674b9b40b8a51352/lib/libc/string/strtok.3#L58 A few other functions in string.h that use "restrict", but omit it in their man pages: * memccpy * memcpy * stpcpy * stpncpy * strlcat * strncat * strncpy memcpy is interesting: Its documentation says it uses bcopy, and therefore the strings may overlap. However, the signature in string.h includes the "restrict" keywords.
Created attachment 228613 [details] patch to memccpy(3), memcpy(3), and strtok(3) Modify function signatures for memccpy, memcpy, mempcpy, and strtok to include the restrict keyword.
The functions in strcpy(3) already have the restrict keyword. This includes stpcpy, stpncpy, strcpy, and strncpy. The functions in strlcpy(3) (strlcpy, strlcat) have the restrict keyword.