File: flock.c

package info (click to toggle)
strace 6.18%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 73,736 kB
  • sloc: ansic: 182,157; sh: 10,202; makefile: 4,225; cpp: 946; awk: 353; perl: 267; exp: 62; sed: 9
file content (28 lines) | stat: -rw-r--r-- 514 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Check decoding of flock syscall.
 *
 * Copyright (c) 2016-2025 The strace developers.
 * All rights reserved.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#include "tests.h"
#include "scno.h"

#include <stdio.h>
#include <sys/file.h>
#include <unistd.h>

int
main(void)
{
	const unsigned long fd = (long int) 0xdeadbeefffffffffULL;

	long rc = syscall(__NR_flock, fd, LOCK_SH);
	printf("flock(fd=%d, op=LOCK_SH) = %s\n",
	       (int) fd, sprintrc(rc));

	puts("+++ exited with 0 +++");
	return 0;
}