|
@@ -1,17 +1,38 @@
|
|
1
|
+#include "etherboot.h"
|
1
|
2
|
#include "errno.h"
|
2
|
3
|
#include "vsprintf.h"
|
3
|
4
|
|
4
|
|
-/* Global "last error" number */
|
|
5
|
+/** @file
|
|
6
|
+ *
|
|
7
|
+ * Error codes and descriptions.
|
|
8
|
+ *
|
|
9
|
+ * This file provides the global variable errno
|
|
10
|
+ *
|
|
11
|
+ */
|
|
12
|
+
|
|
13
|
+/**
|
|
14
|
+ * Global "last error" number.
|
|
15
|
+ *
|
|
16
|
+ * This is valid only when a function has just returned indicating a
|
|
17
|
+ * failure.
|
|
18
|
+ *
|
|
19
|
+ */
|
5
|
20
|
int errno;
|
6
|
21
|
|
7
|
22
|
static struct errortab errortab_start[0] __table_start(errortab);
|
8
|
23
|
static struct errortab errortab_end[0] __table_end(errortab);
|
9
|
24
|
|
10
|
|
-/*
|
|
25
|
+/**
|
11
|
26
|
* Retrieve string representation of error number.
|
12
|
27
|
*
|
13
|
|
- * If error not found in the error table, generate a generic "Error
|
14
|
|
- * 0x0000" message.
|
|
28
|
+ * @v errno Error number
|
|
29
|
+ * @ret strerror Pointer to error text
|
|
30
|
+ *
|
|
31
|
+ * If the error is not found in the linked-in error tables, generates
|
|
32
|
+ * a generic "Error 0x0000" message.
|
|
33
|
+ *
|
|
34
|
+ * The pointer returned by strerror() is valid only until the next
|
|
35
|
+ * call to strerror().
|
15
|
36
|
*
|
16
|
37
|
*/
|
17
|
38
|
const char * strerror ( int errno ) {
|