Changeset 14510 for trunk/source/level-1


Ignore:
Timestamp:
Dec 23, 2010, 10:07:41 AM (9 years ago)
Author:
gb
Message:

Android ("bionic" C library) doesn't define some things (sysexits - #$EX_* -
constants) or they're not in the headers we parse.
Still need to define :link_map, :ucontext structures and work around
missing #_getifaddrs.

Location:
trunk/source/level-1
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-application.lisp

    r14362 r14510  
    167167               (t "~a"))
    168168             opts)
    169      #-windows-target #$EX_USAGE #+windows-target #$EXIT_FAILURE
     169     #-windows-target #-android-target #$EX_USAGE #+android-target 64 #+windows-target #$EXIT_FAILURE
    170170     (summarize-option-syntax a))))
    171171               
     
    261261  (if args
    262262    (%usage-exit (format nil "Unrecognized non-option arguments: ~a" args)
    263                  #-windows-target #$EX_USAGE #+windows-target #$EXIT_FAILURE
     263                 #-windows-target #-android-target #$EX_USAGE #+android-target 64 #+windows-target #$EXIT_FAILURE
    264264                 (summarize-option-syntax a))
    265265    (progn
  • trunk/source/level-1/l1-callbacks.lisp

    r13067 r14510  
    127127  #-windows-target
    128128  (#_mmap (%null-ptr)
    129           (#_getpagesize)
     129          #-android-target (#_getpagesize) #+android-target (#_sysconf #$_SC_PAGE_SIZE)
    130130          (logior #$PROT_READ #$PROT_WRITE #$PROT_EXEC)
    131131          (logior #$MAP_PRIVATE #$MAP_ANON)
     
    143143
    144144(defun reset-callback-storage ()
    145   (setq *available-bytes-for-callbacks* #-windows-target (#_getpagesize) #+windows-target (ash 1 16)
     145  (setq *available-bytes-for-callbacks* #-windows-target #-android-target (#_getpagesize) #+android-target (#_sysconf #$_SC_PAGE_SIZE) #+windows-target (ash 1 16)
    146146        *current-callback-page* (%make-executable-page)))
    147147
  • trunk/source/level-1/l1-error-signal.lisp

    r14119 r14510  
    142142    (bug (format nil "Error during early application initialization:~%
    143143~a" condition))
    144     (#_exit #-windows-target #$EX_SOFTWARE #+windows-target #$EXIT_FAILURE))
     144    (#_exit #-windows-target #-android-target #$EX_SOFTWARE #+android-target 70 #+windows-target #$EXIT_FAILURE))
    145145  (application-error *application* condition error-pointer)
    146146  (application-error
  • trunk/source/level-1/linux-files.lisp

    r14461 r14510  
    350350       (pref stat :stat.st_mode)
    351351       (pref stat :stat.st_size)
    352        #+(or linux-target solaris-target)
     352       #+android-target (pref stat :stat.st_mtime)
     353       #+(or (and linux-target (not android-target)) solaris-target)
    353354       (pref stat :stat.st_mtim.tv_sec)
    354355       #-(or linux-target solaris-target)
     
    358359       (pref stat :stat.st_blksize)
    359360       #+(or linux-target solaris-target)
    360        (round (pref stat :stat.st_mtim.tv_nsec) 1000)
     361       (round (pref stat #-android-target :stat.st_mtim.tv_nsec
     362                         #+android-target :stat.st_mtime_nsec) 1000)
    361363       #-(or linux-target solaris-target)
    362364       (round (pref stat :stat.st_mtimespec.tv_nsec) 1000)
     
    409411  (with-filename-cstrs ((cname #+windows-target (windows-strip-trailing-slash name) #-windows-target name))
    410412    (%stat-values
    411      #+linux-target
     413     #+(and linux-target (not android-target))
    412414     (#_ __xstat #$_STAT_VER_LINUX cname stat)
    413      #-linux-target
     415     #-(and linux-target (not android-target))
    414416     (int-errno-ffcall (%kernel-import target::kernel-import-lisp-stat)
    415417                       :address cname
     
    420422(defun %%fstat (fd stat)
    421423  (%stat-values
    422    #+linux-target
     424   #+(and linux-target (not android-target))
    423425   (#_ __fxstat #$_STAT_VER_LINUX fd stat)
    424    #-linux-target
     426   #-(and linux-target (not android-target))
    425427   (int-errno-ffcall (%kernel-import target::kernel-import-lisp-fstat)
    426428                     :int fd
     
    433435  (with-filename-cstrs ((cname name))
    434436    (%stat-values
    435      #+linux-target
     437     #+(and linux-target (not android-target))
    436438     (#_ __lxstat #$_STAT_VER_LINUX cname stat)
    437      #-linux-target
     439     #-(and linux-target (not android-target))
    438440     (#_lstat cname stat)
    439441     stat)))
     
    500502(defun %uts-string (result idx buf)
    501503  (if (>= result 0)
    502     (%get-cstring (%inc-ptr buf (* #+linux-target #$_UTSNAME_LENGTH
     504    (%get-cstring (%inc-ptr buf (* #+(and linux-target (not android-target)) #$_UTSNAME_LENGTH
     505                                   #+android-target (1+ #$__NEW_UTS_LEN)
    503506                                   #+darwin-target #$_SYS_NAMELEN
    504507                                   #+(or freebsd-target solaris-target) #$SYS_NMLN
     
    542545
    543546
    544 #+linux-target
     547#+(and linux-target (not android-target))
    545548(defun %uname (idx)
    546549  (%stack-block ((buf (* #$_UTSNAME_LENGTH 6))) 
     550    (%uts-string (#_uname buf) idx buf)))
     551
     552#+android-target
     553(defun %uname (idx)
     554  (%stack-block ((buf (* (1+ #$__NEW_UTS_LEN) 6))) 
    547555    (%uts-string (#_uname buf) idx buf)))
    548556
     
    10381046  (defun %execvp (argv)
    10391047    (#_execvp (%get-ptr argv) argv)
    1040     (#_exit #$EX_OSERR))
     1048    (#_exit #-android-target #$EX_OSERR #+android-target 71))
    10411049
    10421050  (defun exec-with-io-redirection (new-in new-out new-err argv)
     
    12951303                                     :signaled)
    12961304                                   signal
    1297                                    (logtest #-solaris-target #$WCOREFLAG
     1305                                   (logtest #-(or solaris-target android-target)
     1306                                            #$WCOREFLAG
    12981307                                            #+solaris-target #$WCOREFLG
     1308                                            #+android-target #x80
    12991309                                            statusflags)))))
    13001310                       (setf (external-process-%status p) status
     
    20952105
    20962106(defloadvar *host-page-size*
    2097     #-windows-target (#_getpagesize)
     2107    #-(or windows-target android-target)
     2108    (#_getpagesize)
    20982109    #+windows-target
    20992110    (rlet ((info #>SYSTEM_INFO))
    21002111      (#_GetSystemInfo info)
    21012112      (pref info #>SYSTEM_INFO.dwPageSize))
     2113    #+android-target
     2114    (#_sysconf #$_SC_PAGE_SIZE)
    21022115    )
    21032116
Note: See TracChangeset for help on using the changeset viewer.