2022-04-07 07:15:35 +00:00
|
|
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
|
|
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
|
|
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
2022-04-13 05:11:00 +00:00
|
|
|
│ Copyright 2022 Justine Alexandra Roberts Tunney │
|
2022-04-07 07:15:35 +00:00
|
|
|
│ │
|
|
|
|
│ Permission to use, copy, modify, and/or distribute this software for │
|
|
|
|
│ any purpose with or without fee is hereby granted, provided that the │
|
|
|
|
│ above copyright notice and this permission notice appear in all copies. │
|
|
|
|
│ │
|
|
|
|
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
|
|
|
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
|
|
|
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
|
|
|
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
|
|
|
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
|
|
|
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
|
|
|
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
|
|
|
│ PERFORMANCE OF THIS SOFTWARE. │
|
|
|
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
2022-04-13 05:11:00 +00:00
|
|
|
#include "libc/intrin/describeflags.internal.h"
|
|
|
|
#include "libc/macros.internal.h"
|
|
|
|
#include "libc/nt/enum/consolemodeflags.h"
|
|
|
|
#include "libc/sysv/consts/map.h"
|
2022-04-07 07:15:35 +00:00
|
|
|
#include "libc/sysv/consts/prot.h"
|
|
|
|
|
2023-05-09 08:56:56 +00:00
|
|
|
const char *(DescribeMapFlags)(char buf[64], int x) {
|
2022-04-13 05:11:00 +00:00
|
|
|
const struct DescribeFlags kMapFlags[] = {
|
2022-05-12 13:43:59 +00:00
|
|
|
{MAP_STACK, "STACK"}, // order matters
|
2022-04-13 05:11:00 +00:00
|
|
|
{MAP_PRIVATE, "PRIVATE"}, //
|
2022-05-18 23:41:29 +00:00
|
|
|
{MAP_ANONYMOUS, "ANONYMOUS"}, //
|
2022-04-13 05:11:00 +00:00
|
|
|
{MAP_SHARED, "SHARED"}, //
|
|
|
|
{MAP_FIXED, "FIXED"}, //
|
|
|
|
{MAP_FIXED_NOREPLACE, "FIXED_NOREPLACE"}, //
|
|
|
|
{MAP_CONCEAL, "CONCEAL"}, //
|
|
|
|
{MAP_LOCKED, "LOCKED"}, //
|
|
|
|
{MAP_NORESERVE, "NORESERVE"}, //
|
|
|
|
{MAP_NONBLOCK, "NONBLOCK"}, //
|
|
|
|
{MAP_POPULATE, "POPULATE"}, //
|
|
|
|
};
|
2022-06-26 01:17:31 +00:00
|
|
|
return DescribeFlags(buf, 64, kMapFlags, ARRAYLEN(kMapFlags), "MAP_", x);
|
2022-04-07 07:15:35 +00:00
|
|
|
}
|