write(2) to /dev/ad4 = EINVAL
Hans Petter Selasky
hselasky at c2i.net
Mon Jan 26 02:07:22 PST 2009
On Monday 26 January 2009, Lukasz Jaroszewski wrote:
> Hi,
> after opening /dev/ad4 with success for O_RDWR, I am getting [EINVAL]
> from write(2), which according to man 2 write, means
> `` [EINVAL] The pointer associated with d was
> negative.'', as you can see below it is not true, I have tried
> different block sizes, with same result.
>
> How can I write one byte to /dev/adN ?
Hi,
You cannot write one byte to /dev/adN, I think. Harddisks are block based.
Please see:
diskinfo -v ad4
And especially the "sector size". When you seek and transfer data the offset
and length must be a factor of the "sector size" or "block size". See also
LBA, logical block address.
--HPS
>
>
> 1361 ow CALL open(0x80485e3,O_RDWR,<unused>0xbfbfecc8)
> 1361 ow NAMI "/dev/ad4"
> ;/dev/ad4 is DOS FAT formatted CF Card.
> 1361 ow RET open 3
>
> 1361 ow CALL write(0x3,0xbfbfecb8,0x8)
> 1361 ow RET write -1 errno 22 Invalid argument
>
> root@~(0) uname -r
> 7.0-STABLE
> -----------
> Best Regards
> Lukasz.
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
More information about the freebsd-hackers
mailing list