文字列が入力してあるファイルからreadシステムコールを使って指定した
1文字をカウントしたいのですが、0文字になってしまいます。
どこに問題があるのでしょうか?
#include <stdio.h>
#include <fcntl.h>

int main(void)
{
int fd;
int n_read;
int count = 0;
int ch;
char buf[256];

fd = open("data.dat", O_RDONLY, 0);

fprintf(stdout, "Input a letter you want to count.\n");
ch = fgetc(stdin);

while ((n_read = read(fd, buf, 1)) > 0) {
if (buf == ch)
count++;
}

fprintf(stdout, "found %d%c.\n", count, ch);

close(fd);

return 0;
}