![]() |
Need help understanding the system call 'write'
Hi all. I'm starting to learn Linux programming and my first bit of code using a system call is not responding the way I expected it to.
It's the write() call. Here's the code: Code:
#include <unistd.h>The statement following the IF evaluation never executes, no matter what. The first string will truncate if the string is longer than the count, and if the string is shorter than the count, the string will print, and then the letter 'A' and a space is printed as a prefix to the next command line prompt. So why isn't the function acting as expected? Any help is appreciated! |
Aw, geez. I figured it out 30 seconds after I posted! I forgot to change the count parameter to match the adjusted string length! Now it's working! :)
|
| All times are GMT -5. The time now is 11:55 PM. |