summaryrefslogtreecommitdiff
path: root/arch/i386
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-08-02 15:41:27 -0400
committerRich Felker <dalias@aerifal.cx>2019-11-02 18:30:56 -0400
commit38143339646a4ccce8afe298c34467767c899f51 (patch)
treea5eb879534856a4c13a7c7dfbb69f91713a08140 /arch/i386
parent5127927f4ba449aff16f6a6db0224a24490ff5b9 (diff)
downloadmusl-38143339646a4ccce8afe298c34467767c899f51.tar.gz
musl-38143339646a4ccce8afe298c34467767c899f51.tar.bz2
musl-38143339646a4ccce8afe298c34467767c899f51.tar.xz
musl-38143339646a4ccce8afe298c34467767c899f51.zip
switch all existing 32-bit archs to 64-bit time_t
this commit preserves ABI fully for existing interface boundaries between libc and libc consumers (applications or libraries), by retaining existing symbol names for the legacy 32-bit interfaces and redirecting sources compiled against the new headers to alternate symbol names. this does not necessarily, however, preserve the pairwise ABI of libc consumers with one another; where they use time_t-derived types in their interfaces with one another, it may be necessary to synchronize updates with each other. the intent is that ABI resulting from this commit already be stable and permanent, but it will not be officially so until a release is made. changes to some header-defined types that do not play any role in the ABI between libc and its consumers may still be subject to change. mechanically, the changes made by this commit for each 32-bit arch are as follows: - _REDIR_TIME64 is defined to activate the symbol redirections in public headers - COMPAT_SRC_DIRS is defined in arch.mak to activate build of ABI compat shims to serve as definitions for the original symbol names - time_t and suseconds_t definitions are changed to long long (64-bit) - IPC_STAT definition is changed to add the IPC_TIME64 bit (0x100), triggering conversion of semid_ds, shmid_ds, and msqid_ds split low/high time bits into new time_t members - structs semid_ds, shmid_ds, msqid_ds, and stat are modified to add new 64-bit time_t/timespec members at the end, maintaining existing layout of other members. - socket options (SO_*) and ioctl (sockios) command macros are redefined to use the kernel's "_NEW" values. in addition, on archs where vdso clock_gettime is used, the VDSO_CGT_SYM macro definition in syscall_arch.h is changed to use a new time64 vdso function if available, and a new VDSO_CGT32_SYM macro is added for use as fallback on kernels lacking time64.
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/arch.mak1
-rw-r--r--arch/i386/bits/alltypes.h.in5
-rw-r--r--arch/i386/bits/ioctl_fix.h4
-rw-r--r--arch/i386/bits/ipcstat.h2
-rw-r--r--arch/i386/bits/msg.h15
-rw-r--r--arch/i386/bits/sem.h10
-rw-r--r--arch/i386/bits/shm.h16
-rw-r--r--arch/i386/bits/socket.h5
-rw-r--r--arch/i386/bits/stat.h6
-rw-r--r--arch/i386/syscall_arch.h4
10 files changed, 47 insertions, 21 deletions
diff --git a/arch/i386/arch.mak b/arch/i386/arch.mak
new file mode 100644
index 00000000..aa4d05ce
--- /dev/null
+++ b/arch/i386/arch.mak
@@ -0,0 +1 @@
+COMPAT_SRC_DIRS = compat/time32
diff --git a/arch/i386/bits/alltypes.h.in b/arch/i386/bits/alltypes.h.in
index f033f376..74e599a2 100644
--- a/arch/i386/bits/alltypes.h.in
+++ b/arch/i386/bits/alltypes.h.in
@@ -1,3 +1,4 @@
+#define _REDIR_TIME64 1
#define _Addr int
#define _Int64 long long
#define _Reg int
@@ -29,5 +30,5 @@ TYPEDEF struct { __attribute__((__aligned__(8))) long long __ll; long double __l
TYPEDEF struct { alignas(8) long long __ll; long double __ld; } max_align_t;
#endif
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
+TYPEDEF long long time_t;
+TYPEDEF long long suseconds_t;
diff --git a/arch/i386/bits/ioctl_fix.h b/arch/i386/bits/ioctl_fix.h
new file mode 100644
index 00000000..29c9d8ba
--- /dev/null
+++ b/arch/i386/bits/ioctl_fix.h
@@ -0,0 +1,4 @@
+#undef SIOCGSTAMP
+#undef SIOCGSTAMPNS
+#define SIOCGSTAMP _IOR(0x89, 6, char[16])
+#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
diff --git a/arch/i386/bits/ipcstat.h b/arch/i386/bits/ipcstat.h
index 0018ad1e..4f4fcb0c 100644
--- a/arch/i386/bits/ipcstat.h
+++ b/arch/i386/bits/ipcstat.h
@@ -1 +1 @@
-#define IPC_STAT 2
+#define IPC_STAT 0x102
diff --git a/arch/i386/bits/msg.h b/arch/i386/bits/msg.h
index bc8436c4..7bbbb2bf 100644
--- a/arch/i386/bits/msg.h
+++ b/arch/i386/bits/msg.h
@@ -1,15 +1,18 @@
struct msqid_ds {
struct ipc_perm msg_perm;
- time_t msg_stime;
- int __unused1;
- time_t msg_rtime;
- int __unused2;
- time_t msg_ctime;
- int __unused3;
+ unsigned long __msg_stime_lo;
+ unsigned long __msg_stime_hi;
+ unsigned long __msg_rtime_lo;
+ unsigned long __msg_rtime_hi;
+ unsigned long __msg_ctime_lo;
+ unsigned long __msg_ctime_hi;
unsigned long msg_cbytes;
msgqnum_t msg_qnum;
msglen_t msg_qbytes;
pid_t msg_lspid;
pid_t msg_lrpid;
unsigned long __unused[2];
+ time_t msg_stime;
+ time_t msg_rtime;
+ time_t msg_ctime;
};
diff --git a/arch/i386/bits/sem.h b/arch/i386/bits/sem.h
index e61571c1..65661542 100644
--- a/arch/i386/bits/sem.h
+++ b/arch/i386/bits/sem.h
@@ -1,11 +1,13 @@
struct semid_ds {
struct ipc_perm sem_perm;
- time_t sem_otime;
- long __unused1;
- time_t sem_ctime;
- long __unused2;
+ unsigned long __sem_otime_lo;
+ unsigned long __sem_otime_hi;
+ unsigned long __sem_ctime_lo;
+ unsigned long __sem_ctime_hi;
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
long __unused3;
long __unused4;
+ time_t sem_otime;
+ time_t sem_ctime;
};
diff --git a/arch/i386/bits/shm.h b/arch/i386/bits/shm.h
index 81b2a29a..725fb469 100644
--- a/arch/i386/bits/shm.h
+++ b/arch/i386/bits/shm.h
@@ -3,17 +3,21 @@
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
- time_t shm_atime;
- int __unused1;
- time_t shm_dtime;
- int __unused2;
- time_t shm_ctime;
- int __unused3;
+ unsigned long __shm_atime_lo;
+ unsigned long __shm_atime_hi;
+ unsigned long __shm_dtime_lo;
+ unsigned long __shm_dtime_hi;
+ unsigned long __shm_ctime_lo;
+ unsigned long __shm_ctime_hi;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
+ unsigned long __pad3;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
};
struct shminfo {
diff --git a/arch/i386/bits/socket.h b/arch/i386/bits/socket.h
new file mode 100644
index 00000000..4d1f645b
--- /dev/null
+++ b/arch/i386/bits/socket.h
@@ -0,0 +1,5 @@
+#define SO_TIMESTAMP 63
+#define SO_TIMESTAMPNS 64
+#define SO_TIMESTAMPING 65
+#define SO_RCVTIMEO 66
+#define SO_SNDTIMEO 67
diff --git a/arch/i386/bits/stat.h b/arch/i386/bits/stat.h
index 22b19bbf..5d7828cf 100644
--- a/arch/i386/bits/stat.h
+++ b/arch/i386/bits/stat.h
@@ -14,8 +14,12 @@ struct stat {
off_t st_size;
blksize_t st_blksize;
blkcnt_t st_blocks;
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } __st_atim32, __st_mtim32, __st_ctim32;
+ ino_t st_ino;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
- ino_t st_ino;
};
diff --git a/arch/i386/syscall_arch.h b/arch/i386/syscall_arch.h
index 22b0b28b..69642e57 100644
--- a/arch/i386/syscall_arch.h
+++ b/arch/i386/syscall_arch.h
@@ -83,7 +83,9 @@ static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a
}
#define VDSO_USEFUL
-#define VDSO_CGT_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_SYM "__vdso_clock_gettime"
+#define VDSO_CGT32_VER "LINUX_2.6"
+#define VDSO_CGT_SYM "__vdso_clock_gettime64"
#define VDSO_CGT_VER "LINUX_2.6"
#define SYSCALL_USE_SOCKETCALL