/
githubmirror
/
strace
Обзор
Документация
Войти
/
githubmirror
/
strace
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/epoll_ioctl.c
59 строк
1 KB
Dmitry V. Levin
Update copyright headers
05 авг 2025, 11:00
05 авг 2025, 11:00
7db24b3
Код
Авторство
О чём код?
/* * Copyright (c) 2024 Eugene Syromyatnikov <evgsyr@gmail.com>. * Copyright (c) 2024-2025 The strace developers. * All rights reserved. * * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include <linux/ioctl.h> #include <linux/eventpoll.h> static void print_struct_epoll_params(struct tcb *const tcp, const kernel_ulong_t addr) { CHECK_IOCTL_SIZE(EPIOCGPARAMS, 8); CHECK_IOCTL_SIZE(EPIOCSPARAMS, 8); CHECK_TYPE_SIZE(struct epoll_params, 8); struct epoll_params ep; tprints_arg_next_name("argp"); if (umove_or_printaddr(tcp, addr, &ep)) return; tprint_struct_begin(); PRINT_FIELD_TICKS(ep, busy_poll_usecs, 1000000, 6); tprint_struct_next(); PRINT_FIELD_U(ep, busy_poll_budget); tprint_struct_next(); PRINT_FIELD_X(ep, prefer_busy_poll); if (ep.__pad) { tprint_struct_next(); PRINT_FIELD_X(ep, __pad); } tprint_struct_end(); } int epoll_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) { switch (code) { case EPIOCSPARAMS: print_struct_epoll_params(tcp, arg); return RVAL_IOCTL_DECODED; case EPIOCGPARAMS: if (entering(tcp)) return 0; print_struct_epoll_params(tcp, arg); return RVAL_IOCTL_DECODED; default: return RVAL_DECODED; } }