(root)/
strace-6.5/
tests-mx32/
renameat2.c
       1  /*
       2   * Check decoding of renameat2 syscall.
       3   *
       4   * Copyright (c) 2015-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  	static const char oldpath[] = "renameat2_oldpath";
      21  	static const char newpath[] = "renameat2_newpath";
      22  	const unsigned long olddirfd =
      23  		(unsigned long) 0xfacefeedffffffff;
      24  	const unsigned long newdirfd =
      25  		(unsigned long) 0xfacefeed00000000 | -100U;
      26  
      27  	long rc = syscall(__NR_renameat2,
      28  			  olddirfd, oldpath, newdirfd, newpath, 1);
      29  	printf("renameat2(%d, \"%s\", AT_FDCWD, \"%s\", RENAME_NOREPLACE)"
      30  	       " = %ld %s (%m)\n",
      31  	       (int) olddirfd, oldpath, newpath, rc, errno2name());
      32  
      33  	puts("+++ exited with 0 +++");
      34  	return 0;
      35  }