]> granicus.if.org Git - strace/blob - hostname.c
Remove traces of riscv64 mpers
[strace] / hostname.c
1 /*
2  * Copyright (c) 2014-2018 The strace developers.
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: LGPL-2.1-or-later
6  */
7
8 #include "defs.h"
9
10 #ifdef HAVE_LINUX_UTSNAME_H
11 # include <linux/utsname.h>
12 #endif
13
14 #ifndef __NEW_UTS_LEN
15 # define __NEW_UTS_LEN 64
16 #endif
17
18 SYS_FUNC(sethostname)
19 {
20         unsigned int len = tcp->u_arg[1];
21
22         if (len > __NEW_UTS_LEN) {
23                 printaddr(tcp->u_arg[0]);
24         } else {
25                 printstrn(tcp, tcp->u_arg[0], len);
26         }
27
28         tprintf(", %u", len);
29
30         return RVAL_DECODED;
31 }
32
33 #if defined(ALPHA)
34 SYS_FUNC(gethostname)
35 {
36         if (exiting(tcp)) {
37                 if (syserror(tcp))
38                         printaddr(tcp->u_arg[0]);
39                 else
40                         printstr(tcp, tcp->u_arg[0]);
41                 tprintf(", %" PRI_klu, tcp->u_arg[1]);
42         }
43         return 0;
44 }
45 #endif /* ALPHA */