/*************************************************************** SYS-FCHDIR.C This file contains Linux/i386/ILP32 implementation of __cpu_sys_fchdir(). 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 __mpu_int64_t __cpu_sys_fchdir( int fd ) { int cwd_fd; cwd_fd = openat( fd, ".", O_PATH | O_DIRECTORY | O_CLOEXEC ); if( cwd_fd < 0 ) return( -(__mpu_int64_t)__cpu_errno_from_host( errno ) ); return( (__mpu_int64_t)cwd_fd ); } /* End of __cpu_sys_fchdir() */