[syslinux] Re: Problem compiling syslinux-3.01

H. Peter Anvin hpa at zytor.com
Tue Jan 4 18:50:53 PST 2005

Terry Chan wrote:
> b) grep -r BLKGETSIZE /usr/include    says:
> /usr/include/sys/mount.h:#define BLKGETSIZE _IO(0x12, 96) /* Return device size.  */
> /usr/include/linux/fs.h:#define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) */
> /usr/include/linux/fs.h:#define BLKGETSIZE64 _IOR(0x12,114,sizeof(u64)) /* return device size in bytes (u64 *arg) */

Okay, your <linux/fs.h> is broken beyond repair.  The proper definition 

#define BLKGETSIZE64 _IOR(0x12,114,size_t)

There is no "sizeof", and u64 doesn't belong in the user headers.  I 
suspect this particular screwup is probably the reason that it's size_t 
instead of the proper __u64 in the current definition, because sizeof() 
returns a size_t, so by putting sizeof(u64) they basically did 
sizeof(sizeof(u64)), which is equivalent to sizeof(size_t) if u64 is 

This is way ugly.  The best bet is to add right after

  #include <inttypes.h>
+typedef uint64_t u64;

... and see if that helps.

Barf, puke.


More information about the Syslinux mailing list