{"provider_name":"Hatena Blog","title":"read(2) / write(2)","categories":["\u65e5\u8a18\u306e\u7df4\u7fd2","code"],"author_url":"https://blog.hatena.ne.jp/taizooo/","type":"rich","description":"\u65e5\u8a18\u306e\u7df4\u7fd2\u3067\u3059\u3002\u300e\u3075\u3064\u3046\u306e Linux \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u300f\u7b2c5\u7ae0\u300c\u30b9\u30c8\u30ea\u30fc\u30e0\u306b\u304b\u304b\u308f\u308b\u30b7\u30b9\u30c6\u30e0\u30b3\u30fc\u30eb\u300d\u306e\u8a715.4 \u30b9\u30c8\u30ea\u30fc\u30e0\u306e\u8aad\u307f\u66f8\u304d read(2) read(2) \u306e\u8a71\u306b\u306a\u3063\u305f\u3068\u3053\u308d\u3067\u3001\u306a\u306b\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u306e\u304b\u5168\u7136\u308f\u304b\u3089\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 void *buf \u3068\u306f\uff1f\u5199\u7d4c\u3057\u3068\u304f\u304b\u3002 #include <unistd.h> ssize_t read(int fd, void *buf, size_t bufsize); \u623b\u308a\u5024\u306e\u5f62\u306f ssize_t \u3001\u5f15\u6570\u306e\u5f62\u306f size_t \u3068\u3042\u308a\u307e\u3059\u3002 \u3053\u308c\u306f\u3069\u3061\u3089\u3082 sys/type.h \u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u578b\u3067\u3001\u57fa\u672c\u7684\u306a\u6574\u6570\u578b\u306e\u5225\u540d\u306b\u3059\u304e\u307e\u305b\u3093\u3002\u3064\u307e\u308a i\u2026","url":"https://copyanddestroy.hatenablog.com/entry/2025/02/21/184358","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcopyanddestroy.hatenablog.com%2Fentry%2F2025%2F02%2F21%2F184358\" title=\"read(2) / write(2) - copy and destroy\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","blog_url":"https://copyanddestroy.hatenablog.com/","image_url":null,"published":"2025-02-21 18:43:58","provider_url":"https://hatena.blog","author_name":"taizooo","height":"190","blog_title":"copy and destroy","width":"100%"}