factor/basis/unix/stat/linux/32/32.factor

29 lines
893 B
Factor
Raw Normal View History

USING: kernel alien.syntax math sequences unix
alien.c-types arrays accessors combinators ;
2008-02-27 02:55:49 -05:00
IN: unix.stat
! stat64
2008-02-27 02:55:49 -05:00
C-STRUCT: stat
{ "dev_t" "st_dev" }
{ "ushort" "__pad1" }
{ "__ino_t" "__st_ino" }
{ "mode_t" "st_mode" }
{ "nlink_t" "st_nlink" }
{ "uid_t" "st_uid" }
{ "gid_t" "st_gid" }
{ "dev_t" "st_rdev" }
{ { "ushort" 2 } "__pad2" }
{ "off64_t" "st_size" }
{ "blksize_t" "st_blksize" }
{ "blkcnt64_t" "st_blocks" }
{ "timespec" "st_atimespec" }
{ "timespec" "st_mtimespec" }
{ "timespec" "st_ctimespec" }
{ "ulonglong" "st_ino" } ;
2008-02-27 02:55:49 -05:00
FUNCTION: int __xstat64 ( int ver, char* pathname, stat* buf ) ;
FUNCTION: int __lxstat64 ( int ver, char* pathname, stat* buf ) ;
2008-02-27 02:55:49 -05:00
: stat ( pathname buf -- int ) [ 1 ] 2dip __xstat64 ;
: lstat ( pathname buf -- int ) [ 1 ] 2dip __lxstat64 ;