On Tue, 13 Sep 2011, Leon Timmermans wrote: > First of all, that is exactly what you should expect. Succeeding > system calls do not set errno, only failing ones do. If you want to > check for an error by using $!, you should set it to 0 before > setting $(. That _may_ work, but is not guaranteed by POSIX. You cannot rely on errno not being changed by a successful call. The API you are invoking may internally call other API that fail, and set errno, but the outer API call expects and deals with that error condition. In which case you will have a successful return, but a non-zero errno value, even though you set errno to 0 before making the call. Cheers, -JanThread Previous | Thread Next