depends =
package = platform.posix
headers = alloca.h assert.h complex.h ctype.h dirent.h dlfcn.h err.h errno.h fcntl.h \
    fenv.h float.h fnmatch.h fts.h ftw.h getopt.h grp.h inttypes.h libgen.h limits.h \
    locale.h math.h memory.h netdb.h paths.h poll.h ptrauth.h \
    pthread.h pwd.h regex.h resolv.h sched.h search.h semaphore.h setjmp.h signal.h \
    stdatomic.h stdint.h stdio.h stdlib.h string.h strings.h syslog.h termios.h \
    time.h ucontext.h unistd.h utime.h wchar.h wctype.h xlocale.h \
    net/ethernet.h net/if.h \
    netinet/icmp6.h netinet/in.h netinet/in_systm.h \
    netinet/ip.h netinet/ip6.h netinet/ip_icmp.h netinet/tcp.h netinet/udp.h \
    sys/acl.h sys/ioctl.h sys/ipc.h sys/mman.h sys/poll.h \
    sys/queue.h sys/select.h sys/shm.h sys/stat.h \
    sys/syslimits.h sys/time.h sys/times.h sys/utsname.h sys/wait.h

compilerOpts = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D__CCT_ENABLE_USER_SPACE
linkerOpts = -ldl -lresolv
excludedFunctions = acl_valid_link_np add_profil pfctlinput profil unwhiteout zopen getdirentries \
                    uuid_generate_early_random setgrfile \
                    in6addr_linklocal_allv2routers
excludedFunctions.ios_arm64 = longjmperror
excludedFunctions.ios_simulator_arm64 = longjmperror \
    openat_dprotected_np mkfifoat mknodat openat_authenticated_np
excludedFunctions.ios_x64 = openat_dprotected_np mkfifoat mknodat openat_authenticated_np

---
// Wrapper to access errno variable.
static int posix_errno() {
    return errno;
}

static void set_posix_errno(int value) {
        errno = value;
}

// Wrapper to access h_errno variable.
static int posix_h_errno() {
    return h_errno;
}

static void set_posix_h_errno(int value) {
        h_errno = value;
}

static int init_sockets() {
        return 0;
}

static void deinit_sockets() {
}
