]> granicus.if.org Git - strace/blobdiff - tests/ftruncate64.c
tests: extend TEST_NETLINK_OBJECT macro
[strace] / tests / ftruncate64.c
index 37d0084c51858a6bf059ee96ece8f4a832403a5d..90d9938fc3885497821ce1bb281a203c08765367 100644 (file)
  */
 
 #include "tests.h"
-#include <sys/syscall.h>
+#include <asm/unistd.h>
 
 #ifdef __NR_ftruncate64
 
-# include <assert.h>
-# include <errno.h>
 # include <stdio.h>
 # include <unistd.h>
 
 int
 main(void)
 {
-       const off_t len = 0xdefaceddeadbeef;
+       const off_t len = 0xdefaceddeadbeefULL;
 
-       assert(ftruncate(-1, len) == -1);
-       if (EBADF != errno)
-               perror_msg_and_skip("ftruncate");
-
-       printf("ftruncate64(-1, %llu) = -1 EBADF (%m)\n",
-              (unsigned long long) len);
+       int rc = ftruncate(-1, len);
+       printf("ftruncate64(-1, %llu) = %d %s (%m)\n",
+              (unsigned long long) len, rc, errno2name());
 
        puts("+++ exited with 0 +++");
        return 0;