libexplain  1.4.D001
Functions
libexplain/mkdtemp_on_error.c File Reference
#include <libexplain/ac/errno.h>
#include <libexplain/ac/limits.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/stdio.h>
#include <libexplain/ac/string.h>
#include <libexplain/ac/sys/param.h>
#include <libexplain/ac/sys/stat.h>
#include <libexplain/is_efault.h>
#include <libexplain/mkdtemp.h>
#include <libexplain/output.h>

Go to the source code of this file.

Functions

static char * mkdtemp (char *template)
char * explain_mkdtemp_on_error (char *pathname)

Function Documentation

char* explain_mkdtemp_on_error ( char *  pathname)

The explain_mkdtemp_on_error function is used to call the mkdtemp(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_mkdtemp(3) function.

Parameters:
pathnameThe pathname, exactly as to be passed to the mkdtemp(3) system call.
Returns:
The value returned by the wrapped mkdtemp(3) system call.
Example:
This function is intended to be used in a fashion similar to the following example:
 char *result = explain_mkdtemp_on_error(pathname);
 if (!result)
 {
     ...cope with error
     ...no need to print error message
 }

Definition at line 80 of file mkdtemp_on_error.c.

static char* mkdtemp ( char *  template) [static]

Definition at line 35 of file mkdtemp_on_error.c.