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

vxWorks adding few errnoLib related constants. #3780

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

devnexen
Copy link
Contributor

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Jul 21, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@tgross35
Copy link
Contributor

tgross35 commented Aug 6, 2024

rust-lang/rust#128751 makes use of VX_TASK_NAME_LEN. Is that something defined in libc?

@devnexen
Copy link
Contributor Author

devnexen commented Aug 6, 2024

I m unsure it s possible yet due to the uncertainty of its value unless a minimum vxworks release is supported.

@tgross35
Copy link
Contributor

tgross35 commented Aug 6, 2024

It may be worth specifying a minimum version, even if old, to make it obvious which APIs can be relied upon. If you are up for this, just make a PR to document some minimum version in https://github.com/rust-lang/rust/blob/60d146580c10036ce89e019422c6bc2fd9729b65/src/doc/rustc/src/platform-support/vxworks.md. Then we can ping a handful of people who have been involved in VxWorks to get their feedback.

Comment on lines 725 to 728
// errnoLib.h
const taskErrorBase: ::c_int = 0x00030000;
const semErrorBase: ::c_int = 0x00160000;
const objErrorBase: ::c_int = 0x003d0000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did not find these constants in errnoLib.h. Which VxWorks workbench did you use for reference?

Copy link
Contributor Author

@devnexen devnexen Aug 7, 2024

Choose a reason for hiding this comment

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

they do not exist, see they re not exposed it s only to serve as base for constants such as :

pub const S_taskLib_NAME_NOT_FOUND: ::c_int = taskErrorBase + 0x0065;

Copy link
Contributor

@biabbas biabbas Aug 7, 2024

Choose a reason for hiding this comment

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

Ok. Can you change the comments. None of the constants are defined in errnoLib.h

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@devnexen devnexen force-pushed the vxworks_basic_errors branch from a7f3de0 to ad48151 Compare August 7, 2024 09:51
Copy link
Contributor

@biabbas biabbas left a comment

Choose a reason for hiding this comment

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

Are these defined somewhere else in your VxWorks reference?

Comment on lines 730 to 734
// errnoLib.h
pub const S_taskLib_NAME_NOT_FOUND: ::c_int = taskErrorBase + 0x0065;
pub const S_taskLib_TASK_HOOK_TABLE_FULL: ::c_int = taskErrorBase + 0x0066;
pub const S_taskLib_TASK_HOOK_NOT_FOUND: ::c_int = taskErrorBase + 0x0067;
pub const S_taskLib_ILLEGAL_PRIORITY: ::c_int = taskErrorBase + 0x0068;
Copy link
Contributor

Choose a reason for hiding this comment

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

These are defined in taskLibCommon.h

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh I see I confused with vxWorks 6. fixing.

Comment on lines +736 to +743
pub const S_semLib_INVALID_STATE: ::c_int = semErrorBase + 0x0065;
pub const S_semLib_INVALID_OPTION: ::c_int = semErrorBase + 0x0066;
pub const S_semLib_INVALID_QUEUE_TYPE: ::c_int = semErrorBase + 0x0067;
pub const S_semLib_INVALID_OPERATION: ::c_int = semErrorBase + 0x0068;
Copy link
Contributor

Choose a reason for hiding this comment

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

These are defined in semLibCommon.h

Comment on lines +741 to +750
pub const S_objLib_OBJ_ID_ERROR: ::c_int = objErrorBase + 0x0001;
pub const S_objLib_OBJ_UNAVAILABLE: ::c_int = objErrorBase + 0x0002;
pub const S_objLib_OBJ_DELETED: ::c_int = objErrorBase + 0x0003;
pub const S_objLib_OBJ_TIMEOUT: ::c_int = objErrorBase + 0x0004;
pub const S_objLib_OBJ_NO_METHOD: ::c_int = objErrorBase + 0x0005;
Copy link
Contributor

Choose a reason for hiding this comment

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

These in objLibCommon.h

@devnexen devnexen force-pushed the vxworks_basic_errors branch from ad48151 to 7a28fc7 Compare August 7, 2024 11:33
Copy link
Contributor

@biabbas biabbas left a comment

Choose a reason for hiding this comment

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

Looks good now. Not sure Why CI tests failed. Maybe reshuffling the constants so that their indentation increases progressively may pass some more ci checks.

@tgross35
Copy link
Contributor

tgross35 commented Aug 8, 2024

CI has some known problems. We're working on getting those sorted out (will need to do that before merge)

@tgross35
Copy link
Contributor

tgross35 commented Aug 9, 2024

I m unsure it s possible yet due to the uncertainty of its value unless a minimum vxworks release is supported.

Does that work now with the minimum version of 7?

@devnexen devnexen force-pushed the vxworks_basic_errors branch from f248ae8 to 8472900 Compare August 9, 2024 16:01
@biabbas
Copy link
Contributor

biabbas commented Aug 12, 2024

I m unsure it s possible yet due to the uncertainty of its value unless a minimum vxworks release is supported.

Does that work now with the minimum version of 7?

Yes. VX_TASK_NAME_LEN is now 31.

@devnexen
Copy link
Contributor Author

it had been added in the last commit

@devnexen devnexen force-pushed the vxworks_basic_errors branch from 8472900 to 73a6a03 Compare August 12, 2024 11:31
@tgross35
Copy link
Contributor

Not going to block on this since it is tier 3, but it may be worth adding a vxworks file in libc-test/semver.

@tgross35 tgross35 added this pull request to the merge queue Aug 12, 2024
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 12, 2024
Merged via the queue into rust-lang:main with commit e209061 Aug 12, 2024
39 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 12, 2024
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 12, 2024
@tgross35 tgross35 removed the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 13, 2024
@tgross35 tgross35 added the stable-applied This PR has been cherry-picked to libc's stable release branch label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants