* Add a `getpagesize` function.
This adds a `getpagesize` function. This interface is deprecated in POSIX,
but it's sufficiently widely used and not problematic in practice.
* Use musl's `getpagesize`.
* Enable the `getpagesize` declaration in unistd.h.
env/unsetenv.c \
unistd/posix_close.c \
stat/futimesat.c \
+ legacy/getpagesize.c \
) \
$(filter-out %/procfdname.c %/syscall.c %/syscall_ret.c %/vdso.c %/version.c, \
$(wildcard $(LIBC_TOP_HALF_MUSL_SRC_DIR)/internal/*.c)) \
getopt
getopt_long
getopt_long_only
+getpagesize
getpid
getrusage
getsockopt
* The page size in WebAssembly is fixed at 64 KiB. If this ever changes,
* it's expected that applications will need to opt in, so we can change
* this.
+ *
+ * If this ever needs to be a value outside the range of an `int`, the
+ * `getpagesize` function which returns this value will need special
+ * consideration. POSIX has deprecated `getpagesize` in favor of
+ * `sysconf(_SC_PAGESIZE)` which does not have this problem.
*/
#define PAGESIZE (0x10000)
pid_t vfork(void);
int vhangup(void);
int chroot(const char *);
+#endif
int getpagesize(void);
+#ifdef __wasilibc_unmodified_upstream /* WASI has no processes */
int getdtablesize(void);
int sethostname(const char *, size_t);
int getdomainname(char *, size_t);