xref: /third_party/ltp/testcases/kernel/syscalls/ptrace/syscalls.h (revision f08c3bdf)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/ltp/testcases/kernel/syscalls/ptrace/
1f08c3bdfSopenharmony_ciconst struct sysnums {
2f08c3bdfSopenharmony_ci	long nr;
3f08c3bdfSopenharmony_ci	const char *snr;
4f08c3bdfSopenharmony_ci} sysnums[] = {
5f08c3bdfSopenharmony_ci#define P(NR) { .nr = SYS_##NR, .snr = #NR, },
6f08c3bdfSopenharmony_ci#include "_syscalls.h"
7f08c3bdfSopenharmony_ci#undef P
8f08c3bdfSopenharmony_ci};
9f08c3bdfSopenharmony_ci
10f08c3bdfSopenharmony_ciconst char *get_sysnum(long nr)
11f08c3bdfSopenharmony_ci{
12f08c3bdfSopenharmony_ci	int i;
13f08c3bdfSopenharmony_ci	for (i = 0; i < ARRAY_SIZE(sysnums); ++i)
14f08c3bdfSopenharmony_ci		if (sysnums[i].nr == nr)
15f08c3bdfSopenharmony_ci			break;
16f08c3bdfSopenharmony_ci	return i == ARRAY_SIZE(sysnums) ? "???" : sysnums[i].snr;
17f08c3bdfSopenharmony_ci}
18

Indexes created Thu Nov 07 10:32:03 CST 2024