{"published":"2022-12-30 02:53:06","title":"\u3010Linux\u3011\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u306bO_CLOEXEC\u304c\u7acb\u3063\u3066\u3044\u308b\u304b\u3092\u8abf\u3079\u308b","url":"https://ryuichi1208.hateblo.jp/entry/2022/12/30/025306","height":"190","blog_url":"https://ryuichi1208.hateblo.jp/","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fryuichi1208.hateblo.jp%2Fentry%2F2022%2F12%2F30%2F025306\" title=\"\u3010Linux\u3011\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u306bO_CLOEXEC\u304c\u7acb\u3063\u3066\u3044\u308b\u304b\u3092\u8abf\u3079\u308b - \u5730\u65b9\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u5b66\u7fd2\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"categories":[],"provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/ryuichi1208/","author_name":"ryuichi1208","type":"rich","provider_name":"Hatena Blog","blog_title":"\u5730\u65b9\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u5b66\u7fd2\u65e5\u8a18","width":"100%","description":"#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #define LOG_FILE_PATH \"./test.log\" int main(int argc, char **argv) { int fd, size; char buf[128]; fd = open(LOG_FILE_PATH, (O_RDONLY | O_CREAT), 0664); if (fd < 0) { return -1; } int flags = fcntl(\u2026"}