You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
320 B
20 lines
320 B
#include <litc.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int ret;
|
|
if ((ret = mknod("/tmp/flea", 10, MKDEV(10, 0))) < 0)
|
|
err(ret, "mknod");
|
|
|
|
int fd = open("/tmp/flea", O_RDWR, 0);
|
|
if (fd < 0)
|
|
err(fd, "open");
|
|
char buf[512];
|
|
if ((ret = read(fd, buf, sizeof(buf))) < 0)
|
|
err(ret, "read");
|
|
|
|
close(fd);
|
|
|
|
return 0;
|
|
}
|