basic/include: trivial cleanups for libc header wrapper (#37937)
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
|
||||
#include_next <malloc.h>
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
#if !HAVE_MALLINFO2
|
||||
struct mallinfo2 {
|
||||
size_t arena; /* non-mmapped space allocated from system */
|
||||
@@ -20,9 +18,10 @@ struct mallinfo2 {
|
||||
};
|
||||
|
||||
static inline struct mallinfo2 mallinfo2(void) {
|
||||
DISABLE_WARNING_DEPRECATED_DECLARATIONS
|
||||
_Pragma("GCC diagnostic push");
|
||||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"");
|
||||
struct mallinfo m = mallinfo();
|
||||
REENABLE_WARNING
|
||||
_Pragma("GCC diagnostic pop");
|
||||
|
||||
return (struct mallinfo2) {
|
||||
.arena = m.arena,
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
#include "missing_fcntl.h"
|
||||
#include "missing_syscall_def.h"
|
||||
|
||||
/* Since glibc-2.37 (774058d72942249f71d74e7f2b639f77184160a6), sys/mount.h includes linux/mount.h, and
|
||||
* we can safely include both headers in the same source file. However, we cannot do that with older glibc.
|
||||
* To avoid conflicts, let's not use glibc's sys/mount.h, and provide our own minimal implementation.
|
||||
* Fortunately, most of definitions we need are covered by linux/fs.h and linux/mount.h, so only one enum
|
||||
* and a few function prototypes need to be defined here. */
|
||||
|
||||
/* Possible value for FLAGS parameter of `umount2'. */
|
||||
enum
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user