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