FCORE(2) BSD Programmer's Manual FCORE(2)NAMEfcore - write a core dump to a file
SYNOPSIS
#include <sys/types.h>
#include <sys/fcore.h>
int
fcore(int fd, pid_t pid, int flags);
DESCRIPTION
The fcore() function causes the system to write a `core dump' for the
process with process ID pid starting at the beginning of the given open
file fd. The flags argument must be zero. See core(5) for details about
the format of core dumps.
The file descriptor fd must be open for writing.
The process ID pid must either be the process ID of the currently running
process, or it must be a child of the current process. If the process is
a child of the current process, it must be traced (see ptrace(2)) and
stopped, and the parent must have waited for it (see wait(2)).
RETURN VALUESFcore() returns 0 on success. On failure, fcore() returns -1 and the
global variable errno is set to indicate the specific error condition.
ERRORSFcore() will return the given error code for the given error condition:
[EBADF] Fd is not open for writing.
[EBUSY] The process is not the current process, and either it is
not stopped or the current process has not waited for it.
[EOPNOTSUPP] Core files are not supported on the given file type.
[EFBIG] The core file would be larger than the current file size
limit.
[EINVAL] The flags parameter has an invalid value.
[EIO] An I/O error occurred while reading virtual memory or
while writing the file.
[EPERM] The given process is not being traced.
[EPERM] The given process is neither the current process nor a
child of the current process.
[ESRCH] The process ID pid does not correspond to an existing pro-
cess.
SEE ALSOgcore(1), core(5)HISTORY
The fcore function first appeared in BSD/OS 4.0.
BSDI BSD/OS December 8, 1997 1