prog.c: In function ‘main’:
prog.c:42:10: warning: implicit declaration of function ‘open’; did you mean ‘popen’? [-Wimplicit-function-declaration]
fd = open("/dev/mydev", O_RDONLY);
^~~~
popen
prog.c:42:29: error: ‘O_RDONLY’ undeclared (first use in this function)
fd = open("/dev/mydev", O_RDONLY);
^~~~~~~~
prog.c:42:29: note: each undeclared identifier is reported only once for each function it appears in
prog.c:43:15: error: ‘buf’ undeclared (first use in this function)
read(fd, &buf, 7);
^~~
prog.c:35:3: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result [-Wunused-result]
chdir("/");
^~~~~~~~~~