From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,5f6741546a169470,start X-Google-Attributes: gid1164f8,public From: chungto@ampex.com (Tony Chung) Subject: How to set errno to ENOSPC Date: 1996/01/02 Message-ID: #1/1 X-Deja-AN: 133714544 sender: news@ampex.com organization: Ampex Corp. reply-to: chungto@ampex.com newsgroups: comp.sys.dec I am writing a device driver for our tape drive on the alpha-dec-osf3.2. When there is an EOM-encountered. I return ENOSPC (errno 28) within xxx_write(). I also set bp->b_error to ENOSPC and set bp->b_flags |= B_ERROR within xxx_strategy. According to man pages, write() should return -1 and set errno to ENOSPC. Instead errno was 0 while write() return something else ( i.e.. (count != write(fd, buf, count)) and count not equal to -1) Any idea? The document do not explain how it work. I wonder how the Kernel code know there is a problem. I suspect this may be done within iodone() which there is no source code. Thanks for any help or comment. --- ============================= Tony Chung chungto@ampex.com