File tree Expand file tree Collapse file tree
okio/src/linuxMain/kotlin/okio Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package okio
1717
1818import kotlinx.cinterop.UnsafeNumber
1919import kotlinx.cinterop.alloc
20+ import kotlinx.cinterop.convert
2021import kotlinx.cinterop.memScoped
2122import kotlinx.cinterop.ptr
2223import okio.internal.linux.AT_FDCWD
@@ -40,18 +41,19 @@ import platform.posix.syscall
4041 * Prefer `statx()` if it's available. Fall back to `stat()` which doesn't have a field for
4142 * `createdAt`.
4243 */
44+ @OptIn(UnsafeNumber ::class )
4345internal actual fun PosixFileSystem.variantMetadataOrNull (path : Path ): FileMetadata ? {
4446 memScoped {
4547 val statx = alloc< statx> ()
4648 val result = syscall(
47- __NR_statx .toLong (),
49+ __NR_statx .convert (),
4850 AT_FDCWD ,
4951 path.toString(),
5052 AT_SYMLINK_NOFOLLOW ,
5153 STATX_BASIC_STATS or STATX_BTIME ,
5254 statx.ptr,
53- )
54- if (result == 0L ) {
55+ ).convert< Int >()
56+ if (result == 0 ) {
5557 return FileMetadata (
5658 isRegularFile = statx.stx_mode.toInt() and S_IFMT == S_IFREG ,
5759 isDirectory = statx.stx_mode.toInt() and S_IFMT == S_IFDIR ,
You can’t perform that action at this time.
0 commit comments