2 /* Test malloc, calloc, realloc and memalign set errno to ENOMEM */
12 char* small
= malloc (16);
16 p
= malloc(SSIZE_MAX
);
17 if (!p
&& errno
== ENOMEM
) puts("malloc: Cannot allocate memory");
20 p
= calloc(1, SSIZE_MAX
);
21 if (!p
&& errno
== ENOMEM
) puts("calloc: Cannot allocate memory");
24 p
= realloc(small
, SSIZE_MAX
);
25 if (!p
&& errno
== ENOMEM
) puts("realloc: Cannot allocate memory");
28 p
= memalign(64, SSIZE_MAX
);
29 if (!p
&& errno
== ENOMEM
) puts("memalign: Cannot allocate memory");