|
NAMEexplain_tempnam - explain tempnam(3) errorsSYNOPSIS#include <libexplain/tempnam.h>const char *explain_tempnam(const char *dir, const char *prefix);
DESCRIPTIONThese functions may be used to obtain explanations for errors returned by the tempnam(3) system call.explain_tempnamconst char *explain_tempnam(const char *dir, const char *prefix);The explain_tempnam function is used to obtain an explanation of an error returned by the tempnam(3) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded.
Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. Example: This function is intended to be used in a fashion similar to the following example: char *result = tempnam(dir, prefix); if (!result) { fprintf(stderr, "%s\n", explain_tempnam(dir, prefix)); exit(EXIT_FAILURE); } The above code example is available pre‐packaged as the explain_tempnam_or_die(3) function. explain_errno_tempnamconst char *explain_errno_tempnam(int errnum, const char *dir, const char *prefix);The explain_errno_tempnam function is used to obtain an explanation of an error returned by the tempnam(3) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail.
Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. Example: This function is intended to be used in a fashion similar to the following example: char *result = tempnam(dir, prefix); if (!result) { int err = errno; fprintf(stderr, "%s\n", explain_errno_tempnam(err, dir, prefix)); exit(EXIT_FAILURE); } The above code example is available pre‐packaged as the explain_tempnam_or_die(3) function. explain_message_tempnamvoid explain_message_tempnam(char *message, int message_size, const char *dir, const char *prefix);The explain_message_tempnam function is used to obtain an explanation of an error returned by the tempnam(3) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded.
Example: This function is intended to be used in a fashion similar to the following example: char *result = tempnam(dir, prefix); if (!result) { char message[3000];explain_message_tempnam(message, sizeof(message), dir, prefix);
The above code example is available pre‐packaged as the explain_tempnam_or_die(3) function. explain_message_errno_tempnamvoid explain_message_errno_tempnam(char *message, int message_size, int errnum, const char *dir, const char *prefix);The explain_message_errno_tempnam function is used to obtain an explanation of an error returned by the tempnam(3) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail.
Example: This function is intended to be used in a fashion similar to the following example: char *result = tempnam(dir, prefix); if (!result) { int err = errno; char message[3000];explain_message_errno_tempnam(message, sizeof(message), err, dir, prefix);
The above code example is available pre‐packaged as the explain_tempnam_or_die(3) function. SEE ALSO
COPYRIGHTlibexplain version 1.3Copyright (C) 2009 Peter Miller Visit the GSP FreeBSD Man Page Interface. |