[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] STAT bits - Ouch!



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2010-12-09 02:27, Vincent Rivière wrote:
> Alan Hourihane wrote:
>> Given, pretty much, every unix'ish style OS defines these....
>>
>> #define __S_IFDIR       0040000 /* Directory.  */
>> #define __S_IFCHR       0020000 /* Character device.  */
>> #define __S_IFBLK       0060000 /* Block device.  */
>> #define __S_IFREG       0100000 /* Regular file.  */
>> #define __S_IFIFO       0010000 /* FIFO.  */
>> #define __S_IFLNK       0120000 /* Symbolic link.  */
>> #define __S_IFSOCK      0140000 /* Socket.  */
>>
>> On FreeMiNT, we do this....
>>
>> #define __S_IFDIR       0040000 /* Directory.  */
>> #define __S_IFCHR       0020000 /* Character device.  */
>> #define __S_IFBLK       0060000 /* Block device.  */
>> #define __S_IFREG       0100000 /* Regular file.  */
>> #define __S_IFIFO       0120000 /* FIFO.  */
>> #define __S_IFLNK       0160000 /* Symbolic link.  */
>> #define __S_IFSOCK      0010000 /* Socket.  */
>
> Compatibility issues are always critical...
>
> Are the UNIX values really the same on every other OS ?

GNU libc 2.5 on Linux:

#define __S_IFMT    0170000 /* These bits determine file type.  */

/* File types.  */
#define __S_IFDIR   0040000 /* Directory.  */
#define __S_IFCHR   0020000 /* Character device.  */
#define __S_IFBLK   0060000 /* Block device.  */
#define __S_IFREG   0100000 /* Regular file.  */
#define __S_IFIFO   0010000 /* FIFO.  */
#define __S_IFLNK   0120000 /* Symbolic link.  */
#define __S_IFSOCK  0140000 /* Socket.  */

Cheers,
	T.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)

iEYEARECAAYFAk0A/fcACgkQMiyRSD9s+zVH7ACeIl9PIuFslOMu1Ky7h9eqiEvc
flsAniY/sd1hij7VPY7SDApAsUgzgJ3M
=a7EG
-----END PGP SIGNATURE-----