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