parent
13c2e444a8
commit
9e3cab4327
|
@ -21,7 +21,10 @@ M: mapped-file set-nth-unsafe
|
|||
|
||||
INSTANCE: mapped-file sequence
|
||||
|
||||
HOOK: <mapped-file> io-backend ( path length -- mmap )
|
||||
HOOK: (mapped-file) io-backend ( path length -- mmap )
|
||||
|
||||
: <mapped-file> ( path length -- mmap )
|
||||
>r normalize-path r> (mapped-file) ;
|
||||
|
||||
HOOK: close-mapped-file io-backend ( mmap -- )
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ IN: io.unix.mmap
|
|||
>r f -roll r> open-r/w [ 0 mmap ] keep
|
||||
over MAP_FAILED = [ close (io-error) ] when ;
|
||||
|
||||
M: unix <mapped-file> ( path length -- obj )
|
||||
swap normalize-path >r
|
||||
M: unix (mapped-file) ( path length -- obj )
|
||||
swap >r
|
||||
dup PROT_READ PROT_WRITE bitor MAP_FILE MAP_SHARED bitor
|
||||
r> mmap-open f mapped-file boa ;
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ M: wince with-privileges
|
|||
nip call ;
|
||||
|
||||
: mmap-open ( path access-mode create-mode flProtect access -- handle handle address )
|
||||
>r >r >r >r normalize-path r> r> r> r>
|
||||
{ "SeCreateGlobalPrivilege" "SeLockMemoryPrivilege" } [
|
||||
>r >r 0 open-file dup f r> 0 0 f
|
||||
CreateFileMapping [ win32-error=0/f ] keep
|
||||
|
@ -71,7 +70,7 @@ M: wince with-privileges
|
|||
dup close-later
|
||||
] with-privileges ;
|
||||
|
||||
M: windows <mapped-file> ( path length -- mmap )
|
||||
M: windows (mapped-file) ( path length -- mmap )
|
||||
[
|
||||
swap
|
||||
GENERIC_WRITE GENERIC_READ bitor
|
||||
|
|
Loading…
Reference in New Issue