1
0
mirror of https://github.com/opencontainers/runc.git synced 2026-02-06 12:45:09 +01:00
Files
runc/tests/integration/testdata/dev_access_test.c
Vasiliy Ulyanov efb8552b05 tests/int: add device access test
The test verifies if the device file can be queried using
'access(dev_name, F_OK)' when the permissions are set to 'rw'. The call
does not explicitly trigger read or write access but should succeed.

Signed-off-by: Vasiliy Ulyanov <vulyanov@suse.de>
2021-02-08 14:14:14 +01:00

18 lines
235 B
C

#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
const char *dev_name = "/dev/kmsg";
if (argc > 1)
dev_name = argv[1];
if (access(dev_name, F_OK) < 0) {
perror(dev_name);
return 1;
}
return 0;
}