Wed Aug 11 10:58:27 BST 2010 rmcilroy@microsoft.com
* Checkpoint GHC on Barrelfish work
Now at the stage where we can build and run a helloword Haskell application on Barrelfish.
Mon Aug 9 10:50:19 BST 2010 rmcilroy@microsoft.com
* Checkpoint barrelfish compatability changes
Thu Jul 29 14:57:30 BST 2010 rmcilroy@microsoft.com
* Changes to get ghc building against Barrelfish
diff -rN -u old-unix/cbits/execvpe.c new-unix/cbits/execvpe.c
|
old
|
new
|
|
| 9 | 9 | #include "Rts.h" |
| 10 | 10 | #endif |
| 11 | 11 | |
| 12 | | #if !(defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)) /* to the end */ |
| | 12 | #if !(defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32) || defined(barrelfish_HOST_OS)) /* to the end */ |
| 13 | 13 | |
| 14 | 14 | /* Evidently non-Posix. */ |
| 15 | 15 | /* #include "PosixSource.h" */ |
diff -rN -u old-unix/cbits/HsUnix.c new-unix/cbits/HsUnix.c
|
old
|
new
|
|
| 8 | 8 | |
| 9 | 9 | #include "HsUnix.h" |
| 10 | 10 | |
| | 11 | #ifdef barrelfish_HOST_OS |
| | 12 | int __hsunix_wifexited (int stat) { |
| | 13 | printf("NYI __hsunix_wifexited\n"); |
| | 14 | return -1; |
| | 15 | } |
| | 16 | int __hsunix_wexitstatus (int stat) { |
| | 17 | printf("NYI __hsunix_wexitstatus\n"); |
| | 18 | return -1; |
| | 19 | } |
| | 20 | int __hsunix_wifsignaled (int stat) { |
| | 21 | printf("NYI __hsunix_wifsignaled\n"); |
| | 22 | return -1; |
| | 23 | } |
| | 24 | int __hsunix_wtermsig (int stat) { |
| | 25 | printf("NYI __hsunix_wtermsig\n"); |
| | 26 | return -1; |
| | 27 | } |
| | 28 | int __hsunix_wifstopped (int stat) { |
| | 29 | printf("NYI __hsunix_wifstopped\n"); |
| | 30 | return -1; |
| | 31 | } |
| | 32 | int __hsunix_wstopsig (int stat) { |
| | 33 | printf("NYI __hsunix_wstopsig\n"); |
| | 34 | return -1; |
| | 35 | } |
| | 36 | #else |
| 11 | 37 | int __hsunix_wifexited (int stat) { return WIFEXITED(stat); } |
| 12 | 38 | int __hsunix_wexitstatus (int stat) { return WEXITSTATUS(stat); } |
| 13 | 39 | int __hsunix_wifsignaled (int stat) { return WIFSIGNALED(stat); } |
| 14 | 40 | int __hsunix_wtermsig (int stat) { return WTERMSIG(stat); } |
| 15 | 41 | int __hsunix_wifstopped (int stat) { return WIFSTOPPED(stat); } |
| 16 | 42 | int __hsunix_wstopsig (int stat) { return WSTOPSIG(stat); } |
| | 43 | #endif |
| 17 | 44 | |
| 18 | 45 | #ifdef HAVE_RTLDNEXT |
| 19 | 46 | void *__hsunix_rtldNext (void) {return RTLD_NEXT;} |
| … |
… |
|
| 30 | 57 | int __hsunix_SIGWINCH() { return SIGWINCH; } |
| 31 | 58 | #endif |
| 32 | 59 | |
| | 60 | #ifndef barrelfish_HOST_OS |
| 33 | 61 | // lstat is a macro on some platforms, so we need a wrapper: |
| 34 | 62 | int __hsunix_lstat(const char *path, struct stat *buf) |
| 35 | 63 | { |
| … |
… |
|
| 41 | 69 | { |
| 42 | 70 | return mknod(pathname,mode,dev); |
| 43 | 71 | } |
| | 72 | #endif |
| 44 | 73 | |
| 45 | 74 | #ifdef HAVE_GETPWENT |
| 46 | 75 | // getpwent is a macro on some platforms, so we need a wrapper: |
| … |
… |
|
| 88 | 117 | return time(tloc); |
| 89 | 118 | } |
| 90 | 119 | |
| | 120 | #ifndef barrelfish_HOST_OS |
| 91 | 121 | // times is a macro on some platforms, so we need a wrapper: |
| 92 | 122 | clock_t __hsunix_times(struct tms *tp) |
| 93 | 123 | { |
| 94 | 124 | return times(tp); |
| 95 | 125 | } |
| | 126 | #endif |
| 96 | 127 | |
| 97 | 128 | #ifdef HAVE_PTSNAME |
| 98 | 129 | // I cannot figure out how to make the definitions of the following |
| … |
… |
|
| 128 | 159 | #endif |
| 129 | 160 | } |
| 130 | 161 | |
| 131 | | #if !defined(__MINGW32__) |
| | 162 | #if !defined(__MINGW32__) && !defined(barrrelfish_HOST_OS) |
| 132 | 163 | int __hscore_mkstemp(char *filetemplate) { |
| 133 | 164 | return (mkstemp(filetemplate)); |
| 134 | 165 | } |
| 135 | 166 | #endif |
| 136 | 167 | |
| 137 | | #if !defined(__MINGW32__) && !defined(irix_HOST_OS) |
| | 168 | #if !defined(__MINGW32__) && !defined(irix_HOST_OS) && !defined(barrelfish_HOST_OS) |
| 138 | 169 | int __hscore_getrlimit(int resource, struct rlimit *rlim) { |
| 139 | 170 | return (getrlimit(resource, rlim)); |
| 140 | 171 | } |
diff -rN -u old-unix/config.sub new-unix/config.sub
|
old
|
new
|
|
| 4 | 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, |
| 5 | 5 | # Inc. |
| 6 | 6 | |
| 7 | | timestamp='2006-07-02' |
| | 7 | timestamp='2010-08-10' |
| 8 | 8 | |
| 9 | 9 | # This file is (in principle) common to ALL GNU software. |
| 10 | 10 | # The presence of a machine in this file suggests that SOME GNU software |
| … |
… |
|
| 1344 | 1344 | -zvmoe) |
| 1345 | 1345 | os=-zvmoe |
| 1346 | 1346 | ;; |
| | 1347 | -barrelfish) |
| | 1348 | os=-barrelfish |
| | 1349 | ;; |
| 1347 | 1350 | -none) |
| 1348 | 1351 | ;; |
| 1349 | 1352 | *) |
diff -rN -u old-unix/include/execvpe.h new-unix/include/execvpe.h
|
old
|
new
|
|
| 14 | 14 | |
| 15 | 15 | #include <errno.h> |
| 16 | 16 | #include <sys/types.h> |
| 17 | | #if HAVE_SYS_WAIT_H |
| | 17 | #if HAVE_SYS_WAIT_H && !defined(BARRELFISH) |
| 18 | 18 | #include <sys/wait.h> |
| 19 | 19 | #endif |
| 20 | 20 | |
| 21 | | #if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_WIN32) |
| | 21 | #if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_WIN32) && !defined(BARRELFISH) |
| 22 | 22 | extern int execvpe(char *name, char *const argv[], char **envp); |
| 23 | 23 | extern void pPrPr_disableITimers (void); |
| 24 | 24 | #endif |
diff -rN -u old-unix/include/HsUnix.h new-unix/include/HsUnix.h
|
old
|
new
|
|
| 121 | 121 | int __hsunix_SIGWINCH(); |
| 122 | 122 | #endif |
| 123 | 123 | |
| | 124 | #ifndef barrelfish_HOST_OS |
| 124 | 125 | // lstat is a macro on some platforms, so we need a wrapper: |
| 125 | 126 | int __hsunix_lstat(const char *path, struct stat *buf); |
| 126 | 127 | |
| 127 | 128 | // lstat is a macro on some platforms, so we need a wrapper: |
| 128 | 129 | int __hsunix_mknod(const char *pathname, mode_t mode, dev_t dev); |
| | 130 | #endif |
| 129 | 131 | |
| 130 | 132 | #ifdef HAVE_GETPWENT |
| 131 | 133 | // getpwent is a macro on some platforms, so we need a wrapper: |
| … |
… |
|
| 155 | 157 | // time is a macro on some platforms, so we need a wrapper: |
| 156 | 158 | time_t __hsunix_time(time_t *); |
| 157 | 159 | |
| | 160 | |
| | 161 | #ifndef barrelfish_HOST_OS |
| 158 | 162 | // times is a macro on some platforms, so we need a wrapper: |
| 159 | 163 | clock_t __hsunix_times(struct tms *); |
| | 164 | #endif |
| 160 | 165 | |
| 161 | 166 | #ifdef HAVE_PTSNAME |
| 162 | 167 | // I cannot figure out how to make the definitions of the following |
| … |
… |
|
| 171 | 176 | // push a SVR4 STREAMS module; do nothing if STREAMS not available |
| 172 | 177 | int __hsunix_push_module(int fd, const char *module); |
| 173 | 178 | |
| 174 | | #if !defined(__MINGW32__) |
| | 179 | #if !defined(__MINGW32__) && !defined(barrelfish_HOST_OS) |
| 175 | 180 | int __hscore_mkstemp(char *filetemplate); |
| 176 | 181 | #endif |
| 177 | 182 | |
| 178 | | #if !defined(__MINGW32__) && !defined(irix_HOST_OS) |
| | 183 | #if !defined(__MINGW32__) && !defined(irix_HOST_OS) && !defined(barrelfish_HOST_OS) |
| 179 | 184 | int __hscore_getrlimit(int resource, struct rlimit *rlim); |
| 180 | 185 | int __hscore_setrlimit(int resource, struct rlimit *rlim); |
| 181 | 186 | #endif |
diff -rN -u old-unix/System/Posix/Files.hsc new-unix/System/Posix/Files.hsc
|
old
|
new
|
|
| 321 | 321 | unsafePerformIO $ withForeignPtr stat $ (#peek struct stat, st_uid) |
| 322 | 322 | fileGroup (FileStatus stat) = |
| 323 | 323 | unsafePerformIO $ withForeignPtr stat $ (#peek struct stat, st_gid) |
| | 324 | #ifdef barrelfish_HOST_OS |
| | 325 | specialDeviceID (FileStatus stat) = 0 |
| | 326 | #else |
| 324 | 327 | specialDeviceID (FileStatus stat) = |
| 325 | 328 | unsafePerformIO $ withForeignPtr stat $ (#peek struct stat, st_rdev) |
| | 329 | #endif |
| 326 | 330 | fileSize (FileStatus stat) = |
| 327 | 331 | unsafePerformIO $ withForeignPtr stat $ (#peek struct stat, st_size) |
| 328 | 332 | accessTime (FileStatus stat) = |
| … |
… |
|
| 408 | 412 | -- |
| 409 | 413 | -- Note: calls @mkfifo@. |
| 410 | 414 | createNamedPipe :: FilePath -> FileMode -> IO () |
| | 415 | #ifdef barrelfish_HOST_OS |
| | 416 | createNamedPipe name mode = do |
| | 417 | return () |
| | 418 | #else |
| 411 | 419 | createNamedPipe name mode = do |
| 412 | 420 | withCString name $ \s -> |
| 413 | 421 | throwErrnoPathIfMinus1_ "createNamedPipe" name (c_mkfifo s mode) |
| | 422 | #endif |
| 414 | 423 | |
| 415 | 424 | -- | @createDevice path mode dev@ creates either a regular or a special file |
| 416 | 425 | -- depending on the value of @mode@ (and @dev@). @mode@ will normally be either |
| … |
… |
|
| 436 | 445 | -- |
| 437 | 446 | -- Note: calls @link@. |
| 438 | 447 | createLink :: FilePath -> FilePath -> IO () |
| | 448 | #ifdef barrelfish_HOST_OS |
| | 449 | createLink name1 name2 = do |
| | 450 | return () |
| | 451 | #else |
| 439 | 452 | createLink name1 name2 = |
| 440 | 453 | withCString name1 $ \s1 -> |
| 441 | 454 | withCString name2 $ \s2 -> |
| 442 | 455 | throwErrnoPathIfMinus1_ "createLink" name1 (c_link s1 s2) |
| | 456 | #endif |
| 443 | 457 | |
| 444 | 458 | -- | @removeLink path@ removes the link named @path@. |
| 445 | 459 | -- |
| … |
… |
|
| 551 | 565 | |
| 552 | 566 | -- ----------------------------------------------------------------------------- |
| 553 | 567 | -- utime() |
| | 568 | #ifdef barrelfish_HOST_OS |
| | 569 | setFileTimes :: FilePath -> EpochTime -> EpochTime -> IO () |
| | 570 | setFileTimes name atime mtime = do |
| | 571 | return () |
| 554 | 572 | |
| | 573 | touchFile :: FilePath -> IO () |
| | 574 | touchFile name = do |
| | 575 | return () |
| | 576 | |
| | 577 | #else |
| 555 | 578 | -- | @setFileTimes path atime mtime@ sets the access and modification times |
| 556 | 579 | -- associated with file @path@ to @atime@ and @mtime@, respectively. |
| 557 | 580 | -- |
| … |
… |
|
| 573 | 596 | withCString name $ \s -> |
| 574 | 597 | throwErrnoPathIfMinus1_ "touchFile" name (c_utime s nullPtr) |
| 575 | 598 | |
| | 599 | #endif |
| | 600 | |
| 576 | 601 | -- ----------------------------------------------------------------------------- |
| 577 | 602 | -- Setting file sizes |
| 578 | 603 | |
| … |
… |
|
| 621 | 646 | | SyncIOAvailable {- _PC_SYNC_IO -} |
| 622 | 647 | |
| 623 | 648 | pathVarConst :: PathVar -> CInt |
| | 649 | #ifdef barrelfish_HOST_OS |
| | 650 | pathVarConst v = 0 |
| | 651 | #else |
| 624 | 652 | pathVarConst v = case v of |
| 625 | 653 | LinkLimit -> (#const _PC_LINK_MAX) |
| 626 | 654 | InputLineLimit -> (#const _PC_MAX_CANON) |
| … |
… |
|
| 661 | 689 | #else |
| 662 | 690 | SymbolicLinkLimit -> error "_PC_SYMLINK_MAX not available" |
| 663 | 691 | #endif |
| | 692 | #endif |
| 664 | 693 | |
| 665 | 694 | |
| 666 | 695 | -- | @getPathVar var path@ obtains the dynamic value of the requested |
diff -rN -u old-unix/System/Posix/IO.hsc new-unix/System/Posix/IO.hsc
|
old
|
new
|
|
| 41 | 41 | fdSeek, |
| 42 | 42 | |
| 43 | 43 | -- ** File options |
| | 44 | #ifdef HAVE_FCNTL_H |
| 44 | 45 | FdOption(..), |
| 45 | 46 | queryFdOption, |
| 46 | 47 | setFdOption, |
| | 48 | #endif |
| 47 | 49 | |
| 48 | 50 | -- ** Locking |
| | 51 | #ifndef barrelfish_HOST_OS |
| 49 | 52 | FileLock, |
| 50 | 53 | LockRequest(..), |
| 51 | 54 | getLock, setLock, |
| 52 | 55 | waitToSetLock, |
| | 56 | #endif |
| 53 | 57 | |
| 54 | 58 | -- ** Pipes |
| 55 | 59 | createPipe, |
| … |
… |
|
| 271 | 275 | -- state as a result. |
| 272 | 276 | let fd = haFD h_ |
| 273 | 277 | flushWriteBufferOnly h_ |
| | 278 | #ifndef barrelfish_HOST_OS |
| 274 | 279 | unlockFile (fromIntegral fd) |
| | 280 | #endif |
| 275 | 281 | -- setting the Handle's fd to (-1) as well as its 'type' |
| 276 | 282 | -- to closed, is enough to disable the finalizer that |
| 277 | 283 | -- eventually is run on the Handle. |
| … |
… |
|
| 294 | 300 | -- ----------------------------------------------------------------------------- |
| 295 | 301 | -- Fd options |
| 296 | 302 | |
| | 303 | #ifdef HAVE_FCNTL_H |
| | 304 | |
| 297 | 305 | data FdOption = AppendOnWrite -- ^O_APPEND |
| 298 | 306 | | CloseOnExec -- ^FD_CLOEXEC |
| 299 | 307 | | NonBlockingRead -- ^O_NONBLOCK |
| … |
… |
|
| 335 | 343 | foreign import ccall unsafe "HsBase.h fcntl_write" |
| 336 | 344 | c_fcntl_write :: CInt -> CInt -> CLong -> IO CInt |
| 337 | 345 | |
| | 346 | #endif |
| | 347 | |
| 338 | 348 | -- ----------------------------------------------------------------------------- |
| 339 | 349 | -- Seeking |
| 340 | 350 | |
| … |
… |
|
| 351 | 361 | -- ----------------------------------------------------------------------------- |
| 352 | 362 | -- Locking |
| 353 | 363 | |
| | 364 | #ifndef barrelfish_HOST_OS |
| | 365 | |
| 354 | 366 | data LockRequest = ReadLock |
| 355 | 367 | | WriteLock |
| 356 | 368 | | Unlock |
| … |
… |
|
| 421 | 433 | throwErrnoIfMinus1_ "waitToSetLock" |
| 422 | 434 | (c_fcntl_lock fd (#const F_SETLKW) p_flock) |
| 423 | 435 | |
| | 436 | #endif |
| | 437 | |
| 424 | 438 | -- ----------------------------------------------------------------------------- |
| 425 | 439 | -- fd{Read,Write} |
| 426 | 440 | |
diff -rN -u old-unix/System/Posix/Process.hsc new-unix/System/Posix/Process.hsc
|
old
|
new
|
|
| 44 | 44 | getProcessTimes, |
| 45 | 45 | |
| 46 | 46 | -- ** Scheduling priority |
| | 47 | #ifndef barrelfish_HOST_OS |
| 47 | 48 | nice, |
| 48 | 49 | getProcessPriority, |
| 49 | 50 | getProcessGroupPriority, |
| … |
… |
|
| 51 | 52 | setProcessPriority, |
| 52 | 53 | setProcessGroupPriority, |
| 53 | 54 | setUserPriority, |
| | 55 | #endif |
| 54 | 56 | |
| 55 | 57 | -- ** Process status |
| 56 | 58 | ProcessStatus(..), |
| … |
… |
|
| 157 | 159 | -- | 'getProcessTimes' calls @times@ to obtain time-accounting |
| 158 | 160 | -- information for the current process and its children. |
| 159 | 161 | getProcessTimes :: IO ProcessTimes |
| | 162 | #ifdef barrelfish_HOST_OS |
| | 163 | getProcessTimes = do |
| | 164 | return (ProcessTimes{ elapsedTime = 0, |
| | 165 | userTime = 0, |
| | 166 | systemTime = 0, |
| | 167 | childUserTime = 0, |
| | 168 | childSystemTime = 0 |
| | 169 | }) |
| | 170 | #else |
| 160 | 171 | getProcessTimes = do |
| 161 | 172 | allocaBytes (#const sizeof(struct tms)) $ \p_tms -> do |
| 162 | 173 | elapsed <- throwErrnoIfMinus1 "getProcessTimes" (c_times p_tms) |
| … |
… |
|
| 170 | 181 | childUserTime = cut, |
| 171 | 182 | childSystemTime = cst |
| 172 | 183 | }) |
| | 184 | #endif |
| 173 | 185 | |
| 174 | 186 | type CTms = () |
| 175 | 187 | |
| … |
… |
|
| 179 | 191 | -- ----------------------------------------------------------------------------- |
| 180 | 192 | -- Process scheduling priority |
| 181 | 193 | |
| | 194 | #ifndef barrelfish_HOST_OS |
| | 195 | |
| 182 | 196 | nice :: Int -> IO () |
| 183 | 197 | nice prio = do |
| 184 | 198 | resetErrno |
| … |
… |
|
| 231 | 245 | foreign import ccall unsafe "setpriority" |
| 232 | 246 | c_setpriority :: CInt -> CInt -> CInt -> IO CInt |
| 233 | 247 | |
| | 248 | #endif |
| | 249 | |
| 234 | 250 | -- ----------------------------------------------------------------------------- |
| 235 | 251 | -- Forking, execution |
| 236 | 252 | |
| … |
… |
|
| 361 | 377 | |
| 362 | 378 | waitOptions :: Bool -> Bool -> CInt |
| 363 | 379 | -- block stopped |
| | 380 | #ifdef barrelfish_HOST_OS |
| | 381 | waitOptions _ _ = 0 |
| | 382 | #else |
| 364 | 383 | waitOptions False False = (#const WNOHANG) |
| 365 | 384 | waitOptions False True = (#const (WNOHANG|WUNTRACED)) |
| 366 | 385 | waitOptions True False = 0 |
| 367 | 386 | waitOptions True True = (#const WUNTRACED) |
| | 387 | #endif |
| 368 | 388 | |
| 369 | 389 | -- Turn a (ptr to a) wait status into a ProcessStatus |
| 370 | 390 | |
diff -rN -u old-unix/System/Posix/Resource.hsc new-unix/System/Posix/Resource.hsc
|
old
|
new
|
|
| 19 | 19 | -- |
| 20 | 20 | ----------------------------------------------------------------------------- |
| 21 | 21 | |
| | 22 | #ifdef barrelfish_HOST_OS |
| | 23 | module System.Posix.Resource () where |
| | 24 | #else |
| | 25 | |
| 22 | 26 | module System.Posix.Resource ( |
| 23 | 27 | -- * Resource Limits |
| 24 | 28 | ResourceLimit(..), ResourceLimits(..), Resource(..), |
| … |
… |
|
| 152 | 156 | showRLim ResourceLimitUnknown = "unknown" |
| 153 | 157 | showRLim (ResourceLimit other) = show other |
| 154 | 158 | -} |
| | 159 | |
| | 160 | #endif |
| | 161 | No newline at end of file |
diff -rN -u old-unix/System/Posix/Semaphore.hsc new-unix/System/Posix/Semaphore.hsc
|
old
|
new
|
|
| 14 | 14 | -- |
| 15 | 15 | ----------------------------------------------------------------------------- |
| 16 | 16 | |
| | 17 | #ifdef barrelfish_HOST_OS |
| | 18 | module System.Posix.Semaphore () where |
| | 19 | #else |
| | 20 | |
| 17 | 21 | module System.Posix.Semaphore |
| 18 | 22 | (OpenSemFlags(..), Semaphore(), |
| 19 | 23 | semOpen, semUnlink, semWait, semTryWait, semThreadWait, |
| … |
… |
|
| 126 | 130 | sem_post :: Ptr () -> IO CInt |
| 127 | 131 | foreign import ccall safe "sem_getvalue" |
| 128 | 132 | sem_getvalue :: Ptr () -> Ptr CInt -> IO Int |
| | 133 | #endif |
| | 134 | No newline at end of file |
diff -rN -u old-unix/System/Posix/SharedMem.hsc new-unix/System/Posix/SharedMem.hsc
|
old
|
new
|
|
| 15 | 15 | -- |
| 16 | 16 | ----------------------------------------------------------------------------- |
| 17 | 17 | |
| | 18 | #ifdef barrelfish_HOST_OS |
| | 19 | module System.Posix.SharedMem () where |
| | 20 | #else |
| | 21 | |
| 18 | 22 | module System.Posix.SharedMem |
| 19 | 23 | (ShmOpenFlags(..), shmOpen, shmUnlink) |
| 20 | 24 | where |
| … |
… |
|
| 84 | 88 | foreign import ccall unsafe "shm_unlink" |
| 85 | 89 | shm_unlink :: CString -> IO CInt |
| 86 | 90 | #endif |
| | 91 | |
| | 92 | #endif |
| | 93 | No newline at end of file |
diff -rN -u old-unix/System/Posix/Signals.hsc new-unix/System/Posix/Signals.hsc
|
old
|
new
|
|
| 71 | 71 | |
| 72 | 72 | -- * Signal sets |
| 73 | 73 | SignalSet, |
| | 74 | #ifndef barrelfish_HOST_OS |
| 74 | 75 | emptySignalSet, fullSignalSet, |
| 75 | 76 | addSignal, deleteSignal, inSignalSet, |
| 76 | 77 | |
| … |
… |
|
| 82 | 83 | |
| 83 | 84 | -- * Waiting for signals |
| 84 | 85 | getPendingSignals, |
| 85 | | #ifndef cygwin32_HOST_OS |
| | 86 | #endif |
| | 87 | #if !defined(cygwin32_HOST_OS) && !defined(barrelfish_HOST_OS) |
| 86 | 88 | awaitSignal, |
| 87 | 89 | #endif |
| 88 | 90 | |
| … |
… |
|
| 348 | 350 | -> Maybe SignalSet -- ^ other signals to block |
| 349 | 351 | -> IO Handler -- ^ old handler |
| 350 | 352 | |
| 351 | | #ifdef __PARALLEL_HASKELL__ |
| | 353 | #if defined (__PARALLEL_HASKELL__) || defined(barrelfish_HOST_OS) |
| 352 | 354 | installHandler = |
| 353 | 355 | error "installHandler: not available for Parallel Haskell" |
| 354 | 356 | #else |
| … |
… |
|
| 482 | 484 | |
| 483 | 485 | newtype SignalSet = SignalSet (ForeignPtr CSigset) |
| 484 | 486 | |
| | 487 | #ifndef barrelfish_HOST_OS |
| 485 | 488 | emptySignalSet :: SignalSet |
| 486 | 489 | emptySignalSet = unsafePerformIO $ do |
| 487 | 490 | fp <- mallocForeignPtrBytes sizeof_sigset_t |
| … |
… |
|
| 558 | 561 | withForeignPtr fp $ \p -> |
| 559 | 562 | throwErrnoIfMinus1_ "getPendingSignals" (c_sigpending p) |
| 560 | 563 | return (SignalSet fp) |
| | 564 | #endif |
| 561 | 565 | |
| 562 | | #ifndef cygwin32_HOST_OS |
| | 566 | #if !defined(cygwin32_HOST_OS) && !defined(barrelfish_HOST_OS) |
| 563 | 567 | |
| 564 | 568 | -- | @awaitSignal iset@ suspends execution until an interrupt is received. |
| 565 | 569 | -- If @iset@ is @Just s@, @awaitSignal@ calls @sigsuspend@, installing |
diff -rN -u old-unix/System/Posix/Terminal.hsc new-unix/System/Posix/Terminal.hsc
|
old
|
new
|
|
| 14 | 14 | -- |
| 15 | 15 | ----------------------------------------------------------------------------- |
| 16 | 16 | |
| | 17 | #ifdef barrelfish_HOST_OS |
| | 18 | module System.Posix.Terminal () where |
| | 19 | #else |
| | 20 | |
| 17 | 21 | module System.Posix.Terminal ( |
| 18 | 22 | -- * Terminal support |
| 19 | 23 | |
| … |
… |
|
| 66 | 70 | -- ** Pseudoterminal operations |
| 67 | 71 | openPseudoTerminal, |
| 68 | 72 | getSlaveTerminalName |
| | 73 | |
| 69 | 74 | ) where |
| 70 | 75 | |
| 71 | 76 | #include "HsUnix.h" |
| … |
… |
|
| 804 | 809 | _ <- action p1 |
| 805 | 810 | return () |
| 806 | 811 | return $ makeTerminalAttributes fp1 |
| | 812 | |
| | 813 | #endif |
| | 814 | No newline at end of file |
diff -rN -u old-unix/System/Posix/Unistd.hsc new-unix/System/Posix/Unistd.hsc
|
old
|
new
|
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | getSystemID :: IO SystemID |
| | 71 | #ifdef barrelfish_HOST_OS |
| | 72 | getSystemID = do |
| | 73 | return (SystemID { systemName = "", |
| | 74 | nodeName = "", |
| | 75 | release = "", |
| | 76 | version = "", |
| | 77 | machine = "" |
| | 78 | }) |
| | 79 | #else |
| 71 | 80 | getSystemID = do |
| 72 | 81 | allocaBytes (#const sizeof(struct utsname)) $ \p_sid -> do |
| 73 | 82 | throwErrnoIfMinus1_ "getSystemID" (c_uname p_sid) |
| … |
… |
|
| 82 | 91 | version = ver, |
| 83 | 92 | machine = mach |
| 84 | 93 | }) |
| | 94 | #endif |
| 85 | 95 | |
| 86 | 96 | foreign import ccall unsafe "uname" |
| 87 | 97 | c_uname :: Ptr CUtsname -> IO CInt |
| … |
… |
|
| 176 | 186 | -- ToDo: lots more |
| 177 | 187 | |
| 178 | 188 | getSysVar :: SysVar -> IO Integer |
| | 189 | #ifdef barrelfish_HOST_OS |
| | 190 | getSysVar v = return (-1) |
| | 191 | #else |
| 179 | 192 | getSysVar v = |
| 180 | 193 | case v of |
| 181 | 194 | ArgumentLimit -> sysconf (#const _SC_ARG_MAX) |
| … |
… |
|
| 194 | 207 | |
| 195 | 208 | foreign import ccall unsafe "sysconf" |
| 196 | 209 | c_sysconf :: CInt -> IO CLong |
| | 210 | #endif |
| | 211 | No newline at end of file |
diff -rN -u old-unix/System/Posix/User.hsc new-unix/System/Posix/User.hsc
|
old
|
new
|
|
| 13 | 13 | -- |
| 14 | 14 | ----------------------------------------------------------------------------- |
| 15 | 15 | |
| | 16 | #ifdef barrelfish_HOST_OS |
| | 17 | module System.Posix.User () where |
| | 18 | #else |
| | 19 | |
| 16 | 20 | module System.Posix.User ( |
| 17 | 21 | -- * User environment |
| 18 | 22 | -- ** Querying the user environment |
| … |
… |
|
| 472 | 476 | if rc == nullPtr && errno /= eOK |
| 473 | 477 | then throwErrno loc |
| 474 | 478 | else return rc |
| | 479 | |
| | 480 | #endif |
| | 481 | No newline at end of file |