There is following code:
int main(int argc, char *argv)
pd.fd = 0;
pd.events = POLLIN;
int ret = ::ppoll(&pd, 1, 0, 0);
$ echo 1 | ./main
$ echo 1 > /proc/$(pgrep main)/fd/0
That's simply impossible, unless the process was specially launched in a way that enables feeding data to it from outside (i.e. through a FIFO or a pipe).
/proc/$PID/fd/0 (i.e. standard input stream) points to the process's controlling terminal, so do (in the absence of redirection)
/proc/$PID/fd/2 (i.e. standard output and standard error streams):
$ ls -l /proc/$$/fd lrwx------ 1 user user 64 Sep 6 01:36 0 -> /dev/pts/3 lrwx------ 1 user user 64 Sep 6 01:36 1 -> /dev/pts/3 lrwx------ 1 user user 64 Sep 6 01:36 2 -> /dev/pts/3
The terminal is a pseudo-device, that can be both read from and written to. When a process reads from it, the terminal provides data entered from the keyboard or by other means (e.g. pasted from the clipboard). When you write to a terminal, it displays the data. Now when you write to
/proc/$PID/fd/0 you write to the terminal rather than to the target process's standard input stream, that's why your data is displayed but the process stays indifferent.