Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

explain_realloc_or_die(3) [debian man page]

explain_realloc_or_die(3)				     Library Functions Manual					 explain_realloc_or_die(3)

NAME
explain_realloc_or_die - Allocate and free dynamic memory and report errors SYNOPSIS
#include <libexplain/realloc.h> void explain_realloc_or_die(void *ptr, size_t size); DESCRIPTION
The explain_realloc_or_die function is used to call the realloc(3) system call. On failure an explanation will be printed to stderr, obtained from explain_realloc(3), and then the process terminates by calling exit(EXIT_FAILURE). This function is intended to be used in a fashion similar to the following example: void *new_ptr = explain_realloc_or_die(ptr, size); ptr The ptr, exactly as to be passed to the realloc(3) system call. size The size, exactly as to be passed to the realloc(3) system call. Returns: This function only returns on success. On failure, prints an explanation and exits. SEE ALSO
realloc(3) Allocate and free dynamic memory explain_realloc(3) explain realloc(3) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_realloc_or_die(3)

Check Out this Related Man Page

explain_fwrite_or_die(3)				     Library Functions Manual					  explain_fwrite_or_die(3)

NAME
explain_fwrite_or_die - binary stream output and report errors SYNOPSIS
#include <libexplain/fwrite.h> size_t explain_fwrite_or_die(const void *ptr, size_t size, size_t nmemb, FILE *fp); DESCRIPTION
The explain_fwrite_or_die function is used to call the fwrite(3) system call. On failure an explanation will be printed to stderr, obtained from explain_fwrite(3), and then the process terminates by calling exit(EXIT_FAILURE). This function is intended to be used in a fashion similar to the following example: size_t result = explain_fwrite_or_die(ptr, size, nmemb, fp); ptr The ptr, exactly as to be passed to the fwrite(3) system call. size The size, exactly as to be passed to the fwrite(3) system call. nmemb The nmemb, exactly as to be passed to the fwrite(3) system call. fp The fp, exactly as to be passed to the fwrite(3) system call. Returns: This function only returns on success. On failure, prints an explanation and exits. SEE ALSO
fwrite(3) binary stream output explain_fwrite(3) explain fwrite(3) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2008 Peter Miller explain_fwrite_or_die(3)
Man Page

10 More Discussions You Might Find Interesting

1. Programming

free() function?????

Did any one knows everything about the unix memory management system and the free() function? There is no problem when making the dynamic arrays free. The problem is that when trying free the link lists. The free() function does not work when trying to make free the link lists. I would be... (4 Replies)
Discussion started by: pegasus
4 Replies

2. Programming

Realloc

Can Any body give me a exampla which has the usage of realloc i want a function which uses realloc & increases /decreases the size of a pointer (0 Replies)
Discussion started by: wojtyla
0 Replies

3. Programming

removing first bit from the word

Hello, I have a code like this : pstSimPOIInfo.ppcName = realloc(pstSimPOIInfo.ppcName, (usLen+strlen(CountryName)+4)); memset(pstSimPOIInfo.ppcName, 0, (usLen+strlen(CountryName)+4)); strncpy((char *)pstSimPOIInfo.ppcName, CityName, strlen(CityName)) strcat(pstSimPOIInfo.ppcName, ",");... (3 Replies)
Discussion started by: jazz
3 Replies

4. Programming

pointers

is this a valid c declaration int (*ptr(int *b)); plz explain... (4 Replies)
Discussion started by: areef4u
4 Replies

5. AIX

C function/system call for memory monitoring

Hello! Is there a C function or system call in AIX that can tell how much free memory is in the system at a certain moment? Also, I'd like to know if there are functions that can: -find the number of processors in the system -report the network interface activity. Thank you very much in... (0 Replies)
Discussion started by: aldehida
0 Replies

6. Programming

Does realloc free fairly?

Hello, my program works properly but valgrind tells me I am not freeing allocated memory. I think the problem is in realloc. I am pretty sure I do something wrong with realloc, because I changed it a bit and valgrind noticed less errors (that the program wasn't working properly with less errors... (3 Replies)
Discussion started by: samciz
3 Replies

7. Programming

What happens when realloc() fails?

Hi, I am seeing varying results about, when realloc() fails in reallocation. Which one is correct out of the below? a) realloc() maintains the original pointer (i.e) the original pointer is left unaltered/untouched but relloc() returns the NULL value. b) original buffer pointer is lost... (3 Replies)
Discussion started by: royalibrahim
3 Replies

8. Programming

realloc fails in C : what next ?

Hi all I'm trying to use someone else's software, which has a realloc that fails in it. This is probably due to memory limitations, as it only happens when I use this software on huge datasets. First question : how to diagnose if it's a soft or hard limitation? I mean, if it's due to my... (10 Replies)
Discussion started by: jossojjos
10 Replies

9. Programming

Realloc() question

b = realloc(a, 1000); if realloc succeeds and b!=a (not in-place replacement), does realloc automatically free a or I should free both a and b afterwards? thank you! (5 Replies)
Discussion started by: bashuser2
5 Replies

10. Programming

realloc() fails

Not sure in which forum to post this. I'm trying here, in Programming. I'm working on a PC with Intel Duo processor & 2GB of ram. OS is Ubuntu 10.04. I'm having problems with a C++ program that makes extensive use of realloc(). It happens that as soon as the overall memory allocated(OS +... (14 Replies)
Discussion started by: mamboknave
14 Replies