Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Place SEEK_DATA, SEEK_HOLE in core.sys.linux.unistd #1357

Merged
merged 1 commit into from Sep 2, 2015
Merged

Place SEEK_DATA, SEEK_HOLE in core.sys.linux.unistd #1357

merged 1 commit into from Sep 2, 2015

Conversation

mrkline
Copy link
Contributor

@mrkline mrkline commented Aug 24, 2015

Pull #1344 placed them with fallocate. While the three are often used in conjunction, SEEK_DATA and SEEK_HOLE should be placed with SEEK_SET, SEEK_CUR, and SEEK_END.

@mrkline
Copy link
Contributor Author

mrkline commented Aug 24, 2015

Does this belong here in core/stdc/stdio.d with the other SEEK_ definitions?
In core/sys/linux/stdio.d since it's Linux-only?
In core/sys/posix/unistd.d since it's used with lseek?
In a new core/sys/linux/unistd.d file since it only works with lseek on Linux?

The choices are many. Is there a general guide or rule of thumb on where to place values like this in druntime?

@WalterBright
Copy link
Member

I don't see what is gained by moving declarations from one file to another.

@mrkline
Copy link
Contributor Author

mrkline commented Aug 27, 2015

I put those declarations there last week, and they're in the wrong spot. I put them in the module fnctl with fallocate when they don't belong there - they're used for lseek (from unistd).

@mrkline
Copy link
Contributor Author

mrkline commented Aug 27, 2015

Relevant man page: http://man7.org/linux/man-pages/man2/lseek.2.html

@DmitryOlshansky
Copy link
Member

In a new core/sys/linux/unistd.d

Makes more sense then the other two

@mrkline mrkline changed the title Place SEEK_DATA, SEEK_HOLE with other SEEK_ macros Place SEEK_DATA, SEEK_HOLE in core.sys.linux.unistd Aug 30, 2015
@mrkline
Copy link
Contributor Author

mrkline commented Aug 30, 2015

@DmitryOlshansky Changed and squashed.

Pull #1344 placed them with fallocate. While the three are often
used in conjunction, SEEK_DATA and SEEK_HOLE are from Linux's
unistd.h, to be used with lseek.
See http://man7.org/linux/man-pages/man2/lseek.2.html
@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

DmitryOlshansky added a commit that referenced this pull request Sep 2, 2015
Place SEEK_DATA, SEEK_HOLE in core.sys.linux.unistd
@DmitryOlshansky DmitryOlshansky merged commit 4e799b7 into dlang:master Sep 2, 2015
@WalterBright
Copy link
Member

Causes regression https://issues.dlang.org/show_bug.cgi?id=15223

@mrkline
Copy link
Contributor Author

mrkline commented Oct 19, 2015

Sorry about missing the MANIFEST and thanks for patching it up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants