ack/plat/osxppc/libsys/getdirentries.s
George Koehler 466bc555fe Add getdirentries() and stat() for Mac OS X.
Also add fstat() and lstat().  I don't #define the constants for
st_mode or d_type, but I provide enough to get the block size of a
file and to list the names in a directory.  Some fields of struct stat
get truncated, see XXX in plat/osx/include/sys/stat.h.

In struct dirent, the inode field might be d_ino or d_fileno.  I
picked d_ino because Apple's sys/dirent.h uses d_ino (but Apple's
manual pages use d_fileno).
2016-11-28 14:32:49 -05:00

12 lines
228 B
ArmAsm

.sect .text
.define _getdirentries
_getdirentries:
addi r0, r0, 196 ! getdirentries
lwz r3, 0(sp) ! fd
lwz r4, 4(sp) ! buffer
lwz r5, 8(sp) ! buffer size
lwz r6, 12(sp) ! base pointer
sc 0
b .set_errno
bclr 20, 0, 0