This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
ubuntu:setuid [2018/02/18 05:51] tschulz |
ubuntu:setuid [2018/02/18 05:54] (current) tschulz |
||
---|---|---|---|
Line 33: | Line 33: | ||
chmod u+s setuidtest | chmod u+s setuidtest | ||
</file> | </file> | ||
+ | |||
+ | ===== Read from stdin ===== | ||
+ | <file c> | ||
+ | char buf[1]; | ||
+ | |||
+ | while(read(0, buf, sizeof(buf))>0) { | ||
+ | // read() here read from stdin charachter by character | ||
+ | // the buf[0] contains the character got by read() | ||
+ | .... | ||
+ | } | ||
+ | </file> | ||
+ | |||