Commit Graph

11 Commits

Author SHA1 Message Date
Rich Felker c71dbb24c9 move time64 socket options from arch bits to top-level sys/socket.h
now that all 32-bit archs have 64-bit time types, the values for the
time-related socket option macros can be treated as universal for
32-bit archs. the sys/socket.h mechanism for this predates
arch/generic and is instead in the top-level header.

x32, which does not use the new time64 values of the macros, already
has its own overrides, so this commit does not affect it.
2019-11-02 18:30:56 -04:00
Rich Felker 3814333964 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.
2019-11-02 18:30:56 -04:00
Rich Felker a0252bc75b move msghdr and cmsghdr out of bits/socket.h
these structures can now be defined generically in terms of endianness
and long size. previously, the 32-bit archs all shared a common
definition from the generic bits header, and each 64-bit arch had to
repeat the 64-bit version, with endian conditionals if the arch had
variants of each endianness.

I would prefer getting rid of the preprocessor conditionals for
padding and instead using unnamed bitfield members, like commit
9b2921bea1 did for struct timespec.
however, at present sendmsg, recvmsg, and recvmmsg need access to the
padding members by name to zero them. this could perhaps be cleaned up
in the future.
2019-11-02 18:30:56 -04:00
Rich Felker efda534b21 fix regression in powerpc[64] SO_PEERSEC definition
commit 587f5a53bc moved the definition
of SO_PEERSEC to bits/socket.h for archs where the SO_* macros differ
from their standard values, but failed to add copies of the generic
definition for powerpc and powerpc64.
2018-06-26 16:30:58 -04:00
Rich Felker befa5866ee make brace placement in public header struct definitions consistent
placing the opening brace on the same line as the struct keyword/tag
is the style I prefer and seems to be the prevailing practice in more
recent additions.

these changes were generated by the command:

find include/ arch/*/bits -name '*.h' \
-exec sed -i '/^struct [^;{]*$/{N;s/\n/ /;}' {} +

and subsequently checked by hand to ensure that the regex did not pick
up any false positives.
2016-07-03 15:02:25 -04:00
Roman Yeryomin 3975577922 socket.h: cleanup/reorder mips and powerpc bits/socket.h
....to be somewhat consistent and easily comparable with asm/socket.h

Signed-off-by: Roman Yeryomin <roman@ubnt.com>
2015-07-21 19:14:58 -04:00
Roman Yeryomin 29ec7677a7 socket.h: fix SO_* for mips
Signed-off-by: Roman Yeryomin <roman@ubnt.com>
2015-07-21 19:14:26 -04:00
Rich Felker 514c2dd24f fix socket.h struct msghdr member types on powerpc
these were incorrectly copied from the kernel, whose ABI matches the
POSIX requirements but with the wrong underlying types and wrong
signedness.
2014-03-11 17:21:38 -04:00
Szabolcs Nagy ca2300d9ac add the new SO_REUSEPORT socket option to mips and powerpc
SO_REUSEPORT implementation was merged in the linux kernel commit
c617f398edd4db2b8567a28e899a88f8f574798d 2013-01-23
2013-04-01 17:54:39 +00:00
rofl0r ae67fe1aad ppc socket.h: add forgotten cmsghdr 2012-11-18 02:42:55 +01:00
rofl0r 1c8eb8bad7 PPC port cleaned up, static linking works well now. 2012-11-13 19:12:25 +01:00