diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2017-03-30 04:57:26 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2017-03-30 04:57:26 +0000 |
commit | 9851b3400ae1362185d9ffe3c163428b9faa6b9f (patch) | |
tree | 5310615d6631002e7262db4e9ea81f3338f4fcb8 /include/string.h | |
parent | 653e7d639682be855c34415b1b7542d9388aafd6 (diff) | |
download | src-test2-9851b3400ae1362185d9ffe3c163428b9faa6b9f.tar.gz src-test2-9851b3400ae1362185d9ffe3c163428b9faa6b9f.zip |
Implement the memset_s(3) function as specified by the C11 ISO/IEC
9899:2011 Appendix K 3.7.4.1.
Other needed supporting types, defines and constraint_handler
infrastructure is added as specified in the C11 spec.
Submitted by: Tom Rix <trix@juniper.net>
Sponsored by: Juniper Networks
Discussed with: ed
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D9903
Differential revision: https://reviews.freebsd.org/D10161
Notes
Notes:
svn path=/head/; revision=316213
Diffstat (limited to 'include/string.h')
-rw-r--r-- | include/string.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/string.h b/include/string.h index 9fe1f826d9cd..21698c309534 100644 --- a/include/string.h +++ b/include/string.h @@ -141,6 +141,22 @@ int timingsafe_memcmp(const void *, const void *, size_t); #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) #include <xlocale/_string.h> #endif + +#if __EXT1_VISIBLE + +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + +#ifndef _ERRNO_T_DEFINED +#define _ERRNO_T_DEFINED +typedef int errno_t; +#endif + +/* ISO/IEC 9899:2011 K.3.7.4.1.1 */ +errno_t memset_s(void *, rsize_t, int, rsize_t); +#endif /* __EXT1_VISIBLE */ __END_DECLS #endif /* _STRING_H_ */ |