1 /*
2 * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
3 * Copyright (c) 2015-2021 The strace developers.
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9 #include "tests.h"
10 #include "scno.h"
11
12 #ifdef __NR_truncate64
13
14 # include <stdio.h>
15 # include <unistd.h>
16
17 int
18 main(void)
19 {
20 static const char fname[] = "truncate64\nfilename";
21 static const char qname[] = "truncate64\\nfilename";
22 const off_t len = 0xdefaceddeadbeefULL;
23
24 int rc = truncate(fname, len);
25 printf("truncate64(\"%s\", %llu) = %d %s (%m)\n",
26 qname, (unsigned long long) len, rc, errno2name());
27
28 puts("+++ exited with 0 +++");
29 return 0;
30 }
31
32 #else
33
34 SKIP_MAIN_UNDEFINED("__NR_truncate64")
35
36 #endif