[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9413.0. "EINTR question" by CSC32::I_WALDO () Mon Apr 07 1997 13:23

    Got the following request from a customer, I don't know the internals
    of UNIX well enough to answer.  
    
    **********************************************************************
    This is a Digital Unix kernel question for versions 3.x and 4.x.
    
    I need to know in exactly which cases system calls are terminated in 
    error with errno=EINTR when signals are being used.
    
    I know that if a system call is blocking, waiting for a user level 
    initiated event (such as the arrival of a Net or IPC message, the 
    unlocking of a semaphore, or the unreferencing of an i-node by another 
    thread of control), that the delivery of a signal to the calling process 
    while the function is blocked will, by default, cause the blocking call 
    to return in error with errno set to EINTR.
    
    What is not clear to me is what happens if the system call is 'blocking' 
    or waiting in a different sense: suppose that there is no user level 
    event as defined above causing the system call to wait, but rather the 
    kernel is waiting for internal reasons, not directly related to the user 
    level, such as waiting for shared kernel resources to free-up, or for an 
    internal kernel event that would preclude an implementation dependent 
    race condition.  Can the system call terminate with errno=EINTR in this
    latter case when there is a signal to be delivered?  If so, it implies 
    that even a system call that is explicitly set not to block 
    could be terminated with errno=EINTR by a signal.  Is this correct?
T.RTitleUserPersonal
Name
DateLines
9413.1SMURF::DENHAMDigital UNIX KernelMon Apr 07 1997 14:585
    I can't think offhand of a nonblocking  system call that can
    return EINTR. I don't believe there's universal list of these
    calls available. If the man page says [EINTR] is one possible
    error, then there you go.