This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

happily messing up with raw devices (aka: lseek problems)


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

Hi there.
I'm (trying to) writing a program to configure a GAG boot manager
installation (gag.sf.net) from command line, while trying to create a
program as portable as possible.

I began the developement under FreeBSD, and there I learnt that
/dev/ad0 (FreeBSD's /dev/sda) must be read at 512 bytes block size
(which seems quite natural but, well, I tought the OS would have done
the necessary things by himself, not being overly complicate at all ni
reading and not so complicate in writing too).

Once I got a fairly fuctioning program in FreeBSD I tried it on Cygwin
(as by te way my FreeBSD box does *not* use GAG, so once succeding to
read the wanted sector and printing the string "GAG not detected" I
couldn't really go on).

Under Cygwin, for a change, the problem is in the lseek I use to skipp
the first 4 sectors in order to read the 45th (the one that contains
te actual data I'm interested into).

Is is normal that Cygwin's lseek doesn't work on /dev/sda?
What should I do?
My own personal work-around would be to read all those 44 sectors (and
discarding them), but I don't like that very much, is there some
better/cleaner alternative?

If anyone wants to see the source code, it's all in my Monotone
server, so either
    monotone pull cyberx.lapo.it it.lapo.gagulator
or browse it online:
    http://cyberx.lapo.it/viewmtn/branch.psp?branch=it.lapo.gagulator

    Lapo

PS: why doesn't Cygwin's man include man2 pages such as lseek? =)

- --
Lapo Luchini
lapo@lapo.it (OpenPGP & X.509)
www.lapo.it (ICQ UIN: 529796)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJDHyZtAAoJELBiMTth2oCDA9kQAI6ncnDgdBCcLrI+6kSwWOZ/
IdvpNAyEAwaARGRJc/DRMeiGtpxrxQYkA7OEQhqLXHlQre9NCjlJcHacx5awC7PA
QxJgG9gr13oVCoQ3JXC6EJXUJ++atHzRmYxcDobRr71YlLENpPxGI7GkUz71Dv/o
nSWvVWpp0p3vXcwKcLCzHqSBsD0Fpjx0kDHr1EsU7ya79WyU/dwymHbRy+dmvrN3
t8zL4R/4dwhEpozVcL/df42DhghYDV8bqCCS6G7lI/yk/Nrqm2LWvOVBfD0ScW1n
liZx3ztRMGBakKaVYs309mNQzi5aFmb2sFIY2IaTLftjwOWlJvZV5WLXWs6XjxMG
QJTtKHRyDf8eSWITEzgTboo7eGrs790WLNNa46TQ/DpmWR8sp2ZjmOzoSII0UE+W
yGpdZQF28fpMi3BpxnD2ce01kRVc2elKJkDDjAqGKI0n4PYuE5OLc4zKIYOUOsoP
LUWyCFJcFY9l5PCFTS0D0cZOSl9zYlw/mVMtxYbywtl4C9Cfz1rWgyR8NyyG7MXI
rOyBnZ5HjkEDyn4qTQStSgKgTgPLEoQvsd2VlmPlsMeT0T4yIb1gep25tZW8LRoQ
3k+w+ZAVevMjsdRECae2tVkxgKTn84r0Okl2GFAXHQFm8Td6ZeV9tTSASuGl7XKS
VzJ/psK4V+JCS3qi0YjD
=Mvhb
-----END PGP SIGNATURE-----


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]