File: stdlib.h

package info (click to toggle)
picolibc 1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 31,616 kB
  • sloc: ansic: 312,308; asm: 22,739; perl: 2,414; sh: 1,619; python: 1,019; pascal: 329; exp: 287; makefile: 164; xml: 40; cpp: 10
file content (31 lines) | stat: -rw-r--r-- 785 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* Copyright (c) 2017 Yaakov Selkowitz <yselkowi@redhat.com> */
#ifndef _SSP_STDLIB_H_
#define _SSP_STDLIB_H_

#include <ssp/ssp.h>

#if __SSP_FORTIFY_LEVEL > 0
__BEGIN_DECLS

__ssp_decl(size_t, mbstowcs, (wchar_t *__buf, const char *__src, size_t __n))
{
  if (__buf != NULL)
    __ssp_check(__buf, __n * sizeof(wchar_t), __ssp_bos);
  return __ssp_real_mbstowcs (__buf, __src, __n);
}

__ssp_redirect_raw(size_t, wcstombs, \
    (char *__buf, const wchar_t *__src, size_t __len), \
    (__buf, __src, __len), __buf != NULL, __ssp_bos);

__ssp_decl(int, wctomb, (char *__buf, wchar_t __wc))
{
  if (__buf != NULL)
    __ssp_check(__buf, MB_CUR_MAX, __ssp_bos);
  return __ssp_real_wctomb (__buf, __wc);
}

__END_DECLS

#endif /* __SSP_FORTIFY_LEVEL > 0 */
#endif /* _SSP_STDLIB_H_ */