Projects
Browse Source     Search     Timeline     Wiki

Changeset 23519

Show
Ignore:
Timestamp:
02/20/08 12:36:39 (10 months ago)
Author:
zarzycki@…
Message:

Make launchd compile 64-bit. It still doesn't work. What remains is
malloc()/free() problems (in launchd_unix_ipc.c???).

Location:
trunk/launchd/src
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/launchd_core_logic.c

    r23518 r23519  
    42874287        } 
    42884288 
    4289 #if defined (__ppc__) 
     4289#if defined (__ppc__) || defined(__ppc64__) 
    42904290        f = PPC_THREAD_STATE64; 
    4291 #elif defined(__i386__) 
     4291#elif defined(__i386__) || defined(__x86_64__) 
    42924292        f = x86_THREAD_STATE; 
    42934293#elif defined(__arm__) 
  • trunk/launchd/src/launchd_runtime.c

    r23509 r23519  
    114114static void do_file_init(void) __attribute__((constructor)); 
    115115static mach_timebase_info_data_t tbi; 
     116static uint64_t tbi_safe_math_max; 
    116117static double tbi_float_val; 
    117118 
     
    10791080                } 
    10801081 
    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); 
    10821083 
    10831084                if (the_demux(&bufRequest->Head, &bufReply->Head) == FALSE) { 
     
    13281329        /* This syscall returns EINVAL when the trace isn't enabled. */ 
    13291330        if (do_apple_internal_logging) { 
    1330                 syscall(180, code, 0, 0, 0, (int)ra); 
     1331                syscall(180, code, 0, 0, 0, (long)ra); 
    13311332        } 
    13321333} 
     
    13391340        /* This syscall returns EINVAL when the trace isn't enabled. */ 
    13401341        if (do_apple_internal_logging) { 
    1341                 syscall(180, code, 0, 0, 0, (int)ra); 
     1342                syscall(180, code, 0, 0, 0, (long)ra); 
    13421343        } 
    13431344} 
    13441345 
    13451346INTERNAL_ABI void 
    1346 runtime_ktrace(runtime_ktrace_code_t code, int a, int b, int c) 
     1347runtime_ktrace(runtime_ktrace_code_t code, long a, long b, long c) 
    13471348{ 
    13481349        void *ra = __builtin_extract_return_addr(__builtin_return_address(0)); 
     
    13501351        /* This syscall returns EINVAL when the trace isn't enabled. */ 
    13511352        if (do_apple_internal_logging) { 
    1352                 syscall(180, code, a, b, c, (int)ra); 
     1353                syscall(180, code, a, b, c, (long)ra); 
    13531354        } 
    13541355} 
     
    16131614        if (tbi.numer != tbi.denom) { 
    16141615#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) { 
    16161623                        o *= tbi.numer; 
    16171624                        o /= tbi.denom; 
     
    16211628                        o = d; 
    16221629                } 
     1630#endif 
    16231631        } 
    16241632 
     
    16341642        tbi_float_val = tbi.numer; 
    16351643        tbi_float_val /= tbi.denom; 
     1644        tbi_safe_math_max = UINT64_MAX / tbi.numer; 
    16361645 
    16371646        if (getpid() == 1) { 
  • trunk/launchd/src/launchd_runtime.h

    r23490 r23519  
    164164INTERNAL_ABI void runtime_ktrace1(runtime_ktrace_code_t code); 
    165165INTERNAL_ABI void runtime_ktrace0(runtime_ktrace_code_t code); 
    166 INTERNAL_ABI void runtime_ktrace(runtime_ktrace_code_t code, int a, int b, int c); 
     166INTERNAL_ABI void runtime_ktrace(runtime_ktrace_code_t code, long a, long b, long c); 
    167167 
    168168 
  • trunk/launchd/src/launchd_runtime_kill.c

    r23494 r23519  
    1919 */ 
    2020 
    21 #if !defined(__LP64__) && !defined(__arm__) 
    22 #define _NONSTD_SOURCE 1 
     21#if defined(__LP64__) 
     22/* ??? No way to get the old behavior */ 
    2323#define old_kill(x, y) kill(x, y) 
    24 #define old_killpg(x, y) killpg(x, y) 
    25 #else 
     24#define old_killpg(x, y) kill(-(x), y) 
     25#elif defined(__arm__) 
    2626/* ??? No blessed way to get the old behavior */ 
    2727extern int __kill(int, int, int); 
    2828#define old_kill(x, y) __kill(x, y, 0) 
    2929#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) 
    3034#endif 
    3135#include <signal.h>