先週分のLWNを見ててpwrite()というシステムコールを見つけたので、 どんな動作なのか試してみた。 manはこちらに。 manを読むと、指定したオフセット位置から指定されたバイト数分データを書き込むけど、ファイルのオフセットは変更しないと書かれているので、こんな感じのコードを書いてみた。 #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <assert.h> int main(int argc, char **argv) { char c; int fd, ret; fd = open("test.txt", O_RDWR); assert(fd != -1); pread(fd, &c, sizeof(c),
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く