tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH 6/7] Update dtrace errno.d mapping and add a script for it



Add a new script to autogenerate errno.d from errno.h, and use it
to regenerate the list to match NetBSD errno codes.
---
 external/cddl/osnet/lib/libdtrace/errno.d     | 60 ++++++++++++-------
 .../cddl/osnet/lib/libdtrace/make-errno-d.awk | 45 ++++++++++++++
 2 files changed, 84 insertions(+), 21 deletions(-)
 create mode 100644 external/cddl/osnet/lib/libdtrace/make-errno-d.awk

diff --git a/external/cddl/osnet/lib/libdtrace/errno.d b/external/cddl/osnet/lib/libdtrace/errno.d
index 645cffc53cc0..4c5ea6cf9b41 100644
--- a/external/cddl/osnet/lib/libdtrace/errno.d
+++ b/external/cddl/osnet/lib/libdtrace/errno.d
@@ -1,4 +1,10 @@
-/*	$NetBSD: errno.d,v 1.3 2018/05/28 21:05:09 chs Exp $	*/
+/*	$NetBSD$	*/
+
+/*
+ * This file is autogenerated.  Please call:
+ *   awk make-errno-d.awk < ../../../../../sys/sys/errno.h
+ * to get new data.
+ */
 
 /*
  * CDDL HEADER START
@@ -122,8 +128,6 @@ inline int ESOCKTNOSUPPORT = 44;
 #pragma D binding "1.0" ESOCKTNOSUPPORT
 inline int EOPNOTSUPP = 45;
 #pragma D binding "1.0" EOPNOTSUPP
-inline int ENOTSUP = EOPNOTSUPP;
-#pragma D binding "1.0" ENOTSUP
 inline int EPFNOSUPPORT = 46;
 #pragma D binding "1.0" EPFNOSUPPORT
 inline int EAFNOSUPPORT = 47;
@@ -202,29 +206,43 @@ inline int ENOMSG = 83;
 #pragma D binding "1.0" ENOMSG
 inline int EOVERFLOW = 84;
 #pragma D binding "1.0" EOVERFLOW
-inline int ECANCELED = 85;
-#pragma D binding "1.0" ECANCELED
-inline int EILSEQ = 86;
+inline int EILSEQ = 85;
 #pragma D binding "1.0" EILSEQ
-inline int ENOATTR = 87;
-#pragma D binding "1.0" ENOATTR
-inline int EDOOFUS = 88;
-#pragma D binding "1.0" EDOOFUS
-inline int EBADMSG = 89;
+inline int ENOTSUP = 86;
+#pragma D binding "1.0" ENOTSUP
+inline int ECANCELED = 87;
+#pragma D binding "1.0" ECANCELED
+inline int EBADMSG = 88;
 #pragma D binding "1.0" EBADMSG
-inline int EMULTIHOP = 90;
+inline int ENODATA = 89;
+#pragma D binding "1.0" ENODATA
+inline int ENOSR = 90;
+#pragma D binding "1.0" ENOSR
+inline int ENOSTR = 91;
+#pragma D binding "1.0" ENOSTR
+inline int ETIME = 92;
+#pragma D binding "1.0" ETIME
+inline int ENOATTR = 93;
+#pragma D binding "1.0" ENOATTR
+inline int EMULTIHOP = 94;
 #pragma D binding "1.0" EMULTIHOP
-inline int ENOLINK = 91;
+inline int ENOLINK = 95;
 #pragma D binding "1.0" ENOLINK
-inline int EPROTO = 92;
+inline int EPROTO = 96;
 #pragma D binding "1.0" EPROTO
-inline int ELAST = 92;
+inline int EOWNERDEAD = 97;
+#pragma D binding "1.0" EOWNERDEAD
+inline int ENOTRECOVERABLE = 98;
+#pragma D binding "1.0" ENOTRECOVERABLE
+inline int ELAST = 98;
 #pragma D binding "1.0" ELAST
-inline int ERESTART = -1;
-#pragma D binding "1.0" ERESTART
 inline int EJUSTRETURN = -2;
 #pragma D binding "1.0" EJUSTRETURN
-inline int ENOIOCTL = -3;
-#pragma D binding "1.0" ENOIOCTL
-inline int EDIRIOCTL = -4;
-#pragma D binding "1.0" EDIRIOCTL
+inline int ERESTART = -3;
+#pragma D binding "1.0" ERESTART
+inline int EPASSTHROUGH = -4;
+#pragma D binding "1.0" EPASSTHROUGH
+inline int EDUPFD = -5;
+#pragma D binding "1.0" EDUPFD
+inline int EMOVEFD = -6;
+#pragma D binding "1.0" EMOVEFD
diff --git a/external/cddl/osnet/lib/libdtrace/make-errno-d.awk b/external/cddl/osnet/lib/libdtrace/make-errno-d.awk
new file mode 100644
index 000000000000..5b8d407f1e0c
--- /dev/null
+++ b/external/cddl/osnet/lib/libdtrace/make-errno-d.awk
@@ -0,0 +1,45 @@
+BEGIN {
+	print "/*	$NetBSD$	*/"
+	print ""
+	print "/*"
+	print " * This file is autogenerated.  Please call:"
+	print " *   awk make-errno-d.awk < ../../../../../sys/sys/errno.h"
+	print " * to get new data."
+	print " */"
+	print ""
+	print "/*"
+	print " * CDDL HEADER START"
+	print " *"
+	print " * The contents of this file are subject to the terms of the"
+	print " * Common Development and Distribution License, Version 1.0 only"
+	print " * (the \"License\").  You may not use this file except in compliance"
+	print " * with the License."
+	print " *"
+	print " * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE"
+	print " * or http://www.opensolaris.org/os/licensing.";
+	print " * See the License for the specific language governing permissions"
+	print " * and limitations under the License."
+	print " *"
+	print " * When distributing Covered Code, include this CDDL HEADER in each"
+	print " * file and include the License file at usr/src/OPENSOLARIS.LICENSE."
+	print " * If applicable, add the following below this CDDL HEADER, with the"
+	print " * fields enclosed by brackets \"[]\" replaced with your own identifying"
+	print " * information: Portions Copyright [yyyy] [name of copyright owner]"
+	print " *"
+	print " * CDDL HEADER END"
+	print " *"
+	print " * Portions Copyright 2006-2008 John Birrell jb%freebsd.org@localhost"
+	print " *"
+	print " * $FreeBSD: head/cddl/lib/libdtrace/errno.d 179189 2008-05-22 04:26:42Z jb $"
+	print " */"
+	print "/*"
+	print " * Copyright 2004 Sun Microsystems, Inc.  All rights reserved."
+	print " * Use is subject to license terms."
+	print " */"
+	print ""
+}
+
+/^#define\s*E/ {
+	print "inline int " $2 " = " $3 ";"
+	print "#pragma D binding \"1.0\" " $2
+}
-- 
2.25.1



Home | Main Index | Thread Index | Old Index