From: Matthew Wilcox <Matthew.Wilcox@genedata.com>
To: Kevin Vajk <kvajk@ricochet.net>
Cc: parisc-linux@thepuffingroup.com
Subject: Re: [parisc-linux] getdents
Date: Thu, 4 Nov 1999 02:43:07 +0100 [thread overview]
Message-ID: <19991104024307.I25252@mencheca.ch.genedata.com> (raw)
In-Reply-To: <Pine.LNX.4.10.9911031724290.26045-100000@sophia.localdomain>; from Kevin Vajk on Wed, Nov 03, 1999 at 05:29:30PM -0800
On Wed, Nov 03, 1999 at 05:29:30PM -0800, Kevin Vajk wrote:
>
>
> OK, here we go:
>
> struct __dirent {
> uint64_t __d_off; /* "magic cookie" */
> _T_INO_T __d_ino; /* file number of entry */
> short __d_reclen; /* length of this record */
> short __d_namlen; /* length of string in d_name */
> char __d_name[_MAXNAMLEN + 1];/* name must be no longer than this */
> };
>
> Note that sizeof(_T_INO_T) varies depending on your system's bit-ness,
> so this is really two structure definitions.
>
> The d_off structure member is an offset for that directory entry. I
> don't know if anybody in user-space ever uses it; I doubt it.
I've done the following:
struct hpux_dirent {
long d_off_pad; /* we only have a 32-bit off_t */
long d_off;
ino_t d_ino;
short d_reclen;
short d_namlen;
char d_name[1];
};
I think that's the right way round to put the padding for a big-endian
machine. Yes, I know it ought to be done properly, but we don't have
a put_user() that will cope with an 8-byte quantity yet. Any volunteers?
--
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
next prev parent reply other threads:[~1999-11-04 1:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-03 2:11 [parisc-linux] getdents Matthew Wilcox
1999-11-04 1:12 ` Kevin Vajk
1999-11-04 1:29 ` Kevin Vajk
1999-11-04 1:43 ` Matthew Wilcox [this message]
1999-11-04 5:52 ` Grant Grundler
1999-11-04 1:39 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19991104024307.I25252@mencheca.ch.genedata.com \
--to=matthew.wilcox@genedata.com \
--cc=kvajk@ricochet.net \
--cc=parisc-linux@thepuffingroup.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox