[EMAIL PROTECTED] wrote:
>
> >From [EMAIL PROTECTED] Mon Jul 3 16:56:45 2000
> [snip]
>
> It seems that you did not understand how interfaces in a POSIX enviroment
> are implemented:
>
> - Call syscall of ioctl() function with parameters
>
> - Check return value
>
> - If return value >= 0, operation worked as expected
>
> - If return value == -1, operation did not work
>
> >From this POSIX point of view, SG_SET_RESERVED_SIZE is not even
> working correctly for the Linux 2.4 implementaion. It always returns
> success regardless of what happens on behalf of it's execution.
It depends on how you define "worked as expected". It returns success
in the case where 512 KB (for example) is requested and 256 KB is
obtained. There is a strong hint here: that's the best you going to
get at the moment. Could that information be conveyed with an error
message? Perhaps cdrecord would like to do a binary chop to find out
the biggest reserved buffer in can obtain before deciding whether that
is of sufficient size. As for the "always returns success": the
reserved buffer can be in use in which case the ioctl yields EBUSY.
See the sg documentation.
Even when you don't wish to call SG_SET_RESERVED_SIZE then an
application like cdrecord still should call SG_GET_RESERVED_SIZE
after an open() because there is no guarantee that the default
sized 32 KB reserve buffer was obtained either.
> >>From lk 2.2.10 (sg version 2.1.34) SG_SET_RESERVED_SIZE was
> >implemented. Lk 2.2.10 was released on 14th June 1999.
> >However this should make no difference to the
> >application which should still call the "GET" to see if
> >the driver was able to get some of that limited resource
> >(i.e. memory). For DMA purposes, swap is obviously useless
> >and for ISA adapters memory above the 16 MB level is
> >useless. Additionally if an adapter doesn't support scatter
> >gather then "splintered" memory may not be suitable.
>
> This is something, a drive usually hides from the application.
> I don't want to know about it.
And you don't have to, you just should call SG_GET_RESERVED_SIZE :-)
> BTW: From my understanding, SG_GET_RESERVED_SIZE count return 0 on pre-2.2.10
> kernels. So this interface is useless.
And if you misunderstood (and you have) would that make the
interface useful?
[snip]
Doug Gilbert
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]