mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
@@ -62,7 +62,7 @@ impl Fd {
|
||||
cvt(unsafe { suppress_iph!(libc::close(self.0)) }, drop)
|
||||
}
|
||||
|
||||
pub fn ftruncate(&self, len: i64) -> io::Result<()> {
|
||||
pub fn ftruncate(&self, len: crate::stdlib::os::Offset) -> io::Result<()> {
|
||||
cvt(unsafe { suppress_iph!(ftruncate(self.0, len)) }, drop)
|
||||
}
|
||||
|
||||
|
||||
@@ -930,7 +930,7 @@ mod _io {
|
||||
if !self.valid_write() || self.write_pos > self.pos {
|
||||
self.write_pos = self.pos
|
||||
}
|
||||
self.adjust_position(self.pos + buf.len() as i64);
|
||||
self.adjust_position(self.pos + buf.len() as Offset);
|
||||
if self.pos > self.write_end {
|
||||
self.write_end = self.pos
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ mod _os {
|
||||
#[pyarg(any)]
|
||||
in_fd: i32,
|
||||
#[pyarg(any)]
|
||||
offset: i64,
|
||||
offset: Offset,
|
||||
#[pyarg(any)]
|
||||
count: i64,
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -1700,7 +1700,7 @@ mod _os {
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
pub fn ftruncate(fd: i32, length: i64, vm: &VirtualMachine) -> PyResult<()> {
|
||||
pub fn ftruncate(fd: i32, length: Offset, vm: &VirtualMachine) -> PyResult<()> {
|
||||
Fd(fd).ftruncate(length).map_err(|e| e.into_pyexception(vm))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user