Skip to content

Add missing error codes and misc. functions for vxworks #4337

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

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/vxworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,9 @@ pub const ENODEV: c_int = 19;
pub const ENOTDIR: c_int = 20;
pub const EISDIR: c_int = 21;
pub const EINVAL: c_int = 22;
pub const ENFILE: c_int = 23;
pub const EMFILE: c_int = 24;
pub const ENOTTY: c_int = 25;
pub const ENAMETOOLONG: c_int = 26;
pub const EFBIG: c_int = 27;
pub const ENOSPC: c_int = 28;
Expand All @@ -636,7 +639,12 @@ pub const EROFS: c_int = 30;
pub const EMLINK: c_int = 31;
pub const EPIPE: c_int = 32;
pub const EDEADLK: c_int = 33;
pub const ENOLCK: c_int = 34;
pub const ENOTSUP: c_int = 35;
pub const EMSGSIZE: c_int = 36;
pub const EDOM: c_int = 37;
pub const ERANGE: c_int = 38;
pub const EDOOM: c_int = 39;
pub const EDESTADDRREQ: c_int = 40;
pub const EPROTOTYPE: c_int = 41;
pub const ENOPROTOOPT: c_int = 42;
Expand All @@ -663,12 +671,30 @@ pub const ENETDOWN: c_int = 62;
pub const ETXTBSY: c_int = 63;
pub const ELOOP: c_int = 64;
pub const EHOSTUNREACH: c_int = 65;
pub const ENOTBLK: c_int = 66;
pub const EHOSTDOWN: c_int = 67;
pub const EINPROGRESS: c_int = 68;
pub const EALREADY: c_int = 69;
pub const EWOULDBLOCK: c_int = 70;
pub const ENOSYS: c_int = 71;
pub const ECANCELED: c_int = 72;
pub const ENOSR: c_int = 74;
pub const ENOSTR: c_int = 75;
pub const EPROTO: c_int = 76;
pub const EBADMSG: c_int = 77;
pub const ENODATA: c_int = 78;
pub const ETIME: c_int = 79;
pub const ENOMSG: c_int = 80;
pub const EFPOS: c_int = 81;
pub const EILSEQ: c_int = 82;
pub const EDQUOT: c_int = 83;
pub const EIDRM: c_int = 84;
pub const EOVERFLOW: c_int = 85;
pub const EMULTIHOP: c_int = 86;
pub const ENOLINK: c_int = 87;
pub const ESTALE: c_int = 88;
pub const EOWNERDEAD: c_int = 89;
pub const ENOTRECOVERABLE: c_int = 90;

// NFS errnos: Refer to pkgs_v2/storage/fs/nfs/h/nfs/nfsCommon.h
const M_nfsStat: c_int = 48 << 16;
Expand Down Expand Up @@ -1242,6 +1268,7 @@ extern "C" {
pub fn umask(mask: mode_t) -> mode_t;
pub fn mlock(addr: *const c_void, len: size_t) -> c_int;
pub fn mlockall(flags: c_int) -> c_int;
pub fn munlock(addr: *const c_void, len: size_t) -> c_int;
pub fn munlockall() -> c_int;

pub fn mmap(
Expand All @@ -1253,6 +1280,10 @@ extern "C" {
offset: off_t,
) -> *mut c_void;
pub fn munmap(addr: *mut c_void, len: size_t) -> c_int;

pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int;
pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int;

pub fn truncate(path: *const c_char, length: off_t) -> c_int;
pub fn shm_open(name: *const c_char, oflag: c_int, mode: crate::mode_t) -> c_int;
pub fn shm_unlink(name: *const c_char) -> c_int;
Expand All @@ -1269,6 +1300,8 @@ extern "C" {

pub fn utimes(filename: *const c_char, times: *const crate::timeval) -> c_int;

pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int;

#[link_name = "_rtld_dlopen"]
pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void;

Expand Down
Loading