/*************************************************************** SYS-FTRUNCATE.C This file contains Linux/i386/ILP32 implementation of __cpu_sys_ftruncate(). PART OF : CPU - library . USAGE : Internal only . Copyright (C) 2026 by Andrew V.Kosteltsev. All Rights Reserved. ***************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include __mpu_int64_t __cpu_sys_ftruncate( int fd, __mpu_int64_t length ) { off_t host_length; host_length = (off_t)length; if( (__mpu_int64_t)host_length != length ) return( -(__mpu_int64_t)__MCPU_EOVERFLOW ); if( ftruncate( fd, host_length ) < 0 ) return( -(__mpu_int64_t)__cpu_errno_from_host( errno ) ); return( 0 ); } /* End of __cpu_sys_ftruncate() */