Changeset 23519
- Timestamp:
- 02/20/08 12:36:39 (10 months ago)
- Location:
- trunk/launchd/src
- Files:
-
- 4 modified
-
launchd_core_logic.c (modified) (1 diff)
-
launchd_runtime.c (modified) (8 diffs)
-
launchd_runtime.h (modified) (1 diff)
-
launchd_runtime_kill.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd_core_logic.c
r23518 r23519 4287 4287 } 4288 4288 4289 #if defined (__ppc__) 4289 #if defined (__ppc__) || defined(__ppc64__) 4290 4290 f = PPC_THREAD_STATE64; 4291 #elif defined(__i386__) 4291 #elif defined(__i386__) || defined(__x86_64__) 4292 4292 f = x86_THREAD_STATE; 4293 4293 #elif defined(__arm__) -
trunk/launchd/src/launchd_runtime.c
r23509 r23519 114 114 static void do_file_init(void) __attribute__((constructor)); 115 115 static mach_timebase_info_data_t tbi; 116 static uint64_t tbi_safe_math_max; 116 117 static double tbi_float_val; 117 118 … … 1079 1080 } 1080 1081 1081 runtime_ktrace(RTKT_LAUNCHD_MACH_IPC|DBG_FUNC_START, bufRequest->Head.msgh_local_port, bufRequest->Head.msgh_id, ( int)the_demux);1082 runtime_ktrace(RTKT_LAUNCHD_MACH_IPC|DBG_FUNC_START, bufRequest->Head.msgh_local_port, bufRequest->Head.msgh_id, (long)the_demux); 1082 1083 1083 1084 if (the_demux(&bufRequest->Head, &bufReply->Head) == FALSE) { … … 1328 1329 /* This syscall returns EINVAL when the trace isn't enabled. */ 1329 1330 if (do_apple_internal_logging) { 1330 syscall(180, code, 0, 0, 0, ( int)ra);1331 syscall(180, code, 0, 0, 0, (long)ra); 1331 1332 } 1332 1333 } … … 1339 1340 /* This syscall returns EINVAL when the trace isn't enabled. */ 1340 1341 if (do_apple_internal_logging) { 1341 syscall(180, code, 0, 0, 0, ( int)ra);1342 syscall(180, code, 0, 0, 0, (long)ra); 1342 1343 } 1343 1344 } 1344 1345 1345 1346 INTERNAL_ABI void 1346 runtime_ktrace(runtime_ktrace_code_t code, int a, int b, intc)1347 runtime_ktrace(runtime_ktrace_code_t code, long a, long b, long c) 1347 1348 { 1348 1349 void *ra = __builtin_extract_return_addr(__builtin_return_address(0)); … … 1350 1351 /* This syscall returns EINVAL when the trace isn't enabled. */ 1351 1352 if (do_apple_internal_logging) { 1352 syscall(180, code, a, b, c, ( int)ra);1353 syscall(180, code, a, b, c, (long)ra); 1353 1354 } 1354 1355 } … … 1613 1614 if (tbi.numer != tbi.denom) { 1614 1615 #endif 1615 if (o < INT32_MAX) { 1616 #ifdef __LP64__ 1617 __uint128_t tmp = o; 1618 tmp *= tbi.numer; 1619 tmp /= tbi.denom; 1620 o = tmp; 1621 #else 1622 if (o <= tbi_safe_math_max) { 1616 1623 o *= tbi.numer; 1617 1624 o /= tbi.denom; … … 1621 1628 o = d; 1622 1629 } 1630 #endif 1623 1631 } 1624 1632 … … 1634 1642 tbi_float_val = tbi.numer; 1635 1643 tbi_float_val /= tbi.denom; 1644 tbi_safe_math_max = UINT64_MAX / tbi.numer; 1636 1645 1637 1646 if (getpid() == 1) { -
trunk/launchd/src/launchd_runtime.h
r23490 r23519 164 164 INTERNAL_ABI void runtime_ktrace1(runtime_ktrace_code_t code); 165 165 INTERNAL_ABI void runtime_ktrace0(runtime_ktrace_code_t code); 166 INTERNAL_ABI void runtime_ktrace(runtime_ktrace_code_t code, int a, int b, intc);166 INTERNAL_ABI void runtime_ktrace(runtime_ktrace_code_t code, long a, long b, long c); 167 167 168 168 -
trunk/launchd/src/launchd_runtime_kill.c
r23494 r23519 19 19 */ 20 20 21 #if !defined(__LP64__) && !defined(__arm__)22 #define _NONSTD_SOURCE 1 21 #if defined(__LP64__) 22 /* ??? No way to get the old behavior */ 23 23 #define old_kill(x, y) kill(x, y) 24 #define old_killpg(x, y) kill pg(x, y)25 #el se24 #define old_killpg(x, y) kill(-(x), y) 25 #elif defined(__arm__) 26 26 /* ??? No blessed way to get the old behavior */ 27 27 extern int __kill(int, int, int); 28 28 #define old_kill(x, y) __kill(x, y, 0) 29 29 #define old_killpg(x, y) __kill(-(x), y, 0) 30 #else 31 #define _NONSTD_SOURCE 1 32 #define old_kill(x, y) kill(x, y) 33 #define old_killpg(x, y) killpg(x, y) 30 34 #endif 31 35 #include <signal.h>

