unix: Minor cleanups

db4
Eduardo Cavazos 2008-05-10 09:10:16 -05:00
parent d1775f9bfa
commit a9bc2309ea
2 changed files with 6 additions and 8 deletions

View File

@ -7,9 +7,9 @@ IN: unix.system-call
ERROR: unix-system-call-error word args message ;
MACRO: unix-system-call ( quot -- )
[ ] [ infer in>> ] [ first ] tri
'[
[ @ dup 0 < [ dup throw ] [ ] if ]
[ drop , narray , swap err_no strerror unix-system-call-error ]
recover
] ;
[ ] [ infer in>> ] [ first ] tri
'[
[ @ dup 0 < [ dup throw ] [ ] if ]
[ drop , narray , swap err_no strerror unix-system-call-error ]
recover
] ;

View File

@ -29,7 +29,6 @@ TYPEDEF: ulong size_t
! ! ! Unix functions
LIBRARY: factor
! FUNCTION: int err_no ( ) ;
FUNCTION: void clear_err_no ( ) ;
LIBRARY: libc
@ -78,7 +77,6 @@ FUNCTION: void* mmap ( void* addr, size_t len, int prot, int flags, int fd, off_
FUNCTION: int munmap ( void* addr, size_t len ) ;
FUNCTION: uint ntohl ( uint n ) ;
FUNCTION: ushort ntohs ( ushort n ) ;
! FUNCTION: char* strerror ( int errno ) ;
: open ( path flags prot -- int ) [ unix.ffi:open ] unix-system-call ;