mirror of
https://github.com/opencontainers/runc.git
synced 2026-02-06 12:45:09 +01:00
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>
18 lines
235 B
C
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;
|
|
}
|