Skip to content

sched_setaffinity failure #968

@ericeil

Description

@ericeil

On rs_preview build 14905:

sudo apt-get install dotnet-dev-1.0.0-preview2-003121

dotnet new

Replace Program.cs with the following:

using System;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var p = System.Diagnostics.Process.GetCurrentProcess();
            Console.WriteLine(p.ProcessorAffinity);
            p.ProcessorAffinity = (IntPtr)1;
        }
    }
}

dotnet restore

dotnet run

On "real" Linux, this runs to completion. On Windows, I get a failure:

Unhandled Exception: System.ComponentModel.Win32Exception: Invalid argument
   at System.Diagnostics.Process.set_ProcessorAffinityCore(IntPtr value)
   at System.Diagnostics.Process.set_ProcessorAffinity(IntPtr value)
   at ConsoleApplication.Program.Main(String[] args)

ProcessorAffinityCore is calling sched_setaffinity, which apparently fails.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions