Commit Graph

12 Commits

Author SHA1 Message Date
Rich Felker 3c02bacf0f allow archs to define IPC_STAT, propagate time64 bit to other macros
to make use of {sem,shm,msg}ctl IPC_STAT functionality to provide
64-bit time_t on 32-bit archs, IPC_STAT and related macros must be
defined with bit 8 (0x100) set. allow archs to define IPC_STAT in
bits/ipc.h, and define the other macros in terms of it so that they
all get the same value of the time64 bit.
2019-08-02 00:08:23 -04:00
Szabolcs Nagy db8b53f207 sys/mman.h: add new hugetlb mmap flags from linux v4.19
aarch64 supports 32MB and 512MB hugetlb page sizes too.
added in linux commit 20916d4636a9b3c1bf562b305f91d126771edaf9
2019-03-13 12:32:14 -04:00
Szabolcs Nagy af55070eae add {MSG,SEM,SHM}_STAT_ANY from linux v4.17
introduced to stat ipc objects without permission checks since the
info is available in /proc/sysvipc anyway, new in linux commits
23c8cec8cf679b10997a512abb1e86f0cedc42ba
a280d6dc77eb6002f269d58cd47c7c7e69b617b6
c21a6970ae727839a2f300cd8dd957de0d0238c3
2018-06-19 13:26:24 -04:00
Szabolcs Nagy abdaba8616 sys/{mman,shm}.h: add {MAP,SHM}_HUGE_ macros from linux uapi
*_HUGE_SHIFT, *_HUGE_2MB, *_HUGE_1GB are documented in the man page,
so add all of the *_HUGE_* macros from linux uapi.

if MAP_HUGETLB is set, top bits of the mmap flags encode the page size.
see the linux commit aafd4562dfee81a40ba21b5ea3cf5e06664bc7f6

if SHM_HUGETLB is set, top bits of the shmget flags encode the page size.
see the linux commit 4da243ac1cf6aeb30b7c555d56208982d66d6d33

*_HUGE_16GB is defined unsigned to avoid signed left shift ub.
2018-02-22 18:48:12 -05:00
rofl0r 0f169cbb79 sys/shm.h: move arch specific structs to bits/ 2014-02-23 11:07:18 +01:00
Rich Felker 513136efa4 fix namespace violation in sys/shm.h
in fixing this, I've changed the logic from ugly #if/#else blocks
inside the struct shm_info definition to a fixed struct definition and
optional macros to rename the elements. this will be helpful if we
need to move shm_info to a bits header in the future, as it will keep
the feature test logic out of bits.
2014-01-08 19:39:18 -05:00
Rich Felker 553d566c3f add missing type shmatt_t in sys/shm.h
this type is not really intended to be used; it's just there to allow
implementations to choose the type for the shm_nattch member of
struct shmid_sh, presumably since historical implementations disagreed
on the type. in any case, it needs to be there, so now it is.
2013-06-28 23:39:50 -04:00
Rich Felker 9cb589939c add some missing macros to sys/shm.h
these are not specified in the standard, but in the reserved
namespace, so there is no problem with defining them unconditionally.
2012-12-15 00:43:27 -05:00
Rich Felker c1a9658bd1 default features: make musl usable without feature test macros
the old behavior of exposing nothing except plain ISO C can be
obtained by defining __STRICT_ANSI__ or using a compiler option (such
as -std=c99) that predefines it. the new default featureset is POSIX
with XSI plus _BSD_SOURCE. any explicit feature test macros will
inhibit the default.

installation docs have also been updated to reflect this change.
2012-09-07 23:13:55 -04:00
Rich Felker 3ed8c9f2df fix all missing instances of __cplusplus checks/extern "C" in headers
patch by Arvid Picciani (aep)
2011-11-10 20:40:06 -05:00
Rich Felker 07e865cc5a numerous fixes to sysv ipc
some of these definitions were just plain wrong, others based on
outdated ancient "non-64" versions of the kernel interface.

as much as possible has now been moved out of bits/*

these changes break abi (the old abi for these functions was wrong),
but since they were not working anyway it can hardly matter.
2011-04-13 16:45:43 -04:00
Rich Felker 0b44a0315b initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00