This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functionality required by std.log
Describes all the changes to druntime required by std.log: 1) Add posix module utsname for getting system information. 2) Modifed the windows module to add support fo getting the computer name and user name.
- Loading branch information
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
module core.sys.posix.sys.utsname; | ||
|
||
extern (C) | ||
{ | ||
version(linux) | ||
{ | ||
private enum utsNameLength = 65; | ||
|
||
struct utsname | ||
{ | ||
char sysname[utsNameLength]; | ||
char nodename[utsNameLength]; | ||
char release[utsNameLength]; | ||
// The field name is version but version is a keyword in D. | ||
char update[utsNameLength]; | ||
char machine[utsNameLength]; | ||
|
||
char __domainname[utsNameLength]; | ||
} | ||
|
||
int uname(utsname* __name); | ||
} | ||
else version(OSX) | ||
{ | ||
private enum utsNameLength = 256; | ||
|
||
struct utsname | ||
{ | ||
char sysname[utsNameLength]; | ||
char nodename[utsNameLength]; | ||
char release[utsNameLength]; | ||
// The field name is version but version is a keyword in D. | ||
char update[utsNameLength]; | ||
char machine[utsNameLength]; | ||
} | ||
|
||
int uname(utsname* __name); | ||
} | ||
else version(FreeBSD) | ||
{ | ||
private enum utsNameLength = 32; | ||
|
||
struct utsname | ||
{ | ||
char sysname[utsNameLength]; | ||
char nodename[utsNameLength]; | ||
char release[utsNameLength]; | ||
// The field name is version but version is a keyword in D. | ||
char update[utsNameLength]; | ||
char machine[utsNameLength]; | ||
} | ||
|
||
int uname(utsname* __name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters