/*************************************************************** SYS-READLINK.C This file contains Linux/i386/ILP32 implementation of __cpu_sys_readlink(). 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_readlink( int dirfd, const char *path, void *buf, __mpu_uint64_t count ) { ssize_t ret; if( !path ) return( -(__mpu_int64_t)__MCPU_EFAULT ); if( count > (__mpu_uint64_t)SIZE_MAX ) return( -(__mpu_int64_t)__MCPU_EINVAL ); ret = readlinkat( dirfd, path, (char *)buf, (size_t)count ); if( ret < 0 ) return( -(__mpu_int64_t)__cpu_errno_from_host( errno ) ); return( (__mpu_int64_t)ret ); } /* End of __cpu_sys_readlink() */