(root)/
strace-6.5/
tests/
tee.c
       1  /*
       2   * Check decoding of tee syscall.
       3   *
       4   * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
       5   * Copyright (c) 2016-2021 The strace developers.
       6   * All rights reserved.
       7   *
       8   * SPDX-License-Identifier: GPL-2.0-or-later
       9   */
      10  
      11  #include "tests.h"
      12  #include "scno.h"
      13  
      14  #include <stdio.h>
      15  #include <unistd.h>
      16  
      17  int
      18  main(void)
      19  {
      20  	const long int fd_in = (long int) 0xdeadbeefffffffffULL;
      21  	const long int fd_out = (long int) 0xdeadbeeffffffffeULL;
      22  	const size_t len = (size_t) 0xdeadbef3facefed3ULL;
      23  	const unsigned int flags = 15;
      24  
      25  	long rc = syscall(__NR_tee, fd_in, fd_out, len, flags);
      26  	printf("tee(%d, %d, %zu, %s) = %ld %s (%m)\n",
      27  	       (int) fd_in, (int) fd_out, len,
      28  	       "SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT",
      29  	       rc, errno2name());
      30  
      31  	puts("+++ exited with 0 +++");
      32  	return 0;
      33  }