/[cmucl]/src/code/unix-glibc2.lisp
ViewVC logotype

Diff of /src/code/unix-glibc2.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.39 by cshapiro, Tue Nov 6 06:04:56 2007 UTC revision 1.40 by cshapiro, Tue Nov 6 07:16:05 2007 UTC
# Line 246  Line 246 
246  (defconstant ms_invalidate 2)  (defconstant ms_invalidate 2)
247    
248  ;; The return value from mmap that means mmap failed.  ;; The return value from mmap that means mmap failed.
249  (defconstant map_failed -1)  (defconstant map_failed (int-sap (1- (ash 1 vm:word-bits))))
250    
251  (defun unix-mmap (addr length prot flags fd offset)  (defun unix-mmap (addr length prot flags fd offset)
252    (declare (type (or null system-area-pointer) addr)    (declare (type (or null system-area-pointer) addr)
# Line 259  Line 259 
259    ;; "negative".  Hence we explicitly check for mmap returning    ;; "negative".  Hence we explicitly check for mmap returning
260    ;; MAP_FAILED.    ;; MAP_FAILED.
261    (let ((result    (let ((result
262           (alien-funcall (extern-alien "mmap" (function int system-area-pointer           (alien-funcall (extern-alien "mmap" (function system-area-pointer
263                                                           system-area-pointer
264                                                         size-t int int int off-t))                                                         size-t int int int off-t))
265                          (or addr +null+) length prot flags (or fd -1) offset)))                          (or addr +null+) length prot flags (or fd -1) offset)))
266      (if (= result map_failed)      (if (sap= result map_failed)
267          (values nil (unix-errno))          (values nil (unix-errno))
268          (sys:int-sap result))))          (values result 0))))
269    
270  (defun unix-munmap (addr length)  (defun unix-munmap (addr length)
271    (declare (type system-area-pointer addr)    (declare (type system-area-pointer addr)

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.5