/*-1* Copyright (c) 2024 The FreeBSD Foundation2*3* SPDX-License-Identifier: BSD-2-Clause4*5* This software were developed by Konstantin Belousov <[email protected]>6* under sponsorship from the FreeBSD Foundation.7*/89#include <errno.h>10#include <unistd.h>1112#include <atf-c.h>1314ATF_TC(errno_basic);15ATF_TC_HEAD(errno_basic, tc)16{17atf_tc_set_md_var(tc, "descr",18"Verify basic functionality of errno");19}2021ATF_TC_BODY(errno_basic, tc)22{23int res;2425res = unlink("/non/existent/file");26ATF_REQUIRE(res == -1);27ATF_REQUIRE(errno == ENOENT);28}2930ATF_TP_ADD_TCS(tp)31{32ATF_TP_ADD_TC(tp, errno_basic);3334return (atf_no_error());35}363738