hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/tools/lib/bpf/libbpf_errno.c
....@@ -1,23 +1,10 @@
1
-// SPDX-License-Identifier: LGPL-2.1
1
+// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
22
33 /*
44 * Copyright (C) 2013-2015 Alexei Starovoitov <ast@kernel.org>
55 * Copyright (C) 2015 Wang Nan <wangnan0@huawei.com>
66 * Copyright (C) 2015 Huawei Inc.
77 * Copyright (C) 2017 Nicira, Inc.
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU Lesser General Public
11
- * License as published by the Free Software Foundation;
12
- * version 2.1 of the License (not later!)
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU Lesser General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU Lesser General Public
20
- * License along with this program; if not, see <http://www.gnu.org/licenses>
218 */
229
2310 #undef _GNU_SOURCE
....@@ -25,6 +12,9 @@
2512 #include <string.h>
2613
2714 #include "libbpf.h"
15
+
16
+/* make sure libbpf doesn't use kernel-only integer typedefs */
17
+#pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64
2818
2919 #define ERRNO_OFFSET(e) ((e) - __LIBBPF_ERRNO__START)
3020 #define ERRCODE_OFFSET(c) ERRNO_OFFSET(LIBBPF_ERRNO__##c)
....@@ -43,6 +33,7 @@
4333 [ERRCODE_OFFSET(PROGTYPE)] = "Kernel doesn't support this program type",
4434 [ERRCODE_OFFSET(WRNGPID)] = "Wrong pid in netlink message",
4535 [ERRCODE_OFFSET(INVSEQ)] = "Invalid netlink sequence",
36
+ [ERRCODE_OFFSET(NLPARSE)] = "Incorrect netlink message parsing",
4637 };
4738
4839 int libbpf_strerror(int err, char *buf, size_t size)