Skip to content

Commit e32502d

Browse files
committed
Avoid having type members and enum members of Arch with the same name
Resolves #3485
1 parent 061f041 commit e32502d

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

src/kernel_abi.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ struct BaseArch : public wordsize,
12821282
};
12831283
RR_VERIFY_TYPE_EXPLICIT(struct ::timezone, timezone);
12841284

1285-
struct statfs {
1285+
struct statfs_t {
12861286
__statfs_word f_type;
12871287
__statfs_word f_bsize;
12881288
__statfs_word f_blocks;
@@ -1298,9 +1298,9 @@ struct BaseArch : public wordsize,
12981298
__statfs_word f_flags;
12991299
__statfs_word f_spare[4];
13001300
};
1301-
RR_VERIFY_TYPE_EXPLICIT(struct ::statfs, statfs);
1301+
RR_VERIFY_TYPE_EXPLICIT(struct ::statfs, statfs_t);
13021302

1303-
struct statfs64 {
1303+
struct statfs64_t {
13041304
__statfs_word f_type;
13051305
__statfs_word f_bsize;
13061306
uint64_t f_blocks;
@@ -1316,7 +1316,7 @@ struct BaseArch : public wordsize,
13161316
__statfs_word f_flags;
13171317
__statfs_word f_spare[4];
13181318
};
1319-
RR_VERIFY_TYPE_EXPLICIT(struct ::statfs64, statfs64);
1319+
RR_VERIFY_TYPE_EXPLICIT(struct ::statfs64, statfs64_t);
13201320

13211321
struct itimerval {
13221322
timeval it_interval;
@@ -1338,7 +1338,7 @@ struct BaseArch : public wordsize,
13381338
} stack_t;
13391339
RR_VERIFY_TYPE(stack_t);
13401340

1341-
struct sysinfo {
1341+
struct sysinfo_t {
13421342
__kernel_long_t uptime;
13431343
__kernel_ulong_t loads[3];
13441344
__kernel_ulong_t totalram;
@@ -1355,7 +1355,7 @@ struct BaseArch : public wordsize,
13551355
uint32_t mem_unit;
13561356
char _f[20 - 2 * sizeof(__kernel_ulong_t) - sizeof(uint32_t)];
13571357
};
1358-
RR_VERIFY_TYPE_EXPLICIT(struct ::sysinfo, sysinfo);
1358+
RR_VERIFY_TYPE_EXPLICIT(struct ::sysinfo, sysinfo_t);
13591359

13601360
static const ::size_t UTSNAME_LENGTH = 65;
13611361
struct utsname {
@@ -2093,7 +2093,7 @@ struct X64Arch : public BaseArch<SupportedArch::x86_64, WordSize64Defs> {
20932093
// Can't verify this one because glibc leaves out the last two members and the
20942094
// kernel header isn't available to userspace.
20952095

2096-
struct stat {
2096+
struct stat_t {
20972097
dev_t st_dev;
20982098
ino_t st_ino;
20992099
nlink_t st_nlink;
@@ -2110,10 +2110,10 @@ struct X64Arch : public BaseArch<SupportedArch::x86_64, WordSize64Defs> {
21102110
struct timespec st_ctim;
21112111
syscall_slong_t __rr_unused[3];
21122112
};
2113-
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::stat, struct stat);
2113+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::stat, struct stat_t);
21142114

2115-
struct stat64 : public stat {};
2116-
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::stat64, struct stat64);
2115+
struct stat64_t : public stat_t {};
2116+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::stat64, struct stat64_t);
21172117

21182118
struct semid64_ds {
21192119
ipc64_perm sem_perm;
@@ -2291,7 +2291,7 @@ struct X86Arch : public BaseArch<SupportedArch::x86, WordSize32Defs> {
22912291
};
22922292
RR_VERIFY_TYPE_X86_ARCH(SupportedArch::x86, ::user, user);
22932293

2294-
struct stat {
2294+
struct stat_t {
22952295
dev_t st_dev;
22962296
unsigned_short __pad1;
22972297
ino_t st_ino;
@@ -2310,9 +2310,9 @@ struct X86Arch : public BaseArch<SupportedArch::x86, WordSize32Defs> {
23102310
unsigned_long __unused4;
23112311
unsigned_long __unused5;
23122312
};
2313-
RR_VERIFY_TYPE_ARCH(SupportedArch::x86, struct ::stat, struct stat);
2313+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86, struct ::stat, struct stat_t);
23142314

2315-
struct __attribute__((packed)) stat64 {
2315+
struct __attribute__((packed)) stat64_t {
23162316
dev_t st_dev;
23172317
unsigned_int __pad1;
23182318
ino_t __st_ino;
@@ -2330,7 +2330,7 @@ struct X86Arch : public BaseArch<SupportedArch::x86, WordSize32Defs> {
23302330
timespec st_ctim;
23312331
ino64_t st_ino;
23322332
};
2333-
RR_VERIFY_TYPE_ARCH(SupportedArch::x86, struct ::stat64, struct stat64);
2333+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86, struct ::stat64, struct stat64_t);
23342334

23352335
struct semid64_ds {
23362336
ipc64_perm sem_perm;
@@ -2377,7 +2377,7 @@ struct GenericArch : public BaseArch<arch_, wordsize> {
23772377
typedef uint32_t legacy_uid_t;
23782378
typedef uint32_t legacy_gid_t;
23792379

2380-
struct stat {
2380+
struct stat_t {
23812381
dev_t st_dev;
23822382
ino_t st_ino;
23832383
mode_t st_mode;
@@ -2405,7 +2405,7 @@ struct GenericArch : public BaseArch<arch_, wordsize> {
24052405
typename BaseArch<arch_, wordsize>::unsigned_long __unused4;
24062406
};
24072407

2408-
struct stat64 : public stat {};
2408+
struct stat64_t : public stat_t {};
24092409
};
24102410

24112411
struct ARM64Arch : public GenericArch<SupportedArch::aarch64, WordSize64Defs> {

src/syscalls.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -544,15 +544,15 @@ def __init__(self, **kwargs):
544544
# system. path is the pathname of any file within the mounted file
545545
# system. buf is a pointer to a statfs structure defined
546546
# approximately as follows:
547-
statfs = EmulatedSyscall(x86=99, x64=137, generic=43, arg2="struct Arch::statfs")
547+
statfs = EmulatedSyscall(x86=99, x64=137, generic=43, arg2="struct Arch::statfs_t")
548548

549549
# int fstatfs(int fd, struct statfs *buf)
550550
#
551551
# The function statfs() returns information about a mounted file
552552
# system. path is the pathname of any file within the
553553
# get_time(GET_TID(thread_id));mounted file system. buf is a pointer
554554
# to a statfs structure defined approximately as follows:
555-
fstatfs = EmulatedSyscall(x86=100, x64=138, generic=44, arg2="struct Arch::statfs")
555+
fstatfs = EmulatedSyscall(x86=100, x64=138, generic=44, arg2="struct Arch::statfs_t")
556556

557557
ioperm = EmulatedSyscall(x86=101, x64=173)
558558

@@ -574,9 +574,9 @@ def __init__(self, **kwargs):
574574
# stored there.
575575
setitimer = EmulatedSyscall(x86=104, x64=38, generic=103, arg3="typename Arch::itimerval")
576576
getitimer = EmulatedSyscall(x86=105, x64=36, generic=102, arg2="typename Arch::itimerval")
577-
stat = EmulatedSyscall(x86=106, x64=4, arg2="struct Arch::stat")
578-
lstat = EmulatedSyscall(x86=107, x64=6, arg2="struct Arch::stat")
579-
fstat = EmulatedSyscall(x86=108, x64=5, generic=80, arg2="struct Arch::stat")
577+
stat = EmulatedSyscall(x86=106, x64=4, arg2="struct Arch::stat_t")
578+
lstat = EmulatedSyscall(x86=107, x64=6, arg2="struct Arch::stat_t")
579+
fstat = EmulatedSyscall(x86=108, x64=5, generic=80, arg2="struct Arch::stat_t")
580580
olduname = UnsupportedSyscall(x86=109)
581581
iopl = EmulatedSyscall(x86=110, x64=172)
582582
vhangup = UnsupportedSyscall(x86=111, x64=153, generic=58)
@@ -596,7 +596,7 @@ def __init__(self, **kwargs):
596596
#
597597
# sysinfo() provides a simple way of getting overall system
598598
# statistics.
599-
sysinfo = EmulatedSyscall(x86=116, x64=99, generic=179, arg1="struct Arch::sysinfo")
599+
sysinfo = EmulatedSyscall(x86=116, x64=99, generic=179, arg1="struct Arch::sysinfo_t")
600600
# int ipc(unsigned int call, int first, int second, int third, void *ptr, long
601601
#fifth);
602602
#
@@ -992,20 +992,20 @@ def __init__(self, **kwargs):
992992
# int stat(const char *path, struct stat *buf);
993993
#
994994
# stat() stats the file pointed to by path and fills in buf.
995-
stat64 = EmulatedSyscall(x86=195, arg2="struct Arch::stat64")
995+
stat64 = EmulatedSyscall(x86=195, arg2="struct Arch::stat64_t")
996996

997997
# int lstat(const char *path, struct stat *buf);
998998
#
999999
# lstat() is identical to stat(), except that if path is a symbolic
10001000
# link, then the link itself is stat-ed, not the file that it refers
10011001
# to.
1002-
lstat64 = EmulatedSyscall(x86=196, arg2="struct Arch::stat64")
1002+
lstat64 = EmulatedSyscall(x86=196, arg2="struct Arch::stat64_t")
10031003

10041004
# int fstat(int fd, struct stat *buf)
10051005
#
10061006
# fstat() is identical to stat(), except that the file to be stat-ed
10071007
# is specified by the file descriptor fd.
1008-
fstat64 = EmulatedSyscall(x86=197, arg2="struct Arch::stat64")
1008+
fstat64 = EmulatedSyscall(x86=197, arg2="struct Arch::stat64_t")
10091009

10101010
lchown32 = EmulatedSyscall(x86=198)
10111011

@@ -1342,8 +1342,8 @@ def __init__(self, **kwargs):
13421342
#
13431343
# FIXME: we use arg3() here, although according to man pages this system
13441344
# call has only 2 parameters. However, strace tells another story...
1345-
statfs64 = EmulatedSyscall(x86=268, arg3="struct Arch::statfs64")
1346-
fstatfs64 = EmulatedSyscall(x86=269, arg3="struct Arch::statfs64")
1345+
statfs64 = EmulatedSyscall(x86=268, arg3="struct Arch::statfs64_t")
1346+
fstatfs64 = EmulatedSyscall(x86=269, arg3="struct Arch::statfs64_t")
13471347

13481348
# int tgkill(int tgid, int tid, int sig)
13491349
#
@@ -1443,8 +1443,8 @@ def __init__(self, **kwargs):
14431443
# The fstatat() system call operates in exactly the same way as
14441444
# stat(2), except for the differences described in this manual
14451445
# page....
1446-
fstatat = EmulatedSyscall(x64=262, generic=79, arg3="struct Arch::stat")
1447-
fstatat64 = EmulatedSyscall(x86=300, arg3="struct Arch::stat64")
1446+
fstatat = EmulatedSyscall(x64=262, generic=79, arg3="struct Arch::stat_t")
1447+
fstatat64 = EmulatedSyscall(x86=300, arg3="struct Arch::stat64_t")
14481448

14491449
# int unlinkat(int dirfd, const char *pathname, int flags)
14501450
#

0 commit comments

Comments
 (0)