Skip to content

Commit 69c52f2

Browse files
dybucctgross35
authored andcommitted
vxworks: ensure kernel symbols are not exposed
Deprecate uses of kernel symbols. Rust has support only for RTP programs. Removep polyfill routines. They were stubs. They returned error values. They don't exist in VxWorks.
1 parent 7bdf901 commit 69c52f2

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/new/vxworks/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
//! VxWorks libc.
2+
//!
3+
//! VxWorks allows compiling different types of programs. The `libc` crate only
4+
//! supports RTPs. Refer to the RTP definitions in case of discrepancy.
25
// FIXME(vxworks): link to headers needed.
36

47
pub(crate) mod unistd;

src/vxworks/mod.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ pub type pthread_key_t = c_ulong;
5858

5959
// From b_off_t.h
6060
pub type off_t = c_longlong;
61-
pub type off64_t = off_t;
61+
62+
#[deprecated(
63+
since = "0.2.187",
64+
note = "Kernel mode definitions are unsupported. Use `off_t` instead."
65+
)]
66+
pub type off64_t = c_longlong;
6267

6368
// From b_BOOL.h
6469
pub type BOOL = c_int;
@@ -2414,14 +2419,6 @@ safe_f! {
24142419
}
24152420
}
24162421

2417-
pub unsafe fn pread(_fd: c_int, _buf: *mut c_void, _count: size_t, _offset: off64_t) -> ssize_t {
2418-
-1
2419-
}
2420-
2421-
pub unsafe fn pwrite(_fd: c_int, _buf: *const c_void, _count: size_t, _offset: off64_t) -> ssize_t {
2422-
-1
2423-
}
2424-
24252422
pub unsafe fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int {
24262423
// check to see if align is a power of 2 and if align is a multiple
24272424
// of sizeof(void *)

0 commit comments

Comments
 (0)