2 * Check decoding of getsockname syscall.
4 * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #define TEST_SYSCALL_NAME getsockname
16 int lfd = socket(AF_UNIX, SOCK_STREAM, 0);
18 perror_msg_and_skip("socket");
20 (void) unlink(TEST_SOCKET);
22 const struct sockaddr_un un = {
23 .sun_family = AF_UNIX,
24 .sun_path = TEST_SOCKET
27 if (bind(lfd, (const void *) &un, sizeof(un)))
28 perror_msg_and_skip("bind");
30 test_sockname_syscall(lfd);
32 (void) unlink(TEST_SOCKET);
34 puts("+++ exited with 0 +++");