On Tuesday, 27 March 2007 22:41, Tim Dijkstra wrote:
> On Tue, 27 Mar 2007 21:18:17 +0200
> "Cédric Boutillier" <[EMAIL PROTECTED]> wrote:
>
> > Hi !
> >
> > Tim said:
> > > Apparently it should be an `unsigned long long', which would make
> > > printf("blkdev: %llu \n", blkdev); the correct way to print it.
> >
> > héhé ! I got a non zero result !!! Thanks Tim ! (Should I be happy ? :) )
>
> Maybe.
>
> > $sudo s2both
> > suspend: resume_dev = 268462812
> > blkdev: 771
> > suspend: Could not use the resume device (try swapon -a)
> > zsh: exit 22 sudo s2both
>
> I hadn't noticed that Rafael had let you print out the exact same
> number (resume_dev), but with a different specifier (%lu). He thought
> that dev_t is unsigned long, while on your arch it is unsigned long long.
Yeah, that's because I've been using 64-bit systems only for quite some time.
> Well I haven't done the math, but apparently, if we cast print out the
> ull number 771 in BE as an ul number we get 268462812.
>
> Now the problem is that the kernel (just like Rafael) expects an
> unsigned long. I think we better fix this in the kernel, but can you
> try if this works (I must confess I don't now if this makes sense):
>
>
>
>
> diff -u -r1.70 suspend.c
> --- suspend.c 16 Mar 2007 16:02:22 -0000 1.70
> +++ suspend.c 27 Mar 2007 20:36:52 -0000
> @@ -208,7 +208,7 @@
> swap.offset = offset;
> error = ioctl(dev, SNAPSHOT_SET_SWAP_AREA, &swap);
> if (error && !offset)
> - error = ioctl(dev, SNAPSHOT_SET_SWAP_FILE, blkdev);
> + error = ioctl(dev, SNAPSHOT_SET_SWAP_FILE, (unsigned long)
> blkdev);
Heh, I wonder. :-)
Rafael
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel