Skip to content

Instantly share code, notes, and snippets.

@takahisa
Created August 10, 2018 02:52
Show Gist options
  • Save takahisa/ebd3afa81e5b644d09fb937bbc08a250 to your computer and use it in GitHub Desktop.
Save takahisa/ebd3afa81e5b644d09fb937bbc08a250 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char **argv) {
int fd1 = open("./services", O_RDONLY);
int fd2 = open("./services", O_RDONLY);
printf("fd1: %d\nfd2: %d\n", fd1, fd2);
close(fd1);
close(fd2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment