/[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.26 by emarsden, Sun Apr 13 16:48:10 2003 UTC revision 1.27 by toy, Fri Jun 6 16:23:45 2003 UTC
# Line 78  Line 78 
78            ru-msgsnd ru-msgrcv ru-nsignals ru-nvcsw ru-nivcsw            ru-msgsnd ru-msgrcv ru-nsignals ru-nvcsw ru-nivcsw
79            rlimit rlim-cur rlim-max sc-onstack sc-mask sc-pc            rlimit rlim-cur rlim-max sc-onstack sc-mask sc-pc
80            unix-errno get-unix-error-msg            unix-errno get-unix-error-msg
81              prot_read prot_write prot_exec prot_none
82              map_shared map_private map_fixed map_anonymous
83              unix-mmap unix-munmap
84            unix-pathname unix-file-mode unix-fd unix-pid unix-uid unix-gid            unix-pathname unix-file-mode unix-fd unix-pid unix-uid unix-gid
85            unix-setitimer unix-getitimer            unix-setitimer unix-getitimer
86            unix-access r_ok w_ok x_ok f_ok unix-chdir unix-chmod setuidexec            unix-access r_ok w_ok x_ok f_ok unix-chdir unix-chmod setuidexec
# Line 221  Line 224 
224                 (setf cur (funcall inc cur 1)))))                 (setf cur (funcall inc cur 1)))))
225      `(progn ,@(mapcar #'defform names))))      `(progn ,@(mapcar #'defform names))))
226    
227    ;;;; Memory-mapped files
228    
229    (defconstant +null+ (sys:int-sap 0))
230    
231    (defconstant prot_read 1)
232    (defconstant prot_write 2)
233    (defconstant prot_exec 4)
234    (defconstant prot_none 0)
235    
236    (defconstant map_shared 1)
237    (defconstant map_private 2)
238    (defconstant map_fixed 16)
239    (defconstant map_anonymous 32)
240    
241    (defun unix-mmap (addr length prot flags fd offset)
242      (declare (type (or null system-area-pointer) addr)
243              (type (unsigned-byte 32) length)
244               (type (integer 1 7) prot)
245              (type (unsigned-byte 32) flags)
246              (type unix-fd fd)
247              (type (signed-byte 32) offset))
248      (syscall ("mmap" system-area-pointer size-t int int int off-t)
249              (sys:int-sap result)
250              (or addr +null+) length prot flags (or fd -1) offset))
251    
252    (defun unix-munmap (addr length)
253      (declare (type system-area-pointer addr)
254              (type (unsigned-byte 32) length))
255      (syscall ("munmap" system-area-pointer size-t) t addr length))
256    
257  ;;;; Lisp types used by syscalls.  ;;;; Lisp types used by syscalls.
258    
259  (deftype unix-pathname () 'simple-string)  (deftype unix-pathname () 'simple-string)
# Line 610  Line 643 
643  #-alpha  #-alpha
644  (progn  (progn
645    (defconstant F-RDLCK 0 "for fcntl and lockf")    (defconstant F-RDLCK 0 "for fcntl and lockf")
646    (defconstant F-WDLCK 1 "for fcntl and lockf")    (defconstant F-WRLCK 1 "for fcntl and lockf")
647    (defconstant F-UNLCK 2 "for fcntl and lockf")    (defconstant F-UNLCK 2 "for fcntl and lockf")
648    (defconstant F-EXLCK 4 "old bsd flock (depricated)")    (defconstant F-EXLCK 4 "old bsd flock (depricated)")
649    (defconstant F-SHLCK 8 "old bsd flock (depricated)"))    (defconstant F-SHLCK 8 "old bsd flock (depricated)"))
650  #+alpha  #+alpha
651  (progn  (progn
652    (defconstant F-RDLCK 1 "for fcntl and lockf")    (defconstant F-RDLCK 1 "for fcntl and lockf")
653    (defconstant F-WDLCK 2 "for fcntl and lockf")    (defconstant F-WRLCK 2 "for fcntl and lockf")
654    (defconstant F-UNLCK 8 "for fcntl and lockf")    (defconstant F-UNLCK 8 "for fcntl and lockf")
655    (defconstant F-EXLCK 16 "old bsd flock (depricated)")    (defconstant F-EXLCK 16 "old bsd flock (depricated)")
656    (defconstant F-SHLCK 32 "old bsd flock (depricated)"))    (defconstant F-SHLCK 32 "old bsd flock (depricated)"))

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.5