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.
This commit is contained in:
parent
a1527a0c3e
commit
513136efa4
1 changed files with 8 additions and 6 deletions
|
|
@ -37,14 +37,16 @@ struct shminfo {
|
||||||
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
|
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct shm_info {
|
|
||||||
int used_ids;
|
|
||||||
unsigned long shm_tot, shm_rss, shm_swp;
|
|
||||||
#ifdef _GNU_SOURCE
|
#ifdef _GNU_SOURCE
|
||||||
unsigned long swap_attempts, swap_successes;
|
#define __used_ids used_ids
|
||||||
#else
|
#define __swap_attempts swap_attempts
|
||||||
unsigned long __reserved[2];
|
#define __swap_successes swap_successes
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct shm_info {
|
||||||
|
int __used_ids;
|
||||||
|
unsigned long shm_tot, shm_rss, shm_swp;
|
||||||
|
unsigned long __swap_attempts, __swap_successes;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef unsigned long shmatt_t;
|
typedef unsigned long shmatt_t;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue