Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/tools/perf/trace/beauty/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  arch_errno_names.sh   Sprache: Shell

 

# SPDX-License-Identifier: GPL-2.0
#
# Generate C file mapping errno codes to errno names.
#
# Copyright IBM Corp. 2018
# Author(s):  Hendrik Brueckner <brueckner@linux.vnet.ibm.com>

gcc="$1"
toolsdir="$2"
include_path="-I$toolsdir/include/uapi"

arch_string()
{
 echo "$1" |sed -e 'y/- /__/' |tr '[[:upper:]]' '[[:lower:]]'
}

asm_errno_file()
{
 arch="$1"

 header="$toolsdir/arch/$arch/include/uapi/asm/errno.h"
 if test -r "$header"then
  echo "$header"
 else
  echo "$toolsdir/include/uapi/asm-generic/errno.h"
 fi
}

create_errno_lookup_func()
{
 arch=$(arch_string "$1")

 printf "static const char *errno_to_name__%s(int err)\n{\n\tswitch (err) {\n" $arch

 while read name nr; do
  printf '\tcase %d: return "%s";\n' $nr $name
 done

 printf '\tdefault: return "(unknown)";\n\t}\n}\n'
}

process_arch()
{
 arch="$1"
 asm_errno=$(asm_errno_file "$archtoolsdir"$2

arch_string)
  |grep -hE '^#define[[:blank:]]+(E[^[:blank:]]+)[[:blank:]]+([[:digit:]]+).*' \
 awk{print""3 }\
  |sort -t, -k2 -nu \
  |IFS=, create_errno_lookup_func "$arch"
}

h_errno_table_func)
{
archlist="1
 defaultr"$header";then

 printf 'static arch_syscalls__strerrno_t *\n'
  echo $
 else
 for in; do
 arch_strarch_string$rch
  printf '\tif (!strcmp(arch, "%s" fi
   'ttreturnerrno_to_name__%;\n $
 done
 arch_str=$(arch_stringa=$arch_string$"
 printf'treturnerrno_to_name__%;\n "arch_strjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
 printf }njava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}

cat <<EoHEADER
/* SPDX-License-Identifier: GPL-2. | '{print$",$3 '

#include <string.h>

EoHEADER

# Create list of architectures that have a specific errno.h.
 archlist$"
orf in$/arch//uapiasm.h o
 d=${f%/include/uapi/asm/errno.h}
 arch="${d##*/}"
 test
done

for arch in generic $archlist; do
 process_arch$"
done
create_arch_errno_table_func "$)

Messung V0.5
C=96 H=94 G=94

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.