xref: /aosp_15_r20/external/ltp/testcases/kernel/syscalls/gethostname/gethostname01.c (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
4  * Copyright (c) 2023 SUSE LLC Ioannis Bonatakis <[email protected]>
5  */
6 
7 /*\
8  * [Description]
9  *
10  * Test is checking that gethostname() succeeds.
11  */
12 
13 #include "tst_test.h"
14 #include <stdlib.h>
15 
run(void)16 static void run(void)
17 {
18 	char hname[100];
19 
20 	TST_EXP_PASS(gethostname(hname, sizeof(hname)));
21 }
22 
23 static struct tst_test test = {
24 	.test_all = run
25 };
26