Browse Prior Art Database

Improved Errno Processing

IP.com Disclosure Number: IPCOM000099217D
Original Publication Date: 1990-Jan-01
Included in the Prior Art Database: 2005-Mar-14
Document File: 1 page(s) / 41K

Publishing Venue

IBM

Related People

O'Quin, JC: AUTHOR [+3]

Abstract

Disclosed is a technique that improves UNIX* error (errno) processing by making it more efficient and

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 95% of the total text.

Improved Errno Processing

       Disclosed is a technique that improves UNIX* error (errno)
processing by making it more efficient and

      The errno variable is part of the system call interface UNIX
systems.  It is a variable that indicates the the system call failed.
 In traditional UNIX systems, is processed in a small assembler
routine that is link into the application program.

      The solution is to assign a fixed address in each user for the
errno variable. This address is at the top the user stack for the
process.  The loader resolves all to this fixed address.  The system
call handler can automatically update errno before returning to the
because errno's address is known.

      This solution also allows for reliable processing of with
respect to signals. A program typically checks errors in the
following way: ( system_call() == -1 ) { examine errno }

      Note that the above code could incorrectly determine the for
failure if a signal that performs a system call taken between the
time that the system call returns and is examined.  This is fixed by
having the system handler save and restore errno.

      This design has the advantage that errno can be as part of the
standard system call handler.  This path length by eliminating the
need for the assembler  It also has cache performance advantages
because a single copy shared by all users.  It saves space in user
file by not requiring the assembler routine. it allows errno to b...