this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Solved all local unresolved symbol references

+595 -81
+106 -6
kernel-include/sys/proc_info.h
··· 41 41 #include <net/route.h> 42 42 #include <netinet/in.h> 43 43 #include <netinet/tcp.h> 44 + #include <mach/machine.h> 44 45 45 46 __BEGIN_DECLS 46 47 ··· 95 96 }; 96 97 97 98 99 + #ifdef PRIVATE 100 + struct proc_uniqidentifierinfo { 101 + uint8_t p_uuid[16]; /* UUID of the main executable */ 102 + uint64_t p_uniqueid; /* 64 bit unique identifier for process */ 103 + uint64_t p_puniqueid; /* unique identifier for process's parent */ 104 + uint64_t p_reserve2; /* reserved for future use */ 105 + uint64_t p_reserve3; /* reserved for future use */ 106 + uint64_t p_reserve4; /* reserved for future use */ 107 + }; 108 + 109 + 110 + struct proc_bsdinfowithuniqid { 111 + struct proc_bsdinfo pbsd; 112 + struct proc_uniqidentifierinfo p_uniqidentifier; 113 + }; 114 + 115 + struct proc_archinfo { 116 + cpu_type_t p_cputype; 117 + cpu_subtype_t p_cpusubtype; 118 + }; 119 + 120 + struct proc_pidcoalitioninfo { 121 + uint64_t coalition_id; 122 + uint64_t reserved1; 123 + uint64_t reserved2; 124 + uint64_t reserved3; 125 + }; 126 + 127 + #endif 128 + 129 + 98 130 /* pbi_flags values */ 99 131 #define PROC_FLAG_SYSTEM 1 /* System process */ 100 132 #define PROC_FLAG_TRACED 2 /* process currently being traced, possibly by gdb */ ··· 118 150 #ifdef PRIVATE 119 151 #define PROC_FLAG_DARWINBG 0x8000 /* process in darwin background */ 120 152 #define PROC_FLAG_EXT_DARWINBG 0x10000 /* process in darwin background - external enforcement */ 121 - #define PROC_FLAG_IOS_APPLEDAEMON 0x20000 /* Process is apple daemon */ 122 - #define PROC_FLAG_DELAYIDLESLEEP 0x40000 /* Process is marked to delay idle sleep on disk IO */ 153 + #define PROC_FLAG_IOS_APPLEDAEMON 0x20000 /* Process is apple daemon */ 154 + #define PROC_FLAG_DELAYIDLESLEEP 0x40000 /* Process is marked to delay idle sleep on disk IO */ 155 + #define PROC_FLAG_IOS_IMPPROMOTION 0x80000 /* Process is daemon which receives importane donation */ 156 + #define PROC_FLAG_ADAPTIVE 0x100000 /* Process is adaptive */ 157 + #define PROC_FLAG_ADAPTIVE_IMPORTANT 0x200000 /* Process is adaptive, and is currently important */ 158 + #define PROC_FLAG_IMPORTANCE_DONOR 0x400000 /* Process is marked as an importance donor */ 159 + #define PROC_FLAG_SUPPRESSED 0x800000 /* Process is suppressed */ 160 + #define PROC_FLAG_APPLICATION 0x1000000 /* Process is an application */ 161 + #define PROC_FLAG_IOS_APPLICATION PROC_FLAG_APPLICATION /* Process is an application */ 123 162 #endif 124 163 125 164 ··· 240 279 uint32_t fi_status; 241 280 off_t fi_offset; 242 281 int32_t fi_type; 243 - int32_t rfu_1; /* reserved */ 282 + uint32_t fi_guardflags; 244 283 }; 245 284 246 285 /* stats flags in proc_fileinfo */ 247 286 #define PROC_FP_SHARED 1 /* shared by more than one fd */ 248 287 #define PROC_FP_CLEXEC 2 /* close on exec */ 288 + #define PROC_FP_GUARDED 4 /* guarded fd */ 289 + 290 + #define PROC_FI_GUARD_CLOSE (1u << 0) 291 + #define PROC_FI_GUARD_DUP (1u << 1) 292 + #define PROC_FI_GUARD_SOCKET_IPC (1u << 2) 293 + #define PROC_FI_GUARD_FILEPORT (1u << 3) 249 294 250 295 /* 251 296 * A copy of stat64 with static sized fields. ··· 647 692 #define PROC_PIDTHREADID64INFO 15 648 693 #define PROC_PIDTHREADID64INFO_SIZE (sizeof(struct proc_threadinfo)) 649 694 695 + #define PROC_PID_RUSAGE 16 696 + #define PROC_PID_RUSAGE_SIZE 0 697 + 698 + #ifdef PRIVATE 699 + #define PROC_PIDUNIQIDENTIFIERINFO 17 700 + #define PROC_PIDUNIQIDENTIFIERINFO_SIZE \ 701 + (sizeof(struct proc_uniqidentifierinfo)) 702 + 703 + #define PROC_PIDT_BSDINFOWITHUNIQID 18 704 + #define PROC_PIDT_BSDINFOWITHUNIQID_SIZE \ 705 + (sizeof(struct proc_bsdinfowithuniqid)) 706 + 707 + #define PROC_PIDARCHINFO 19 708 + #define PROC_PIDARCHINFO_SIZE \ 709 + (sizeof(struct proc_archinfo)) 710 + 711 + #define PROC_PIDCOALITIONINFO 20 712 + #define PROC_PIDCOALITIONINFO_SIZE (sizeof(struct proc_pidcoalitioninfo)) 713 + 714 + #define PROC_PIDNOTEEXIT 21 715 + #define PROC_PIDNOTEEXIT_SIZE (sizeof(uint32_t)) 716 + 717 + #define PROC_PIDREGIONPATHINFO2 22 718 + #define PROC_PIDREGIONPATHINFO2_SIZE (sizeof(struct proc_regionwithpathinfo)) 719 + 720 + #define PROC_PIDREGIONPATHINFO3 23 721 + #define PROC_PIDREGIONPATHINFO3_SIZE (sizeof(struct proc_regionwithpathinfo)) 722 + 723 + #endif 724 + 650 725 /* Flavors for proc_pidfdinfo */ 651 726 652 727 #define PROC_PIDFDVNODEINFO 1 ··· 702 777 #define PROC_DIRTYCONTROL_TRACK 1 703 778 #define PROC_DIRTYCONTROL_SET 2 704 779 #define PROC_DIRTYCONTROL_GET 3 780 + #define PROC_DIRTYCONTROL_CLEAR 4 705 781 706 782 /* proc_track_dirty() flags */ 707 783 #define PROC_DIRTY_TRACK 0x1 708 784 #define PROC_DIRTY_ALLOW_IDLE_EXIT 0x2 709 - 710 - #define PROC_DIRTY_TRACK_MASK (PROC_DIRTY_TRACK|PROC_DIRTY_ALLOW_IDLE_EXIT) 785 + #define PROC_DIRTY_DEFER 0x4 786 + #define PROC_DIRTY_LAUNCH_IN_PROGRESS 0x8 711 787 712 788 /* proc_get_dirty() flags */ 713 789 #define PROC_DIRTY_TRACKED 0x1 714 790 #define PROC_DIRTY_ALLOWS_IDLE_EXIT 0x2 715 - #define PROC_DIRTY_IS_DIRTY 0x4 791 + #define PROC_DIRTY_IS_DIRTY 0x4 792 + #define PROC_DIRTY_LAUNCH_IS_IN_PROGRESS 0x8 793 + 794 + #ifdef PRIVATE 795 + 796 + /* Flavors for proc_pidoriginatorinfo */ 797 + #define PROC_PIDORIGINATOR_UUID 0x1 798 + #define PROC_PIDORIGINATOR_UUID_SIZE (sizeof(uuid_t)) 799 + 800 + #define PROC_PIDORIGINATOR_BGSTATE 0x2 801 + #define PROC_PIDORIGINATOR_BGSTATE_SIZE (sizeof(uint32_t)) 802 + 803 + /* __proc_info() call numbers */ 804 + #define PROC_INFO_CALL_LISTPIDS 0x1 805 + #define PROC_INFO_CALL_PIDINFO 0x2 806 + #define PROC_INFO_CALL_PIDFDINFO 0x3 807 + #define PROC_INFO_CALL_KERNMSGBUF 0x4 808 + #define PROC_INFO_CALL_SETCONTROL 0x5 809 + #define PROC_INFO_CALL_PIDFILEPORTINFO 0x6 810 + #define PROC_INFO_CALL_TERMINATE 0x7 811 + #define PROC_INFO_CALL_DIRTYCONTROL 0x8 812 + #define PROC_INFO_CALL_PIDRUSAGE 0x9 813 + #define PROC_INFO_CALL_PIDORIGINATORINFO 0xa 814 + 815 + #endif /* PRIVATE */ 716 816 717 817 #ifdef XNU_KERNEL_PRIVATE 718 818 #ifndef pshmnode
+19 -37
kernel-include/sys/process_policy.h
··· 34 34 #include <sys/types.h> 35 35 #include <stdint.h> 36 36 37 + #ifndef XNU_KERNEL_PRIVATE 38 + #include <TargetConditionals.h> 39 + #endif 40 + 37 41 __BEGIN_DECLS 38 42 39 43 /* defns of scope */ ··· 52 56 #define PROC_POLICY_ACTION_GET 11 /* get the policy attributes */ 53 57 #define PROC_POLICY_ACTION_ADD 12 /* add a policy attribute */ 54 58 #define PROC_POLICY_ACTION_REMOVE 13 /* remove a policy attribute */ 59 + #define PROC_POLICY_ACTION_HOLD 14 /* hold an importance boost assertion */ 60 + #define PROC_POLICY_ACTION_DROP 15 /* drop an importance boost assertion */ 55 61 56 62 /* policies */ 57 63 #define PROC_POLICY NONE 0 ··· 59 65 #define PROC_POLICY_HARDWARE_ACCESS 2 /* access to various hardware */ 60 66 #define PROC_POLICY_RESOURCE_STARVATION 3 /* behavior on resource starvation */ 61 67 #define PROC_POLICY_RESOURCE_USAGE 4 /* behavior on resource consumption */ 62 - #if CONFIG_EMBEDDED 63 - #define PROC_POLICY_APP_LIFECYCLE 5 /* app life cycle management */ 64 - #else /* CONFIG_EMBEDDED */ 65 68 #define PROC_POLICY_RESERVED 5 /* behavior on resource consumption */ 66 - #endif /* CONFIG_EMBEDDED */ 67 69 #define PROC_POLICY_APPTYPE 6 /* behavior on resource consumption */ 70 + #define PROC_POLICY_BOOST 7 /* importance boost/drop */ 68 71 69 72 /* sub policies for background policy */ 70 73 #define PROC_POLICY_BG_NONE 0 /* none */ ··· 72 75 #define PROC_POLICY_BG_DISKTHROTTLE 2 /* disk accesses throttled */ 73 76 #define PROC_POLICY_BG_NETTHROTTLE 4 /* network accesses throttled */ 74 77 #define PROC_POLICY_BG_GPUDENY 8 /* no access to GPU */ 75 - #if CONFIG_EMBEDDED 76 - #define PROC_POLICY_BG_ALL 0x0F 77 - #else /* CONFIG_EMBEDDED */ 78 78 #define PROC_POLICY_BG_ALL 0x07 79 - #endif /* CONFIG_EMBEDDED */ 80 79 #define PROC_POLICY_BG_DEFAULT PROC_POLICY_BG_ALL 81 80 82 81 /* sub policies for hardware */ ··· 137 136 #define PROC_POLICY_RSRCACT_NOTIFY_KQ 4 /* send kqueue notification */ 138 137 #define PROC_POLICY_RSRCACT_NOTIFY_EXC 5 /* send exception */ 139 138 139 + #define PROC_POLICY_CPUMON_DISABLE 0xFF /* Disable CPU usage monitor */ 140 + #define PROC_POLICY_CPUMON_DEFAULTS 0xFE /* Set default CPU usage monitor params */ 140 141 141 - /* type of resource for kqueue notifiction */ 142 - #define PROC_POLICY_RSRTYPE_CPU 1 143 - #define PROC_POLICY_RSRTYPE_WIREDMEM 2 144 - #define PROC_POLICY_RSRTYPE_VIRTUALMEM 4 145 - #define PROC_POLICY_RSRTYPE_DISK 8 146 - #define PROC_POLICY_RSRTYPE_NETWORK 0x010 147 - #define PROC_POLICY_RSRTYPE_POWER 0x20 148 - 142 + /* sub policies for importance boost/drop */ 143 + #define PROC_POLICY_IMP_IMPORTANT 1 /* Important-level boost */ 144 + #define PROC_POLICY_IMP_STANDARD 2 /* Standard-level boost */ 145 + #define PROC_POLICY_IMP_DONATION 3 /* Mark a task as an importance source */ 149 146 150 147 typedef struct proc_policy_attribute { 151 148 uint32_t ppattr_attribute; /* the policy attribute to be modified or returned */ ··· 164 161 uint64_t ppattr_cpu_attr_deadline; /* 64bit deadline in nsecs */ 165 162 } proc_policy_cpuusage_attr_t; 166 163 167 - #if CONFIG_EMBEDDED 168 - /* sub policies for app lifecycle management */ 169 - #define PROC_POLICY_APPLIFE_NONE 0 /* does nothing.. */ 170 - #define PROC_POLICY_APPLIFE_STATE 1 /* sets the app to various lifecycle states */ 171 - #define PROC_POLICY_APPLIFE_DEVSTATUS 2 /* notes the device in inactive or short/long term */ 172 - #define PROC_POLICY_APPLIFE_PIDBIND 3 /* a thread is to be bound to another processes app state */ 173 - #endif /* CONFIG_EMBEDDED */ 174 164 175 165 /* sub policies for PROC_POLICY_APPTYPE */ 176 166 #define PROC_POLICY_APPTYPE_NONE 0 /* does nothing.. */ 177 167 #define PROC_POLICY_APPTYPE_MODIFY 1 /* sets the app to various lifecycle states */ 178 - #if CONFIG_EMBEDDED 179 - #define PROC_POLICY_APPTYPE_THREADTHR 2 /* notes the device in inactive or short/long term */ 180 - #endif /* CONFIG_EMBEDDED */ 181 168 169 + /* exported apptypes for PROC_POLICY_APPTYPE */ 170 + #define PROC_POLICY_OSX_APPTYPE_TAL 1 /* TAL-launched app */ 182 171 183 - #define PROC_POLICY_OSX_APPTYPE_NONE 0 184 - #if CONFIG_EMBEDDED 185 - #define PROC_POLICY_IOS_RESV1_APPTYPE 1 /* TAL based launched */ 186 - #define PROC_POLICY_IOS_APPLE_DAEMON 2 /* for user of IOS apple daemons */ 187 - #define PROC_POLICY_IOS_APPTYPE 3 /* ios specific handling */ 188 - #define PROC_POLICY_IOS_NONUITYPE 4 /* ios non graphics type */ 189 - #else 190 - #define PROC_POLICY_OSX_APPTYPE_TAL 1 /* TAL based launched */ 191 - #define PROC_POLICY_OSX_APPTYPE_WIDGET 2 /* for dashboard client */ 192 - #define PROC_POLICY_OSX_APPTYPE_DASHCLIENT 2 /* rename to move away from widget */ 193 - #endif 172 + #define PROC_POLICY_OSX_APPTYPE_DASHCLIENT 2 /* Dashboard client (deprecated) */ 173 + #define PROC_POLICY_IOS_DONATEIMP 6 /* donates priority imp (deprecated) */ 174 + #define PROC_POLICY_IOS_HOLDIMP 7 /* hold importance assertion (deprecated) */ 175 + #define PROC_POLICY_IOS_DROPIMP 8 /* drop importance assertion (deprecated) */ 194 176 195 177 #ifndef KERNEL 196 178 int process_policy(int scope, int action, int policy, int policy_subtype, proc_policy_attribute_t * attrp, pid_t target_pid, uint64_t target_threadid);
+205 -32
kernel-include/sys/resource.h
··· 68 68 #include <sys/cdefs.h> 69 69 #include <sys/_types.h> 70 70 71 - #ifndef KERNEL 71 + #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL 72 + #include <stdint.h> 73 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 74 + 75 + #ifndef KERNEL 72 76 #include <Availability.h> 73 77 #endif 74 78 75 79 /* [XSI] The timeval structure shall be defined as described in 76 80 * <sys/time.h> 77 81 */ 78 - #define __need_struct_timeval 82 + #include <sys/_types/_timeval.h> 79 83 #ifdef KERNEL 80 - #define __need_struct_user32_timeval 81 - #define __need_struct_user64_timeval 84 + #include <sys/_types/_user32_timeval.h> 85 + #include <sys/_types/_user64_timeval.h> 82 86 #endif 83 - #include <sys/_structs.h> 84 87 85 88 /* The id_t type shall be defined as described in <sys/types.h> */ 86 - #ifndef _ID_T 87 - #define _ID_T 88 - typedef __darwin_id_t id_t; /* can hold pid_t, gid_t, or uid_t */ 89 - #endif 89 + #include <sys/_types/_id_t.h> 90 90 91 91 92 92 /* ··· 107 107 #define PRIO_PGRP 1 /* Second argument is a GID */ 108 108 #define PRIO_USER 2 /* Second argument is a UID */ 109 109 110 - #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) 110 + #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL 111 111 #define PRIO_DARWIN_THREAD 3 /* Second argument is always 0 (current thread) */ 112 112 #define PRIO_DARWIN_PROCESS 4 /* Second argument is a PID */ 113 113 114 + #ifdef PRIVATE 115 + 116 + #define PRIO_DARWIN_GPU 5 /* Second argument is a PID */ 117 + 118 + #define PRIO_DARWIN_GPU_ALLOW 0x1 119 + #define PRIO_DARWIN_GPU_DENY 0x2 120 + 121 + #define PRIO_DARWIN_ROLE 6 /* Second argument is a PID */ 122 + 123 + #define PRIO_DARWIN_ROLE_DEFAULT 0x0 /* Default state */ 124 + #define PRIO_DARWIN_ROLE_UI_FOCAL 0x1 /* On screen, focal UI */ 125 + #define PRIO_DARWIN_ROLE_UI 0x2 /* On screen, non-focal UI */ 126 + #define PRIO_DARWIN_ROLE_NON_UI 0x3 /* Off screen, non-focal UI */ 127 + 128 + #endif /* PRIVATE */ 129 + 114 130 /* 115 131 * Range limitations for the value of the third parameter to setpriority(). 116 132 */ ··· 126 142 127 143 /* 128 144 * use PRIO_DARWIN_NONUI to restrict a process's ability to make calls to 129 - * the GPU. 145 + * the GPU. (deprecated) 130 146 */ 131 147 #define PRIO_DARWIN_NONUI 0x1001 132 148 133 - #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ 149 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 134 150 135 151 136 152 ··· 157 173 struct rusage { 158 174 struct timeval ru_utime; /* user time used (PL) */ 159 175 struct timeval ru_stime; /* system time used (PL) */ 160 - #if defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE) 176 + #if __DARWIN_C_LEVEL < __DARWIN_C_FULL 161 177 long ru_opaque[14]; /* implementation defined */ 162 - #else /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ 178 + #else 163 179 /* 164 180 * Informational aliases for source compatibility with programs 165 181 * that need more information than that provided by standards, ··· 181 197 long ru_nvcsw; /* voluntary context switches (atomic) */ 182 198 long ru_nivcsw; /* involuntary " */ 183 199 #define ru_last ru_nivcsw /* internal: ruadd() range end */ 184 - #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ 200 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 201 + }; 202 + 203 + #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL 204 + /* 205 + * Flavors for proc_pid_rusage(). 206 + */ 207 + #define RUSAGE_INFO_V0 0 208 + #define RUSAGE_INFO_V1 1 209 + #define RUSAGE_INFO_V2 2 210 + #define RUSAGE_INFO_V3 3 211 + #define RUSAGE_INFO_CURRENT RUSAGE_INFO_V3 212 + 213 + typedef void *rusage_info_t; 214 + 215 + struct rusage_info_v0 { 216 + uint8_t ri_uuid[16]; 217 + uint64_t ri_user_time; 218 + uint64_t ri_system_time; 219 + uint64_t ri_pkg_idle_wkups; 220 + uint64_t ri_interrupt_wkups; 221 + uint64_t ri_pageins; 222 + uint64_t ri_wired_size; 223 + uint64_t ri_resident_size; 224 + uint64_t ri_phys_footprint; 225 + uint64_t ri_proc_start_abstime; 226 + uint64_t ri_proc_exit_abstime; 227 + }; 228 + 229 + struct rusage_info_v1 { 230 + uint8_t ri_uuid[16]; 231 + uint64_t ri_user_time; 232 + uint64_t ri_system_time; 233 + uint64_t ri_pkg_idle_wkups; 234 + uint64_t ri_interrupt_wkups; 235 + uint64_t ri_pageins; 236 + uint64_t ri_wired_size; 237 + uint64_t ri_resident_size; 238 + uint64_t ri_phys_footprint; 239 + uint64_t ri_proc_start_abstime; 240 + uint64_t ri_proc_exit_abstime; 241 + uint64_t ri_child_user_time; 242 + uint64_t ri_child_system_time; 243 + uint64_t ri_child_pkg_idle_wkups; 244 + uint64_t ri_child_interrupt_wkups; 245 + uint64_t ri_child_pageins; 246 + uint64_t ri_child_elapsed_abstime; 247 + }; 248 + 249 + struct rusage_info_v2 { 250 + uint8_t ri_uuid[16]; 251 + uint64_t ri_user_time; 252 + uint64_t ri_system_time; 253 + uint64_t ri_pkg_idle_wkups; 254 + uint64_t ri_interrupt_wkups; 255 + uint64_t ri_pageins; 256 + uint64_t ri_wired_size; 257 + uint64_t ri_resident_size; 258 + uint64_t ri_phys_footprint; 259 + uint64_t ri_proc_start_abstime; 260 + uint64_t ri_proc_exit_abstime; 261 + uint64_t ri_child_user_time; 262 + uint64_t ri_child_system_time; 263 + uint64_t ri_child_pkg_idle_wkups; 264 + uint64_t ri_child_interrupt_wkups; 265 + uint64_t ri_child_pageins; 266 + uint64_t ri_child_elapsed_abstime; 267 + uint64_t ri_diskio_bytesread; 268 + uint64_t ri_diskio_byteswritten; 269 + }; 270 + 271 + struct rusage_info_v3 { 272 + uint8_t ri_uuid[16]; 273 + uint64_t ri_user_time; 274 + uint64_t ri_system_time; 275 + uint64_t ri_pkg_idle_wkups; 276 + uint64_t ri_interrupt_wkups; 277 + uint64_t ri_pageins; 278 + uint64_t ri_wired_size; 279 + uint64_t ri_resident_size; 280 + uint64_t ri_phys_footprint; 281 + uint64_t ri_proc_start_abstime; 282 + uint64_t ri_proc_exit_abstime; 283 + uint64_t ri_child_user_time; 284 + uint64_t ri_child_system_time; 285 + uint64_t ri_child_pkg_idle_wkups; 286 + uint64_t ri_child_interrupt_wkups; 287 + uint64_t ri_child_pageins; 288 + uint64_t ri_child_elapsed_abstime; 289 + uint64_t ri_diskio_bytesread; 290 + uint64_t ri_diskio_byteswritten; 291 + uint64_t ri_cpu_time_qos_default; 292 + uint64_t ri_cpu_time_qos_maintenance; 293 + uint64_t ri_cpu_time_qos_background; 294 + uint64_t ri_cpu_time_qos_utility; 295 + uint64_t ri_cpu_time_qos_legacy; 296 + uint64_t ri_cpu_time_qos_user_initiated; 297 + uint64_t ri_cpu_time_qos_user_interactive; 298 + uint64_t ri_billed_system_time; 299 + uint64_t ri_serviced_system_time; 185 300 }; 186 301 302 + typedef struct rusage_info_v3 rusage_info_current; 303 + 304 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 187 305 188 306 #ifdef KERNEL 189 307 308 + struct rusage_superset { 309 + struct rusage ru; 310 + rusage_info_current ri; 311 + }; 312 + 313 + struct rusage_info_child { 314 + uint64_t ri_child_user_time; 315 + uint64_t ri_child_system_time; 316 + uint64_t ri_child_pkg_idle_wkups; 317 + uint64_t ri_child_interrupt_wkups; 318 + uint64_t ri_child_pageins; 319 + uint64_t ri_child_elapsed_abstime; 320 + }; 321 + 190 322 struct user64_rusage { 191 323 struct user64_timeval ru_utime; /* user time used */ 192 324 struct user64_timeval ru_stime; /* system time used */ ··· 251 383 #define RLIMIT_STACK 3 /* stack size */ 252 384 #define RLIMIT_CORE 4 /* core file size */ 253 385 #define RLIMIT_AS 5 /* address space (resident set size) */ 254 - #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) 386 + #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL 255 387 #define RLIMIT_RSS RLIMIT_AS /* source compatibility alias */ 256 388 #define RLIMIT_MEMLOCK 6 /* locked-in-memory address space */ 257 389 #define RLIMIT_NPROC 7 /* number of processes */ 258 - #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ 390 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 259 391 #define RLIMIT_NOFILE 8 /* number of open files */ 260 - #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) 392 + #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL 261 393 #define RLIM_NLIMITS 9 /* total number of resource limits */ 262 - #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ 394 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 263 395 #define _RLIMIT_POSIX_FLAG 0x1000 /* Set bit for strict POSIX */ 264 396 265 397 /* ··· 271 403 rlim_t rlim_max; /* maximum value for rlim_cur */ 272 404 }; 273 405 274 - #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) 406 + #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL 407 + /* 408 + * proc_rlimit_control() 409 + * 410 + * Resource limit flavors 411 + */ 412 + #define RLIMIT_WAKEUPS_MONITOR 0x1 /* Configure the wakeups monitor. */ 413 + #define RLIMIT_CPU_USAGE_MONITOR 0x2 /* Configure the CPU usage monitor. */ 414 + #define RLIMIT_THREAD_CPULIMITS 0x3 /* Configure a blocking, per-thread, CPU limits. */ 415 + 416 + /* 417 + * Flags for wakeups monitor control. 418 + */ 419 + #define WAKEMON_ENABLE 0x01 420 + #define WAKEMON_DISABLE 0x02 421 + #define WAKEMON_GET_PARAMS 0x04 422 + #define WAKEMON_SET_DEFAULTS 0x08 423 + #define WAKEMON_MAKE_FATAL 0x10 /* Configure the task so that violations are fatal. */ 424 + /* 425 + * Flags for CPU usage monitor control. 426 + */ 427 + #define CPUMON_MAKE_FATAL 0x1000 428 + 429 + struct proc_rlimit_control_wakeupmon { 430 + uint32_t wm_flags; 431 + int32_t wm_rate; 432 + }; 433 + 275 434 /* I/O type */ 276 435 #define IOPOL_TYPE_DISK 0 436 + #if PRIVATE 437 + #define IOPOL_TYPE_VFS_HFS_CASE_SENSITIVITY 1 438 + #endif 277 439 278 440 /* scope */ 279 441 #define IOPOL_SCOPE_PROCESS 0 280 442 #define IOPOL_SCOPE_THREAD 1 443 + #define IOPOL_SCOPE_DARWIN_BG 2 281 444 282 445 /* I/O Priority */ 283 - #define IOPOL_DEFAULT 0 284 - #define IOPOL_NORMAL 1 285 - #define IOPOL_PASSIVE 2 286 - #define IOPOL_THROTTLE 3 287 - #define IOPOL_UTILITY 4 446 + #define IOPOL_DEFAULT 0 447 + #define IOPOL_IMPORTANT 1 448 + #define IOPOL_PASSIVE 2 449 + #define IOPOL_THROTTLE 3 450 + #define IOPOL_UTILITY 4 451 + #define IOPOL_STANDARD 5 452 + 453 + /* compatibility with older names */ 454 + #define IOPOL_APPLICATION IOPOL_STANDARD 455 + #define IOPOL_NORMAL IOPOL_IMPORTANT 456 + 457 + #if PRIVATE 458 + #define IOPOL_VFS_HFS_CASE_SENSITIVITY_DEFAULT 0 459 + #define IOPOL_VFS_HFS_CASE_SENSITIVITY_FORCE_CASE_SENSITIVE 1 460 + #endif 288 461 289 462 #ifdef PRIVATE 290 463 /* 291 - * Structures for use in communicating via iopolicysys() between Lic and the 292 - * kernel. Not to be used by uesr programs directly. 464 + * Structures for use in communicating via iopolicysys() between Libc and the 465 + * kernel. Not to be used by user programs directly. 293 466 */ 294 467 295 468 /* ··· 308 481 }; 309 482 310 483 #endif /* PRIVATE */ 311 - #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ 484 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 312 485 313 486 #ifndef KERNEL 314 487 315 488 __BEGIN_DECLS 316 489 int getpriority(int, id_t); 317 - #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) 490 + #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL 318 491 int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); 319 - #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ 492 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 320 493 int getrlimit(int, struct rlimit *) __DARWIN_ALIAS(getrlimit); 321 494 int getrusage(int, struct rusage *); 322 495 int setpriority(int, id_t, int); 323 - #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) 496 + #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL 324 497 int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); 325 - #endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ 498 + #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ 326 499 int setrlimit(int, const struct rlimit *) __DARWIN_ALIAS(setrlimit); 327 500 __END_DECLS 328 501
+110
platform-include/sys/proc_info.h
··· 96 96 }; 97 97 98 98 99 + #ifdef PRIVATE 100 + struct proc_uniqidentifierinfo { 101 + uint8_t p_uuid[16]; /* UUID of the main executable */ 102 + uint64_t p_uniqueid; /* 64 bit unique identifier for process */ 103 + uint64_t p_puniqueid; /* unique identifier for process's parent */ 104 + uint64_t p_reserve2; /* reserved for future use */ 105 + uint64_t p_reserve3; /* reserved for future use */ 106 + uint64_t p_reserve4; /* reserved for future use */ 107 + }; 108 + 109 + 110 + struct proc_bsdinfowithuniqid { 111 + struct proc_bsdinfo pbsd; 112 + struct proc_uniqidentifierinfo p_uniqidentifier; 113 + }; 114 + 115 + struct proc_archinfo { 116 + cpu_type_t p_cputype; 117 + cpu_subtype_t p_cpusubtype; 118 + }; 119 + 120 + struct proc_pidcoalitioninfo { 121 + uint64_t coalition_id; 122 + uint64_t reserved1; 123 + uint64_t reserved2; 124 + uint64_t reserved3; 125 + }; 126 + 127 + #endif 99 128 100 129 101 130 /* pbi_flags values */ ··· 118 147 #define PROC_FLAG_PA_SUSP 0x1000 /* The process is currently suspended due to resource starvation */ 119 148 #define PROC_FLAG_PSUGID 0x2000 /* process has set privileges since last exec */ 120 149 #define PROC_FLAG_EXEC 0x4000 /* process has called exec */ 150 + #ifdef PRIVATE 151 + #define PROC_FLAG_DARWINBG 0x8000 /* process in darwin background */ 152 + #define PROC_FLAG_EXT_DARWINBG 0x10000 /* process in darwin background - external enforcement */ 153 + #define PROC_FLAG_IOS_APPLEDAEMON 0x20000 /* Process is apple daemon */ 154 + #define PROC_FLAG_DELAYIDLESLEEP 0x40000 /* Process is marked to delay idle sleep on disk IO */ 155 + #define PROC_FLAG_IOS_IMPPROMOTION 0x80000 /* Process is daemon which receives importane donation */ 156 + #define PROC_FLAG_ADAPTIVE 0x100000 /* Process is adaptive */ 157 + #define PROC_FLAG_ADAPTIVE_IMPORTANT 0x200000 /* Process is adaptive, and is currently important */ 158 + #define PROC_FLAG_IMPORTANCE_DONOR 0x400000 /* Process is marked as an importance donor */ 159 + #define PROC_FLAG_SUPPRESSED 0x800000 /* Process is suppressed */ 160 + #define PROC_FLAG_APPLICATION 0x1000000 /* Process is an application */ 161 + #define PROC_FLAG_IOS_APPLICATION PROC_FLAG_APPLICATION /* Process is an application */ 162 + #endif 121 163 122 164 123 165 struct proc_taskinfo { ··· 653 695 #define PROC_PID_RUSAGE 16 654 696 #define PROC_PID_RUSAGE_SIZE 0 655 697 698 + #ifdef PRIVATE 699 + #define PROC_PIDUNIQIDENTIFIERINFO 17 700 + #define PROC_PIDUNIQIDENTIFIERINFO_SIZE \ 701 + (sizeof(struct proc_uniqidentifierinfo)) 702 + 703 + #define PROC_PIDT_BSDINFOWITHUNIQID 18 704 + #define PROC_PIDT_BSDINFOWITHUNIQID_SIZE \ 705 + (sizeof(struct proc_bsdinfowithuniqid)) 706 + 707 + #define PROC_PIDARCHINFO 19 708 + #define PROC_PIDARCHINFO_SIZE \ 709 + (sizeof(struct proc_archinfo)) 710 + 711 + #define PROC_PIDCOALITIONINFO 20 712 + #define PROC_PIDCOALITIONINFO_SIZE (sizeof(struct proc_pidcoalitioninfo)) 713 + 714 + #define PROC_PIDNOTEEXIT 21 715 + #define PROC_PIDNOTEEXIT_SIZE (sizeof(uint32_t)) 716 + 717 + #define PROC_PIDREGIONPATHINFO2 22 718 + #define PROC_PIDREGIONPATHINFO2_SIZE (sizeof(struct proc_regionwithpathinfo)) 719 + 720 + #define PROC_PIDREGIONPATHINFO3 23 721 + #define PROC_PIDREGIONPATHINFO3_SIZE (sizeof(struct proc_regionwithpathinfo)) 722 + 723 + #endif 656 724 657 725 /* Flavors for proc_pidfdinfo */ 658 726 ··· 723 791 #define PROC_DIRTY_IS_DIRTY 0x4 724 792 #define PROC_DIRTY_LAUNCH_IS_IN_PROGRESS 0x8 725 793 794 + #ifdef PRIVATE 726 795 796 + /* Flavors for proc_pidoriginatorinfo */ 797 + #define PROC_PIDORIGINATOR_UUID 0x1 798 + #define PROC_PIDORIGINATOR_UUID_SIZE (sizeof(uuid_t)) 799 + 800 + #define PROC_PIDORIGINATOR_BGSTATE 0x2 801 + #define PROC_PIDORIGINATOR_BGSTATE_SIZE (sizeof(uint32_t)) 802 + 803 + /* __proc_info() call numbers */ 804 + #define PROC_INFO_CALL_LISTPIDS 0x1 805 + #define PROC_INFO_CALL_PIDINFO 0x2 806 + #define PROC_INFO_CALL_PIDFDINFO 0x3 807 + #define PROC_INFO_CALL_KERNMSGBUF 0x4 808 + #define PROC_INFO_CALL_SETCONTROL 0x5 809 + #define PROC_INFO_CALL_PIDFILEPORTINFO 0x6 810 + #define PROC_INFO_CALL_TERMINATE 0x7 811 + #define PROC_INFO_CALL_DIRTYCONTROL 0x8 812 + #define PROC_INFO_CALL_PIDRUSAGE 0x9 813 + #define PROC_INFO_CALL_PIDORIGINATORINFO 0xa 814 + 815 + #endif /* PRIVATE */ 816 + 817 + #ifdef XNU_KERNEL_PRIVATE 818 + #ifndef pshmnode 819 + struct pshmnode; 820 + #endif 821 + 822 + #ifndef psemnode 823 + struct psemnode ; 824 + #endif 825 + 826 + #ifndef pipe 827 + struct pipe; 828 + #endif 829 + 830 + extern int fill_socketinfo(socket_t so, struct socket_info *si); 831 + extern int fill_pshminfo(struct pshmnode * pshm, struct pshm_info * pinfo); 832 + extern int fill_pseminfo(struct psemnode * psem, struct psem_info * pinfo); 833 + extern int fill_pipeinfo(struct pipe * cpipe, struct pipe_info * pinfo); 834 + extern int fill_kqueueinfo(struct kqueue * kq, struct kqueue_info * kinfo); 835 + extern int fill_procworkqueue(proc_t, struct proc_workqueueinfo *); 836 + #endif /* XNU_KERNEL_PRIVATE */ 727 837 728 838 __END_DECLS 729 839
+3 -1
src/duct/src/CMakeLists.txt
··· 22 22 SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) 23 23 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) 24 24 25 - add_library(system_duct SHARED commpage.c libnotify.c numcpus.c CRGetCrashLogMessage.c acl.c bootstrap.c dyld.c dirhelper.c) 25 + add_library(system_duct SHARED commpage.c libnotify.c numcpus.c 26 + CRGetCrashLogMessage.c acl.c bootstrap.c dyld.c dirhelper.c dns_sd.c 27 + sa_dst_compare.c) 26 28 27 29 install(TARGETS system_duct DESTINATION lib${SUFFIX}/darling)
+30
src/duct/src/dns_sd.c
··· 1 + #include <stddef.h> 2 + 3 + // We don't have Bonjour (libsystem_dnssd) yet. 4 + 5 + int DNSServiceCreateConnection(void** ptr) 6 + { 7 + *ptr = NULL; 8 + return 1; 9 + } 10 + 11 + int DNSServiceQueryRecord() 12 + { 13 + return 1; 14 + } 15 + 16 + int DNSServiceProcessResult() 17 + { 18 + return 1; 19 + } 20 + 21 + int DNSServiceRefDeallocate() 22 + { 23 + return 1; 24 + } 25 + 26 + int DNSServiceRefSockFD() 27 + { 28 + return 1; 29 + } 30 +
+7
src/duct/src/sa_dst_compare.c
··· 1 + // This function is called from _gai_addr_sort() 2 + // No implementation seems to be available. 3 + 4 + int sa_dst_compare() 5 + { 6 + return 0; 7 + }
+1 -1
src/kernel/CMakeLists.txt
··· 6 6 7 7 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2 -msse3 -w -fblocks -ggdb") 8 8 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__DARWIN_UNIX03 -fPIC -w -nostdinc") 9 - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib -Wl,--version-script=${DARLING_TOP_DIRECTORY}/darwin.map") 9 + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/darwin.map") 10 10 11 11 if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR CMAKE_INSTALL_LIBDIR STREQUAL "lib32") 12 12 set(BITS 32)
+7
src/kernel/darwin.map
··· 1 + DARWIN { 2 + global: 3 + *; 4 + local: 5 + darwin_errno; 6 + }; 7 +
+6
src/kernel/libsyscall/CMakeLists.txt
··· 12 12 include_directories("${DARLING_TOP_DIRECTORY}/platform-include") 13 13 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../libc/include") 14 14 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../duct/include") 15 + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/wrappers/libproc") 15 16 include_directories("${CMAKE_CURRENT_BINARY_DIR}") 16 17 add_definitions(-DPRIVATE -D__DARWIN_C_LEVEL=20150101) 17 18 add_definitions('-D__XNU_PRIVATE_EXTERN=') ··· 37 38 mig(mach/vm_map.defs) 38 39 39 40 set(syscall_sources 41 + wrappers/libproc/libproc.c 42 + wrappers/libproc/proc_listpidspath.c 43 + 40 44 #wrappers/coalition.c 41 45 # wrappers/__commpage_gettimeofday.c 42 46 #wrappers/csr.c ··· 555 559 mig(mach/task.defs) 556 560 mig(mach/thread_act.defs) 557 561 mig(mach/vm_map.defs) 562 + 563 + set_source_files_properties(custom/errno.c PROPERTIES COMPILE_FLAGS "-no-integrated-as") 558 564 559 565 add_library(libsyscall OBJECT ${syscall_sources})
+7 -1
src/kernel/libsyscall/custom/errno.c
··· 46 46 extern void _pthread_exit_if_canceled(int error); 47 47 48 48 #undef errno 49 - int errno; 49 + 50 + 51 + // __attribute__((visibility("hidden"))) 52 + int darwin_errno; 53 + __asm__(".symver darwin_errno, errno@DARWIN"); 54 + 55 + #define errno darwin_errno 50 56 51 57 int * 52 58 __error(void)
+1 -1
src/kernel/libsyscall/sys/__ptrace.S
··· 32 32 33 33 #ifdef DARLING 34 34 # define ___ptrace __ptrace 35 - # define _errno errno 35 + # define _errno darwin_errno 36 36 #endif 37 37 38 38 #if defined(__i386__)
+1
src/kernel/libsyscall/wrappers/libproc/libproc_internal.h
··· 26 26 #include <TargetConditionals.h> 27 27 28 28 #include <sys/cdefs.h> 29 + #include <sys/resource.h> 29 30 #include <libproc.h> 30 31 31 32 __BEGIN_DECLS
+1
src/libc/gen/stack_logging_disk.c
··· 732 732 */ 733 733 static ssize_t 734 734 robust_write(int fd, const void *buf, size_t nbyte) { 735 + __asm__(".symver errno, errno@DARWIN"); 735 736 extern int errno; 736 737 ssize_t written = write(fd, buf, nbyte); 737 738 if (written == -1 && errno == EBADF) {
+1
src/libc/gen/wordexp.c
··· 38 38 #include <crt_externs.h> 39 39 40 40 extern size_t malloc_good_size(size_t size); 41 + __asm__(".symver errno, errno@DARWIN"); 41 42 extern int errno; 42 43 43 44 pthread_once_t re_init_c = PTHREAD_ONCE_INIT;
+2 -1
src/libc/posix1e/CMakeLists.txt
··· 1 1 project(libc-posix1e) 2 2 3 3 cmake_minimum_required(VERSION 2.4.0) 4 + include_directories(${DARLING_TOP_DIRECTORY}/src/libinfo/membership.subproj) 4 5 5 6 set(posix1e_sources 6 7 acl.c ··· 8 9 acl_file.c 9 10 acl_flag.c 10 11 acl_perm.c 11 - #acl_translate.c # doesn't build, ducted 12 + acl_translate.c # doesn't build, ducted 12 13 ) 13 14 14 15 add_library(libc-posix1e OBJECT ${posix1e_sources})
+2
src/libc/sys/errno.c
··· 29 29 #include <pthread_internals.h> 30 30 31 31 #undef errno 32 + 33 + __asm__(".symver errno, errno@DARWIN"); 32 34 extern int errno; 33 35 int *__error(void) { 34 36 pthread_t self = pthread_self();
+1
src/libc/threads/cprocs.c
··· 135 135 */ 136 136 137 137 #undef errno 138 + __asm__(".symver errno, errno@DARWIN"); 138 139 extern int errno; 139 140 extern int *__error(void); 140 141 extern int __pthread_canceled(int);
+1
src/libdyld/CMakeLists.txt
··· 10 10 endif(COMMAND cmake_policy) 11 11 12 12 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 13 + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/darwin.map") 13 14 14 15 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) 15 16 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../util)
+33
src/libdyld/darwin.map
··· 1 + DARWIN { 2 + global: 3 + NSLookupAndBindSymbol; 4 + NSLookupSymbolInModule; 5 + NSNameOfSymbol; 6 + NSAddressOfSymbol; 7 + NSIsSymbolNameDefined; 8 + NSModuleForSymbol; 9 + NSIsSymbolNameDefinedInImage; 10 + NSNameOfModule; 11 + NSLibraryNameForModule; 12 + NSVersionOfRunTimeLibrary; 13 + NSVersionOfLinkTimeLibrary; 14 + _NSGetExecutablePath; 15 + 16 + _dyld_image_count; 17 + _dyld_get_image_header; 18 + _dyld_get_image_vmaddr_slide; 19 + _dyld_get_image_slide; 20 + _dyld_get_image_name; 21 + getsectdata; 22 + _dyld_register_func_for_add_image; 23 + _dyld_register_func_for_remove_image; 24 + _dyld_deregister_func_for_add_image; 25 + _dyld_deregister_func_for_remove_image; 26 + _dyld_bind_fully_image_containing_address; 27 + __dyld_bind_fully_image_containing_address; 28 + __dyld_make_delayed_module_initializer_calls; 29 + __dyld_mod_term_funcs; 30 + dyld_image_path_containing_address; 31 + _dyld_find_unwind_sections; 32 + }; 33 +
+5
src/libdyld/dl_public.cpp
··· 32 32 g_lastErrorRead = false; 33 33 } 34 34 35 + __asm__(".symver __darwin_dlopen, dlopen@DARWIN"); 35 36 void* __darwin_dlopen(const char* filename, int flag) 36 37 { 37 38 std::string resolved; ··· 99 100 return obj; 100 101 } 101 102 103 + __asm__(".symver __darwin_dlclose, dlclose@DARWIN"); 102 104 int __darwin_dlclose(void* handle) 103 105 { 104 106 if (!handle) ··· 110 112 return 0; 111 113 } 112 114 115 + __asm__(".symver __darwin_dlerror, dlerror@DARWIN"); 113 116 const char* __darwin_dlerror(void) 114 117 { 115 118 if (g_lastErrorRead || !g_lastError[0]) ··· 141 144 str.resize(pos); 142 145 } 143 146 147 + __asm__(".symver __darwin_dlsym, dlsym@DARWIN"); 144 148 void* __darwin_dlsym(void* handle, const char* symbol) 145 149 { 146 150 std::string name = symbol; ··· 199 203 return addr; 200 204 } 201 205 206 + __asm__(".symver __darwin_dladdr, dladdr@DARWIN"); 202 207 int __darwin_dladdr(void *addr, Dl_info *info) 203 208 { 204 209 MachOObject* obj;
+4
src/libinfo/CMakeLists.txt
··· 23 23 add_subdirectory(util.subproj) 24 24 add_subdirectory(dns.subproj) 25 25 add_subdirectory(nis.subproj) 26 + add_subdirectory(rpc.subproj) 26 27 add_subdirectory(lookup.subproj) 28 + add_subdirectory(membership.subproj) 27 29 28 30 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${SUFFIX}/darling") 29 31 SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) ··· 33 35 $<TARGET_OBJECTS:info-dns> 34 36 $<TARGET_OBJECTS:info-gen> 35 37 $<TARGET_OBJECTS:info-nis> 38 + $<TARGET_OBJECTS:info-rpc> 36 39 $<TARGET_OBJECTS:info-lookup> 40 + $<TARGET_OBJECTS:info-membership> 37 41 ) 38 42 target_link_libraries(system_info system_c resolv) 39 43
+3
src/libinfo/lookup.subproj/mdns_module.c
··· 1 + // Modified by Lubos Dolezel for Darling build 1 2 /* 2 3 * Copyright (c) 2008-2011 Apple Inc. All rights reserved. 3 4 * ··· 217 218 218 219 if (_mdns_debug & MDNS_DEBUG_STDOUT) fprintf(stdout, "%s", out); 219 220 if (_mdns_debug & MDNS_DEBUG_STDERR) fprintf(stderr, "%s", out); 221 + #ifndef DARLING // No ASL in Darling yet 220 222 if (_mdns_debug & MDNS_DEBUG_ASL) asl_log_message(ASL_LEVEL_NOTICE, "%s", out); 223 + #endif 221 224 free(out); 222 225 223 226 va_end(v);
+17
src/libinfo/membership.subproj/CMakeLists.txt
··· 1 + project(libinfo-membership) 2 + 3 + cmake_minimum_required(VERSION 2.4.0) 4 + 5 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../libc/locale) 6 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../libc/locale/FreeBSD) 7 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../libc/pthreads) 8 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../libc/stdtime/FreeBSD) 9 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../external/libdispatch/) 10 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../lookup.subproj) 11 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 12 + 13 + set(info-membership_sources 14 + membership.c 15 + ) 16 + 17 + add_library(info-membership OBJECT ${info-membership_sources})
+21
src/libinfo/rpc.subproj/CMakeLists.txt
··· 1 + project(libinfo-rpc) 2 + 3 + cmake_minimum_required(VERSION 2.4.0) 4 + 5 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../libc/locale) 6 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../libc/locale/FreeBSD) 7 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../libc/pthreads) 8 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../libc/stdtime/FreeBSD) 9 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../external/libdispatch/) 10 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../external/libdispatch/private) 11 + include_directories(${DARLING_TOP_DIRECTORY}/src/libresolv) 12 + include_directories(${DARLING_TOP_DIRECTORY}/src/libresolv/dnsinfo) 13 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 14 + 15 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fblocks") 16 + 17 + set(info-rpc_sources 18 + bindresvport.c 19 + ) 20 + 21 + add_library(info-rpc OBJECT ${info-rpc_sources})
+1 -1
src/libsystem/CMakeLists.txt
··· 38 38 39 39 add_library(system SHARED ${libsystem_sources}) 40 40 target_link_libraries(system system_malloc system_c system_kernel keymgr 41 - system_m system_info system_notify unwind libdispatch_shared objc launch) 41 + system_m system_info system_notify unwind libdispatch_shared objc launch dyld) 42 42 43 43 install(TARGETS system DESTINATION lib${SUFFIX}/darling) 44 44