]> granicus.if.org Git - strace/blob - tests/ftruncate64.c
ec74b8e3e54062870b37fa8405444ea1286f542b
[strace] / tests / ftruncate64.c
1 /*
2  * Copyright (c) 2015-2016 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_ftruncate64
12
13 # include <stdio.h>
14 # include <unistd.h>
15
16 int
17 main(void)
18 {
19         const off_t len = 0xdefaceddeadbeefULL;
20
21         int rc = ftruncate(-1, len);
22         printf("ftruncate64(-1, %llu) = %d %s (%m)\n",
23                (unsigned long long) len, rc, errno2name());
24
25         puts("+++ exited with 0 +++");
26         return 0;
27 }
28
29 #else
30
31 SKIP_MAIN_UNDEFINED("__NR_ftruncate64")
32
33 #endif