Skip to content

Add perror to libcmini#150

Merged
th-otto merged 1 commit intofreemint:masterfrom
pietvo:perror
Feb 11, 2026
Merged

Add perror to libcmini#150
th-otto merged 1 commit intofreemint:masterfrom
pietvo:perror

Conversation

@pietvo
Copy link
Contributor

@pietvo pietvo commented Feb 10, 2026

I needed perror in my project. There was none in libcmini, so I decided to write it myself. I submit it hereby for inclusion in the library.

@th-otto
Copy link
Contributor

th-otto commented Feb 10, 2026

Thank you. But i have a few comment:

  • <sys/errno.h> does not exist. That should be just <errno.h>
  • <unistd.h> is not needed there at all

@pietvo
Copy link
Contributor Author

pietvo commented Feb 10, 2026

Thanks for your comment. In fact, <errno.h> isn't needed either, because what it supplies is accessed by strerror.

I have done some cleanup and will push a new version.

@th-otto
Copy link
Contributor

th-otto commented Feb 10, 2026

errno.h is needed for the declaration of the errno variable.

Edit: i just see that it is also declared in stdio.h. But imho this is wrong.

@pietvo
Copy link
Contributor Author

pietvo commented Feb 10, 2026

OK, I'll put it back. It is a bit confusing. On my Mac, the man page says that it is in <sys.errno.h> and I see in some compiler setups that <errno.h> includes <sys.errno.h> or the other way around.

@th-otto th-otto merged commit e97c893 into freemint:master Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants