Blame src/internal/sofort_errinfo_impl.h

d413d6
#include <errno.h>
d413d6
#include <sofort/sofort.h>
d413d6
d413d6
int sfrt_record_error(
d413d6
	const struct sfrt_driver_ctx *,
d413d6
	int		esyscode,
d413d6
	int		elibcode,
d413d6
	const char *	efunction,
d413d6
	int		eline,
d413d6
	unsigned	eflags,
d413d6
	void *		ectx);
d413d6
d413d6
#define SFRT_SYSTEM_ERROR(dctx)           \
d413d6
	sfrt_record_error(                \
d413d6
		dctx,                     \
d413d6
		errno,                    \
d413d6
		0,                        \
d413d6
		__func__,                 \
d413d6
		__LINE__,                 \
d413d6
		SFRT_ERROR_TOP_LEVEL,     \
d413d6
		0)
d413d6
d413d6
#define SFRT_BUFFER_ERROR(dctx)           \
d413d6
	sfrt_record_error(                \
d413d6
		dctx,                     \
d413d6
		ENOBUFS,                  \
d413d6
		0,                        \
d413d6
		__func__,                 \
d413d6
		__LINE__,                 \
d413d6
		SFRT_ERROR_TOP_LEVEL,     \
d413d6
		0)
d413d6
d413d6
#define SFRT_SPAWN_ERROR(dctx)            \
d413d6
	sfrt_record_error(                \
d413d6
		dctx,                     \
d413d6
		errno,                    \
d413d6
		0,                        \
d413d6
		__func__,                 \
d413d6
		__LINE__,                 \
d413d6
		SFRT_ERROR_TOP_LEVEL      \
d413d6
		| (errno ? 0              \
d413d6
		   : SFRT_ERROR_CHILD),   \
d413d6
		0)
d413d6
d413d6
#define SFRT_FILE_ERROR(dctx)             \
d413d6
	sfrt_record_error(                \
d413d6
		dctx,                     \
d413d6
		EIO,                      \
d413d6
		0,                        \
d413d6
		__func__,                 \
d413d6
		__LINE__,                 \
d413d6
		SFRT_ERROR_TOP_LEVEL,     \
d413d6
		0)
d413d6
d413d6
#define SFRT_CUSTOM_ERROR(dctx,elibcode)  \
d413d6
	sfrt_record_error(                \
d413d6
		dctx,                     \
d413d6
		0,                        \
d413d6
		elibcode,                 \
d413d6
		__func__,                 \
d413d6
		__LINE__,                 \
d413d6
		SFRT_ERROR_TOP_LEVEL      \
d413d6
		| SFRT_ERROR_CUSTOM,      \
d413d6
		0)
d413d6
d413d6
#define SFRT_NESTED_ERROR(dctx)           \
d413d6
	sfrt_record_error(                \
d413d6
		dctx,                     \
d413d6
		0,                        \
d413d6
		0,                        \
d413d6
		__func__,                 \
d413d6
		__LINE__,                 \
d413d6
		SFRT_ERROR_NESTED,        \
d413d6
		0)