[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: binding to libc's stats() using alien
- From: Sebastien Lai <237482@...>
- Date: Tue, 16 Aug 2011 19:39:13 +0200
Most of them are typedef'd to 'unsigned int' (or 'unsigned long int'),
so it might be worth a try to replace the *_t types with 'unsigned
int'.
It is, however, wise to check the headerfiles for the actual typedef
definition of those types.
On Mon, Aug 15, 2011 at 8:27 AM, 杨镭 <clanherb@gmail.com> wrote:
> The second argument of stats() is a stuct, which has a lot of fields to
> declare:
>
> struct stat {
>
> dev_t st_dev; /* IDs of device on which file resides */
> ino_t st_ino; /* I-node number of file */
> mode_t st_mode; /* File type and permissions */
> nlink_t st_nlink; /* Number of (hard) links to file */
> uid_t st_uid; /* User ID of file owner */
> gid_t st_gid; /* Group ID of file owner */
>
> ......
> };
> What's the most easy way to declare such a struct, especially one should
> know the basic C type behind type such as dev_t or ino_t?
> I tried the constants utility which is bundled with alien, but I guess it
> only works with magic number not something like dev_t
> --
> lei yang