Skip to content

Commit b182182

Browse files
authored
Remove legacy fields from stat struct. NFC (#19569)
Musl needs these in order to support the linux kernel but we don't need to use the same ABI in emscripten. Fixes: #19567
1 parent 0a87589 commit b182182

File tree

5 files changed

+36
-36
lines changed

5 files changed

+36
-36
lines changed

src/generated_struct_info32.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,33 +1459,32 @@
14591459
"sin6_port": 2
14601460
},
14611461
"stat": {
1462-
"__size__": 112,
1463-
"__st_ino_truncated": 8,
1462+
"__size__": 96,
14641463
"st_atim": {
14651464
"__size__": 16,
1466-
"tv_nsec": 64,
1467-
"tv_sec": 56
1465+
"tv_nsec": 48,
1466+
"tv_sec": 40
14681467
},
1469-
"st_blksize": 48,
1470-
"st_blocks": 52,
1468+
"st_blksize": 32,
1469+
"st_blocks": 36,
14711470
"st_ctim": {
14721471
"__size__": 16,
1473-
"tv_nsec": 96,
1474-
"tv_sec": 88
1472+
"tv_nsec": 80,
1473+
"tv_sec": 72
14751474
},
14761475
"st_dev": 0,
1477-
"st_gid": 24,
1478-
"st_ino": 104,
1479-
"st_mode": 12,
1476+
"st_gid": 16,
1477+
"st_ino": 88,
1478+
"st_mode": 4,
14801479
"st_mtim": {
14811480
"__size__": 16,
1482-
"tv_nsec": 80,
1483-
"tv_sec": 72
1481+
"tv_nsec": 64,
1482+
"tv_sec": 56
14841483
},
1485-
"st_nlink": 16,
1486-
"st_rdev": 28,
1487-
"st_size": 40,
1488-
"st_uid": 20
1484+
"st_nlink": 8,
1485+
"st_rdev": 20,
1486+
"st_size": 24,
1487+
"st_uid": 12
14891488
},
14901489
"statfs": {
14911490
"__size__": 64,

src/generated_struct_info64.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,33 +1459,32 @@
14591459
"sin6_port": 2
14601460
},
14611461
"stat": {
1462-
"__size__": 120,
1463-
"__st_ino_truncated": 8,
1462+
"__size__": 104,
14641463
"st_atim": {
14651464
"__size__": 16,
1466-
"tv_nsec": 72,
1467-
"tv_sec": 64
1465+
"tv_nsec": 56,
1466+
"tv_sec": 48
14681467
},
1469-
"st_blksize": 56,
1470-
"st_blocks": 60,
1468+
"st_blksize": 40,
1469+
"st_blocks": 44,
14711470
"st_ctim": {
14721471
"__size__": 16,
1473-
"tv_nsec": 104,
1474-
"tv_sec": 96
1472+
"tv_nsec": 88,
1473+
"tv_sec": 80
14751474
},
14761475
"st_dev": 0,
1477-
"st_gid": 36,
1478-
"st_ino": 112,
1479-
"st_mode": 16,
1476+
"st_gid": 20,
1477+
"st_ino": 96,
1478+
"st_mode": 4,
14801479
"st_mtim": {
14811480
"__size__": 16,
1482-
"tv_nsec": 88,
1483-
"tv_sec": 80
1481+
"tv_nsec": 72,
1482+
"tv_sec": 64
14841483
},
1485-
"st_nlink": 24,
1486-
"st_rdev": 40,
1487-
"st_size": 48,
1488-
"st_uid": 32
1484+
"st_nlink": 8,
1485+
"st_rdev": 24,
1486+
"st_size": 32,
1487+
"st_uid": 16
14891488
},
14901489
"statfs": {
14911490
"__size__": 104,

src/library_syscall.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ var SyscallsLibrary = {
5252
throw e;
5353
}
5454
{{{ makeSetValue('buf', C_STRUCTS.stat.st_dev, 'stat.dev', 'i32') }}};
55-
{{{ makeSetValue('buf', C_STRUCTS.stat.__st_ino_truncated, 'stat.ino', 'i32') }}};
5655
{{{ makeSetValue('buf', C_STRUCTS.stat.st_mode, 'stat.mode', 'i32') }}};
5756
{{{ makeSetValue('buf', C_STRUCTS.stat.st_nlink, 'stat.nlink', SIZE_TYPE) }}};
5857
{{{ makeSetValue('buf', C_STRUCTS.stat.st_uid, 'stat.uid', 'i32') }}};

src/struct_info.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"structs": {
3636
"stat": [
3737
"st_dev",
38-
"__st_ino_truncated",
3938
"st_mode",
4039
"st_nlink",
4140
"st_uid",

system/lib/libc/musl/arch/emscripten/bits/stat.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
struct stat
55
{
66
dev_t st_dev;
7+
#ifndef __EMSCRIPTEN__
78
int __st_dev_padding;
89
long __st_ino_truncated;
10+
#endif
911
mode_t st_mode;
1012
nlink_t st_nlink;
1113
uid_t st_uid;
1214
gid_t st_gid;
1315
dev_t st_rdev;
16+
#ifndef __EMSCRIPTEN__
1417
int __st_rdev_padding;
18+
#endif
1519
off_t st_size;
1620
blksize_t st_blksize;
1721
blkcnt_t st_blocks;

0 commit comments

Comments
 (0)