2018-05-07 05:58:06 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2016-05-09 06:55:17 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Samsung Electronics
|
|
|
|
* Przemyslaw Marczak <p.marczak@samsung.com>
|
|
|
|
*/
|
2010-06-12 06:19:46 +08:00
|
|
|
#ifndef _ERRNO_H
|
2016-05-09 06:55:17 +08:00
|
|
|
#define _ERRNO_H
|
2010-06-12 06:19:46 +08:00
|
|
|
|
2016-09-21 10:28:57 +08:00
|
|
|
#include <linux/errno.h>
|
2010-06-12 06:19:46 +08:00
|
|
|
|
|
|
|
extern int errno;
|
|
|
|
|
|
|
|
#define __set_errno(val) do { errno = val; } while (0)
|
|
|
|
|
2019-10-06 19:58:57 +08:00
|
|
|
/**
|
|
|
|
* errno_str() - get description for error number
|
|
|
|
*
|
|
|
|
* @errno: error number (negative in case of error)
|
|
|
|
* Return: string describing the error. If CONFIG_ERRNO_STR is not
|
|
|
|
* defined an empty string is returned.
|
|
|
|
*/
|
2014-10-09 04:48:37 +08:00
|
|
|
#ifdef CONFIG_ERRNO_STR
|
|
|
|
const char *errno_str(int errno);
|
2016-05-09 06:55:18 +08:00
|
|
|
#else
|
2019-10-06 19:58:57 +08:00
|
|
|
static const char error_message[] = "";
|
|
|
|
|
2016-05-09 06:55:18 +08:00
|
|
|
static inline const char *errno_str(int errno)
|
|
|
|
{
|
2019-10-06 19:58:57 +08:00
|
|
|
return error_message;
|
2016-05-09 06:55:18 +08:00
|
|
|
}
|
2014-10-09 04:48:37 +08:00
|
|
|
#endif
|
2010-06-12 06:19:46 +08:00
|
|
|
#endif /* _ERRNO_H */
|