src/debug/debug-pal/unix/diagnosticsipc.cpp
void IpcStream::DiagnosticsIpc::Unlink(ErrorCallback callback)
{
    if (_isUnlinked)
        return;
    _isUnlinked = true;

    const int fSuccessUnlink = ::unlink(_pServerAddress->sun_path);
    if (fSuccessUnlink == -1)
    {
        if (callback != nullptr)
            callback(strerror(errno), errno);
        _ASSERTE(fSuccessUnlink == 0);
    }
}
//! This helps remove the socket from the filesystem when the runtime exits.
//! From: http://man7.org/linux/man-pages/man7/unix.7.html#NOTES
//!   Binding to a socket with a filename creates a socket in the
//!   filesystem that must be deleted by the caller when it is no longer
//!   needed (using unlink(2)).  The usual UNIX close-behind semantics
//!   apply; the socket can be unlinked at any time and will be finally
//!   removed from the filesystem when the last reference to it is closed.
This helps remove the socket from the filesystem when the runtime exits.
This helps remove the socket from the filesystem when the runtime exits .
void IpcStream::DiagnosticsIpc::Unlink(ErrorCallback callback)
{
    if (_isUnlinked)
        return;
    _isUnlinked = true;
    const int fSuccessUnlink = ::unlink(_pServerAddress->sun_path);
    if (fSuccessUnlink == -1)
    {
        if (callback != nullptr)
            callback(strerror(errno), errno);
        _ASSERTE(fSuccessUnlink == 0);
    }
}
void IpcStream :: DiagnosticsIpc :: Unlink ( ErrorCallback callback ) { if ( _isUnlinked ) return ; _isUnlinked = true ; const int fSuccessUnlink = :: unlink ( _pServerAddress -> sun_path ) ; if ( fSuccessUnlink == -1 ) { if ( callback != nullptr ) callback ( strerror ( errno ) , errno ) ; _ASSERTE ( fSuccessUnlink == 0 ) ; } }
This helps remove the socket from the filesystem when the runtime exits.
This helps remove the socket from the filesystem when the runtime exits .