Branch data Line data Source code
1 : : /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited
2 : : * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial
3 : : */
4 : :
5 : : #include "SolidSyslogVxWorks64Hostname.h"
6 : :
7 : : #include "vxWorks.h"
8 : :
9 : : #include "hostLib.h"
10 : :
11 : : #include "SolidSyslogHeaderField.h"
12 : :
13 : 47 : void SolidSyslogVxWorks64_GetHostname(struct SolidSyslogHeaderField* field, void* context)
14 : : {
15 : : char hostname[MAXHOSTNAMELEN + 1];
16 : :
17 : : (void) context;
18 : :
19 [ + + ]: 47 : if (gethostname(hostname, (int) sizeof(hostname)) == OK)
20 : : {
21 : 46 : hostname[MAXHOSTNAMELEN] = '\0';
22 : 46 : SolidSyslogHeaderField_PrintUsAscii(field, hostname, sizeof(hostname));
23 : : }
24 : 47 : }
|