1*49cdfc7eSAndroid Build Coastguard Worker // SPDX-License-Identifier: GPL-2.0-or-later 2*49cdfc7eSAndroid Build Coastguard Worker /* 3*49cdfc7eSAndroid Build Coastguard Worker * Copyright (c) International Business Machines Corp., 2001 4*49cdfc7eSAndroid Build Coastguard Worker * 07/2001 Ported by Wayne Boyer 5*49cdfc7eSAndroid Build Coastguard Worker */ 6*49cdfc7eSAndroid Build Coastguard Worker 7*49cdfc7eSAndroid Build Coastguard Worker /*\ 8*49cdfc7eSAndroid Build Coastguard Worker * [Description] 9*49cdfc7eSAndroid Build Coastguard Worker * 10*49cdfc7eSAndroid Build Coastguard Worker * Call close(-1) and expects it to return EBADF. 11*49cdfc7eSAndroid Build Coastguard Worker */ 12*49cdfc7eSAndroid Build Coastguard Worker 13*49cdfc7eSAndroid Build Coastguard Worker #include <stdio.h> 14*49cdfc7eSAndroid Build Coastguard Worker #include <errno.h> 15*49cdfc7eSAndroid Build Coastguard Worker #include <sys/stat.h> 16*49cdfc7eSAndroid Build Coastguard Worker #include "tst_test.h" 17*49cdfc7eSAndroid Build Coastguard Worker run(void)18*49cdfc7eSAndroid Build Coastguard Workerstatic void run(void) 19*49cdfc7eSAndroid Build Coastguard Worker { 20*49cdfc7eSAndroid Build Coastguard Worker TST_EXP_FAIL(close(-1), EBADF); 21*49cdfc7eSAndroid Build Coastguard Worker } 22*49cdfc7eSAndroid Build Coastguard Worker 23*49cdfc7eSAndroid Build Coastguard Worker static struct tst_test test = { 24*49cdfc7eSAndroid Build Coastguard Worker .test_all = run, 25*49cdfc7eSAndroid Build Coastguard Worker }; 26