brintos

brintos / linux-shallow public Read only

0
0
Text · 426 B · c659c33 Raw
12 lines · bash
1#!/bin/sh2# SPDX-License-Identifier: LGPL-2.13 4[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/asm-generic/5 6printf "static const char *madvise_advices[] = {\n"7regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MADV_([[:alnum:]_]+)[[:space:]]+([[:digit:]]+)[[:space:]]*.*'8grep -E $regex ${header_dir}/mman-common.h | \9	sed -r "s/$regex/\2 \1/g"	| \10	sort -n | xargs printf "\t[%s] = \"%s\",\n"11printf "};\n"12