Skip to content

Commit 905090f

Browse files
devnexentgross35
authored andcommitted
vxWorks adding few errnoLib related constants.
(cherry picked from commit 73a6a03)
1 parent 59890b5 commit 905090f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/vxworks/mod.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pub type SEM_ID_KERNEL = ::OBJ_HANDLE;
9191
pub type RTP_ID = ::OBJ_HANDLE;
9292
pub type SD_ID = ::OBJ_HANDLE;
9393
pub type CONDVAR_ID = ::OBJ_HANDLE;
94+
pub type STATUS = ::OBJ_HANDLE;
9495

9596
// From vxTypes.h
9697
pub type _Vx_usr_arg_t = isize;
@@ -613,6 +614,7 @@ pub const PTHREAD_STACK_MIN: usize = 4096;
613614
pub const _PTHREAD_SHARED_SEM_NAME_MAX: usize = 30;
614615

615616
// ERRNO STUFF
617+
pub const ERROR: ::c_int = -1;
616618
pub const OK: ::c_int = 0;
617619
pub const EPERM: ::c_int = 1; /* Not owner */
618620
pub const ENOENT: ::c_int = 2; /* No such file or directory */
@@ -720,6 +722,33 @@ pub const S_nfsLib_NFSERR_SERVERFAULT: ::c_int = EIO;
720722
pub const S_nfsLib_NFSERR_BADTYPE: ::c_int = M_nfsStat | nfsstat::NFSERR_BADTYPE as ::c_int;
721723
pub const S_nfsLib_NFSERR_JUKEBOX: ::c_int = M_nfsStat | nfsstat::NFSERR_JUKEBOX as ::c_int;
722724

725+
// internal offset values for below constants
726+
const taskErrorBase: ::c_int = 0x00030000;
727+
const semErrorBase: ::c_int = 0x00160000;
728+
const objErrorBase: ::c_int = 0x003d0000;
729+
730+
// taskLibCommon.h
731+
pub const S_taskLib_NAME_NOT_FOUND: ::c_int = taskErrorBase + 0x0065;
732+
pub const S_taskLib_TASK_HOOK_TABLE_FULL: ::c_int = taskErrorBase + 0x0066;
733+
pub const S_taskLib_TASK_HOOK_NOT_FOUND: ::c_int = taskErrorBase + 0x0067;
734+
pub const S_taskLib_ILLEGAL_PRIORITY: ::c_int = taskErrorBase + 0x0068;
735+
736+
// FIXME: could also be useful for TASK_DESC type
737+
pub const VX_TASK_NAME_LENGTH: ::c_int = 31;
738+
739+
// semLibCommon.h
740+
pub const S_semLib_INVALID_STATE: ::c_int = semErrorBase + 0x0065;
741+
pub const S_semLib_INVALID_OPTION: ::c_int = semErrorBase + 0x0066;
742+
pub const S_semLib_INVALID_QUEUE_TYPE: ::c_int = semErrorBase + 0x0067;
743+
pub const S_semLib_INVALID_OPERATION: ::c_int = semErrorBase + 0x0068;
744+
745+
// objLibCommon.h
746+
pub const S_objLib_OBJ_ID_ERROR: ::c_int = objErrorBase + 0x0001;
747+
pub const S_objLib_OBJ_UNAVAILABLE: ::c_int = objErrorBase + 0x0002;
748+
pub const S_objLib_OBJ_DELETED: ::c_int = objErrorBase + 0x0003;
749+
pub const S_objLib_OBJ_TIMEOUT: ::c_int = objErrorBase + 0x0004;
750+
pub const S_objLib_OBJ_NO_METHOD: ::c_int = objErrorBase + 0x0005;
751+
723752
// in.h
724753
pub const IPPROTO_IP: ::c_int = 0;
725754
pub const IPPROTO_IPV6: ::c_int = 41;

0 commit comments

Comments
 (0)