Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I tried basically exactly that, and it didn't work for me.

On my test system (Ubuntu 21.10 on x86_64) the puts() call never fails.

I switched to a raw write() and that successfully catches it, by returning -1 when output is redirected to /dev/full.

Quite interesting, actually.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: