{"id":2227174,"url":"http://patchwork.ozlabs.org/api/patches/2227174/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/patch/20260423095834.11932-9-chrubis@suse.cz/","project":{"id":59,"url":"http://patchwork.ozlabs.org/api/projects/59/?format=json","name":"Linux Test Project development","link_name":"ltp","list_id":"ltp.lists.linux.it","list_email":"ltp@lists.linux.it","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260423095834.11932-9-chrubis@suse.cz>","list_archive_url":null,"date":"2026-04-23T09:58:34","name":"[8/8] syscalls: Remove old epoll-ltp test","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"fca70d0e79b220ccd427559b192b9012142cb27a","submitter":{"id":8530,"url":"http://patchwork.ozlabs.org/api/people/8530/?format=json","name":"Cyril Hrubis","email":"chrubis@suse.cz"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ltp/patch/20260423095834.11932-9-chrubis@suse.cz/mbox/","series":[{"id":501170,"url":"http://patchwork.ozlabs.org/api/series/501170/?format=json","web_url":"http://patchwork.ozlabs.org/project/ltp/list/?series=501170","date":"2026-04-23T09:58:26","name":"Add more epoll tests","version":1,"mbox":"http://patchwork.ozlabs.org/series/501170/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2227174/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/2227174/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256\n header.s=susede2_rsa header.b=mhKx6GpD;\n\tdkim=fail reason=\"signature verification failed\" header.d=suse.cz\n header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519\n header.b=j/SwohDn;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa\n header.b=mhKx6GpD;\n\tdkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=j/SwohDn;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)","smtp-out1.suse.de;\n dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=mhKx6GpD;\n dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=\"j/SwohDn\""],"Received":["from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1WnT1m39z1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 20:01:01 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 3E9CC3E537D\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 12:00:59 +0200 (CEST)","from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 908E03E5385\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 11:58:44 +0200 (CEST)","from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 93BF62009E7\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 11:58:43 +0200 (CEST)","from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out1.suse.de (Postfix) with ESMTPS id B050E6A83A\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:21 +0000 (UTC)","from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 98A7E593A3\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:21 +0000 (UTC)","from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id 3BA1JD3t6Wl6UAAAD6G6ig\n (envelope-from <chrubis@suse.cz>)\n for <ltp@lists.linux.it>; Thu, 23 Apr 2026 09:58:21 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776938301; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=8JCcZBbNlehkjnzUpMK0KYE5mW2pCAgjPEvd23uZueE=;\n b=mhKx6GpDhLif69LhJQy9A4a1I1SnRaWcKVTOSoBXcJzS7QhWaUZkVvp4ttszVpvtVr/aeM\n G+p9Ip0sgNo5sCVEhsHhGqQVfBfq7XlNFv9rN4kQDFpX43RYe92Q+LSBUq2zkFUla1nZOa\n jQo0Vx47mYDVZhKftGrLf/WSSj4hO1s=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776938301;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=8JCcZBbNlehkjnzUpMK0KYE5mW2pCAgjPEvd23uZueE=;\n b=j/SwohDnW03bOqLc7XnMNajU/F3v4a+hC31wJPwEnj3o+8kvpuEYk8tWx9y4ZKfTV8QTIE\n kKBaEFegxfDC/bAw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_rsa;\n t=1776938301; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=8JCcZBbNlehkjnzUpMK0KYE5mW2pCAgjPEvd23uZueE=;\n b=mhKx6GpDhLif69LhJQy9A4a1I1SnRaWcKVTOSoBXcJzS7QhWaUZkVvp4ttszVpvtVr/aeM\n G+p9Ip0sgNo5sCVEhsHhGqQVfBfq7XlNFv9rN4kQDFpX43RYe92Q+LSBUq2zkFUla1nZOa\n jQo0Vx47mYDVZhKftGrLf/WSSj4hO1s=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz;\n s=susede2_ed25519; t=1776938301;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=8JCcZBbNlehkjnzUpMK0KYE5mW2pCAgjPEvd23uZueE=;\n b=j/SwohDnW03bOqLc7XnMNajU/F3v4a+hC31wJPwEnj3o+8kvpuEYk8tWx9y4ZKfTV8QTIE\n kKBaEFegxfDC/bAw=="],"From":"Cyril Hrubis <chrubis@suse.cz>","To":"ltp@lists.linux.it","Date":"Thu, 23 Apr 2026 11:58:34 +0200","Message-ID":"<20260423095834.11932-9-chrubis@suse.cz>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260423095834.11932-1-chrubis@suse.cz>","References":"<20260423095834.11932-1-chrubis@suse.cz>","MIME-Version":"1.0","X-Rspamd-Action":"no action","X-Rspamd-Server":"rspamd2.dmz-prg2.suse.org","X-Spamd-Result":"default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n R_MISSING_CHARSET(0.50)[];\n R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+];\n TO_MATCH_ENVRCPT_ALL(0.00)[];\n FUZZY_RATELIMITED(0.00)[rspamd.com];\n RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519];\n RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[];\n DKIM_TRACE(0.00)[suse.cz:+]; RCVD_COUNT_TWO(0.00)[2];\n FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[];\n SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];\n TO_DN_NONE(0.00)[];\n RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];\n PREVIOUSLY_DELIVERED(0.00)[ltp@lists.linux.it];\n RCVD_VIA_SMTP_AUTH(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:dkim, suse.cz:mid, suse.cz:email,\n imap1.dmz-prg2.suse.org:helo, imap1.dmz-prg2.suse.org:rdns]","X-Rspamd-Queue-Id":"B050E6A83A","X-Spam-Score":"-3.01","X-Spam-Level":"","X-Spam-Status":"No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-7.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-7.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"[LTP] [PATCH 8/8] syscalls: Remove old epoll-ltp test","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"},"content":"Now that the epoll coverate is greater than it ever was we can remove\nthe old and ugly epoll-ltp test.\n\nFixes: https://github.com/linux-test-project/ltp/issues/860\nSigned-off-by: Cyril Hrubis <chrubis@suse.cz>\n---\n runtest/syscalls                            |   2 +-\n testcases/kernel/syscalls/epoll/.gitignore  |   1 -\n testcases/kernel/syscalls/epoll/Makefile    |   8 -\n testcases/kernel/syscalls/epoll/README.1ST  |  38 -\n testcases/kernel/syscalls/epoll/epoll-ltp.c | 738 --------------------\n 5 files changed, 1 insertion(+), 786 deletions(-)\n delete mode 100644 testcases/kernel/syscalls/epoll/.gitignore\n delete mode 100644 testcases/kernel/syscalls/epoll/Makefile\n delete mode 100644 testcases/kernel/syscalls/epoll/README.1ST\n delete mode 100644 testcases/kernel/syscalls/epoll/epoll-ltp.c","diff":"diff --git a/runtest/syscalls b/runtest/syscalls\nindex 0200a9e13..2984f8ba9 100644\n--- a/runtest/syscalls\n+++ b/runtest/syscalls\n@@ -181,7 +181,7 @@ epoll_create03 epoll_create03\n \n epoll_create1_01 epoll_create1_01\n epoll_create1_02 epoll_create1_02\n-epoll01 epoll-ltp\n+\n epoll_ctl01 epoll_ctl01\n epoll_ctl02 epoll_ctl02\n epoll_ctl03 epoll_ctl03\ndiff --git a/testcases/kernel/syscalls/epoll/.gitignore b/testcases/kernel/syscalls/epoll/.gitignore\ndeleted file mode 100644\nindex dfb4445db..000000000\n--- a/testcases/kernel/syscalls/epoll/.gitignore\n+++ /dev/null\n@@ -1 +0,0 @@\n-/epoll-ltp\ndiff --git a/testcases/kernel/syscalls/epoll/Makefile b/testcases/kernel/syscalls/epoll/Makefile\ndeleted file mode 100644\nindex 044619fb8..000000000\n--- a/testcases/kernel/syscalls/epoll/Makefile\n+++ /dev/null\n@@ -1,8 +0,0 @@\n-# SPDX-License-Identifier: GPL-2.0-or-later\n-# Copyright (c) International Business Machines  Corp., 2001\n-\n-top_srcdir\t\t?= ../../../..\n-\n-include $(top_srcdir)/include/mk/testcases.mk\n-\n-include $(top_srcdir)/include/mk/generic_leaf_target.mk\ndiff --git a/testcases/kernel/syscalls/epoll/README.1ST b/testcases/kernel/syscalls/epoll/README.1ST\ndeleted file mode 100644\nindex e5c5fcc5c..000000000\n--- a/testcases/kernel/syscalls/epoll/README.1ST\n+++ /dev/null\n@@ -1,38 +0,0 @@\n-Epoll Setup\n-\n-\n-\t** Directions for glibc version of 2.3.2 or higher **\n-\n-Epoll support is currently implemented in glibc 2.3.2, therefore if you have a$\n-glibc version of 2.3.2 or higher then do the following steps:\n-\n-1. Download and untar the epoll library from:\n-  http://www.xmailserver.org/linux-patches/epoll-lib-0.11.tar.gz\n-2. Copy <epoll-lib_directory>/include/epoll.h    /usr/include\n-3. Compile epoll-ltp.c in the  <ltp_dir>testcases/kernel/syscall/epoll\n-\n-\n-\n-\t** Older version of glibc **\n-To compile the epoll-ltp successfully the following libraries are needed:\n-\n-Epoll library http://www.xmailserver.org/linux-patches/epoll-lib-0.11.tar.gz\n-Portable Coroutine Library (PCL)  http://www.xmailserver.org/libpcl.html\n-\n-\n-1.\tDownload and untar the PCL library\n-2.\tRun ./configure\n-3.\tRun make\n-4.\tRun make install\n-5.\tCopy <libpcl_directory>/pcl/.libs/libpcl.* /lib\n-6.\tDownload and untar the epoll library\n-7.\t*You may have to modify the makefile in <epoll-lib_directory>/Makefile and <epoll-lib_directory>/examples/Makefile with the following\n--\tKERNELDIR = kernel_directory\n--\t#all: .depend $(TARGET) epoll-example  change this line to$\n--\tall: .$(TARGET) epoll-example\n--\t#include .depend  comment out this line\n-8.\tCopy <epoll-lib_directory>/include/epoll.h    /usr/include\n-9.\t<epoll-lib_directory>  make\n-10. Copy <epoll-lib_directory>/lib/libepoll*    /lib\n-11. Compile epoll-ltp.c in the  <ltp_dir>testcases/kernel/syscall/epoll\n-\ndiff --git a/testcases/kernel/syscalls/epoll/epoll-ltp.c b/testcases/kernel/syscalls/epoll/epoll-ltp.c\ndeleted file mode 100644\nindex dac132e2f..000000000\n--- a/testcases/kernel/syscalls/epoll/epoll-ltp.c\n+++ /dev/null\n@@ -1,738 +0,0 @@\n-/*\n- *\n- * Copyright (c) International Business Machines  Corp., 2001\n- *\n- * This program is free software;  you can redistribute it and/or modify\n- * it under the terms of the GNU General Public License as published by\n- * the Free Software Foundation; either version 2 of the License, or\n- * (at your option) any later version.\n- *\n- * This program is distributed in the hope that it will be useful,\n- * but WITHOUT ANY WARRANTY;  without even the implied warranty of\n- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See\n- * the GNU General Public License for more details.\n- *\n- * You should have received a copy of the GNU General Public License\n- * along with this program;  if not, write to the Free Software\n- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n- *\n- */\n-\n-/******************************************************************************\n-\n-   File:        epoll-ltp.c\n-\n-   Description:\n-     Test the epoll_* system calls. This test program attempts to\n-     be very thorough in exercising epoll_* system calls. Large\n-     combinations of valid and invalid parameters are passed with\n-     valid and invalid sequences. Due to the combinatorial nature\n-     of this test program the test may take a \"long\" time to\n-     execute.\n-\n-   Total Tests: 2 (2 system calls are being tested for)\n-\n-   Test Name:   epoll_create, epoll_ctl\n-\n-   Test Assertion\n-   & Strategy:  Test a variety of incorrect parameters for epoll_create\n-\n-                Then run a reasonable epoll_create and get a fd for the epoll\n-                     set.\n-\n-                Next run epoll_ctl on that fd (epoll_fd) with a variety of\n-                     incorrect parameters and a couple correct ones.\n-\n-                Finally ?How to thoroughly test epoll_wait?\n-\n-   Author:      Matt Helsley <matthltc@us.ibm.com>\n-\n-   History:     Created - May 22 2003 - Matt Helsley <matthltc@us.ibm.com>\n-                Added   -\n-\n-   Notes: Currently we assume that the OS will never allocate an fd s.t.\n-          fd == INT_MAX and that it will instead choose to allocate fds\n-          from the \"low\" numbers. -MH\n-\n-   Currently pokes epoll_create several times in 2 + NUM_RAND_ATTEMPTS ways\n-             pokes epoll_ctl 27648 - (2 + NUM_RAND_ATTEMPTS) ways\n-             does not poke epoll_wait\n-\n-   TODO: change errno test code to build lists of possible errno values for\n-            each erroneous parameter. Check that the errno value is in one\n-            of the lists. Currently errno is not checked at all when multiple\n-            erroneous parameters are passed in.\n-\n-         test epoll_ctl with a large number of file descriptor events in the\n-            set\n-\n-   Link against epoll and ltp (-lepoll -lltp)\n-\n-*******************************************************************************/\n-\n-#ifndef _GNU_SOURCE\n-#define _GNU_SOURCE\n-#endif\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <unistd.h>\n-#include <fcntl.h>\n-#include <stdarg.h>\n-#include <string.h>\n-#include <signal.h>\n-#include <assert.h>\n-#include <limits.h>\n-#include <ctype.h>\n-#include <time.h>\n-#include <errno.h>\n-#include <signal.h>\n-#include <sys/types.h>\n-#include <sys/time.h>\n-#include <sys/file.h>\n-#include <sys/ioctl.h>\n-#include <sys/mman.h>\n-#include <sys/select.h>\n-#include <sys/wait.h>\n-\n-#include \"config.h\"\n-#include \"test.h\"\n-\n-char *TCID = \"epoll01\";\n-int TST_TOTAL = 1;\n-\n-#ifdef HAVE_SYS_EPOLL_H\n-\n-#include <sys/epoll.h>\n-\n-/* Local Defines */\n-#if !defined(TRUE) && !defined(FALSE)\n-#define TRUE  1\n-#define FALSE 0\n-#endif\n-\n-#define NUM_RAND_ATTEMPTS 16\n-#define BACKING_STORE_SIZE_HINT 32\n-\n-/*\n-  Define the beginning of a \"protected region\".\n-  This is a region where a wide variety of errors\n-  could occur or signals could arrive (including\n-  SIGSEGV and SIGKILL).\n-$\n-  The test program uses this to catch those\n-  conditions as best it can and continue testing.\n-\n-  The region MUST be marked by a corresponding\n-  PROTECT_REGION_END.\n-\n-  DO NOT nest protected regions! i.e. Do not build\n-  code of the form:\n-\n-\tPROTECT_REGION_START\n-              ...\n-\tPROTECT_REGION_START\n-              ...\n-\tPROTECT_REGION_END\n-              ...\n-\tPROTECT_REGION_END\n- */\n-#define PROTECT_REGION_START\t\t\\\n-do {\t\t\t\t\t\\\n-\tpid_t kid_pid;\t\t\t\\\n-\tint kid_status;\t\t\t\\\n-\t\t\t\t\t\\\n-\ttst_old_flush();\t\t\t\\\n-\tkid_pid = tst_fork();\t\\\n-\tif (kid_pid == 0) {\n-\n-#define PROTECT_REGION_EXIT(errval) return (errval);\n-\n-#define PROTECT_REGION_END(result, errval)\t\t\t\t\t\\\n-\treturn 0;\t\t\t\t\t\t\t\t\\\n-\t} else {\t\t\t\t\t\t\t\t\\\n-\t waitpid(kid_pid, &kid_status, 0);\t\t\t\t\t\\\n-\t if (WIFEXITED(kid_status)) {\t\t\t\t\t\t\\\n-\t\t(result) = WEXITSTATUS(kid_status);\t\t\t\t\\\n-\t} else { /* Must have been signaled */\t\t\t\t\t\\\n-\t\t(result) = (errval);\t\t\t\t\t\t\\\n-\t\tif (WIFSIGNALED(kid_status))\t\t\t\t\t\t\\\n-\t\t\ttst_resm(TFAIL, \"Protected function test exited due to signal %d (%s)\", \\\n-\t\t\t\tWTERMSIG(kid_status), strsignal(WTERMSIG(kid_status)));\t\\\n-\t\t}\t\t\t\t\t\t\t\t\\\n-\t}\t\t\t\t\t\t\t\t\t\\\n-} while (0)\n-\n-/*\n- * Call a function in a \"protected\" context.\n- * This protects the test program proper from segfaults\n- * and allows for the extraction of an integer return\n- * code.\n- *\n- * return only integer results.\n- */\n-#define PROTECT_FUNC(fn, errval, epoll_fd) (\t\t\t\t\t\\\n-{\t\t\t\t\t\t\t\t\t\t\\\n-\tpid_t kid_pid;\t\t\t\t\t\t\t\t\\\n-\tint kid_status;\t\t\t\t\t\t\t\t\\\n-\t\t\t\t\t\t\t\t\t\t\\\n-\ttst_old_flush();\t\t\t\t\t\t\t\t\\\n-\tkid_pid = tst_fork();\t\t\t\t\t\t\\\n-\tif (kid_pid == 0) { /* Run the function */\t\t\t\t\\\n-\t\treturn fn(epoll_fd);\t\t\t\t\t\t\\\n-\t} else {\t\t\t\t\t\t\t\t\\\n-\t\twaitpid(kid_pid, &kid_status, 0);\t\t\t\t\\\n-\t\tif (WIFEXITED(kid_status)) {\t\t\t\t\t\\\n-\t\tkid_status = WEXITSTATUS(kid_status);\t\t\t\t\\\n-\t} else { /* Must have been signaled */\t\t\t\t\t\\\n-\t\tkid_status = (errval);\t\t\t\t\t\t\\\n-\t\tif (WIFSIGNALED(kid_status))\t\t\t\t\t\\\n-\t\t\ttst_resm(TFAIL, \"Protected function test exited due to signal %d (%s)\", \\\n-\t\t\t\t\t\tWTERMSIG(kid_status), strsignal(WTERMSIG(kid_status))); \\\n-\t}\t\t\t\t\t\t\t\t\t\\\n-}\t\t\t\t\t\t\t\t\t\t\\\n-kid_status = kid_status;})\n-\n-/*\n- * Given the number of random size requests to test,\n- * test various boundary cases of epoll_create().\n- *\n- * Return the number of tests that failed. 0 indicates\n- * 100% passed.\n- */\n-int test_epoll_create(unsigned int num_rand_attempts)\n-{\n-\tint epoll_fd = -1;\n-\tint fd_set_size = -1;\n-\tunsigned int attempt_count;\n-\tunsigned int num_epoll_create_test_fails = 0;\n-\tunsigned int num_epoll_create_test_calls = 0;\n-\n-\t/* Negative set sizes */\n-\terrno = 0;\n-\tfd_set_size = -1;\n-\tnum_epoll_create_test_calls++;\n-\tepoll_fd = epoll_create(fd_set_size);\n-\tif (epoll_fd >= 0) {\n-\t\ttst_resm(TFAIL | TERRNO,\n-\t\t\t \"epoll_create with negative set size succeeded unexpectedly\");\n-\t\tnum_epoll_create_test_fails++;\n-\t\tclose(epoll_fd);\n-\t} else {\n-\t\tif (errno != EINVAL) {\n-\t\t\ttst_resm(TFAIL | TERRNO,\n-\t\t\t\t \"epoll_create with negative set size didn't set errno to EINVAL\");\n-\t\t\tnum_epoll_create_test_fails++;\n-\t\t} else {\n-\t\t\ttst_resm(TPASS, \"epoll_create with negative set size\");\n-\t\t}\n-\t}\n-\n-\t/* Large set sizes -- try several less than or equal to INT_MAX by some\n-\t   small amount (expect num_rand_attempts to be approximately the\n-\t   amount we'd like to go below INT_MAX). */\n-\tfd_set_size = INT_MAX;\n-\tfor (attempt_count = num_rand_attempts; attempt_count > 0;\n-\t     attempt_count--, fd_set_size--) {\n-\t\tnum_epoll_create_test_calls++;\n-\t\tepoll_fd = epoll_create(fd_set_size);\n-\t\tif (epoll_fd == -1) {\n-\t\t\tif (errno != ENOMEM) {\n-\t\t\t\ttst_resm(TFAIL,\n-\t\t\t\t\t \"epoll_create with large set size (size = %d)\",\n-\t\t\t\t\t fd_set_size);\n-\t\t\t\tnum_epoll_create_test_fails++;\n-\t\t\t} else {\n-\t\t\t\ttst_resm(TPASS,\n-\t\t\t\t\t \"epoll_create with large set size (size = %d)\",\n-\t\t\t\t\t fd_set_size);\n-\t\t\t}\n-\t\t} else {\n-\t\t\ttst_resm(TPASS,\n-\t\t\t\t \"epoll_create with large set size (size = %d)\",\n-\t\t\t\t fd_set_size);\n-\t\t\tclose(epoll_fd);\n-\t\t}\n-\t}\n-\n-\t/* Random large set sizes */\n-\tfor (attempt_count = num_rand_attempts; attempt_count > 0;\n-\t     attempt_count--) {\n-\t\tfd_set_size = abs(rand() + SHRT_MAX) % INT_MAX;\n-\t\terrno = 0;\n-\t\tnum_epoll_create_test_calls++;\n-\t\tepoll_fd = epoll_create(fd_set_size);\n-\t\tif (epoll_fd < 0) {\n-\t\t\tif (errno != ENOMEM) {\n-\t\t\t\ttst_resm(TFAIL,\n-\t\t\t\t\t \"epoll_create with random random large set size (size = %d)\",\n-\t\t\t\t\t fd_set_size);\n-\t\t\t\tnum_epoll_create_test_fails++;\n-\t\t\t} else {\n-\t\t\t\ttst_resm(TPASS,\n-\t\t\t\t\t \"epoll_create with random random large set size (size = %d)\",\n-\t\t\t\t\t fd_set_size);\n-\t\t\t}\n-\t\t} else {\n-\t\t\ttst_resm(TPASS,\n-\t\t\t\t \"epoll_create with random large set size (size = %d)\",\n-\t\t\t\t fd_set_size);\n-\t\t\tclose(epoll_fd);\n-\t\t}\n-\t}\n-\n-\ttst_resm(TINFO,\n-\t\t \"Summary: Of %d tests, epoll_create failed %d (%3.0f%% passed).\",\n-\t\t num_epoll_create_test_calls, num_epoll_create_test_fails,\n-\t\t ((float)\n-\t\t  (num_epoll_create_test_calls - num_epoll_create_test_fails)\n-\t\t  * 100.0f / (float)\n-\t\t  num_epoll_create_test_calls));\n-\t/* Return 0 on success. */\n-\n-\treturn num_epoll_create_test_fails;\n-}\n-\n-/* RES_PASS indicates a PASS result */\n-#define RES_PASS 0\n-\n-/*\n- * RES_FAIL_* indicates a FAIL result\n- * In brief, there are two things that can go wrong in a\n- * failure. The return value (result = epoll_ctl(...)) and\n- * the errno value may not match expectations. In this notation,\n- * MIS -> mismatch, MAT -> match, BAD -> bad, and IGN -> ignored.\n- *\n- * RETV_MIS_* indicates the return value was either 0 or 1, but did\n- * not match the expected return value\n- *\n- * _RETV_MAT_* indicates that the return value was 0 xor 1 and did\n- * match the expected value\n- *\n- *_RETV_BAD_* the return value was neither 0 nor 1.\n- *_ERRNO_MAT  the error number matched the expected number\n- *_ERRNO_MIS  the error number did not match the expected number\n- *_ERRNO_IGN  no error number was expected and so errno was ignored\n- *\n- * Keep these values below 256 as only 1 byte gets passed as a\n- * return value for the process. Note that RES_PASS is 0 which\n- * LTP interprets as a PASS.\n- */\n-\n-/* Did not get the expected return value, but errno value was expected */\n-#define RES_FAIL_RETV_MIS_ERRNO_MAT 1\n-/* Did not get the expected return value, but errno value was expected */\n-#define RES_FAIL_RETV_BAD_ERRNO_MAT 2\n-/* Did get the expected return value, and errno value was not expected */\n-#define RES_FAIL_RETV_MAT_ERRNO_MIS 3\n-/* Return value was neither 0 nor -1. Mismatch in value of errno */\n-#define RES_FAIL_RETV_BAD_ERRNO_MIS 4\n-/* Did not get the expected return value and errno is irrelevant */\n-#define RES_FAIL_RETV_MIS_ERRNO_IGN 5\n-/* Return value was neither 0 nor -1. value of errno is irrelevant */\n-#define RES_FAIL_RETV_BAD_ERRNO_IGN 6\n-/* We expected multiple errors so we were unable to check errno for conformance */\n-#define RES_PASS_RETV_MAT_ERRNO_IGN 7\n-\n-static const char *result_strings[] = {\n-\t\"Passed\",\n-\t\"Return value mismatched yet errno matched.\",\n-\t\"Return value was bad    yet errno matched.\",\n-\t\"Return value matched    yet errno mismatched.\",\n-\t\"Return value was bad    and errno mismatched.\",\n-\t\"Return value mismatched  so errno ignored.\",\n-\t\"Return value was bad     so errno ignored.\",\n-\t\"Return value matched    but errno ignored. (multiple errors expected)\"\n-};\n-\n-/****************************************************************************************/\n-/* This macro helps keep the code below understandable. It prints out the\n-   failure message passed to it plus the parameters to the system call. */\n-#define EPOLL_CTL_TEST_RESULTS_SHOW_PARAMS 1\n-#if EPOLL_CTL_TEST_RESULTS_SHOW_PARAMS\n-#define EPOLL_CTL_TEST_FAIL(msg , ...) \\\n-({ \\\n-\tif (ev_ptr != NULL) { \\\n-\t\ttst_resm(TFAIL, ( \"(epoll_ctl(%d,%08x,%d,%p = {%08x,%08d}) returned %d:%s)\" ) , ##__VA_ARGS__ , \\\n-\t\t\tepoll_fds[epfd_index], epoll_ctl_ops[op_index], \\\n-\t\t\tepoll_fds[fd_index], ev_ptr, ev_ptr->events, ev_ptr->data.fd, errno, \\\n-\t\t\tstrerror(errno)); \\\n-\t} else { \\\n-\t\ttst_resm(TFAIL, ( \"(epoll_ctl(%d,%08x,%d,%p) returned %d:%s)\" ) , ##__VA_ARGS__  , \\\n-\t\t\tepoll_fds[epfd_index], epoll_ctl_ops[op_index], \\\n-\t\t\tepoll_fds[fd_index], ev_ptr, errno, strerror(errno)); \\\n-\t} \\\n-})\n-\n-#define EPOLL_CTL_TEST_PASS(msg , ...) \\\n-({ \\\n-\tif (ev_ptr != NULL) { \\\n-\t\ttst_resm(TPASS, ( \"(epoll_ctl(%d,%08x,%d,%p = {%08x,%08d}) returned %d:%s)\" ) , ##__VA_ARGS__ , \\\n-\t\t\tepoll_fds[epfd_index], epoll_ctl_ops[op_index], \\\n-\t\t\tepoll_fds[fd_index], ev_ptr, ev_ptr->events, ev_ptr->data.fd, errno, \\\n-\t\t\tstrerror(errno)); \\\n-\t} else { \\\n-\t\ttst_resm(TPASS, ( \"(epoll_ctl(%d,%08x,%d,%p) returned %d:%s)\" ) , ##__VA_ARGS__  , \\\n-\t\t\tepoll_fds[epfd_index], epoll_ctl_ops[op_index], \\\n-\t\t\tepoll_fds[fd_index], ev_ptr, errno, strerror(errno)); \\\n-\t} \\\n-})\n-#else\n-#define EPOLL_CTL_TEST_FAIL(msg , ...) tst_resm(TFAIL, msg , ##__VA_ARGS__)\n-#define EPOLL_CTL_TEST_PASS(msg , ...) tst_resm(TPASS, msg , ##__VA_ARGS__)\n-#endif\n-\n-/****************************************************************************************/\n-\n-int test_epoll_ctl(int epoll_fd)\n-{\n-\tint fds[] = { -1, INT_MAX };\n-\tint epoll_fds[] = { 0, -1, 0, INT_MAX };\n-\tint epoll_events[64];\n-\t/* The list of operations to try AND THE ORDER THEY ARE TRIED IN */\n-\tint epoll_ctl_ops[] =\n-\t    { EPOLL_CTL_DEL, EPOLL_CTL_MOD, EPOLL_CTL_ADD, EPOLL_CTL_MOD,\n-\t\tEPOLL_CTL_DEL, EPOLL_CTL_MOD, EPOLL_CTL_DEL, INT_MAX, -1\n-\t};\n-\tstruct epoll_event event;\n-\tchar event_mem[sizeof(struct epoll_event) * 2];\n-\tstruct epoll_event *unaligned_event_ptr;\n-\n-\t/* Indices into lists */\n-\tint index = 0;\t\t/* multi-use index. First uses are to initialize\n-\t\t\t\t   lists. Second use is to iterate over the implicit\n-\t\t\t\t   list of structs to pass in */\n-\tunsigned int epfd_index;\t/* index into fd list for the epfd parameter */\n-\tunsigned int event_index;\t/* index into event list for the events field of the\n-\t\t\t\t\t   struct epoll_event parameter */\n-\tunsigned int fd_index;\t/* index into fd list for the fd parameter */\n-\tunsigned int op_index;\t/* index into the list of operations for the op\n-\t\t\t\t   parameter */\n-\tunsigned int num_epoll_ctl_test_fails = 0;\n-\tunsigned int num_epoll_ctl_test_calls = 0;\n-\n-\t/* Generate all possible combinations of events (2^6 == 64)\n-\t   Assume we know nothing about the EPOLL event types _except_\n-\t   that they describe bits in a set. */\n-\tfor (index = 0; index < 64; index++) {\n-\t\tepoll_events[index] = ((EPOLLIN * ((index & 0x01) >> 0)) |\n-\t\t\t\t       (EPOLLOUT * ((index & 0x02) >> 1)) |\n-\t\t\t\t       (EPOLLPRI * ((index & 0x04) >> 2)) |\n-\t\t\t\t       (EPOLLERR * ((index & 0x08) >> 3)) |\n-\t\t\t\t       (EPOLLHUP * ((index & 0x10) >> 4)) |\n-\t\t\t\t       (EPOLLET * ((index & 0x20) >> 5)));\n-\t}\n-\n-\t/* Get a pointer to an unaligned struct epoll_event */\n-\t{\n-\t\tchar *unalign_ptr = event_mem;\n-\n-\t\tunalign_ptr =\n-\t\t    unalign_ptr + (((unsigned long)unalign_ptr & 1) ? 0 : 1);\n-\t\tunaligned_event_ptr = (struct epoll_event *)unalign_ptr;\n-\t}\n-\n-\t/* One of the fds we want to test is the valid one */\n-\tepoll_fds[0] = epoll_fd;\n-\n-\t/* Test out all of the interesting combinations. This is going to\n-\t   take a while (in compute cycles). It took less than 1 minute to\n-\t   run on a PIII 500 without checking the results. */\n-\tfor (index = 0; index < 3; index++) {\n-\t\tstruct epoll_event *ev_ptr = NULL;\n-\n-\t\tswitch (index) {\n-\t\tcase 0:\t/* Pass aligned struct */\n-\t\t\tevent.data.u64 = 0;\n-\t\t\tev_ptr = &event;\n-\t\t\tbreak;\n-\t\tcase 1:\t/* Pass unaligned struct */\n-\t\t\tunaligned_event_ptr->data.u64 = 0;\n-\t\t\tev_ptr = unaligned_event_ptr;\n-\t\t\tbreak;\n-\t\tcase 2:\n-\t\tdefault:\t/* Pass NULL ptr */\n-\t\t\tev_ptr = NULL;\n-\t\t\tbreak;\n-\t\t}\n-\n-\t\tfor (epfd_index = 0;\n-\t\t     epfd_index < (sizeof(epoll_fds) / sizeof(int));\n-\t\t     epfd_index++) {\n-\t\t\tfor (event_index = 0;\n-\t\t\t     event_index < (sizeof(epoll_events) / sizeof(int));\n-\t\t\t     event_index++) {\n-\t\t\t\tfor (fd_index = 0;\n-\t\t\t\t     fd_index < (sizeof(fds) / sizeof(int));\n-\t\t\t\t     fd_index++) {\n-\t\t\t\t\t/* Now epoll_fd is a descriptor that references the set of\n-\t\t\t\t\t   file descriptors we are interested in. Next we test epoll_ctl */\n-\t\t\t\t\tfor (op_index = 0;\n-\t\t\t\t\t     op_index <\n-\t\t\t\t\t     (sizeof(epoll_ctl_ops) /\n-\t\t\t\t\t      sizeof(int)); op_index++) {\n-\t\t\t\t\t\tint result;\n-\t\t\t\t\t\tint expected_errno = 0;\n-\t\t\t\t\t\tint num_errors_expected = 0;\n-\n-\t\t\t\t\t\tif (ev_ptr != NULL)\n-\t\t\t\t\t\t\tev_ptr->events =\n-\t\t\t\t\t\t\t    epoll_events\n-\t\t\t\t\t\t\t    [event_index];\n-\n-\t\t\t\t\t\t/* Perform the call itself. Put it in a protected region which\n-\t\t\t\t\t\t   returns -1 in the variable result if a protection violation\n-\t\t\t\t\t\t   occurs (see PROTECT_REGION_END for the result) */\n-\t\t\t\t\t\tPROTECT_REGION_START errno = 0;\n-\n-\t\t\t\t\t\t/* NOTE that we are assuming that epoll will operate across\n-\t\t\t\t\t\t   a fork() call such that a subsequent fork() in the parent\n-\t\t\t\t\t\t   will also manipulate the same set */\n-\t\t\t\t\t\tresult =\n-\t\t\t\t\t\t    epoll_ctl(epoll_fds\n-\t\t\t\t\t\t\t      [epfd_index],\n-\t\t\t\t\t\t\t      epoll_ctl_ops\n-\t\t\t\t\t\t\t      [op_index],\n-\t\t\t\t\t\t\t      fds[fd_index],\n-\t\t\t\t\t\t\t      ev_ptr);\n-\n-\t\t\t\t\t\t/* We can't test errno resulting from the epoll_ctl call outside of\n-\t\t\t\t\t\t   the PROTECT_REGION hence we do not have a PROTECT_REGION_END\n-\t\t\t\t\t\t   here */\n-\n-\t\t\t\t\t\t/*\n-\t\t\t\t\t\t   Test the results. Look for appropriate error conditions\n-\t\t\t\t\t\t */\n-\n-\t\t\t\t\t\t/* Check the epfd */\n-\t\t\t\t\t\tif (epoll_fds[epfd_index] !=\n-\t\t\t\t\t\t    epoll_fd) {\n-\t\t\t\t\t\t\t/* Expect an error */\n-\t\t\t\t\t\t\tif (epoll_fds\n-\t\t\t\t\t\t\t    [epfd_index] == 0)\n-\t\t\t\t\t\t\t\texpected_errno =\n-\t\t\t\t\t\t\t\t    EINVAL;\n-\t\t\t\t\t\t\telse\t/* epfd is not a valid file descriptor since it is\n-\t\t\t\t\t\t\t\t   neither epoll_fd nor stdin */\n-\t\t\t\t\t\t\t\texpected_errno =\n-\t\t\t\t\t\t\t\t    EBADF;\n-\t\t\t\t\t\t\tnum_errors_expected++;\n-\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\tswitch (epoll_ctl_ops[op_index]) {\n-\t\t\t\t\t\tcase EPOLL_CTL_ADD:\n-\t\t\t\t\t\tcase EPOLL_CTL_MOD:\n-\t\t\t\t\t\tcase EPOLL_CTL_DEL:\n-\t\t\t\t\t\t\tbreak;\n-\t\t\t\t\t\tdefault:\t/* Expect an error */\n-\t\t\t\t\t\t\texpected_errno = EINVAL;\n-\t\t\t\t\t\t\tnum_errors_expected++;\n-\t\t\t\t\t\t\tbreak;\n-\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\texpected_errno = EPERM;\n-\t\t\t\t\t\tnum_errors_expected++;\n-\n-\t\t\t\t\t\tif (ev_ptr == NULL) {\n-\t\t\t\t\t\t\texpected_errno = EINVAL;\n-\t\t\t\t\t\t\tnum_errors_expected++;\n-\t\t\t\t\t\t} else if ((ev_ptr == &event)\n-\t\t\t\t\t\t\t   || (ev_ptr ==\n-\t\t\t\t\t\t\t       unaligned_event_ptr))\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\tif (ev_ptr->events == 0) {\n-\t\t\t\t\t\t\t\texpected_errno =\n-\t\t\t\t\t\t\t\t    EINVAL;\n-\t\t\t\t\t\t\t\tnum_errors_expected++;\n-\t\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\t\tfor (index = 1;\n-\t\t\t\t\t\t\t     index < 64;\n-\t\t\t\t\t\t\t     index++) {\n-\t\t\t\t\t\t\t\tif ((int)ev_ptr->events != epoll_events[index]) {\n-\t\t\t\t\t\t\t\t\texpected_errno\n-\t\t\t\t\t\t\t\t\t    =\n-\t\t\t\t\t\t\t\t\t    EINVAL;\n-\t\t\t\t\t\t\t\t\tnum_errors_expected++;\n-\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t} else {\n-\t\t\t\t\t\t\t/* Do not expect an error */\n-\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\tif (num_errors_expected == 0) {\n-\t\t\t\t\t\t\t/* We did not expect an error */\n-\t\t\t\t\t\t\tif (result == 0) {\n-\t\t\t\t\t\t\t\t/* We didn't get an error. Think of this as RES_PASS_RETV_MAT_ERRNO_IGN */\n-\t\t\t\t\t\t\t\treturn RES_PASS;\n-\t\t\t\t\t\t\t} else if (result == -1) {\t/* The return value is -1, so it's not bad */\n-\t\t\t\t\t\t\t\treturn\n-\t\t\t\t\t\t\t\t    RES_FAIL_RETV_MIS_ERRNO_IGN;\n-\t\t\t\t\t\t\t} else {\n-\t\t\t\t\t\t\t\treturn\n-\t\t\t\t\t\t\t\t    RES_FAIL_RETV_BAD_ERRNO_IGN;\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t} else if (num_errors_expected\n-\t\t\t\t\t\t\t   == 1) {\n-\t\t\t\t\t\t\t/* We expected an error */\n-\t\t\t\t\t\t\tif (result == 0) {\n-\t\t\t\t\t\t\t\treturn RES_FAIL_RETV_MIS_ERRNO_IGN;\t/* Unexpected success */\n-\t\t\t\t\t\t\t} else if (result == -1) {\n-\t\t\t\t\t\t\t\t/* We got an error. Check errno */\n-\t\t\t\t\t\t\t\tif (errno ==\n-\t\t\t\t\t\t\t\t    expected_errno)\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\treturn RES_PASS;\t/* think of this as RETV_MAT_ERRNO_MAT */\n-\t\t\t\t\t\t\t\t} else {\n-\t\t\t\t\t\t\t\t\treturn\n-\t\t\t\t\t\t\t\t\t    RES_FAIL_RETV_MAT_ERRNO_MIS;\n-\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t} else {\n-\t\t\t\t\t\t\t\t/* We got a bad return code! Interpret this as\n-\t\t\t\t\t\t\t\t   getting an error and check errno. */\n-\t\t\t\t\t\t\t\tif (errno ==\n-\t\t\t\t\t\t\t\t    expected_errno)\n-\t\t\t\t\t\t\t\t\treturn\n-\t\t\t\t\t\t\t\t\t    RES_FAIL_RETV_BAD_ERRNO_MAT;\n-\t\t\t\t\t\t\t\telse\n-\t\t\t\t\t\t\t\t\treturn\n-\t\t\t\t\t\t\t\t\t    RES_FAIL_RETV_BAD_ERRNO_MIS;\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t} else if (num_errors_expected >\n-\t\t\t\t\t\t\t   1) {\n-\t\t\t\t\t\t\t/* We expected multiple errors */\n-\t\t\t\t\t\t\tif (result == 0) {\n-\t\t\t\t\t\t\t\treturn RES_FAIL_RETV_MIS_ERRNO_IGN;\t/* Unexpected success */\n-\t\t\t\t\t\t\t} else if (result == -1) {\n-\t\t\t\t\t\t\t\t/* We got an error. Check errno */\n-\t\t\t\t\t\t\t\tif (errno ==\n-\t\t\t\t\t\t\t\t    expected_errno)\n-\t\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t\treturn RES_PASS;\t/* think of this as RETV_MAT_ERRNO_MAT */\n-\t\t\t\t\t\t\t\t} else {\n-\t\t\t\t\t\t\t\t\t/* Ignore errno because the desired value is unknowable\n-\t\t\t\t\t\t\t\t\t   without looking at the structure of the code. */\n-\t\t\t\t\t\t\t\t\treturn\n-\t\t\t\t\t\t\t\t\t    RES_PASS_RETV_MAT_ERRNO_IGN;\n-\t\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\t} else {\n-\t\t\t\t\t\t\t\t/* We got a bad return code! Interpret this as\n-\t\t\t\t\t\t\t\t   getting an error and check errno. */\n-\t\t\t\t\t\t\t\tif (errno ==\n-\t\t\t\t\t\t\t\t    expected_errno)\n-\t\t\t\t\t\t\t\t\t/* Don't Ignore errno because the desired value\n-\t\t\t\t\t\t\t\t\t   happened to match what we expected. */\n-\t\t\t\t\t\t\t\t\treturn\n-\t\t\t\t\t\t\t\t\t    RES_FAIL_RETV_BAD_ERRNO_MAT;\n-\t\t\t\t\t\t\t\telse\n-\t\t\t\t\t\t\t\t\t/* Ignore errno because the desired value is unknowable\n-\t\t\t\t\t\t\t\t\t   without looking at the structure of the code. */\n-\t\t\t\t\t\t\t\t\treturn\n-\t\t\t\t\t\t\t\t\t    RES_FAIL_RETV_BAD_ERRNO_IGN;\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t}\n-\n-\t\t\t\t\t\t/* All \"return\"s between PROTECT_REGION_BEGIN\n-\t\t\t\t\t\t   and PROTECT_REGION_END place their value in\n-\t\t\t\t\t\t   the result parameter. If the region caused\n-\t\t\t\t\t\t   a protection violation (segfault or otherwise)\n-\t\t\t\t\t\t   then the result is set to the second parameter's\n-\t\t\t\t\t\t   value (-1 in this case). */\n-\t\t\t\t\t\tPROTECT_REGION_END(result, -1);\n-\n-\t\t\t\t\t\t/* Count the number of tests run */\n-\t\t\t\t\t\tnum_epoll_ctl_test_calls++;\n-\n-\t\t\t\t\t\t/* Now test the result */\n-\t\t\t\t\t\tif (!((result == RES_PASS)\n-\t\t\t\t\t\t      || (result ==\n-\t\t\t\t\t\t\t  RES_PASS_RETV_MAT_ERRNO_IGN)))\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\tif (result >\n-\t\t\t\t\t\t\t   (int)(sizeof(result_strings) /\n-\t\t\t\t\t\t\t     sizeof(const char\n-\t\t\t\t\t\t\t\t    *))) {\n-\t\t\t\t\t\t\t\t/* Returned a result which has no corresponding text description */\n-\t\t\t\t\t\t\t\tEPOLL_CTL_TEST_FAIL\n-\t\t\t\t\t\t\t\t    (\"FIXME FIX ME BUG in Test Program itself!\");\n-\t\t\t\t\t\t\t} else {\n-\t\t\t\t\t\t\t\tif (result == -1)\t/* Segfault during epoll_ctl call */\n-\t\t\t\t\t\t\t\t\tEPOLL_CTL_TEST_FAIL\n-\t\t\t\t\t\t\t\t\t    (\"Test arguments caused abnormal exit.\");\n-\t\t\t\t\t\t\t\telse\t/* The 'normal' failure */\n-\t\t\t\t\t\t\t\t\tEPOLL_CTL_TEST_FAIL\n-\t\t\t\t\t\t\t\t\t    ((result_strings[result]));\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\tnum_epoll_ctl_test_fails++;\n-#ifdef DEBUG\n-\t\t\t\t\t\t} else\t/* The call of epoll_ctl behaved as expected */\n-\t\t\t\t\t\t\tEPOLL_CTL_TEST_PASS((result_strings[result]));\n-#else\n-\t\t\t\t\t\t}\n-#endif\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t}\n-\t\t}\n-\t\tclose(epoll_fd);\n-\t}\n-\n-\ttst_resm(TINFO,\n-\t\t \"Summary: Of %d tests, epoll_ctl failed %d (%3.0f%% passed).\",\n-\t\t num_epoll_ctl_test_calls, num_epoll_ctl_test_fails,\n-\t\t ((float)(num_epoll_ctl_test_calls - num_epoll_ctl_test_fails) *\n-\t\t  100.0f / (float)num_epoll_ctl_test_calls));\n-\treturn (num_epoll_ctl_test_fails / num_epoll_ctl_test_calls);\n-}\n-\n-int main(void)\n-{\n-\tint epoll_fd;\n-\tstruct timeval tv;\n-\tint last_result;\n-\n-\ttst_resm(TINFO, \"testing if epoll() system call works\");\n-\n-\t/* Get the current time */\n-\tif (gettimeofday(&tv, NULL) != 0) {\n-\t\ttst_brkm(TBROK | TERRNO, NULL, \"gettimeofday failed\");\n-\t} else {\n-\t\ttst_resm(TINFO, \"gettimeofday() works\");\n-\t}\n-\n-\t/* Set up RNG */\n-\tsrand(tv.tv_usec);\n-\ttst_resm(TINFO,\n-\t\t \"random number seeded with gettimeofday() [seed = %ld] works\",\n-\t\t tv.tv_usec);\n-\n-\ttst_resm(TINFO, \"Testing epoll_create\");\n-\t/* Testing epoll_create with some different sizes */\n-\tlast_result = PROTECT_FUNC(test_epoll_create, -1, NUM_RAND_ATTEMPTS);\n-\tif (last_result != 0) {\n-\t\t/* create test(s) failed */\n-\t}\n-\n-\t/* Create an epoll_fd for testing epoll_ctl */\n-\tepoll_fd = epoll_create(BACKING_STORE_SIZE_HINT);\n-\tif (epoll_fd < 0) {\n-\t\ttst_brkm(TFAIL | TERRNO, NULL, \"epoll_create failed\");\n-\t}\n-\n-\ttst_resm(TINFO, \"Testing epoll_ctl\");\n-\tlast_result = PROTECT_FUNC(test_epoll_ctl, -1, epoll_fd);\n-\tif (last_result != 0) {\n-\t\t/* ctl test(s) failed */\n-\t}\n-\n-\ttst_exit();\n-}\n-\n-#else\n-\n-int main(void)\n-{\n-\ttst_brkm(TCONF, NULL, \"No epoll support found.\");\n-}\n-\n-#endif\n","prefixes":["8/8"]}