2 # SPDX-License-Identifier: LGPL-2.1
5 beauty_uapi_linux_dir
=tools
/perf
/trace
/beauty
/include
/uapi
/linux
/
7 beauty_uapi_linux_dir
=$1
10 linux_fcntl
=${beauty_uapi_linux_dir}/fcntl.h
12 printf "static const char *fs_at_flags[] = {\n"
13 regex
='^[[:space:]]*#[[:space:]]*define[[:space:]]+AT_([^_]+[[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
14 # AT_EACCESS is only meaningful to faccessat, so we will special case it there...
15 # AT_STATX_SYNC_TYPE is not a bit, its a mask of AT_STATX_SYNC_AS_STAT, AT_STATX_FORCE_SYNC and AT_STATX_DONT_SYNC
16 # AT_HANDLE_FID and AT_HANDLE_MNT_ID_UNIQUE are reusing values and are valid only for name_to_handle_at()
17 # AT_RENAME_NOREPLACE reuses 0x1 and is valid only for renameat2()
18 grep -E $regex ${linux_fcntl} | \
19 grep -v AT_EACCESS | \
20 grep -v AT_STATX_SYNC_TYPE | \
21 grep -v AT_HANDLE_FID | \
22 grep -v AT_HANDLE_MNT_ID_UNIQUE | \
23 grep -v AT_RENAME_NOREPLACE | \
24 sed -r "s/$regex/\2 \1/g" | \
25 xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"