Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Finishing up PAL'ing Unix\libc (non-networking and crypto) PInvoke calls #3257

Merged
merged 1 commit into from
Sep 17, 2015
Merged

Conversation

jonmill
Copy link

@jonmill jonmill commented Sep 15, 2015

Finishing up PAL'ing Unix\libc (non-networking and crypto) PInvoke calls

/c @nguerrera

@jonmill
Copy link
Author

jonmill commented Sep 15, 2015

@dotnet-bot test this please

Looks like a Windows test failure around a string comparison...will try to test again. The test suite that failed in this run passes locally

{
internal static int DEFAULT_PC_NAME_MAX = 255;

internal enum PathConfNames : int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be PathConfName singular since these aren't flags.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@stephentoub
Copy link
Member

Other than the issues called out, LGTM. Good to see us almost through the non-networking/crypto P/Invokes.

@@ -344,3 +354,75 @@ int32_t WTermSig(int32_t status)
{
return WTERMSIG(status);
}

static
int32_t ConvertPathConfNameToPlatform(PathConfName& name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no sense to pass name as a reference

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed :) I deleted the whole function anyway

@jonmill
Copy link
Author

jonmill commented Sep 17, 2015

@dotnet-bot test this please

@jonmill
Copy link
Author

jonmill commented Sep 17, 2015

Any further comments folks? @nguerrera @stephentoub

if (result != null)
{
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: trailing whitespace

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@ghost
Copy link

ghost commented Sep 17, 2015

@sokket, by any chance, does this happen to fix https://github.com/dotnet/corefx/issues/2988?

@@ -53,6 +54,11 @@ static_assert(PAL_LOG_LOCAL5 == LOG_LOCAL5, "");
static_assert(PAL_LOG_LOCAL6 == LOG_LOCAL6, "");
static_assert(PAL_LOG_LOCAL7 == LOG_LOCAL7, "");

// Validate that out PriorityWhich values are correct for the platform
static_assert(static_cast<int>(PriorityWhich::PAL_PRIO_PROCESS) == PRIO_PROCESS, "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made our enums not have the 'class' designation so that we can get rid of a bunch of casts like this: i.e. enum Foo : T instead of enum class Foo : T. Please fix the new ones up to match.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@jonmill
Copy link
Author

jonmill commented Sep 17, 2015

@jasonwilliams200OK I don't think so since this doesn't shim anything in System.Net yet; this could be fixed with my next check-in though :). I'm moving on to shim the System.Net calls that are currently in Master next, so I'll assign that bug to me and make sure that the shim code for System.Net compiles on my FreeBSD box as well

{
// GetPriority uses errno 0 to show succes to make sure we don't have a stale value
errno = 0;
return getpriority(static_cast<int>(which), static_cast<id_t>(who));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that you also won't need to cast which here after changing from enum class to enum.

As for id_t, are there any range concerns here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope; it's more because id_t is declared as unsigned but the c# base class declares it as signed, so we need a conversion when sending back to the OS here

@nguerrera
Copy link
Contributor

LGTM for the most part, but I left a few more comments.

@jonmill
Copy link
Author

jonmill commented Sep 17, 2015

Thanks folks! Double checking that the build passes and then will merge

jonmill pushed a commit that referenced this pull request Sep 17, 2015
Finishing up PAL'ing Unix\libc (non-networking and crypto) PInvoke calls
@jonmill jonmill merged commit 6615490 into dotnet:master Sep 17, 2015
@jonmill jonmill deleted the pal branch September 17, 2015 20:48
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants