• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
4  *
5  * Basic test for uname(2):
6  * Calling uname() succeeded and got correct sysname.
7  *
8  */
9 
10 #include <sys/utsname.h>
11 #include <errno.h>
12 #include <string.h>
13 #include "tst_test.h"
14 
verify_uname(void)15 static void verify_uname(void)
16 {
17 	struct utsname un;
18 
19 	memset(&un, 0, sizeof(un));
20 
21 	TST_EXP_PASS(uname(&un));
22 
23 	if (!TST_PASS)
24 		return;
25 
26 	if (strcmp(un.sysname, "Linux")) {
27 		tst_res(TFAIL, "sysname is not Linux");
28 		return;
29 	}
30 
31 	tst_res(TPASS, "sysname set to Linux");
32 }
33 
34 static struct tst_test test = {
35 	.test_all = verify_uname,
36 };
37