Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Conversation

@dkgroot
Copy link
Contributor

@dkgroot dkgroot commented Mar 6, 2018

Consists of two seperate commits:

  1. Fix the previous implementation (add aio.d for linux x64 #2074).
    Note: ssize_t aio_return(const(aiocb)* aiocbp); should have been ssize_t aio_return(aiocb* aiocbp); (According to Linux, BSD's and OpenGroup-Posix )
  2. Add implementations for FreeBSD, NetBSD and DragonFly

Port Requested by @ibuclaw : #2074 (comment)
Ping @Darredevil

@dlang-bot
Copy link
Contributor

dlang-bot commented Mar 6, 2018

Thanks for your pull request and interest in making D better, @dkgroot! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + druntime#2133"

@dkgroot dkgroot force-pushed the port_aio branch 2 times, most recently from d0e6b37 to 3ab765b Compare March 6, 2018 16:07
@dkgroot
Copy link
Contributor Author

dkgroot commented Mar 6, 2018

@ibuclaw As per your request: #2074 (comment)

struct __aiocb_private {
long status;
long error;
void *kernelinfo;
Copy link
Member

Choose a reason for hiding this comment

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

Should probably use D style type here, and in other places (void* foo, not void *foo).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Q:Would it make sense to to extend checkwhitespace.d to also check for this ?

Copy link
Member

Choose a reason for hiding this comment

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

We should have a much more comprehensive lint used for phobos, so we should probably replace checkwhitespace with that and spend effort on something that may be replaced in the future.

private ssize_t _retval;
}

version = bsd_posix;
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about this, does it really make things easier to have this instead of specific versions?

Don't mind either way.

Copy link
Member

Choose a reason for hiding this comment

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

Given how small this module is, I mean.

Copy link
Contributor Author

@dkgroot dkgroot Mar 6, 2018

Choose a reason for hiding this comment

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

I think it focusses the attention on the difference between the enums' ordering (I was actually a little surprised that open groups posix specification does not state the values for these constants :-))

Would be happy to change it though, let's see if somebody would like it changed as well.

Copy link
Member

Choose a reason for hiding this comment

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

Can we proceed with removing version = bsd_posix? Just to speed up pulling this in, as this is the only part I'm hesitant about here.

@dkgroot
Copy link
Contributor Author

dkgroot commented Mar 7, 2018

BTW: Would it be helpfull to copy the comments/documentation over from the linux/bsd header files. I noticed that some of the other sys/posix/*.d files did have this ?

@dkgroot dkgroot force-pushed the port_aio branch 2 times, most recently from 1ee0732 to dee866d Compare March 8, 2018 11:52
@PetarKirov
Copy link
Member

@dkgroot AFAIK we avoid copying comments since they are covered by copyright, unlike pure API bindings.

Copy link
Member

@PetarKirov PetarKirov left a comment

Choose a reason for hiding this comment

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

LGTM, modulo a few style nits.

}
else version (FreeBSD)
{
struct __aiocb_private {
Copy link
Member

Choose a reason for hiding this comment

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

Put brace on next line.

LIO_READ,
LIO_WRITE,
LIO_NOP
};
Copy link
Member

Choose a reason for hiding this comment

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

Remove semicolon.

/* functions outside/extending posix requirement */
version (FreeBSD)
{
int aio_waitcomplete(aiocb ** aiocb_list, const(timespec)* timeout);
Copy link
Member

Choose a reason for hiding this comment

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

aiocb**

@dkgroot
Copy link
Contributor Author

dkgroot commented Mar 19, 2018

Ping @MartinNowak @CyberShadow

1 similar comment
@dkgroot
Copy link
Contributor Author

dkgroot commented Apr 11, 2018

Ping @MartinNowak @CyberShadow

@CyberShadow
Copy link
Member

I don't use these operating systems so I can't really vouch for this, but the diff looks good.

Would you mind squashing the changes from the last commit into the first two?

@dkgroot
Copy link
Contributor Author

dkgroot commented Apr 11, 2018

@CyberShadow Thanks for checking.
Don't mind squashing, but wanted to preserve the two first commits to show the distinction (The first one is fixing the previously merged implementation, the second is extending it by adding the BSD implementation). The squashing can be done when someone has been able to review it.

Do you know anybody who does use one of the BSD's for checking/testing ? If so can you add them as a reviewer ?

@CyberShadow
Copy link
Member

Don't mind squashing, but wanted to preserve the two first commits to show the distinction

Yep, my suggestion was to just get rid of the third commit, and leave the first two separate.

Do you know anybody who does use one of the BSD's for checking/testing ? If so can you add them as a reviewer ?

Other than the people already in this thread, I don't think so; so, we might as well merge this after the fixup.

@dkgroot
Copy link
Contributor Author

dkgroot commented May 2, 2018

Does one of you know why auto-tester fails on linux_64_32 for this change, i don't see how 'std/regex/internal/tests.d' could be related to these changes. Maybe it's just an unrelated regression.

@wilzbach
Copy link
Contributor

wilzbach commented May 2, 2018

Spurious failure because std.regex's CTFE tests consumes so much memory (see e.g. dlang/phobos#6164)
auto-tester automatically restarts itself.

@dkgroot
Copy link
Contributor Author

dkgroot commented May 2, 2018

@wilzbach Thanks for the heads-up !
Ping @MartinNowak
Anything holding this PR up ?

@wilzbach
Copy link
Contributor

wilzbach commented May 6, 2018

version (X86_64)
{
...
}
else version (DragonFlyBSD)
{

}


I thought DragonFlyBSD is x86_64 only?

@dkgroot
Copy link
Contributor Author

dkgroot commented May 6, 2018

@wilzbach Not sure how this came to be (It has been a couple of weeks). It looks like the BSD versions are at the wrong version scope (indentation). Thanks for noticing/finding this !

@dkgroot dkgroot force-pushed the port_aio branch 2 times, most recently from 59c967e to c10c6d0 Compare May 6, 2018 10:15
Copy link
Member

@ibuclaw ibuclaw left a comment

Choose a reason for hiding this comment

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

Let's just proceed. As the incomplete implementation (unsupported cpu type is just plain wrong in the GNU path) is blocking me.

bsd_posix should perhaps by BSD_Posix?

@dlang-bot dlang-bot merged commit c06ed31 into dlang:master Jun 23, 2018
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.

6 participants