Yet more unix fixes

db4
Slava Pestov 2008-12-16 02:32:57 -06:00
parent de75909550
commit 4dcef7e94f
7 changed files with 20 additions and 20 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2006 Patrick Mauritz.
! See http://factorcode.org/license.txt for BSD license.
IN: unix
USING: alien.syntax system kernel ;
USING: alien.syntax system kernel layouts constants ;
! Solaris.
@ -16,15 +16,15 @@ CONSTANT: SEEK_END 2
CONSTANT: SOL_SOCKET HEX: ffff
CONSTANT: FD_SETSIZE cell 4 = 1024 65536 ?
: FD_SETSIZE ( -- n ) cell 4 = 1024 65536 ? ;
CONSTANT: SO_REUSEADDR 4
CONSTANT: SO_OOBINLINE HEX: 0100
CONSTANT: SO_SNDTIMEO HEX: 1005
CONSTANT: SO_RCVTIMEO HEX: 1006
: F_SETFL 4 ; ! set file status flags
: O_NONBLOCK HEX: 80 ; ! no delay
CONSTANT: F_SETFL 4 ! set file status flags
CONSTANT: O_NONBLOCK HEX: 80 ! no delay
C-STRUCT: addrinfo
{ "int" "flags" }
@ -70,10 +70,10 @@ CONSTANT: AF_UNIX 1
CONSTANT: AF_INET 2
CONSTANT: AF_INET6 26
CONSTANT: PF_UNSPEC AF_UNSPEC
CONSTANT: PF_UNIX AF_UNIX
CONSTANT: PF_INET AF_INET
CONSTANT: PF_INET6 AF_INET6
ALIAS: PF_UNSPEC AF_UNSPEC
ALIAS: PF_UNIX AF_UNIX
ALIAS: PF_INET AF_INET
ALIAS: PF_INET6 AF_INET6
CONSTANT: IPPROTO_TCP 6
CONSTANT: IPPROTO_UDP 17

View File

@ -25,5 +25,5 @@ C-STRUCT: stat
FUNCTION: int __xstat ( int ver, char* pathname, stat* buf ) ;
FUNCTION: int __lxstat ( int ver, char* pathname, stat* buf ) ;
: stat ( pathname buf -- int ) 3 -rot __xstat ;
: lstat ( pathname buf -- int ) 3 -rot __lxstat ;
: stat ( pathname buf -- int ) [ 3 ] 2dip __xstat ;
: lstat ( pathname buf -- int ) [ 3 ] 2dip __lxstat ;

View File

@ -26,5 +26,5 @@ C-STRUCT: stat
FUNCTION: int __xstat ( int ver, char* pathname, stat* buf ) ;
FUNCTION: int __lxstat ( int ver, char* pathname, stat* buf ) ;
: stat ( pathname buf -- int ) 1 -rot __xstat ;
: lstat ( pathname buf -- int ) 1 -rot __lxstat ;
: stat ( pathname buf -- int ) [ 1 ] 2dip __xstat ;
: lstat ( pathname buf -- int ) [ 1 ] 2dip __lxstat ;

View File

@ -25,5 +25,5 @@ C-STRUCT: stat
FUNCTION: int __stat30 ( char* pathname, stat* buf ) ;
FUNCTION: int __lstat30 ( char* pathname, stat* buf ) ;
CONSTANT: stat ( pathname buf -- n ) __stat30
CONSTANT: lstat ( pathname buf -- n ) __lstat30
: stat ( pathname buf -- n ) __stat30 ;
: lstat ( pathname buf -- n ) __lstat30 ;

View File

@ -25,5 +25,5 @@ C-STRUCT: stat
FUNCTION: int __stat13 ( char* pathname, stat* buf ) ;
FUNCTION: int __lstat13 ( char* pathname, stat* buf ) ;
CONSTANT: stat ( pathname buf -- n ) __stat13
CONSTANT: lstat ( pathname buf -- n ) __lstat13
: stat ( pathname buf -- n ) __stat13 ;
: lstat ( pathname buf -- n ) __lstat13 ;

View File

@ -4,7 +4,7 @@ IN: unix.stat
! File Types
: S_IFMT OCT: 170000 ; ! These bits determine file type.
CONSTANT: S_IFMT OCT: 170000 ! These bits determine file type.
CONSTANT: S_IFDIR OCT: 40000 ! Directory.
CONSTANT: S_IFCHR OCT: 20000 ! Character device.
@ -22,8 +22,8 @@ FUNCTION: int mkdir ( char* path, mode_t mode ) ;
C-STRUCT: fsid
{ { "int" 2 } "__val" } ;
TYPEDEF: fsid __fsid_t
TYPEDEF: fsid fsid_t
TYPEDEF: fsid __fsid_t
TYPEDEF: fsid fsid_t
<< os {
{ linux [ "unix.stat.linux" require ] }

View File

@ -89,7 +89,7 @@ CONSTANT: VQ_FLAG8000 HEX: 8000
CONSTANT: NFSV4_MAX_FH_SIZE 128
CONSTANT: NFSV3_MAX_FH_SIZE 64
CONSTANT: NFSV2_MAX_FH_SIZE 32
CONSTANT: NFS_MAX_FH_SIZE NFSV4_MAX_FH_SIZE
ALIAS: NFS_MAX_FH_SIZE NFSV4_MAX_FH_SIZE
CONSTANT: MFSNAMELEN 15
CONSTANT: MNAMELEN 90