[parisc-linux] getdents

Matthew Wilcox Matthew.Wilcox@genedata.com
Wed, 3 Nov 1999 03:11:52 +0100

I'm trying to implement the HPUX getdents syscall so that we can `-ls'
in sash.  Unfortunately, there appears to be no manual page on this.
Could someone let me know exactly what libc is expecting getdents
to return?  So far I have deduced the following:

It takes three parameters; a file descriptor, an address and a length
in bytes.  On return, that block of memory is filled with as many of
the following struct as will fit:

struct hpux_dirent {
	ino_t	d_ino;
	short	d_reclen;
	short	d_namlen;
	char	d_name[1];

But checking through the other compatibility implementations of getdents;
there is so much variation about what else might be returned in that
block that I would prefer to not speculate further unless I have to.

Matthew Wilcox <willy@bofh.ai>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson