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

Add linux-specific core.sys.linux.file module#1677

Merged
DmitryOlshansky merged 1 commit intodlang:masterfrom
Burgos:issue-11373
Jan 15, 2017
Merged

Add linux-specific core.sys.linux.file module#1677
DmitryOlshansky merged 1 commit intodlang:masterfrom
Burgos:issue-11373

Conversation

@Burgos
Copy link
Contributor

@Burgos Burgos commented Oct 20, 2016

This adds core.sys.linux.file module which contains
flock function definition and values of the parameters
to pass.

@CyberShadow
Copy link
Member

I believe this should be core.sys.linux.sys.file to follow the naming scheme for sys/file.h.

@CyberShadow
Copy link
Member

CyberShadow commented Nov 3, 2016

BTW, unless you specifically need advisory-only locks, we already have definitions for fcntl locks, also exposed via std.stdio.File.lock() etc.

@CyberShadow
Copy link
Member

Makefiles and file lists need to be modified when adding new modules. See all occurrences of an existing module name for an example, e.g. git grep timerfd | grep -v ^src/.

@Burgos
Copy link
Contributor Author

Burgos commented Nov 3, 2016

I believe this should be core.sys.linux.sys.file to follow the naming scheme for sys/file.h.

Thanks, I got fooled by the sys prefix.

Updated with moved location and updated make/COPY, win32.mak and win64.mak files.

/// Unlock
enum LOCK_UN = 0x08;
/// Atomic update
enum __LOCK_ATOMIC = 0x16;
Copy link
Member

Choose a reason for hiding this comment

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

This one isn't in my file.h. Is it Debian-specific?

Copy link
Member

Choose a reason for hiding this comment

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

I think this one is only implemented in the GNU Hurd kernel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I got it from mine (Ubuntu's) file.h, but I don't see it on glibc's upstream file.h, so I'll remove it.

Thanks and good catch!

This adds core.sys.linux.file module which contains
flock function definition and values of the parameters
to pass.
@Burgos
Copy link
Contributor Author

Burgos commented Nov 3, 2016

Updated with __LOCK_ATOMIC removed.

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

@DmitryOlshansky
Copy link
Member

Looks good apart from horrible windows makefiles... but that's separate problem.

@DmitryOlshansky DmitryOlshansky merged commit 4296d48 into dlang:master Jan 15, 2017
@andralex
Copy link
Member

thx!

@Burgos Burgos deleted the issue-11373 branch May 7, 2017 15:17
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.

4 participants