All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Understanding the Limitations of Errno in Linux and POSIX

By

ingve

11mo ago· 3 min readenNews

Summary

The article discusses the limitations of errno in Linux and POSIX, highlighting that the value in errno is only significant when an error occurs and is never set to zero by system calls or library functions.

Key quotes

· 2 pulled
The value in errno is significant only when the return value of the call indicated an error (i.e., -1 from most system calls; -1 or NULL from most library functions); a function that succeeds is allowed to change errno.
The value of errno is never set to zero by any system call or library function.
Snippet from the RSS feed
If you read manual pages, such as Linux's errno(3), you'll soon discover an important and peculiar seeming limitation of looking at errno. To quote the Linux version:

You might also wanna read