Skip to content

Commit 02cc772

Browse files
authored
Rollup merge of rust-lang#94609 - esp-rs:esp-idf-stat-type-fixes, r=Mark-Simulacrum
espidf: fix stat Marking as draft as currently dependant on [a libc fix](rust-lang/libc#2708) and release.
2 parents 878c783 + 4f6b3a6 commit 02cc772

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

library/std/src/os/unix/process.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@ pub trait CommandExt: Sealed {
2424
#[stable(feature = "rust1", since = "1.0.0")]
2525
fn uid(
2626
&mut self,
27-
#[cfg(not(target_os = "vxworks"))] id: u32,
28-
#[cfg(target_os = "vxworks")] id: u16,
27+
#[cfg(not(any(target_os = "vxworks", target_os = "espidf")))] id: u32,
28+
#[cfg(any(target_os = "vxworks", target_os = "espidf"))] id: u16,
2929
) -> &mut process::Command;
3030

3131
/// Similar to `uid`, but sets the group ID of the child process. This has
3232
/// the same semantics as the `uid` field.
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
fn gid(
3535
&mut self,
36-
#[cfg(not(target_os = "vxworks"))] id: u32,
37-
#[cfg(target_os = "vxworks")] id: u16,
36+
#[cfg(not(any(target_os = "vxworks", target_os = "espidf")))] id: u32,
37+
#[cfg(any(target_os = "vxworks", target_os = "espidf"))] id: u16,
3838
) -> &mut process::Command;
3939

4040
/// Sets the supplementary group IDs for the calling process. Translates to
4141
/// a `setgroups` call in the child process.
4242
#[unstable(feature = "setgroups", issue = "90747")]
4343
fn groups(
4444
&mut self,
45-
#[cfg(not(target_os = "vxworks"))] groups: &[u32],
46-
#[cfg(target_os = "vxworks")] groups: &[u16],
45+
#[cfg(not(any(target_os = "vxworks", target_os = "espidf")))] groups: &[u32],
46+
#[cfg(any(target_os = "vxworks", target_os = "espidf"))] groups: &[u16],
4747
) -> &mut process::Command;
4848

4949
/// Schedules a closure to be run just before the `exec` function is
@@ -160,26 +160,26 @@ pub trait CommandExt: Sealed {
160160
impl CommandExt for process::Command {
161161
fn uid(
162162
&mut self,
163-
#[cfg(not(target_os = "vxworks"))] id: u32,
164-
#[cfg(target_os = "vxworks")] id: u16,
163+
#[cfg(not(any(target_os = "vxworks", target_os = "espidf")))] id: u32,
164+
#[cfg(any(target_os = "vxworks", target_os = "espidf"))] id: u16,
165165
) -> &mut process::Command {
166166
self.as_inner_mut().uid(id);
167167
self
168168
}
169169

170170
fn gid(
171171
&mut self,
172-
#[cfg(not(target_os = "vxworks"))] id: u32,
173-
#[cfg(target_os = "vxworks")] id: u16,
172+
#[cfg(not(any(target_os = "vxworks", target_os = "espidf")))] id: u32,
173+
#[cfg(any(target_os = "vxworks", target_os = "espidf"))] id: u16,
174174
) -> &mut process::Command {
175175
self.as_inner_mut().gid(id);
176176
self
177177
}
178178

179179
fn groups(
180180
&mut self,
181-
#[cfg(not(target_os = "vxworks"))] groups: &[u32],
182-
#[cfg(target_os = "vxworks")] groups: &[u16],
181+
#[cfg(not(any(target_os = "vxworks", target_os = "espidf")))] groups: &[u32],
182+
#[cfg(any(target_os = "vxworks", target_os = "espidf"))] groups: &[u16],
183183
) -> &mut process::Command {
184184
self.as_inner_mut().groups(groups);
185185
self

library/std/src/sys/unix/fd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl FileDesc {
109109
self.as_raw_fd(),
110110
buf.as_mut_ptr() as *mut c_void,
111111
cmp::min(buf.len(), READ_LIMIT),
112-
offset as i64,
112+
offset as libc::off64_t,
113113
))
114114
.map(|n| n as usize)
115115
}
@@ -176,7 +176,7 @@ impl FileDesc {
176176
self.as_raw_fd(),
177177
buf.as_ptr() as *const c_void,
178178
cmp::min(buf.len(), READ_LIMIT),
179-
offset as i64,
179+
offset as libc::off64_t,
180180
))
181181
.map(|n| n as usize)
182182
}

library/std/src/sys/unix/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ impl File {
966966
SeekFrom::End(off) => (libc::SEEK_END, off),
967967
SeekFrom::Current(off) => (libc::SEEK_CUR, off),
968968
};
969-
let n = cvt(unsafe { lseek64(self.as_raw_fd(), pos, whence) })?;
969+
let n = cvt(unsafe { lseek64(self.as_raw_fd(), pos as libc::off64_t, whence) })?;
970970
Ok(n as u64)
971971
}
972972

0 commit comments

Comments
 (0)