Creates a core file without terminating the calling process.
Standard C library (libc.a)
int coredump( coredumpinfop)
struct coredumpinfo *coredumpinfop ;
The coredump subroutine creates a core file of the calling process without terminating the calling process. The created core file contains the memory image of the process, and this can be used with the dbx command for debugging purposes. In multithreaded processes, only one thread at a time should attempt to call this subroutine. Subsequent calls to coredump while a core dump (initiated by another thread) is in progress will fail.
Applications expected to use this facility need to be built with the -bM:UR binder flag, otherwise the routine will fail with an error code of ENOTSUP.
The coredumpinfo structure has the following fields:
|Member Type||Member Name||Description|
|unsigned int||length||Length of the core file name|
|char *||name||Points to a character string that contains the name of the core file|
|int||reserved||Reserved fields for future use|
|coredumpinfop||Points to the coredumpinfo structure|
If a NULL pointer is passed as an argument, the default file named core in the current directory is used.
Upon successful completion, the coredump subroutine returns a value of 1. If the coredump subroutine is not successful, a value of -1 is returned and the errno global variable is set to indicate the error
|EACCESS||Search permission is denied on a component of the path prefix, the file exists and the pwrite permission is denied, or the file does not exist and write permission is denied for the parent directory of the file to be created.|
|EINPROGRESS||A core dump is already in progress.|
|ENOMEM||Not enough memory.|
|ENOTSUP||Routine not supported.|
|EFAULT||Invalid user address.|
The adb command, dbx command.
The core file format.