[cups.development] cupsBackChannelRead() returns -1

Helge Blischke h.blischke at acm.org
Tue Mar 20 10:11:00 PDT 2012


Michael Sweet wrote:

> errno 11 is EDEADLK, not something we'd expect from reading the pipe. 
> This is likely an Ubuntu issue.
> 
> 
> On Mar 20, 2012, at 8:09 AM, Phil Ineichen wrote:
> 
>> The following code runs fine on CUPS 1.4.6 (Ubuntu 11.04)
>> 
>> byte buf[16];
>> ssize_t bytesRead = cupsBackChannelRead((char*)buf, sizeof(buf), 2.5);
>> if(bytesRead == -1)
>> {
>>   fprintf(stderr, "DEBUG: cupsBackChannelRead failed, errno=%d\n",
>>   errno);
>> }
>> else if(bytesRead == 0)
>> {
>>   fprintf(stderr, "DEBUG: cupsBackChannelRead no data\n");
>> }
>> else
>> {
>>   fprintf(stderr, "DEBUG: cupsBackChannelRead has read %i bytes\n",
>>   bytesRead);
>> }
>> 
>> But cupsBackChannelRead() returns -1 and errno 11 on CUPS 1.5.0 (Ubuntu
>> 11.10)!
>> 
>> I am not sure what is causing this behavior (Ubuntu, driver or CUPS).
>> 
>> Thank you!
>> _______________________________________________
>> cups-dev mailing list
>> cups-dev at easysw.com
>> http://lists.easysw.com/mailman/listinfo/cups-dev
> 
> _________________________________________________________
> Michael Sweet, Senior Printing System Engineer, PWG Chair

The Ubuntu headers (especially /usr/include/asm-generic/errno-base.h) define 
errno 11 as EAGAIN (try again) (uname reports kernel version 2.6.32).
It might be a blocking/nonblocking issue?

Helge





More information about the cups-devel mailing list