Rev 4349 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | #ifdef MALLOC_PROVIDED |
2 | int _dummy_calloc = 1; |
||
3 | #else |
||
4 | /* |
||
5 | FUNCTION |
||
6 | < |
||
7 | |||
8 | INDEX |
||
9 | calloc |
||
10 | |||
11 | INDEX |
||
12 | _calloc_r |
||
13 | |||
14 | ANSI_SYNOPSIS |
||
15 | #include |
||
16 | void *calloc(size_t <[n]>, size_t <[s]>); |
||
17 | void *_calloc_r(void *<[reent]>, size_t <[n]>, size_t <[s]>); |
||
18 | |||
19 | TRAD_SYNOPSIS |
||
20 | #include |
||
21 | char *calloc(<[n]>, <[s]>) |
||
22 | size_t <[n]>, <[s]>; |
||
23 | |||
24 | char *_calloc_r(<[reent]>, <[n]>, <[s]>) |
||
25 | char *<[reent]>; |
||
26 | size_t <[n]>; |
||
27 | size_t <[s]>; |
||
28 | |||
29 | |||
30 | |||
31 | DESCRIPTION |
||
32 | Use < |
||
33 | array of <[n]> elements, each of which has size <[s]>. |
||
34 | |||
35 | The memory allocated by < |
||
36 | used by < |
||
37 | bytes. (To avoid the overhead of initializing the space, use |
||
38 | < |
||
39 | |||
40 | The alternate function <<_calloc_r>> is reentrant. |
||
41 | The extra argument <[reent]> is a pointer to a reentrancy structure. |
||
42 | |||
43 | RETURNS |
||
44 | If successful, a pointer to the newly allocated space. |
||
45 | |||
46 | If unsuccessful, < |
||
47 | |||
48 | PORTABILITY |
||
49 | < |
||
50 | |||
51 | Supporting OS subroutines required: < |
||
52 | < |
||
53 | */ |
||
54 | |||
55 | #include |
||
56 | #include |
||
57 | |||
58 | #ifndef _REENT_ONLY |
||
59 | |||
60 | _PTR |
||
61 | _DEFUN (calloc, (n, size), |
||
62 | size_t n _AND |
||
63 | size_t size) |
||
64 | { |
||
65 | return _calloc_r (_REENT, n, size); |
||
66 | } |
||
67 | |||
68 | #endif |
||
69 | #endif /* MALLOC_PROVIDED */ |