Darling build of system_cmds-854.40.2

This commit is contained in:
Ariel Abreu 2020-08-20 16:14:41 -04:00
parent c04e2cca25
commit 2b596f811b
No known key found for this signature in database
GPG Key ID: ECF8C2B9E8AD3E6B
64 changed files with 2569 additions and 239 deletions

View File

@ -1,247 +1,70 @@
project(system_cmds) project(system_cmds)
add_compile_definitions(
PRIVATE
)
add_compile_options( add_compile_options(
-nostdinc -nostdinc
-fPIC -fPIC
-fblocks -fblocks
) )
add_darling_executable(ac ac.tproj/ac.c) add_subdirectory(ac.tproj)
add_darling_executable(accton accton.tproj/accton.c) add_subdirectory(accton.tproj)
add_darling_executable(arch arch.tproj/arch.c) add_subdirectory(arch.tproj)
target_link_libraries(arch CoreFoundation) add_subdirectory(at.tproj)
add_darling_executable(at add_subdirectory(atrun.tproj)
at.tproj/at.c #add_subdirectory(chkpasswd.tproj) # missing `rpcsvc/yppasswd.h`
at.tproj/panic.c add_subdirectory(chpass.tproj) # compiles, but it's broken because OpenDirectory is just a stub
at.tproj/parsetime.c add_subdirectory(cpuctl.tproj)
at.tproj/perm.c add_subdirectory(dmesg.tproj)
) add_subdirectory(dynamic_pager.tproj)
target_compile_definitions(at PRIVATE #add_subdirectory(fs_usage.tproj) # missing ktrace stuff
-DDAEMON_UID=1 add_subdirectory(gcore.tproj)
-DDAEMON_GID=1 add_subdirectory(getconf.tproj)
-DDEFAULT_AT_QUEUE='a' add_subdirectory(getty.tproj)
-DDEFAULT_BATCH_QUEUE='b' add_subdirectory(hostinfo.tproj)
-DPERM_PATH="/usr/lib/cron" add_subdirectory(iosim.tproj)
) add_subdirectory(iostat.tproj)
add_darling_executable(atrun atrun.tproj/atrun.c) add_subdirectory(kpgo.tproj)
target_include_directories(atrun PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/at.tproj) add_subdirectory(latency.tproj)
target_compile_definitions(atrun PRIVATE add_subdirectory(login.tproj)
-DDAEMON_UID=1 # missing EVFILT_NW_CHANNEL definition
-DDAEMON_GID=1 # it *is* defined in the new libdispatch sources, and it seems like it *should* be defined in sys/event.h,
) # but it's not (yes, even after updating kernel sources). for now, just don't build this.
# it's just a developer utility anyways
# Disable until we have remote_cmds (rpc_yppasswd) #add_subdirectory(lskq.tproj)
#add_darling_executable(chkpasswd add_subdirectory(lsmp.tproj)
# chkpasswd.tproj/file_passwd.c add_subdirectory(ltop.tproj)
# chkpasswd.tproj/nis_passwd.c # rpcsvc/yp_prot.h add_subdirectory(mean.tproj)
# chkpasswd.tproj/od_passwd.c add_subdirectory(memory_pressure.tproj)
# chkpasswd.tproj/pam_passwd.c add_subdirectory(mkfile.tproj)
# chkpasswd.tproj/passwd.c add_subdirectory(mslutil)
# chkpasswd.tproj/stringops.c add_subdirectory(newgrp.tproj)
#) add_subdirectory(nologin.tproj)
#target_link_libraries(chkpasswd pam.2) add_subdirectory(nvram.tproj)
#add_darling_executable(chpass _PWSCAN_WARN add_subdirectory(pagesize.tproj)
# chpass.tproj/chpass.c #add_subdirectory(passwd.tproj) # missing `rpcsvc/yppasswd.h`
# chpass.tproj/edit.c add_subdirectory(proc_uuid_policy.tproj)
# chpass.tproj/field.c add_subdirectory(purge.tproj)
# chpass.tproj/open_directory.c add_subdirectory(pwd_mkdb.tproj)
# chpass.tproj/pw_copy.c add_subdirectory(reboot.tproj)
# chpass.tproj/table.c add_subdirectory(sa.tproj)
# chpass.tproj/util.c add_subdirectory(sc_usage.tproj)
#) add_subdirectory(shutdown.tproj)
#target_include_directories(chpass PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/pwd_mkdb.tproj) add_subdirectory(stackshot.tproj)
add_darling_executable(dmesg dmesg.tproj/dmesg.c) add_subdirectory(sync.tproj)
add_darling_executable(dynamic_pager dynamic_pager.tproj/dynamic_pager.c) add_subdirectory(sysctl.tproj)
#add_darling_executable(fs_usage fs_usage.tproj/fs_usage.c) add_subdirectory(taskpolicy.tproj)
#target_compile_options(fs_usage PRIVATE -include dispatch/dispatch.h) add_subdirectory(trace.tproj)
#target_link_libraries(fs_usage util) # FIXME: Also needs ktrace add_subdirectory(vifs.tproj)
#add_darling_executable(gcore compression.h add_subdirectory(vipw.tproj)
# gcore.tproj/corefile.c add_subdirectory(vm_purgeable_stat.tproj)
# gcore.tproj/dyld.c add_subdirectory(vm_stat.tproj)
# gcore.tproj/dyld_shared_cache.c add_subdirectory(wait4path)
# gcore.tproj/main.c add_subdirectory(wordexp-helper.tproj)
# gcore.tproj/sparse.c add_subdirectory(zdump.tproj)
# gcore.tproj/threads.c add_subdirectory(zic.tproj)
# gcore.tproj/utils.c add_subdirectory(zlog.tproj)
# gcore.tproj/vanilla.c add_subdirectory(zprint.tproj)
# gcore.tproj/vm.c
#)
add_darling_executable(getconf getconf.tproj/confstr.c getconf.tproj/getconf.c getconf.tproj/limits.c getconf.tproj/pathconf.c getconf.tproj/progenv.c getconf.tproj/sysconf.c)
add_darling_executable(getty
getty.tproj/chat.c
getty.tproj/init.c
getty.tproj/main.c
getty.tproj/subr.c
)
add_darling_executable(hostinfo hostinfo.tproj/hostinfo.c)
#add_darling_executable(iostat iostat.tproj/iostat.c) # Needs IOKit
#target_compile_options(iostat PRIVATE -include errno.h)
#add_darling_executable(latency latency.tproj/latency.c) ktrace
#target_link_libraries(latency ncurses util)
add_darling_executable(login-exe
login.tproj/login.c
login.tproj/login_audit.c
)
set_target_properties(login-exe PROPERTIES OUTPUT_NAME "login")
target_link_libraries(login-exe pam.2 bsm.0)
target_compile_definitions(login-exe PRIVATE USE_PAM USE_BSM_AUDIT)
#add_darling_executable(lskq lskq.tproj/lskq.c) error: incomplete definition of type 'struct kevent_extinfo'
add_darling_executable(lsmp
lsmp.tproj/lsmp.c
lsmp.tproj/port_details.c
lsmp.tproj/task_details.c)
#add_darling_executable(memory_pressure memory_pressure.tproj/memory_pressure.c) libdispatch
add_darling_executable(mkfile mkfile.tproj/mkfile.c)
add_darling_executable(newgrp newgrp.tproj/newgrp.c)
add_darling_executable(nologin nologin.tproj/nologin.c)
#add_darling_executable(nvram nvram.tproj/nvram.c)
#target_compile_options(nvram PRIVATE -include errno.h)
#target_link_libraries(nvram CoreFoundation)
#add_darling_executable(passwd # Disabled until we have remote_cmds (yppasswd)
# passwd.tproj/file_passwd.c
# passwd.tproj/nis_passwd.c rpcsvc/yp_prot.h
# passwd.tproj/od_passwd.c open directory problems
# passwd.tproj/pam_passwd.c
# passwd.tproj/passwd.c
#)
#target_link_libraries(passwd pam.2)
add_darling_executable(purge purge.tproj/purge.c)
add_darling_executable(pwd_mkdb
pwd_mkdb.tproj/pw_scan.c
pwd_mkdb.tproj/pwd_mkdb.c
)
target_compile_definitions(pwd_mkdb PRIVATE _PW_NAME_LEN=MAXLOGNAME _PW_YPTOKEN="__YP!")
add_darling_executable(reboot reboot.tproj/reboot.c)
add_darling_executable(sa
sa.tproj/db.c
sa.tproj/main.c
sa.tproj/pdb.c
sa.tproj/usrdb.c
)
target_compile_definitions(sa PRIVATE AHZV1=64)
#add_darling_executable(sc_usage sc_usage.tproj/sc_usage.c) kernel debug
#add_darling_executable(shutdown shutdown.tproj/shutdown.c) IOKit, libbsm
add_darling_executable(sync sync.tproj/sync.c)
add_darling_executable(sysctl sysctl.tproj/sysctl.c)
#add_darling_executable(taskpolicy taskpolicy.tproj/taskpolicy.c) POSIX_SPAWN_PROC_CLAMP_NONE
#add_darling_executable(trace trace.tproj/trace.c)
#target_link_libraries(trace util)
add_darling_executable(vifs vifs.tproj/vifs.c)
add_darling_executable(vipw
vipw.tproj/pw_util.c
vipw.tproj/vipw.c
)
add_darling_executable(vm_stat vm_stat.tproj/vm_stat.c)
add_darling_executable(wait4path wait4path/wait4path.c)
add_darling_executable(zdump zdump.tproj/zdump.c)
add_darling_executable(zic
zic.tproj/ialloc.c
zic.tproj/scheck.c
zic.tproj/zic.c
)
#add_darling_executable(zprint zprint.tproj/zprint.c) IOKit
install(TARGETS wait4path sync DESTINATION libexec/darling/bin)
install(TARGETS at arch vm_stat getconf lsmp hostinfo login-exe DESTINATION libexec/darling/usr/bin)
install(TARGETS zic ac vipw vifs sysctl zdump pwd_mkdb mkfile accton sa purge sysctl
DESTINATION libexec/darling/usr/sbin)
install(TARGETS nologin reboot dynamic_pager dmesg DESTINATION libexec/darling/sbin)
install(TARGETS getty atrun DESTINATION libexec/darling/usr/libexec
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
)
install(FILES pagesize.tproj/pagesize.sh DESTINATION libexec/darling/usr/bin
RENAME pagesize
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
)
InstallSymlink(arch ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/machine)
InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/atq)
InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/atrm)
InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/batch)
InstallSymlink(chpass ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/chfn)
InstallSymlink(chpass ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/chsh)
InstallSymlink(reboot ${CMAKE_INSTALL_PREFIX}/libexec/darling/sbin/halt)
#install(FILES chkpasswd.tproj/chkpasswd.pam DESTINATION libexec/darling/etc/pam.d RENAME chkpasswd)
install(FILES passwd.tproj/passwd.pam DESTINATION libexec/darling/etc/pam.d RENAME passwd)
install(DIRECTORY login.tproj/pam.d DESTINATION libexec/darling/etc)
install(FILES atrun.tproj/com.apple.atrun.plist DESTINATION libexec/darling/System/Library/LaunchDaemons)
install(FILES
arch.tproj/arch.1
arch.tproj/machine.1
at.tproj/at.1
chpass.tproj/chpass.1
fs_usage.tproj/fs_usage.1
gcore.tproj/gcore.1
getconf.tproj/getconf.1
latency.tproj/latency.1
login.tproj/login.1
lskq.tproj/lskq.1
lsmp.tproj/lsmp.1
memory_pressure.tproj/memory_pressure.1
newgrp.tproj/newgrp.1
pagesize.tproj/pagesize.1
passwd.tproj/passwd.1
sc_usage.tproj/sc_usage.1
trace.tproj/trace.1
vm_stat.tproj/vm_stat.1
wait4path/wait4path.1
zprint.tproj/zprint.1
DESTINATION libexec/darling/usr/share/man/man1
)
InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/atq.1)
InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/atrm.1)
InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/batch.1)
InstallSymlink(chpass.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/chfn.1)
InstallSymlink(chpass.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/chsh.1)
install(FILES
getty.tproj/gettytab.5
getty.tproj/ttys.5
nologin.tproj/nologin.5
sysctl.tproj/sysctl.conf.5
DESTINATION libexec/darling/usr/share/man/man5
)
install(FILES
ac.tproj/ac.8
accton.tproj/accton.8
atrun.tproj/atrun.8
chkpasswd.tproj/chkpasswd.8
dmesg.tproj/dmesg.8
dynamic_pager.tproj/dynamic_pager.8
getty.tproj/getty.8
hostinfo.tproj/hostinfo.8
iostat.tproj/iostat.8
mkfile.tproj/mkfile.8
nologin.tproj/nologin.8
nvram.tproj/nvram.8
purge.tproj/purge.8
pwd_mkdb.tproj/pwd_mkdb.8
reboot.tproj/reboot.8
sa.tproj/sa.8
shutdown.tproj/shutdown.8
sync.tproj/sync.8
sysctl.tproj/sysctl.8
taskpolicy.tproj/taskpolicy.8
vifs.tproj/vifs.8
vipw.tproj/vipw.8
zdump.tproj/zdump.8
zic.tproj/zic.8
DESTINATION libexec/darling/usr/share/man/man8
)
InstallSymlink(reboot.8 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man8/halt.8)

9
ac.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,9 @@
project(system_cmds-ac)
add_darling_executable(ac
ac.c
)
install(TARGETS ac DESTINATION libexec/darling/usr/sbin)
install(FILES ac.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,9 @@
project(system_cmds-accton)
add_darling_executable(accton
accton.c
)
install(TARGETS accton DESTINATION libexec/darling/usr/sbin)
install(FILES accton.8 DESTINATION libexec/darling/usr/share/man/man8)

15
arch.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
project(system_cmds-arch)
add_darling_executable(arch
arch.c
)
target_link_libraries(arch
CoreFoundation
)
install(TARGETS arch DESTINATION libexec/darling/usr/bin)
install(FILES arch.1 machine.1 DESTINATION libexec/darling/usr/share/man/man1)
InstallSymlink(arch ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/machine)

30
at.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,30 @@
project(system_cmds-at)
add_compile_definitions(
DAEMON_UID=1
DAEMON_GID=1
DEFAULT_AT_QUEUE='a'
DEFAULT_BATCH_QUEUE='b'
PERM_PATH="/usr/lib/cron/"
)
add_darling_executable(at
at.c
panic.c
parsetime.c
perm.c
)
install(TARGETS at DESTINATION libexec/darling/usr/bin)
install(FILES at.1 DESTINATION libexec/darling/usr/share/man/man1)
InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/atq)
InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/atrm)
InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/batch)
InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/atq.1)
InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/atrm.1)
InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/batch.1)
InstallSymlink("../../var/at" "${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/lib/cron")

View File

@ -0,0 +1,20 @@
project(system_cmds-atrun)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../at.tproj
)
add_compile_definitions(
DAEMON_UID=1
DAEMON_GID=1
)
add_darling_executable(atrun
atrun.c
)
install(TARGETS atrun DESTINATION libexec/darling/usr/libexec)
install(FILES atrun.8 DESTINATION libexec/darling/usr/share/man/man8)
install(FILES com.apple.atrun.plist DESTINATION libexec/darling/System/Library/LaunchDaemons)

View File

@ -0,0 +1,18 @@
project(system_cmds-chkpasswd)
add_darling_executable(chkpasswd
file_passwd.c
nis_passwd.c
od_passwd.c
pam_passwd.c
passwd.c
stringops.c
)
target_link_libraries(chkpasswd
pam.2
CoreFoundation
OpenDirectory
)
install(FILES chkpasswd.pam DESTINATION libexec/darling/etc/pam.d RENAME chkpasswd)

View File

@ -0,0 +1,37 @@
project(system_cmds-chpass)
include_directories(
../vipw.tproj
)
add_compile_definitions(
OPEN_DIRECTORY
)
add_darling_executable(chpass
chpass.c
edit.c
field.c
open_directory.c
pw_copy.c
table.c
util.c
# not in Xcode build files but apparently necessary
../vipw.tproj/pw_util.c
)
target_link_libraries(chpass
CoreFoundation
OpenDirectory
)
install(TARGETS chpass DESTINATION libexec/darling/usr/bin)
InstallSymlink(chpass ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/chfn)
InstallSymlink(chpass ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/chsh)
install(FILES chpass.1 DESTINATION libexec/darling/usr/share/man/man1)
InstallSymlink(chpass.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/chfn.1)
InstallSymlink(chpass.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/chsh.1)

View File

@ -0,0 +1,9 @@
project(system_cmds-cpuctl)
add_darling_executable(cpuctl
cpuctl.c
)
install(TARGETS cpuctl DESTINATION libexec/darling/usr/bin)
install(FILES cpuctl.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,9 @@
project(system_cmds-dmesg)
add_darling_executable(dmesg
dmesg.c
)
install(TARGETS dmesg DESTINATION libexec/darling/sbin)
install(FILES dmesg.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,20 @@
project(system_cmds-dynamic_pager)
add_compile_definitions(
NO_DIRECT_RPC
)
add_darling_executable(dynamic_pager
dynamic_pager.c
)
target_link_libraries(dynamic_pager
SystemConfiguration
CoreFoundation
)
install(TARGETS dynamic_pager DESTINATION libexec/darling/sbin)
install(FILES dynamic_pager.8 DESTINATION libexec/darling/usr/share/man/man8)
#install(FILES com.apple.dynamic_pager.plist DESTINATION libexec/darling/System/Library/LaunchDaemons)

View File

@ -0,0 +1,14 @@
project(system_cmds-fs_usage)
add_darling_executable(fs_usage
fs_usage.c
)
target_link_libraries(fs_usage
ktrace
util
)
install(TARGETS fs_usage DESTINATION libexec/darling/usr/bin)
install(FILES fs_usage.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,23 @@
project(system_cmds-gcore)
add_darling_executable(gcore
convert.c
corefile.c
dyld_shared_cache.c
dyld.c
main.c
sparse.c
threads.c
utils.c
vanilla.c
vm.c
)
target_link_libraries(gcore
util
compression
)
install(TARGETS gcore DESTINATION libexec/darling/usr/bin)
install(FILES gcore.1 DESTINATION libexec/darling/usr/share/man/man1)

205
gen/getconf.tproj/confstr.c Normal file
View File

@ -0,0 +1,205 @@
/*
* Copyright is disclaimed as to the contents of this file.
*
* $FreeBSD: src/usr.bin/getconf/confstr.gperf,v 1.5 2003/08/22 17:32:07 markm Exp $
*/
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#include "getconf.h"
/*
* Override gperf's built-in external scope.
*/
static const struct map *in_word_set(const char *str);
/*
* The Standard seems a bit ambiguous over whether the POSIX_V6_*
* are specified with or without a leading underscore, so we just
* use both.
*/
struct map { const char *name; int key; int valid; };
static const struct map wordlist[] = {
#ifdef _CS_PATH
{ "PATH", _CS_PATH, 1 },
#else
{ "PATH", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
{ "POSIX_V6_ILP32_OFF32_CFLAGS", _CS_POSIX_V6_ILP32_OFF32_CFLAGS, 1 },
#else
{ "POSIX_V6_ILP32_OFF32_CFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
{ "POSIX_V6_ILP32_OFF32_LDFLAGS", _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, 1 },
#else
{ "POSIX_V6_ILP32_OFF32_LDFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
{ "POSIX_V6_ILP32_OFF32_LIBS", _CS_POSIX_V6_ILP32_OFF32_LIBS, 1 },
#else
{ "POSIX_V6_ILP32_OFF32_LIBS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
{ "POSIX_V6_ILP32_OFFBIG_CFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, 1 },
#else
{ "POSIX_V6_ILP32_OFFBIG_CFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
{ "POSIX_V6_ILP32_OFFBIG_LDFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, 1 },
#else
{ "POSIX_V6_ILP32_OFFBIG_LDFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
{ "POSIX_V6_ILP32_OFFBIG_LIBS", _CS_POSIX_V6_ILP32_OFFBIG_LIBS, 1 },
#else
{ "POSIX_V6_ILP32_OFFBIG_LIBS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
{ "POSIX_V6_LP64_OFF64_CFLAGS", _CS_POSIX_V6_LP64_OFF64_CFLAGS, 1 },
#else
{ "POSIX_V6_LP64_OFF64_CFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
{ "POSIX_V6_LP64_OFF64_LDFLAGS", _CS_POSIX_V6_LP64_OFF64_LDFLAGS, 1 },
#else
{ "POSIX_V6_LP64_OFF64_LDFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
{ "POSIX_V6_LP64_OFF64_LIBS", _CS_POSIX_V6_LP64_OFF64_LIBS, 1 },
#else
{ "POSIX_V6_LP64_OFF64_LIBS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
{ "POSIX_V6_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, 1 },
#else
{ "POSIX_V6_LPBIG_OFFBIG_CFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
{ "POSIX_V6_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, 1 },
#else
{ "POSIX_V6_LPBIG_OFFBIG_LDFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
{ "POSIX_V6_LPBIG_OFFBIG_LIBS", _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, 1 },
#else
{ "POSIX_V6_LPBIG_OFFBIG_LIBS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
{ "POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS, 1 },
#else
{ "POSIX_V6_WIDTH_RESTRICTED_ENVS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
{ "_POSIX_V6_ILP32_OFF32_CFLAGS", _CS_POSIX_V6_ILP32_OFF32_CFLAGS, 1 },
#else
{ "_POSIX_V6_ILP32_OFF32_CFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
{ "_POSIX_V6_ILP32_OFF32_LDFLAGS", _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, 1 },
#else
{ "_POSIX_V6_ILP32_OFF32_LDFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
{ "_POSIX_V6_ILP32_OFF32_LIBS", _CS_POSIX_V6_ILP32_OFF32_LIBS, 1 },
#else
{ "_POSIX_V6_ILP32_OFF32_LIBS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
{ "_POSIX_V6_ILP32_OFFBIG_CFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, 1 },
#else
{ "_POSIX_V6_ILP32_OFFBIG_CFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
{ "_POSIX_V6_ILP32_OFFBIG_LDFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, 1 },
#else
{ "_POSIX_V6_ILP32_OFFBIG_LDFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
{ "_POSIX_V6_ILP32_OFFBIG_LIBS", _CS_POSIX_V6_ILP32_OFFBIG_LIBS, 1 },
#else
{ "_POSIX_V6_ILP32_OFFBIG_LIBS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
{ "_POSIX_V6_LP64_OFF64_CFLAGS", _CS_POSIX_V6_LP64_OFF64_CFLAGS, 1 },
#else
{ "_POSIX_V6_LP64_OFF64_CFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
{ "_POSIX_V6_LP64_OFF64_LDFLAGS", _CS_POSIX_V6_LP64_OFF64_LDFLAGS, 1 },
#else
{ "_POSIX_V6_LP64_OFF64_LDFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
{ "_POSIX_V6_LP64_OFF64_LIBS", _CS_POSIX_V6_LP64_OFF64_LIBS, 1 },
#else
{ "_POSIX_V6_LP64_OFF64_LIBS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
{ "_POSIX_V6_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, 1 },
#else
{ "_POSIX_V6_LPBIG_OFFBIG_CFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
{ "_POSIX_V6_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, 1 },
#else
{ "_POSIX_V6_LPBIG_OFFBIG_LDFLAGS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
{ "_POSIX_V6_LPBIG_OFFBIG_LIBS", _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, 1 },
#else
{ "_POSIX_V6_LPBIG_OFFBIG_LIBS", 0, 0 },
#endif
#ifdef _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
{ "_POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS, 1 },
#else
{ "_POSIX_V6_WIDTH_RESTRICTED_ENVS", 0, 0 },
#endif
#ifdef _CS_DARWIN_USER_DIR
{ "DARWIN_USER_DIR", _CS_DARWIN_USER_DIR, 1 },
#else
{ "DARWIN_USER_DIR", 0, 0 },
#endif
#ifdef _CS_DARWIN_USER_TEMP_DIR
{ "DARWIN_USER_TEMP_DIR", _CS_DARWIN_USER_TEMP_DIR, 1 },
#else
{ "DARWIN_USER_TEMP_DIR", 0, 0 },
#endif
#ifdef _CS_DARWIN_USER_CACHE_DIR
{ "DARWIN_USER_CACHE_DIR", _CS_DARWIN_USER_CACHE_DIR, 1 },
#else
{ "DARWIN_USER_CACHE_DIR", 0, 0 },
#endif
{ NULL, 0, 0 }
};
#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1)
static const struct map *
in_word_set(const char *word)
{
const struct map *mp;
for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) {
if (strcmp(word, mp->name) == 0)
return (mp);
}
return (NULL);
}
int
find_confstr(const char *name, int *key)
{
const struct map *rv;
rv = in_word_set(name);
if (rv != NULL) {
if (rv->valid) {
*key = rv->key;
return 1;
}
return -1;
}
return 0;
}

474
gen/getconf.tproj/limits.c Normal file
View File

@ -0,0 +1,474 @@
/*
* Copyright is disclaimed as to the contents of this file.
*
* $FreeBSD: src/usr.bin/getconf/limits.gperf,v 1.2 2003/08/22 17:32:07 markm Exp $
*/
#include <sys/types.h>
#include <string.h>
#include <limits.h>
#ifdef APPLE_GETCONF_UNDERSCORE
#include <alloca.h>
#endif /* APPLE_GETCONF_UNDERSCORE */
#include "getconf.h"
/*
* Override gperf's built-in external scope.
*/
static const struct map *in_word_set(const char *str);
struct map { const char *name; intmax_t value; int valid; };
static const struct map wordlist[] = {
#ifdef _POSIX_AIO_LISTIO_MAX
{ "_POSIX_AIO_LISTIO_MAX", _POSIX_AIO_LISTIO_MAX, 1 },
#else
{ "_POSIX_AIO_LISTIO_MAX", 0, 0 },
#endif
#ifdef _POSIX_AIO_MAX
{ "_POSIX_AIO_MAX", _POSIX_AIO_MAX, 1 },
#else
{ "_POSIX_AIO_MAX", 0, 0 },
#endif
#ifdef _POSIX_ARG_MAX
{ "_POSIX_ARG_MAX", _POSIX_ARG_MAX, 1 },
#else
{ "_POSIX_ARG_MAX", 0, 0 },
#endif
#ifdef _POSIX_CHILD_MAX
{ "_POSIX_CHILD_MAX", _POSIX_CHILD_MAX, 1 },
#else
{ "_POSIX_CHILD_MAX", 0, 0 },
#endif
#ifdef _POSIX_CLOCKRES_MIN
{ "_POSIX_CLOCKRES_MIN", _POSIX_CLOCKRES_MIN, 1 },
#else
{ "_POSIX_CLOCKRES_MIN", 0, 0 },
#endif
#ifdef _POSIX_DELAYTIMER_MAX
{ "_POSIX_DELAYTIMER_MAX", _POSIX_DELAYTIMER_MAX, 1 },
#else
{ "_POSIX_DELAYTIMER_MAX", 0, 0 },
#endif
#ifdef _POSIX_HOST_NAME_MAX
{ "_POSIX_HOST_NAME_MAX", _POSIX_HOST_NAME_MAX, 1 },
#else
{ "_POSIX_HOST_NAME_MAX", 0, 0 },
#endif
#ifdef _POSIX_LINK_MAX
{ "_POSIX_LINK_MAX", _POSIX_LINK_MAX, 1 },
#else
{ "_POSIX_LINK_MAX", 0, 0 },
#endif
#ifdef _POSIX_LOGIN_NAME_MAX
{ "_POSIX_LOGIN_NAME_MAX", _POSIX_LOGIN_NAME_MAX, 1 },
#else
{ "_POSIX_LOGIN_NAME_MAX", 0, 0 },
#endif
#ifdef _POSIX_MAX_CANON
{ "_POSIX_MAX_CANON", _POSIX_MAX_CANON, 1 },
#else
{ "_POSIX_MAX_CANON", 0, 0 },
#endif
#ifdef _POSIX_MAX_INPUT
{ "_POSIX_MAX_INPUT", _POSIX_MAX_INPUT, 1 },
#else
{ "_POSIX_MAX_INPUT", 0, 0 },
#endif
#ifdef _POSIX_MQ_OPEN_MAX
{ "_POSIX_MQ_OPEN_MAX", _POSIX_MQ_OPEN_MAX, 1 },
#else
{ "_POSIX_MQ_OPEN_MAX", 0, 0 },
#endif
#ifdef _POSIX_MQ_PRIO_MAX
{ "_POSIX_MQ_PRIO_MAX", _POSIX_MQ_PRIO_MAX, 1 },
#else
{ "_POSIX_MQ_PRIO_MAX", 0, 0 },
#endif
#ifdef _POSIX_NAME_MAX
{ "_POSIX_NAME_MAX", _POSIX_NAME_MAX, 1 },
#else
{ "_POSIX_NAME_MAX", 0, 0 },
#endif
#ifdef _POSIX_NGROUPS_MAX
{ "_POSIX_NGROUPS_MAX", _POSIX_NGROUPS_MAX, 1 },
#else
{ "_POSIX_NGROUPS_MAX", 0, 0 },
#endif
#ifdef _POSIX_OPEN_MAX
{ "_POSIX_OPEN_MAX", _POSIX_OPEN_MAX, 1 },
#else
{ "_POSIX_OPEN_MAX", 0, 0 },
#endif
#ifdef _POSIX_PATH_MAX
{ "_POSIX_PATH_MAX", _POSIX_PATH_MAX, 1 },
#else
{ "_POSIX_PATH_MAX", 0, 0 },
#endif
#ifdef _POSIX_PIPE_BUF
{ "_POSIX_PIPE_BUF", _POSIX_PIPE_BUF, 1 },
#else
{ "_POSIX_PIPE_BUF", 0, 0 },
#endif
#ifdef _POSIX_RE_DUP_MAX
{ "_POSIX_RE_DUP_MAX", _POSIX_RE_DUP_MAX, 1 },
#else
{ "_POSIX_RE_DUP_MAX", 0, 0 },
#endif
#ifdef _POSIX_RTSIG_MAX
{ "_POSIX_RTSIG_MAX", _POSIX_RTSIG_MAX, 1 },
#else
{ "_POSIX_RTSIG_MAX", 0, 0 },
#endif
#ifdef _POSIX_SEM_NSEMS_MAX
{ "_POSIX_SEM_NSEMS_MAX", _POSIX_SEM_NSEMS_MAX, 1 },
#else
{ "_POSIX_SEM_NSEMS_MAX", 0, 0 },
#endif
#ifdef _POSIX_SEM_VALUE_MAX
{ "_POSIX_SEM_VALUE_MAX", _POSIX_SEM_VALUE_MAX, 1 },
#else
{ "_POSIX_SEM_VALUE_MAX", 0, 0 },
#endif
#ifdef _POSIX_SIGQUEUE_MAX
{ "_POSIX_SIGQUEUE_MAX", _POSIX_SIGQUEUE_MAX, 1 },
#else
{ "_POSIX_SIGQUEUE_MAX", 0, 0 },
#endif
#ifdef _POSIX_SSIZE_MAX
{ "_POSIX_SSIZE_MAX", _POSIX_SSIZE_MAX, 1 },
#else
{ "_POSIX_SSIZE_MAX", 0, 0 },
#endif
#ifdef _POSIX_STREAM_MAX
{ "_POSIX_STREAM_MAX", _POSIX_STREAM_MAX, 1 },
#else
{ "_POSIX_STREAM_MAX", 0, 0 },
#endif
#ifdef _POSIX_SS_REPL_MAX
{ "_POSIX_SS_REPL_MAX", _POSIX_SS_REPL_MAX, 1 },
#else
{ "_POSIX_SS_REPL_MAX", 0, 0 },
#endif
#ifdef _POSIX_SYMLINK_MAX
{ "_POSIX_SYMLINK_MAX", _POSIX_SYMLINK_MAX, 1 },
#else
{ "_POSIX_SYMLINK_MAX", 0, 0 },
#endif
#ifdef _POSIX_SYMLOOP_MAX
{ "_POSIX_SYMLOOP_MAX", _POSIX_SYMLOOP_MAX, 1 },
#else
{ "_POSIX_SYMLOOP_MAX", 0, 0 },
#endif
#ifdef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
{ "_POSIX_THREAD_DESTRUCTOR_ITERATIONS", _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 1 },
#else
{ "_POSIX_THREAD_DESTRUCTOR_ITERATIONS", 0, 0 },
#endif
#ifdef _POSIX_THREAD_KEYS_MAX
{ "_POSIX_THREAD_KEYS_MAX", _POSIX_THREAD_KEYS_MAX, 1 },
#else
{ "_POSIX_THREAD_KEYS_MAX", 0, 0 },
#endif
#ifdef _POSIX_THREAD_THREADS_MAX
{ "_POSIX_THREAD_THREADS_MAX", _POSIX_THREAD_THREADS_MAX, 1 },
#else
{ "_POSIX_THREAD_THREADS_MAX", 0, 0 },
#endif
#ifdef _POSIX_TIMER_MAX
{ "_POSIX_TIMER_MAX", _POSIX_TIMER_MAX, 1 },
#else
{ "_POSIX_TIMER_MAX", 0, 0 },
#endif
#ifdef _POSIX_TRACE_EVENT_NAME_MAX
{ "_POSIX_TRACE_EVENT_NAME_MAX", _POSIX_TRACE_EVENT_NAME_MAX, 1 },
#else
{ "_POSIX_TRACE_EVENT_NAME_MAX", 0, 0 },
#endif
#ifdef _POSIX_TRACE_NAME_MAX
{ "_POSIX_TRACE_NAME_MAX", _POSIX_TRACE_NAME_MAX, 1 },
#else
{ "_POSIX_TRACE_NAME_MAX", 0, 0 },
#endif
#ifdef _POSIX_TRACE_SYS_MAX
{ "_POSIX_TRACE_SYS_MAX", _POSIX_TRACE_SYS_MAX, 1 },
#else
{ "_POSIX_TRACE_SYS_MAX", 0, 0 },
#endif
#ifdef _POSIX_TRACE_USER_EVENT_MAX
{ "_POSIX_TRACE_USER_EVENT_MAX", _POSIX_TRACE_USER_EVENT_MAX, 1 },
#else
{ "_POSIX_TRACE_USER_EVENT_MAX", 0, 0 },
#endif
#ifdef _POSIX_TTY_NAME_MAX
{ "_POSIX_TTY_NAME_MAX", _POSIX_TTY_NAME_MAX, 1 },
#else
{ "_POSIX_TTY_NAME_MAX", 0, 0 },
#endif
#ifdef _POSIX_TZNAME_MAX
{ "_POSIX_TZNAME_MAX", _POSIX_TZNAME_MAX, 1 },
#else
{ "_POSIX_TZNAME_MAX", 0, 0 },
#endif
#ifdef _POSIX2_BC_BASE_MAX
{ "_POSIX2_BC_BASE_MAX", _POSIX2_BC_BASE_MAX, 1 },
#else
{ "_POSIX2_BC_BASE_MAX", 0, 0 },
#endif
#ifdef _POSIX2_BC_DIM_MAX
{ "_POSIX2_BC_DIM_MAX", _POSIX2_BC_DIM_MAX, 1 },
#else
{ "_POSIX2_BC_DIM_MAX", 0, 0 },
#endif
#ifdef _POSIX2_BC_SCALE_MAX
{ "_POSIX2_BC_SCALE_MAX", _POSIX2_BC_SCALE_MAX, 1 },
#else
{ "_POSIX2_BC_SCALE_MAX", 0, 0 },
#endif
#ifdef _POSIX2_BC_STRING_MAX
{ "_POSIX2_BC_STRING_MAX", _POSIX2_BC_STRING_MAX, 1 },
#else
{ "_POSIX2_BC_STRING_MAX", 0, 0 },
#endif
#ifdef _POSIX2_CHARCLASS_NAME_MAX
{ "_POSIX2_CHARCLASS_NAME_MAX", _POSIX2_CHARCLASS_NAME_MAX, 1 },
#else
{ "_POSIX2_CHARCLASS_NAME_MAX", 0, 0 },
#endif
#ifdef _POSIX2_COLL_WEIGHTS_MAX
{ "_POSIX2_COLL_WEIGHTS_MAX", _POSIX2_COLL_WEIGHTS_MAX, 1 },
#else
{ "_POSIX2_COLL_WEIGHTS_MAX", 0, 0 },
#endif
#ifdef _POSIX2_EXPR_NEST_MAX
{ "_POSIX2_EXPR_NEST_MAX", _POSIX2_EXPR_NEST_MAX, 1 },
#else
{ "_POSIX2_EXPR_NEST_MAX", 0, 0 },
#endif
#ifdef _POSIX2_LINE_MAX
{ "_POSIX2_LINE_MAX", _POSIX2_LINE_MAX, 1 },
#else
{ "_POSIX2_LINE_MAX", 0, 0 },
#endif
#ifdef _POSIX2_RE_DUP_MAX
{ "_POSIX2_RE_DUP_MAX", _POSIX2_RE_DUP_MAX, 1 },
#else
{ "_POSIX2_RE_DUP_MAX", 0, 0 },
#endif
#ifdef _XOPEN_IOV_MAX
{ "_XOPEN_IOV_MAX", _XOPEN_IOV_MAX, 1 },
#else
{ "_XOPEN_IOV_MAX", 0, 0 },
#endif
#ifdef _XOPEN_NAME_MAX
{ "_XOPEN_NAME_MAX", _XOPEN_NAME_MAX, 1 },
#else
{ "_XOPEN_NAME_MAX", 0, 0 },
#endif
#ifdef _XOPEN_PATH_MAX
{ "_XOPEN_PATH_MAX", _XOPEN_PATH_MAX, 1 },
#else
{ "_XOPEN_PATH_MAX", 0, 0 },
#endif
#ifdef CHAR_BIT
{ "CHAR_BIT", CHAR_BIT, 1 },
#else
{ "CHAR_BIT", 0, 0 },
#endif
#ifdef CHAR_MAX
{ "CHAR_MAX", CHAR_MAX, 1 },
#else
{ "CHAR_MAX", 0, 0 },
#endif
#ifdef CHAR_MIN
{ "CHAR_MIN", CHAR_MIN, 1 },
#else
{ "CHAR_MIN", 0, 0 },
#endif
#ifdef INT_MAX
{ "INT_MAX", INT_MAX, 1 },
#else
{ "INT_MAX", 0, 0 },
#endif
#ifdef INT_MIN
{ "INT_MIN", INT_MIN, 1 },
#else
{ "INT_MIN", 0, 0 },
#endif
#ifdef LLONG_MIN
{ "LLONG_MIN", LLONG_MIN, 1 },
#else
{ "LLONG_MIN", 0, 0 },
#endif
#ifdef LLONG_MAX
{ "LLONG_MAX", LLONG_MAX, 1 },
#else
{ "LLONG_MAX", 0, 0 },
#endif
#ifdef LONG_BIT
{ "LONG_BIT", LONG_BIT, 1 },
#else
{ "LONG_BIT", 0, 0 },
#endif
#ifdef LONG_MAX
{ "LONG_MAX", LONG_MAX, 1 },
#else
{ "LONG_MAX", 0, 0 },
#endif
#ifdef LONG_MIN
{ "LONG_MIN", LONG_MIN, 1 },
#else
{ "LONG_MIN", 0, 0 },
#endif
#ifdef MB_LEN_MAX
{ "MB_LEN_MAX", MB_LEN_MAX, 1 },
#else
{ "MB_LEN_MAX", 0, 0 },
#endif
#ifdef SCHAR_MAX
{ "SCHAR_MAX", SCHAR_MAX, 1 },
#else
{ "SCHAR_MAX", 0, 0 },
#endif
#ifdef SCHAR_MIN
{ "SCHAR_MIN", SCHAR_MIN, 1 },
#else
{ "SCHAR_MIN", 0, 0 },
#endif
#ifdef SHRT_MAX
{ "SHRT_MAX", SHRT_MAX, 1 },
#else
{ "SHRT_MAX", 0, 0 },
#endif
#ifdef SHRT_MIN
{ "SHRT_MIN", SHRT_MIN, 1 },
#else
{ "SHRT_MIN", 0, 0 },
#endif
#ifdef SSIZE_MAX
{ "SSIZE_MAX", SSIZE_MAX, 1 },
#else
{ "SSIZE_MAX", 0, 0 },
#endif
#ifdef UCHAR_MAX
{ "UCHAR_MAX", UCHAR_MAX, 1 },
#else
{ "UCHAR_MAX", 0, 0 },
#endif
#ifdef UINT_MAX
{ "UINT_MAX", UINT_MAX, 1 },
#else
{ "UINT_MAX", 0, 0 },
#endif
#ifdef ULLONG_MAX
{ "ULLONG_MAX", ULLONG_MAX, 1 },
#else
{ "ULLONG_MAX", 0, 0 },
#endif
#ifdef ULONG_MAX
{ "ULONG_MAX", ULONG_MAX, 1 },
#else
{ "ULONG_MAX", 0, 0 },
#endif
#ifdef USHRT_MAX
{ "USHRT_MAX", USHRT_MAX, 1 },
#else
{ "USHRT_MAX", 0, 0 },
#endif
#ifdef WORD_BIT
{ "WORD_BIT", WORD_BIT, 1 },
#else
{ "WORD_BIT", 0, 0 },
#endif
#ifdef CHARCLASS_NAME_MAX
{ "CHARCLASS_NAME_MAX", CHARCLASS_NAME_MAX, 1 },
#else
{ "CHARCLASS_NAME_MAX", 0, 0 },
#endif
#ifdef NL_ARGMAX
{ "NL_ARGMAX", NL_ARGMAX, 1 },
#else
{ "NL_ARGMAX", 0, 0 },
#endif
#ifdef NL_LANGMAX
{ "ML_LANGMAX", NL_LANGMAX, 1 },
#else
{ "ML_LANGMAX", 0, 0 },
#endif
#ifdef NL_MSGMAX
{ "NL_MSGMAX", NL_MSGMAX, 1 },
#else
{ "NL_MSGMAX", 0, 0 },
#endif
#ifdef NL_NMAX
{ "NL_NMAX", NL_NMAX, 1 },
#else
{ "NL_NMAX", 0, 0 },
#endif
#ifdef NL_SETMAX
{ "NL_SETMAX", NL_SETMAX, 1 },
#else
{ "NL_SETMAX", 0, 0 },
#endif
#ifdef NL_TEXTMAX
{ "NL_TEXTMAX", NL_TEXTMAX, 1 },
#else
{ "NL_TEXTMAX", 0, 0 },
#endif
#ifdef NZERO
{ "NZERO", NZERO, 1 },
#else
{ "NZERO", 0, 0 },
#endif
{ NULL, 0, 0 }
};
#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1)
static const struct map *
in_word_set(const char *word)
{
const struct map *mp;
for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) {
if (strcmp(word, mp->name) == 0)
return (mp);
}
return (NULL);
}
int
find_limit(const char *name, intmax_t *value)
{
const struct map *rv;
#ifdef APPLE_GETCONF_UNDERSCORE
char *alt;
#endif /* APPLE_GETCONF_UNDERSCORE */
rv = in_word_set(name);
if (rv != NULL) {
if (rv->valid) {
*value = rv->value;
return 1;
}
return -1;
}
#ifdef APPLE_GETCONF_UNDERSCORE
if(*name == '_')
alt = (char *)name + 1;
else {
if((alt = (char *)alloca(strlen(name) + 2)) == NULL)
return 0;
*alt = '_';
strcpy(alt + 1, name);
}
rv = in_word_set(alt);
if (rv != NULL) {
if (rv->valid) {
*value = rv->value;
return 1;
}
return -1;
}
#endif /* APPLE_GETCONF_UNDERSCORE */
return 0;
}

View File

@ -0,0 +1,204 @@
/*
* Copyright is disclaimed as to the contents of this file.
*
* $FreeBSD: src/usr.bin/getconf/pathconf.gperf,v 1.4 2003/08/22 17:32:07 markm Exp $
*/
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#ifdef APPLE_GETCONF_UNDERSCORE
#include <alloca.h>
#endif /* APPLE_GETCONF_UNDERSCORE */
#include "getconf.h"
/*
* Override gperf's built-in external scope.
*/
static const struct map *in_word_set(const char *str);
struct map { const char *name; int key; int valid; };
static const struct map wordlist[] = {
#ifdef _PC_FILESIZEBITS
{ "FILESIZEBITS", _PC_FILESIZEBITS, 1 },
#else
{ "FILESIZEBITS", 0, 0 },
#endif
#ifdef _PC_LINK_MAX
{ "LINK_MAX", _PC_LINK_MAX, 1 },
#else
{ "LINK_MAX", 0, 0 },
#endif
#ifdef _PC_MAX_CANON
{ "MAX_CANON", _PC_MAX_CANON, 1 },
#else
{ "MAX_CANON", 0, 0 },
#endif
#ifdef _PC_MAX_INPUT
{ "MAX_INPUT", _PC_MAX_INPUT, 1 },
#else
{ "MAX_INPUT", 0, 0 },
#endif
#ifdef _PC_NAME_MAX
{ "NAME_MAX", _PC_NAME_MAX, 1 },
#else
{ "NAME_MAX", 0, 0 },
#endif
#ifdef _PC_PATH_MAX
{ "PATH_MAX", _PC_PATH_MAX, 1 },
#else
{ "PATH_MAX", 0, 0 },
#endif
#ifdef _PC_PIPE_BUF
{ "PIPE_BUF", _PC_PIPE_BUF, 1 },
#else
{ "PIPE_BUF", 0, 0 },
#endif
#ifdef _PC_ALLOC_SIZE_MIN
{ "POSIX_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN, 1 },
#else
{ "POSIX_ALLOC_SIZE_MIN", 0, 0 },
#endif
#ifdef _PC_REC_INCR_XFER_SIZE
{ "POSIX_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE, 1 },
#else
{ "POSIX_REC_INCR_XFER_SIZE", 0, 0 },
#endif
#ifdef _PC_REC_MAX_XFER_SIZE
{ "POSIX_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE, 1 },
#else
{ "POSIX_REC_MAX_XFER_SIZE", 0, 0 },
#endif
#ifdef _PC_REC_MIN_XFER_SIZE
{ "POSIX_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE, 1 },
#else
{ "POSIX_REC_MIN_XFER_SIZE", 0, 0 },
#endif
#ifdef _PC_REC_XFER_ALIGN
{ "POSIX_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN, 1 },
#else
{ "POSIX_REC_XFER_ALIGN", 0, 0 },
#endif
#ifdef _PC_2_SYMLINKS
{ "POSIX2_SYMLINKS", _PC_2_SYMLINKS, 1 },
#else
{ "POSIX2_SYMLINKS", 0, 0 },
#endif
#ifdef _PC_SYMLINK_MAX
{ "SYMLINK_MAX", _PC_SYMLINK_MAX, 1 },
#else
{ "SYMLINK_MAX", 0, 0 },
#endif
#ifdef _PC_ACL_EXTENDED
{ "TRUSTEDBSD_ACL_EXTENDED", _PC_ACL_EXTENDED, 1 },
#else
{ "TRUSTEDBSD_ACL_EXTENDED", 0, 0 },
#endif
#ifdef _PC_ACL_PATH_MAX
{ "TRUSTEDBSD_ACL_PATH_MAX", _PC_ACL_PATH_MAX, 1 },
#else
{ "TRUSTEDBSD_ACL_PATH_MAX", 0, 0 },
#endif
#ifdef _PC_CAP_PRESENT
{ "TRUSTEDBSD_CAP_PRESENT", _PC_CAP_PRESENT, 1 },
#else
{ "TRUSTEDBSD_CAP_PRESENT", 0, 0 },
#endif
#ifdef _PC_INF_PRESENT
{ "TRUSTEDBSD_INF_PRESENT", _PC_INF_PRESENT, 1 },
#else
{ "TRUSTEDBSD_INF_PRESENT", 0, 0 },
#endif
#ifdef _PC_MAC_PRESENT
{ "TRUSTEDBSD_MAC_PRESENT", _PC_MAC_PRESENT, 1 },
#else
{ "TRUSTEDBSD_MAC_PRESENT", 0, 0 },
#endif
#ifdef _PC_ASYNC_IO
{ "_POSIX_ASYNC_IO", _PC_ASYNC_IO, 1 },
#else
{ "_POSIX_ASYNC_IO", 0, 0 },
#endif
#ifdef _PC_CHOWN_RESTRICTED
{ "_POSIX_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED, 1 },
#else
{ "_POSIX_CHOWN_RESTRICTED", 0, 0 },
#endif
#ifdef _PC_NO_TRUNC
{ "_POSIX_NO_TRUNC", _PC_NO_TRUNC, 1 },
#else
{ "_POSIX_NO_TRUNC", 0, 0 },
#endif
#ifdef _PC_PATH_MAX
{ "_POSIX_PATH_MAX", _PC_PATH_MAX, 1 },
#else
{ "_POSIX_PATH_MAX", 0, 0 },
#endif
#ifdef _PC_PRIO_IO
{ "_POSIX_PRIO_IO", _PC_PRIO_IO, 1 },
#else
{ "_POSIX_PRIO_IO", 0, 0 },
#endif
#ifdef _PC_SYNC_IO
{ "_POSIX_SYNC_IO", _PC_SYNC_IO, 1 },
#else
{ "_POSIX_SYNC_IO", 0, 0 },
#endif
#ifdef _PC_VDISABLE
{ "_POSIX_VDISABLE", _PC_VDISABLE, 1 },
#else
{ "_POSIX_VDISABLE", 0, 0 },
#endif
{ NULL, 0, 0 }
};
#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1)
static const struct map *
in_word_set(const char *word)
{
const struct map *mp;
for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) {
if (strcmp(word, mp->name) == 0)
return (mp);
}
return (NULL);
}
int
find_pathconf(const char *name, int *key)
{
const struct map *rv;
#ifdef APPLE_GETCONF_UNDERSCORE
char *alt;
#endif /* APPLE_GETCONF_UNDERSCORE */
rv = in_word_set(name);
if (rv != NULL) {
if (rv->valid) {
*key = rv->key;
return 1;
}
return -1;
}
#ifdef APPLE_GETCONF_UNDERSCORE
if(*name == '_')
alt = (char *)name + 1;
else {
if((alt = (char *)alloca(strlen(name) + 2)) == NULL)
return 0;
*alt = '_';
strcpy(alt + 1, name);
}
rv = in_word_set(alt);
if (rv != NULL) {
if (rv->valid) {
*key = rv->key;
return 1;
}
return -1;
}
#endif /* APPLE_GETCONF_UNDERSCORE */
return 0;
}

114
gen/getconf.tproj/progenv.c Normal file
View File

@ -0,0 +1,114 @@
/*
* Copyright is disclaimed as to the contents of this file.
*
* $FreeBSD: src/usr.bin/getconf/progenv.gperf,v 1.2 2003/08/22 17:32:07 markm Exp $
*/
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#include "getconf.h"
/*
* Override gperf's built-in external scope.
*/
static const struct map *in_word_set(const char *str);
/*
* The Standard seems a bit ambiguous over whether the POSIX_V6_*
* are specified with or without a leading underscore, so we just
* use both.
*/
/*
* The alt_path member gives the path containing another `getconf'
* executable which was compiled using the specified programming
* environment. If it is NULL, the current executable is good enough.
* If we ever support multiple environments, this table will need to
* be updated. (We cheat here and define the supported environments
* statically.)
*/
#if defined(__alpha__) || defined(__sparc64__)
#define have_LP64_OFF64 NULL
#elif defined(__APPLE__)
#define have_LP64_OFF64 NULL
#define have_LPBIG_OFFBIG NULL
#endif
#if defined(__i386__) || defined(__powerpc__) || defined(__x86_64__)
#define have_ILP32_OFFBIG NULL
#endif
struct map { const char *name; const char *alt_path; int valid; };
static const struct map wordlist[] = {
#ifdef notdef
{ "POSIX_V6_ILP32_OFF32", notdef, 1 },
#else
{ "POSIX_V6_ILP32_OFF32", 0, 0 },
#endif
#ifdef have_ILP32_OFFBIG
{ "POSIX_V6_ILP32_OFFBIG", have_ILP32_OFFBIG, 1 },
#else
{ "POSIX_V6_ILP32_OFFBIG", 0, 0 },
#endif
#ifdef have_LP64_OFF64
{ "POSIX_V6_LP64_OFF64", have_LP64_OFF64, 1 },
#else
{ "POSIX_V6_LP64_OFF64", 0, 0 },
#endif
#ifdef have_LPBIG_OFFBIG
{ "POSIX_V6_LPBIG_OFFBIG", have_LPBIG_OFFBIG, 1 },
#else
{ "POSIX_V6_LPBIG_OFFBIG", 0, 0 },
#endif
#ifdef notdef
{ "_POSIX_V6_ILP32_OFF32", notdef, 1 },
#else
{ "_POSIX_V6_ILP32_OFF32", 0, 0 },
#endif
#ifdef have_ILP32_OFFBIG
{ "_POSIX_V6_ILP32_OFFBIG", have_ILP32_OFFBIG, 1 },
#else
{ "_POSIX_V6_ILP32_OFFBIG", 0, 0 },
#endif
#ifdef have_LP64_OFF64
{ "_POSIX_V6_LP64_OFF64", have_LP64_OFF64, 1 },
#else
{ "_POSIX_V6_LP64_OFF64", 0, 0 },
#endif
#ifdef have_LPBIG_OFFBIG
{ "_POSIX_V6_LPBIG_OFFBIG", have_LPBIG_OFFBIG, 1 },
#else
{ "_POSIX_V6_LPBIG_OFFBIG", 0, 0 },
#endif
{ NULL, 0, 0 }
};
#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1)
static const struct map *
in_word_set(const char *word)
{
const struct map *mp;
for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) {
if (strcmp(word, mp->name) == 0)
return (mp);
}
return (NULL);
}
int
find_progenv(const char *name, const char **alt_path)
{
const struct map *rv;
rv = in_word_set(name);
if (rv != NULL) {
if (rv->valid) {
*alt_path = rv->alt_path;
return 1;
}
return -1;
}
return 0;
}

699
gen/getconf.tproj/sysconf.c Normal file
View File

@ -0,0 +1,699 @@
/*
* Copyright is disclaimed as to the contents of this file.
*
* $FreeBSD: src/usr.bin/getconf/sysconf.gperf,v 1.5 2003/08/22 17:32:07 markm Exp $
*/
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#ifdef APPLE_GETCONF_UNDERSCORE
#include <alloca.h>
#endif /* APPLE_GETCONF_UNDERSCORE */
#include "getconf.h"
/*
* Override gperf's built-in external scope.
*/
static const struct map *in_word_set(const char *str);
struct map { const char *name; int key; int valid; };
static const struct map wordlist[] = {
#ifdef _SC_AIO_LISTIO_MAX
{ "AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX, 1 },
#else
{ "AIO_LISTIO_MAX", 0, 0 },
#endif
#ifdef _SC_AIO_MAX
{ "AIO_MAX", _SC_AIO_MAX, 1 },
#else
{ "AIO_MAX", 0, 0 },
#endif
#ifdef _SC_AIO_PRIO_DELTA_MAX
{ "AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX, 1 },
#else
{ "AIO_PRIO_DELTA_MAX", 0, 0 },
#endif
#ifdef _SC_ARG_MAX
{ "ARG_MAX", _SC_ARG_MAX, 1 },
#else
{ "ARG_MAX", 0, 0 },
#endif
#ifdef _SC_ATEXIT_MAX
{ "ATEXIT_MAX", _SC_ATEXIT_MAX, 1 },
#else
{ "ATEXIT_MAX", 0, 0 },
#endif
#ifdef _SC_BC_BASE_MAX
{ "BC_BASE_MAX", _SC_BC_BASE_MAX, 1 },
#else
{ "BC_BASE_MAX", 0, 0 },
#endif
#ifdef _SC_BC_DIM_MAX
{ "BC_DIM_MAX", _SC_BC_DIM_MAX, 1 },
#else
{ "BC_DIM_MAX", 0, 0 },
#endif
#ifdef _SC_BC_SCALE_MAX
{ "BC_SCALE_MAX", _SC_BC_SCALE_MAX, 1 },
#else
{ "BC_SCALE_MAX", 0, 0 },
#endif
#ifdef _SC_BC_STRING_MAX
{ "BC_STRING_MAX", _SC_BC_STRING_MAX, 1 },
#else
{ "BC_STRING_MAX", 0, 0 },
#endif
#ifdef _SC_CHILD_MAX
{ "CHILD_MAX", _SC_CHILD_MAX, 1 },
#else
{ "CHILD_MAX", 0, 0 },
#endif
#ifdef _SC_CLK_TCK
{ "CLK_TCK", _SC_CLK_TCK, 1 },
#else
{ "CLK_TCK", 0, 0 },
#endif
#ifdef _SC_COLL_WEIGHTS_MAX
{ "COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX, 1 },
#else
{ "COLL_WEIGHTS_MAX", 0, 0 },
#endif
#ifdef _SC_DELAYTIMER_MAX
{ "DELAYTIMER_MAX", _SC_DELAYTIMER_MAX, 1 },
#else
{ "DELAYTIMER_MAX", 0, 0 },
#endif
#ifdef _SC_EXPR_NEST_MAX
{ "EXPR_NEST_MAX", _SC_EXPR_NEST_MAX, 1 },
#else
{ "EXPR_NEST_MAX", 0, 0 },
#endif
#ifdef _SC_GETGR_R_SIZE_MAX
{ "GETGR_R_SIZE_MAX", _SC_GETGR_R_SIZE_MAX, 1 },
#else
{ "GETGR_R_SIZE_MAX", 0, 0 },
#endif
#ifdef _SC_GETPW_R_SIZE_MAX
{ "GETPW_R_SIZE_MAX", _SC_GETPW_R_SIZE_MAX, 1 },
#else
{ "GETPW_R_SIZE_MAX", 0, 0 },
#endif
#ifdef _SC_HOST_NAME_MAX
{ "HOST_NAME_MAX", _SC_HOST_NAME_MAX, 1 },
#else
{ "HOST_NAME_MAX", 0, 0 },
#endif
#ifdef _SC_IOV_MAX
{ "IOV_MAX", _SC_IOV_MAX, 1 },
#else
{ "IOV_MAX", 0, 0 },
#endif
#ifdef _SC_LINE_MAX
{ "LINE_MAX", _SC_LINE_MAX, 1 },
#else
{ "LINE_MAX", 0, 0 },
#endif
#ifdef _SC_LOGIN_NAME_MAX
{ "LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX, 1 },
#else
{ "LOGIN_NAME_MAX", 0, 0 },
#endif
#ifdef _SC_MQ_OPEN_MAX
{ "MQ_OPEN_MAX", _SC_MQ_OPEN_MAX, 1 },
#else
{ "MQ_OPEN_MAX", 0, 0 },
#endif
#ifdef _SC_MQ_PRIO_MAX
{ "MQ_PRIO_MAX", _SC_MQ_PRIO_MAX, 1 },
#else
{ "MQ_PRIO_MAX", 0, 0 },
#endif
#ifdef _SC_NGROUPS_MAX
{ "NGROUPS_MAX", _SC_NGROUPS_MAX, 1 },
#else
{ "NGROUPS_MAX", 0, 0 },
#endif
#ifdef _SC_NPROCESSORS_CONF
{ "NPROCESSORS_CONF", _SC_NPROCESSORS_CONF, 1 },
#else
{ "NPROCESSORS_CONF", 0, 0 },
#endif
#ifdef _SC_NPROCESSORS_ONLN
{ "NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN, 1 },
#else
{ "NPROCESSORS_ONLN", 0, 0 },
#endif
#ifdef _SC_OPEN_MAX
{ "OPEN_MAX", _SC_OPEN_MAX, 1 },
#else
{ "OPEN_MAX", 0, 0 },
#endif
#ifdef _SC_PAGESIZE
{ "PAGESIZE", _SC_PAGESIZE, 1 },
#else
{ "PAGESIZE", 0, 0 },
#endif
#ifdef _SC_PAGESIZE
{ "PAGE_SIZE", _SC_PAGESIZE, 1 },
#else
{ "PAGE_SIZE", 0, 0 },
#endif
#ifdef _SC_PASS_MAX
{ "PASS_MAX", _SC_PASS_MAX, 1 },
#else
{ "PASS_MAX", 0, 0 },
#endif
#ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
{ "PTHREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS, 1 },
#else
{ "PTHREAD_DESTRUCTOR_ITERATIONS", 0, 0 },
#endif
#ifdef _SC_THREAD_KEYS_MAX
{ "PTHREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX, 1 },
#else
{ "PTHREAD_KEYS_MAX", 0, 0 },
#endif
#ifdef _SC_THREAD_STACK_MIN
{ "PTHREAD_STACK_MIN", _SC_THREAD_STACK_MIN, 1 },
#else
{ "PTHREAD_STACK_MIN", 0, 0 },
#endif
#ifdef _SC_THREAD_THREADS_MAX
{ "PTHREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX, 1 },
#else
{ "PTHREAD_THREADS_MAX", 0, 0 },
#endif
#ifdef _SC_RE_DUP_MAX
{ "RE_DUP_MAX", _SC_RE_DUP_MAX, 1 },
#else
{ "RE_DUP_MAX", 0, 0 },
#endif
#ifdef _SC_RTSIG_MAX
{ "RTSIG_MAX", _SC_RTSIG_MAX, 1 },
#else
{ "RTSIG_MAX", 0, 0 },
#endif
#ifdef _SC_SEM_NSEMS_MAX
{ "SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX, 1 },
#else
{ "SEM_NSEMS_MAX", 0, 0 },
#endif
#ifdef _SC_SEM_VALUE_MAX
{ "SEM_VALUE_MAX", _SC_SEM_VALUE_MAX, 1 },
#else
{ "SEM_VALUE_MAX", 0, 0 },
#endif
#ifdef _SC_SIGQUEUE_MAX
{ "SIGQUEUE_MAX", _SC_SIGQUEUE_MAX, 1 },
#else
{ "SIGQUEUE_MAX", 0, 0 },
#endif
#ifdef _SC_STREAM_MAX
{ "STREAM_MAX", _SC_STREAM_MAX, 1 },
#else
{ "STREAM_MAX", 0, 0 },
#endif
#ifdef _SC_SYMLOOP_MAX
{ "SYMLOOP_MAX", _SC_SYMLOOP_MAX, 1 },
#else
{ "SYMLOOP_MAX", 0, 0 },
#endif
#ifdef _SC_TIMER_MAX
{ "TIMER_MAX", _SC_TIMER_MAX, 1 },
#else
{ "TIMER_MAX", 0, 0 },
#endif
#ifdef _SC_TTY_NAME_MAX
{ "TTY_NAME_MAX", _SC_TTY_NAME_MAX, 1 },
#else
{ "TTY_NAME_MAX", 0, 0 },
#endif
#ifdef _SC_TZNAME_MAX
{ "TZNAME_MAX", _SC_TZNAME_MAX, 1 },
#else
{ "TZNAME_MAX", 0, 0 },
#endif
#ifdef _SC_2_CHAR_TERM
{ "_POSIX2_CHAR_TERM", _SC_2_CHAR_TERM, 1 },
#else
{ "_POSIX2_CHAR_TERM", 0, 0 },
#endif
#ifdef _SC_2_C_BIND
{ "_POSIX2_C_BIND", _SC_2_C_BIND, 1 },
#else
{ "_POSIX2_C_BIND", 0, 0 },
#endif
#ifdef _SC_2_C_DEV
{ "_POSIX2_C_DEV", _SC_2_C_DEV, 1 },
#else
{ "_POSIX2_C_DEV", 0, 0 },
#endif
#ifdef _SC_2_C_VERSION
{ "_POSIX2_C_VERSION", _SC_2_C_VERSION, 1 },
#else
{ "_POSIX2_C_VERSION", 0, 0 },
#endif
#ifdef _SC_2_FORT_DEV
{ "_POSIX2_FORT_DEV", _SC_2_FORT_DEV, 1 },
#else
{ "_POSIX2_FORT_DEV", 0, 0 },
#endif
#ifdef _SC_2_FORT_RUN
{ "_POSIX2_FORT_RUN", _SC_2_FORT_RUN, 1 },
#else
{ "_POSIX2_FORT_RUN", 0, 0 },
#endif
#ifdef _SC_2_LOCALEDEF
{ "_POSIX2_LOCALEDEF", _SC_2_LOCALEDEF, 1 },
#else
{ "_POSIX2_LOCALEDEF", 0, 0 },
#endif
#ifdef _SC_PBS
{ "_POSIX2_PBS", _SC_PBS, 1 },
#else
{ "_POSIX2_PBS", 0, 0 },
#endif
#ifdef _SC_PBS_ACCOUNTING
{ "_POSIX2_PBS_ACCOUNTING", _SC_PBS_ACCOUNTING, 1 },
#else
{ "_POSIX2_PBS_ACCOUNTING", 0, 0 },
#endif
#ifdef _SC_PBS_CHECKPOINT
{ "_POSIX2_PBS_CHECKPOINT", _SC_PBS_CHECKPOINT, 1 },
#else
{ "_POSIX2_PBS_CHECKPOINT", 0, 0 },
#endif
#ifdef _SC_PBS_LOCATE
{ "_POSIX2_PBS_LOCATE", _SC_PBS_LOCATE, 1 },
#else
{ "_POSIX2_PBS_LOCATE", 0, 0 },
#endif
#ifdef _SC_PBS_MESSAGE
{ "_POSIX2_PBS_MESSAGE", _SC_PBS_MESSAGE, 1 },
#else
{ "_POSIX2_PBS_MESSAGE", 0, 0 },
#endif
#ifdef _SC_PBS_TRACK
{ "_POSIX2_PBS_TRACK", _SC_PBS_TRACK, 1 },
#else
{ "_POSIX2_PBS_TRACK", 0, 0 },
#endif
#ifdef _SC_2_SW_DEV
{ "_POSIX2_SW_DEV", _SC_2_SW_DEV, 1 },
#else
{ "_POSIX2_SW_DEV", 0, 0 },
#endif
#ifdef _SC_2_UPE
{ "_POSIX2_UPE", _SC_2_UPE, 1 },
#else
{ "_POSIX2_UPE", 0, 0 },
#endif
#ifdef _SC_2_VERSION
{ "_POSIX2_VERSION", _SC_2_VERSION, 1 },
#else
{ "_POSIX2_VERSION", 0, 0 },
#endif
#ifdef _SC_ADVISORY_INFO
{ "_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO, 1 },
#else
{ "_POSIX_ADVISORY_INFO", 0, 0 },
#endif
#ifdef _SC_ASYNCHRONOUS_IO
{ "_POSIX_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO, 1 },
#else
{ "_POSIX_ASYNCHRONOUS_IO", 0, 0 },
#endif
#ifdef _SC_BARRIERS
{ "_POSIX_BARRIERS", _SC_BARRIERS, 1 },
#else
{ "_POSIX_BARRIERS", 0, 0 },
#endif
#ifdef _SC_CLOCK_SELECTION
{ "_POSIX_CLOCK_SELECTION", _SC_CLOCK_SELECTION, 1 },
#else
{ "_POSIX_CLOCK_SELECTION", 0, 0 },
#endif
#ifdef _SC_CPUTIME
{ "_POSIX_CPUTIME", _SC_CPUTIME, 1 },
#else
{ "_POSIX_CPUTIME", 0, 0 },
#endif
#ifdef _SC_FILE_LOCKING
{ "_POSIX_FILE_LOCKING", _SC_FILE_LOCKING, 1 },
#else
{ "_POSIX_FILE_LOCKING", 0, 0 },
#endif
#ifdef _SC_FSYNC
{ "_POSIX_FSYNC", _SC_FSYNC, 1 },
#else
{ "_POSIX_FSYNC", 0, 0 },
#endif
#ifdef _SC_IPV6
{ "_POSIX_IPV6", _SC_IPV6, 1 },
#else
{ "_POSIX_IPV6", 0, 0 },
#endif
#ifdef _SC_JOB_CONTROL
{ "_POSIX_JOB_CONTROL", _SC_JOB_CONTROL, 1 },
#else
{ "_POSIX_JOB_CONTROL", 0, 0 },
#endif
#ifdef _SC_MAPPED_FILES
{ "_POSIX_MAPPED_FILES", _SC_MAPPED_FILES, 1 },
#else
{ "_POSIX_MAPPED_FILES", 0, 0 },
#endif
#ifdef _SC_MEMLOCK
{ "_POSIX_MEMLOCK", _SC_MEMLOCK, 1 },
#else
{ "_POSIX_MEMLOCK", 0, 0 },
#endif
#ifdef _SC_MEMLOCK_RANGE
{ "_POSIX_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE, 1 },
#else
{ "_POSIX_MEMLOCK_RANGE", 0, 0 },
#endif
#ifdef _SC_MEMORY_PROTECTION
{ "_POSIX_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION, 1 },
#else
{ "_POSIX_MEMORY_PROTECTION", 0, 0 },
#endif
#ifdef _SC_MESSAGE_PASSING
{ "_POSIX_MESSAGE_PASSING", _SC_MESSAGE_PASSING, 1 },
#else
{ "_POSIX_MESSAGE_PASSING", 0, 0 },
#endif
#ifdef _SC_MONOTONIC_CLOCK
{ "_POSIX_MONOTONIC_CLOCK", _SC_MONOTONIC_CLOCK, 1 },
#else
{ "_POSIX_MONOTONIC_CLOCK", 0, 0 },
#endif
#ifdef _SC_PRIORITIZED_IO
{ "_POSIX_PRIORITIZED_IO", _SC_PRIORITIZED_IO, 1 },
#else
{ "_POSIX_PRIORITIZED_IO", 0, 0 },
#endif
#ifdef _SC_PRIORITY_SCHEDULING
{ "_POSIX_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING, 1 },
#else
{ "_POSIX_PRIORITY_SCHEDULING", 0, 0 },
#endif
#ifdef _SC_RAW_SOCKETS
{ "_POSIX_RAW_SOCKETS", _SC_RAW_SOCKETS, 1 },
#else
{ "_POSIX_RAW_SOCKETS", 0, 0 },
#endif
#ifdef _SC_READER_WRITER_LOCKS
{ "_POSIX_READER_WRITER_LOCKS", _SC_READER_WRITER_LOCKS, 1 },
#else
{ "_POSIX_READER_WRITER_LOCKS", 0, 0 },
#endif
#ifdef _SC_REALTIME_SIGNALS
{ "_POSIX_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS, 1 },
#else
{ "_POSIX_REALTIME_SIGNALS", 0, 0 },
#endif
#ifdef _SC_REGEXP
{ "_POSIX_REGEXP", _SC_REGEXP, 1 },
#else
{ "_POSIX_REGEXP", 0, 0 },
#endif
#ifdef _SC_SAVED_IDS
{ "_POSIX_SAVED_IDS", _SC_SAVED_IDS, 1 },
#else
{ "_POSIX_SAVED_IDS", 0, 0 },
#endif
#ifdef _SC_SEMAPHORES
{ "_POSIX_SEMAPHORES", _SC_SEMAPHORES, 1 },
#else
{ "_POSIX_SEMAPHORES", 0, 0 },
#endif
#ifdef _SC_SHARED_MEMORY_OBJECTS
{ "_POSIX_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS, 1 },
#else
{ "_POSIX_SHARED_MEMORY_OBJECTS", 0, 0 },
#endif
#ifdef _SC_SHELL
{ "_POSIX_SHELL", _SC_SHELL, 1 },
#else
{ "_POSIX_SHELL", 0, 0 },
#endif
#ifdef _SC_SPAWN
{ "_POSIX_SPAWN", _SC_SPAWN, 1 },
#else
{ "_POSIX_SPAWN", 0, 0 },
#endif
#ifdef _SC_SPIN_LOCKS
{ "_POSIX_SPIN_LOCKS", _SC_SPIN_LOCKS, 1 },
#else
{ "_POSIX_SPIN_LOCKS", 0, 0 },
#endif
#ifdef _SC_SPORADIC_SERVER
{ "_POSIX_SPORADIC_SERVER", _SC_SPORADIC_SERVER, 1 },
#else
{ "_POSIX_SPORADIC_SERVER", 0, 0 },
#endif
#ifdef _SC_SS_REPL_MAX
{ "_POSIX_SS_REPL_MAX", _SC_SS_REPL_MAX, 1 },
#else
{ "_POSIX_SS_REPL_MAX", 0, 0 },
#endif
#ifdef _SC_SYNCHRONIZED_IO
{ "_POSIX_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO, 1 },
#else
{ "_POSIX_SYNCHRONIZED_IO", 0, 0 },
#endif
#ifdef _SC_THREADS
{ "_POSIX_THREADS", _SC_THREADS, 1 },
#else
{ "_POSIX_THREADS", 0, 0 },
#endif
#ifdef _SC_THREAD_ATTR_STACKADDR
{ "_POSIX_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR, 1 },
#else
{ "_POSIX_THREAD_ATTR_STACKADDR", 0, 0 },
#endif
#ifdef _SC_THREAD_ATTR_STACKSIZE
{ "_POSIX_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE, 1 },
#else
{ "_POSIX_THREAD_ATTR_STACKSIZE", 0, 0 },
#endif
#ifdef _SC_THREAD_CPUTIME
{ "_POSIX_THREAD_CPUTIME", _SC_THREAD_CPUTIME, 1 },
#else
{ "_POSIX_THREAD_CPUTIME", 0, 0 },
#endif
#ifdef _SC_THREAD_PRIORITY_SCHEDULING
{ "_POSIX_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING, 1 },
#else
{ "_POSIX_THREAD_PRIORITY_SCHEDULING", 0, 0 },
#endif
#ifdef _SC_THREAD_PRIO_INHERIT
{ "_POSIX_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT, 1 },
#else
{ "_POSIX_THREAD_PRIO_INHERIT", 0, 0 },
#endif
#ifdef _SC_THREAD_PRIO_PROTECT
{ "_POSIX_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT, 1 },
#else
{ "_POSIX_THREAD_PRIO_PROTECT", 0, 0 },
#endif
#ifdef _SC_THREAD_PROCESS_SHARED
{ "_POSIX_THREAD_PROCESS_SHARED", _SC_THREAD_PROCESS_SHARED, 1 },
#else
{ "_POSIX_THREAD_PROCESS_SHARED", 0, 0 },
#endif
#ifdef _SC_THREAD_SAFE_FUNCTIONS
{ "_POSIX_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS, 1 },
#else
{ "_POSIX_THREAD_SAFE_FUNCTIONS", 0, 0 },
#endif
#ifdef _SC_THREAD_SPORADIC_SERVER
{ "_POSIX_THREAD_SPORADIC_SERVER", _SC_THREAD_SPORADIC_SERVER, 1 },
#else
{ "_POSIX_THREAD_SPORADIC_SERVER", 0, 0 },
#endif
#ifdef _SC_TIMEOUTS
{ "_POSIX_TIMEOUTS", _SC_TIMEOUTS, 1 },
#else
{ "_POSIX_TIMEOUTS", 0, 0 },
#endif
#ifdef _SC_TIMERS
{ "_POSIX_TIMERS", _SC_TIMERS, 1 },
#else
{ "_POSIX_TIMERS", 0, 0 },
#endif
#ifdef _SC_TRACE
{ "_POSIX_TRACE", _SC_TRACE, 1 },
#else
{ "_POSIX_TRACE", 0, 0 },
#endif
#ifdef _SC_TRACE_EVENT_FILTER
{ "_POSIX_TRACE_EVENT_FILTER", _SC_TRACE_EVENT_FILTER, 1 },
#else
{ "_POSIX_TRACE_EVENT_FILTER", 0, 0 },
#endif
#ifdef _SC_TRACE_EVENT_NAME_MAX
{ "_POSIX_TRACE_EVENT_NAME_MAX", _SC_TRACE_EVENT_NAME_MAX, 1 },
#else
{ "_POSIX_TRACE_EVENT_NAME_MAX", 0, 0 },
#endif
#ifdef _SC_TRACE_INHERIT
{ "_POSIX_TRACE_INHERIT", _SC_TRACE_INHERIT, 1 },
#else
{ "_POSIX_TRACE_INHERIT", 0, 0 },
#endif
#ifdef _SC_TRACE_LOG
{ "_POSIX_TRACE_LOG", _SC_TRACE_LOG, 1 },
#else
{ "_POSIX_TRACE_LOG", 0, 0 },
#endif
#ifdef _SC_TRACE_NAME_MAX
{ "_POSIX_TRACE_NAME_MAX", _SC_TRACE_NAME_MAX, 1 },
#else
{ "_POSIX_TRACE_NAME_MAX", 0, 0 },
#endif
#ifdef _SC_TRACE_SYS_MAX
{ "_POSIX_TRACE_SYS_MAX", _SC_TRACE_SYS_MAX, 1 },
#else
{ "_POSIX_TRACE_SYS_MAX", 0, 0 },
#endif
#ifdef _SC_TRACE_USER_EVENT_MAX
{ "_POSIX_TRACE_USER_EVENT_MAX", _SC_TRACE_USER_EVENT_MAX, 1 },
#else
{ "_POSIX_TRACE_USER_EVENT_MAX", 0, 0 },
#endif
#ifdef _SC_TYPED_MEMORY_OBJECTS
{ "_POSIX_TYPED_MEMORY_OBJECTS", _SC_TYPED_MEMORY_OBJECTS, 1 },
#else
{ "_POSIX_TYPED_MEMORY_OBJECTS", 0, 0 },
#endif
#ifdef _SC_V6_ILP32_OFF32
{ "_POSIX_V6_ILP32_OFF32", _SC_V6_ILP32_OFF32, 1 },
#else
{ "_POSIX_V6_ILP32_OFF32", 0, 0 },
#endif
#ifdef _SC_V6_ILP32_OFFBIG
{ "_POSIX_V6_ILP32_OFFBIG", _SC_V6_ILP32_OFFBIG, 1 },
#else
{ "_POSIX_V6_ILP32_OFFBIG", 0, 0 },
#endif
#ifdef _SC_V6_LP64_OFF64
{ "_POSIX_V6_LP64_OFF64", _SC_V6_LP64_OFF64, 1 },
#else
{ "_POSIX_V6_LP64_OFF64", 0, 0 },
#endif
#ifdef _SC_V6_LPBIG_OFFBIG
{ "_POSIX_V6_LPBIG_OFFBIG", _SC_V6_LPBIG_OFFBIG, 1 },
#else
{ "_POSIX_V6_LPBIG_OFFBIG", 0, 0 },
#endif
#ifdef _SC_VERSION
{ "_POSIX_VERSION", _SC_VERSION, 1 },
#else
{ "_POSIX_VERSION", 0, 0 },
#endif
#ifdef _SC_XOPEN_CRYPT
{ "_XOPEN_CRYPT", _SC_XOPEN_CRYPT, 1 },
#else
{ "_XOPEN_CRYPT", 0, 0 },
#endif
#ifdef _SC_XOPEN_ENH_I18N
{ "_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N, 1 },
#else
{ "_XOPEN_ENH_I18N", 0, 0 },
#endif
#ifdef _SC_XOPEN_LEGACY
{ "_XOPEN_LEGACY", _SC_XOPEN_LEGACY, 1 },
#else
{ "_XOPEN_LEGACY", 0, 0 },
#endif
#ifdef _SC_XOPEN_REALTIME
{ "_XOPEN_REALTIME", _SC_XOPEN_REALTIME, 1 },
#else
{ "_XOPEN_REALTIME", 0, 0 },
#endif
#ifdef _SC_XOPEN_REALTIME_THREADS
{ "_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS, 1 },
#else
{ "_XOPEN_REALTIME_THREADS", 0, 0 },
#endif
#ifdef _SC_XOPEN_SHM
{ "_XOPEN_SHM", _SC_XOPEN_SHM, 1 },
#else
{ "_XOPEN_SHM", 0, 0 },
#endif
#ifdef _SC_XOPEN_STREAMS
{ "_XOPEN_STREAMS", _SC_XOPEN_STREAMS, 1 },
#else
{ "_XOPEN_STREAMS", 0, 0 },
#endif
#ifdef _SC_XOPEN_UNIX
{ "_XOPEN_UNIX", _SC_XOPEN_UNIX, 1 },
#else
{ "_XOPEN_UNIX", 0, 0 },
#endif
#ifdef _SC_XOPEN_VERSION
{ "_XOPEN_VERSION", _SC_XOPEN_VERSION, 1 },
#else
{ "_XOPEN_VERSION", 0, 0 },
#endif
#ifdef _SC_XCU_VERSION
{ "_XOPEN_XCU_VERSION", _SC_XCU_VERSION, 1 },
#else
{ "_XOPEN_XCU_VERSION", 0, 0 },
#endif
{ NULL, 0, 0 }
};
#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1)
static const struct map *
in_word_set(const char *word)
{
const struct map *mp;
for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) {
if (strcmp(word, mp->name) == 0)
return (mp);
}
return (NULL);
}
int
find_sysconf(const char *name, int *key)
{
const struct map *rv;
#ifdef APPLE_GETCONF_UNDERSCORE
char *alt;
#endif /* APPLE_GETCONF_UNDERSCORE */
rv = in_word_set(name);
if (rv != NULL) {
if (rv->valid) {
*key = rv->key;
return 1;
}
return -1;
}
#ifdef APPLE_GETCONF_UNDERSCORE
if(*name == '_')
alt = (char *)name + 1;
else {
if((alt = (char *)alloca(strlen(name) + 2)) == NULL)
return 0;
*alt = '_';
strcpy(alt + 1, name);
}
rv = in_word_set(alt);
if (rv != NULL) {
if (rv->valid) {
*key = rv->key;
return 1;
}
return -1;
}
#endif /* APPLE_GETCONF_UNDERSCORE */
return 0;
}

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Darwin Filesystem Path Waiter</string>
<key>CFBundleExecutable</key>
<string>wait4path</string>
<key>CFBundleIdentifier</key>
<string>com.apple.system_cmds.wait4path</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>wait4path</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleVersion</key>
<string>854.40.2</string>
<key>DTCompiler</key>
<string>Darling Clang</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>10.15</string>
<key>DTSDKBuild</key>
<string></string>
<key>DTSDKName</key>
<string>Darling 10.15</string>
<key>DTXcode</key>
<string></string>
<key>DTXcodeBuild</key>
<string></string>
<key>DarwinBuilderBuild</key>
<string>1A1</string>
<key>DarwinBuilderVersion</key>
<string>10.15.6</string>
<key>DarwinVariant</key>
<string>RELEASE</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2015 Apple Inc. All rights reserved.</string>
</dict>
</plist>

View File

@ -0,0 +1,11 @@
__attribute__((__used__)) const unsigned long __darwin_builder_version = 10150;
__attribute__((__used__)) const unsigned long __darwin_builder_build = 0x1A1;
__attribute__((__used__)) const char *__darwin_build_inc_version = "854.40.2";
__attribute__((__used__)) const char *__darwin_version_string = "Darwin Filesystem Path Waiter Version 1.0.0: Wed Aug 19 15:14:43 EDT 2020; ariel:wait4path/wait4path/RELEASE_X86_64";
__attribute__((__used__)) const char *__darwin_variant = "RELEASE";
__attribute__((__used__)) const char *__darwin_version_string_heywhat = "@(#)VERSION:Darwin Filesystem Path Waiter Version 1.0.0: Wed Aug 19 15:14:43 EDT 2020; ariel:wait4path/wait4path/RELEASE_X86_64";
__attribute__((__used__)) const char *__darwin_debug_binary = "/Users/ariel/git/darling/src/external/system_cmds/gen/wait4path/wait4path";
__attribute__((__used__))
__attribute__((__section__("__TEXT,__info_plist")))
static const char __darwin_info_plist[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\"><dict> <key>CFBundleDisplayName</key> <string>Darwin Filesystem Path Waiter</string> <key>CFBundleExecutable</key> <string>wait4path</string> <key>CFBundleIdentifier</key> <string>com.apple.system_cmds.wait4path</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>wait4path</string> <key>CFBundleShortVersionString</key> <string>1.0.0</string> <key>CFBundleVersion</key> <string>854.40.2</string> <key>DTCompiler</key> <string>Darling Clang</string> <key>DTPlatformName</key> <string>macosx</string> <key>DTPlatformVersion</key> <string>10.15</string> <key>DTSDKBuild</key> <string></string> <key>DTSDKName</key> <string>Darling 10.15</string> <key>DTXcode</key> <string></string> <key>DTXcodeBuild</key> <string></string> <key>DarwinBuilderBuild</key> <string>1A1</string> <key>DarwinBuilderVersion</key> <string>10.15.6</string> <key>DarwinVariant</key> <string>RELEASE</string> <key>NSHumanReadableCopyright</key> <string>Copyright 2015 Apple Inc. All rights reserved.</string></dict></plist>";

View File

@ -0,0 +1,10 @@
#ifndef __DARWIN_VERSION_H__
#define __DARWIN_VERSION_H__
const unsigned long __darwin_builder_version;
const unsigned long __darwin_builder_build;
const char *__darwin_build_inc_version;
const char *__darwin_version_string;
const char *__darwin_variant;
const char *__darwin_debug_binary;
#endif // __DARWIN_VERSION_H__

View File

@ -0,0 +1,24 @@
project(system_cmds-getconf)
add_compile_definitions(
APPLE_GETCONF_UNDERSCORE
APPLE_GETCONF_SPEC
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
)
add_darling_executable(getconf
getconf.c
../gen/getconf.tproj/confstr.c
../gen/getconf.tproj/limits.c
../gen/getconf.tproj/pathconf.c
../gen/getconf.tproj/progenv.c
../gen/getconf.tproj/sysconf.c
)
install(TARGETS getconf DESTINATION libexec/darling/usr/bin)
install(FILES getconf.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,14 @@
project(system_cmds-getty)
add_darling_executable(getty
chat.c
init.c
main.c
subr.c
)
install(TARGETS getty DESTINATION libexec/darling/usr/libexec)
install(FILES getty.8 DESTINATION libexec/darling/usr/share/man/man8)
install(FILES gettytab.5 ttys.5 DESTINATION libexec/darling/usr/share/man/man5)

View File

@ -0,0 +1,9 @@
project(system_cmds-hostinfo)
add_darling_executable(hostinfo
hostinfo.c
)
install(TARGETS hostinfo DESTINATION libexec/darling/usr/bin)
install(FILES hostinfo.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,19 @@
project(system_cmds-iosim)
include_directories(
../at.tproj
)
add_darling_executable(iosim
iosim.c
)
target_link_libraries(iosim
IOKit
CoreFoundation
util
)
install(TARGETS iosim DESTINATION libexec/darling/usr/bin)
install(FILES iosim.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -15,7 +15,9 @@
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
#ifndef DARLING // in Darling, we already have panic declared through in `mach/mach.h`, included as a dependency of one of those headers above
#include "panic.h" #include "panic.h"
#endif
#include <IOKit/IOKitLib.h> #include <IOKit/IOKitLib.h>
#define IO_MODE_SEQ 0 #define IO_MODE_SEQ 0

View File

@ -0,0 +1,14 @@
project(system_cmds-iostat)
add_darling_executable(iostat
iostat.c
)
target_link_libraries(iostat
IOKit
CoreFoundation
)
install(TARGETS iostat DESTINATION libexec/darling/usr/sbin)
install(FILES iostat.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,7 @@
project(system_cmds-kpgo)
add_darling_executable(kpgo
kpgo.c
)
install(TARGETS kpgo DESTINATION libexec/darling/usr/bin)

View File

@ -0,0 +1,14 @@
project(system_cmds-latency)
add_darling_executable(latency
latency.c
)
target_link_libraries(latency
ncurses
util
)
install(TARGETS latency DESTINATION libexec/darling/usr/bin)
install(FILES latency.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,24 @@
project(system_cmds-login)
add_compile_definitions(
USE_PAM
USE_BSM_AUDIT
)
add_darling_executable(login-exe
login.c
login_audit.c
)
set_target_properties(login-exe PROPERTIES OUTPUT_NAME "login")
target_link_libraries(login-exe
bsm.0
pam.2
)
install(TARGETS login-exe DESTINATION libexec/darling/usr/bin)
install(FILES login.1 DESTINATION libexec/darling/usr/share/man/man1)
install(DIRECTORY login.tproj/pam.d DESTINATION libexec/darling/etc)

View File

@ -0,0 +1,9 @@
project(system_cmds-lskq)
add_darling_executable(lskq
lskq.c
)
install(TARGETS lskq DESTINATION libexec/darling/usr/bin)
install(FILES lskq.1 DESTINATION libexec/darling/usr/share/man/man1)

15
lsmp.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
project(system_cmds-lsmp)
add_darling_executable(lsmp
lsmp.c
port_details.c
task_details.c
)
target_link_libraries(lsmp
util
)
install(TARGETS lsmp DESTINATION libexec/darling/usr/bin)
install(FILES lsmp.1 DESTINATION libexec/darling/usr/share/man/man1)

13
ltop.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,13 @@
project(system_cmds-ltop)
add_darling_executable(ltop
ltop.c
)
target_link_libraries(ltop
util
)
install(TARGETS ltop DESTINATION libexec/darling/usr/bin)
install(FILES ltop.1 DESTINATION libexec/darling/usr/share/man/man1)

11
mean.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,11 @@
project(system_cmds-mean)
add_darling_executable(mean
mean.c
)
target_link_libraries(mean
util
)
install(TARGETS mean DESTINATION libexec/darling/usr/bin)

View File

@ -0,0 +1,13 @@
project(system_cmds-memory_pressure)
add_darling_executable(memory_pressure
memory_pressure.c
)
target_link_libraries(memory_pressure
util
)
install(TARGETS memory_pressure DESTINATION libexec/darling/usr/bin)
install(FILES memory_pressure.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,9 @@
project(system_cmds-mkfile)
add_darling_executable(mkfile
mkfile.c
)
install(TARGETS mkfile DESTINATION libexec/darling/usr/sbin)
install(FILES mkfile.8 DESTINATION libexec/darling/usr/share/man/man8)

9
mslutil/CMakeLists.txt Normal file
View File

@ -0,0 +1,9 @@
project(system_cmds-mslutil)
add_darling_executable(mslutil
mslutil.c
)
install(TARGETS mslutil DESTINATION libexec/darling/usr/bin)
install(FILES mslutil.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,9 @@
project(system_cmds-newgrp)
add_darling_executable(newgrp
newgrp.c
)
install(TARGETS newgrp DESTINATION libexec/darling/usr/bin)
install(FILES newgrp.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,11 @@
project(system_cmds-nologin)
add_darling_executable(nologin
nologin.c
)
install(TARGETS nologin DESTINATION libexec/darling/sbin)
install(FILES nologin.8 DESTINATION libexec/darling/usr/share/man/man8)
install(FILES nologin.5 DESTINATION libexec/darling/usr/share/man/man5)

View File

@ -0,0 +1,14 @@
project(system_cmds-nvram)
add_darling_executable(nvram
nvram.c
)
target_link_libraries(nvram
IOKit
CoreFoundation
)
install(TARGETS nvram DESTINATION libexec/darling/usr/sbin)
install(FILES nvram.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,5 @@
project(system_cmds-pagesize)
install(PROGRAMS pagesize.sh DESTINATION libexec/darling/usr/bin RENAME pagesize)
install(FILES pagesize.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,15 @@
project(system_cmds-passwd)
add_darling_executable(passwd
file_passwd.c
nis_passwd.c
od_passwd.c
pam_passwd.c
passwd.c
)
install(TARGETS passwd DESTINATION libexec/darling/usr/bin)
install(FILES passwd.1 DESTINATION libexec/darling/usr/share/man/man1)
install(FILES passwd.pam DESTINATION libexec/darling/private/etc/pam.d/passwd)

View File

@ -0,0 +1,9 @@
project(system_cmds-proc_uuid_policy)
add_darling_executable(proc_uuid_policy
proc_uuid_policy.c
)
install(TARGETS proc_uuid_policy DESTINATION libexec/darling/usr/bin)
install(FILES proc_uuid_policy.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,9 @@
project(system_cmds-purge)
add_darling_executable(purge
purge.c
)
install(TARGETS purge DESTINATION libexec/darling/usr/sbin)
install(FILES purge.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,15 @@
project(system_cmds-pwd_mkdb)
add_compile_definitions(
_PW_NAME_LEN=MAXLOGNAME
_PW_YPTOKEN="__YP!"
)
add_darling_executable(pwd_mkdb
pw_scan.c
pwd_mkdb.c
)
install(TARGETS pwd_mkdb DESTINATION libexec/darling/usr/sbin)
install(FILES pwd_mkdb.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,21 @@
project(system_cmds-reboot)
mig(kextmanager.defs)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
add_darling_executable(reboot
reboot.c
${CMAKE_CURRENT_BINARY_DIR}/kextmanagerUser.c
)
install(TARGETS reboot DESTINATION libexec/darling/sbin)
InstallSymlink(reboot ${CMAKE_INSTALL_PREFIX}/libexec/darling/sbin/halt)
install(FILES reboot.8 DESTINATION libexec/darling/usr/share/man/man8)
InstallSymlink(reboot.8 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man8/halt.8)

16
sa.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,16 @@
project(system_cmds-sa)
add_compile_definitions(
AHZV1=64
)
add_darling_executable(sa
db.c
main.c
pdb.c
usrdb.c
)
install(TARGETS sa DESTINATION libexec/darling/usr/sbin)
install(FILES sa.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,14 @@
project(system_cmds-sc_usage)
add_darling_executable(sc_usage
sc_usage.c
)
target_link_libraries(sc_usage
util
ncurses
)
install(TARGETS sc_usage DESTINATION libexec/darling/usr/bin)
install(FILES sc_usage.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,22 @@
project(system_cmds-shutdown)
mig(kextmanager.defs)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
add_darling_executable(shutdown
shutdown.c
${CMAKE_CURRENT_BINARY_DIR}/kextmanagerUser.c
)
target_link_libraries(shutdown
bsm.0
IOKit
)
install(TARGETS shutdown DESTINATION libexec/darling/sbin)
install(FILES shutdown.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,7 @@
project(system_cmds-stackshot)
add_darling_executable(stackshot
stackshot.c
)
install(TARGETS stackshot DESTINATION libexec/darling/usr/bin)

View File

@ -0,0 +1,9 @@
project(system_cmds-sync)
add_darling_executable(sync
sync.c
)
install(TARGETS sync DESTINATION libexec/darling/bin)
install(FILES sync.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,11 @@
project(system_cmds-sysctl)
add_darling_executable(sysctl
sysctl.c
)
install(TARGETS sysctl DESTINATION libexec/darling/usr/sbin)
install(FILES sysctl.8 DESTINATION libexec/darling/usr/share/man/man8)
install(FILES sysctl.conf.5 DESTINATION libexec/darling/usr/share/man/man5)

View File

@ -0,0 +1,9 @@
project(system_cmds-taskpolicy)
add_darling_executable(taskpolicy
taskpolicy.c
)
install(TARGETS taskpolicy DESTINATION libexec/darling/usr/sbin)
install(FILES taskpolicy.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,13 @@
project(system_cmds-trace)
add_darling_executable(trace
trace.c
)
target_link_libraries(trace
util
)
install(TARGETS trace DESTINATION libexec/darling/usr/bin)
install(FILES trace.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,9 @@
project(system_cmds-vifs)
add_darling_executable(vifs
vifs.c
)
install(TARGETS trace DESTINATION libexec/darling/usr/sbin)
install(FILES vifs.8 DESTINATION libexec/darling/usr/share/man/man8)

10
vipw.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,10 @@
project(system_cmds-vipw)
add_darling_executable(vipw
pw_util.c
vipw.c
)
install(TARGETS vipw DESTINATION libexec/darling/usr/sbin)
install(FILES vipw.8 DESTINATION libexec/darling/usr/share/man/man8)

View File

@ -0,0 +1,13 @@
project(system_cmds-vm_purgeable_stat)
add_darling_executable(vm_purgeable_stat
vm_purgeable_stat.c
)
target_link_libraries(vm_purgeable_stat
util
)
install(TARGETS vm_purgeable_stat DESTINATION libexec/darling/usr/bin)
install(FILES vm_purgeable_stat.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,9 @@
project(system_cmds-vm_stat)
add_darling_executable(vm_stat
vm_stat.c
)
install(TARGETS vm_stat DESTINATION libexec/darling/usr/bin)
install(FILES vm_stat.1 DESTINATION libexec/darling/usr/share/man/man1)

11
wait4path/CMakeLists.txt Normal file
View File

@ -0,0 +1,11 @@
project(system_cmds-wait4path)
add_darling_executable(wait4path
wait4path.c
../gen/wait4path/x86_64/darwin_version.c
)
install(TARGETS wait4path DESTINATION libexec/darling/bin)
install(FILES wait4path.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,7 @@
project(system_cmds-wordexp-helper)
add_darling_executable(wordexp-helper
wordexp-helper.c
)
install(TARGETS wordexp-helper DESTINATION libexec/darling/usr/lib/system)

View File

@ -0,0 +1,9 @@
project(system_cmds-zdump)
add_darling_executable(zdump
zdump.c
)
install(TARGETS zdump DESTINATION libexec/darling/usr/sbin)
install(FILES zdump.8 DESTINATION libexec/darling/usr/share/man/man8)

11
zic.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,11 @@
project(system_cmds-zic)
add_darling_executable(zic
ialloc.c
scheck.c
zic.c
)
install(TARGETS zic DESTINATION libexec/darling/usr/sbin)
install(FILES zic.8 DESTINATION libexec/darling/usr/share/man/man8)

15
zlog.tproj/CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
project(system_cmds-zlog)
add_darling_executable(zlog
SymbolicationHelper.c
zlog.c
)
target_link_libraries(zlog
CoreFoundation
CoreSymbolication
)
install(TARGETS zlog DESTINATION libexec/darling/usr/bin)
install(FILES zlog.1 DESTINATION libexec/darling/usr/share/man/man1)

View File

@ -0,0 +1,26 @@
project(system_cmds-zprint)
include_directories(
${CMAKE_SOURCE_DIR}/${DARLING_SDK_RELATIVE_PATH}/usr/include/mach
)
add_compile_definitions(
KERNEL_PRIVATE
)
add_darling_executable(zprint
zprint.c
)
target_link_libraries(zprint
IOKit
CoreSymbolication
CoreFoundation
util
)
install(TARGETS zprint DESTINATION libexec/darling/usr/bin)
install(FILES zprint.1 DESTINATION libexec/darling/usr/share/man/man1)
install(FILES zprint.lua DESTINATION libexec/darling/usr/share/recon)