Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix posix errno conditionals #843

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Oct 5, 2023

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason of this change is not clear to me, can you add some context about the purpose of this change in the commit message, it would be very useful during review.

@fadushin
Copy link
Collaborator

fadushin commented Oct 6, 2023

The reason of this change is not clear to me, can you add some context about the purpose of this change in the commit message, it would be very useful during review.

It is probably needed to properly map errnos to atoms (mnemonics) in the case where clock_settime or settimeofday are available. but open and close are not.

Ensure errno.h is included if we implement atomvm:clock_settime, even if close
or open are not found, as we need errno in this implementation. Also make sure
posix_errno_to_term is implemented in this case.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w40/fix-posix-errno-conditionals branch from cc9ebe4 to 302dff3 Compare October 6, 2023 05:12
@pguyot
Copy link
Collaborator Author

pguyot commented Oct 6, 2023

The reason of this change is not clear to me, can you add some context about the purpose of this change in the commit message, it would be very useful during review.

It is probably needed to properly map errnos to atoms (mnemonics) in the case where clock_settime or settimeofday are available. but open and close are not.

We also need errno.h for errno, so the code wouldn't compile if open or close weren't found but clock_settime or settimeofday were.

I did update the commit message as requested.

@fadushin fadushin merged commit 8c7b768 into atomvm:master Oct 6, 2023
81 checks passed
@pguyot pguyot deleted the w40/fix-posix-errno-conditionals branch October 6, 2023 17:53
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.

3 participants