use readdir on openbsd until we upgrade so the build machine is ok

db4
Doug Coleman 2008-10-20 11:32:55 -05:00
parent 636873a41c
commit b90aeee25c
6 changed files with 19 additions and 2 deletions

View File

@ -13,5 +13,8 @@ M: bsd stat>file-info ( stat -- file-info )
{
[ stat-st_flags >>flags ]
[ stat-st_gen >>gen ]
[ stat-st_birthtimespec timespec>unix-time >>birth-time ]
[
stat-st_birthtimespec timespec>unix-time
>>birth-time
]
} cleave ;

View File

@ -142,7 +142,9 @@ os {
[ opendir dup [ (io-error) ] unless ] dip
dupd curry swap '[ _ closedir io-error ] [ ] cleanup ; inline
: find-next-file ( DIR* -- byte-array )
HOOK: find-next-file os ( DIR* -- byte-array )
M: unix find-next-file ( DIR* -- byte-array )
"dirent" <c-object>
f <void*>
[ readdir_r 0 = [ (io-error) ] unless ] 2keep
@ -159,6 +161,8 @@ M: unix (directory-entries) ( path -- seq )
[ drop ] produce
] with-unix-directory ;
os openbsd = [ "io.unix.files.openbsd" require ] when
<PRIVATE
: stat-mode ( path -- mode )

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1,7 @@
! Copyright (C) 2005, 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: unix system ;
IN: io.unix.files
M: openbsd find-next-file ( DIR* -- byte-array )
readdir ;

View File

@ -0,0 +1 @@
unportable

View File

@ -160,6 +160,7 @@ FUNCTION: int pipe ( int* filedes ) ;
FUNCTION: void* popen ( char* command, char* type ) ;
FUNCTION: ssize_t read ( int fd, void* buf, size_t nbytes ) ;
FUNCTION: dirent* readdir ( DIR* dirp ) ;
FUNCTION: int readdir_r ( void* dirp, dirent* entry, dirent** result ) ;
FUNCTION: ssize_t readlink ( char* path, char* buf, size_t bufsize ) ;