Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
9cef74b7
Commit
9cef74b7
authored
14 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
ENH: optional argument to hostName() to return full hostname
- value as reported by gethostbyname
parent
f3b95df7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OSspecific/POSIX/POSIX.C
+14
-4
14 additions, 4 deletions
src/OSspecific/POSIX/POSIX.C
src/OpenFOAM/include/OSspecific.H
+2
-1
2 additions, 1 deletion
src/OpenFOAM/include/OSspecific.H
with
16 additions
and
5 deletions
src/OSspecific/POSIX/POSIX.C
+
14
−
4
View file @
9cef74b7
...
...
@@ -109,12 +109,22 @@ bool Foam::setEnv
}
Foam
::
word
Foam
::
hostName
()
Foam
::
word
Foam
::
hostName
(
bool
full
)
{
char
buf
fer
[
256
];
gethostname
(
buf
fer
,
256
);
char
buf
[
256
];
gethostname
(
buf
,
256
);
return
buffer
;
if
(
full
)
{
struct
hostent
*
hptr
=
gethostbyname
(
buf
);
if
(
hptr
)
{
return
hptr
->
h_name
;
}
}
return
buf
;
}
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/include/OSspecific.H
+
2
−
1
View file @
9cef74b7
...
...
@@ -68,7 +68,8 @@ string getEnv(const word&);
bool
setEnv
(
const
word
&
name
,
const
string
&
value
,
const
bool
overwrite
);
//- Return the system's host name
word
hostName
();
// Optionally the full name reported from gethostbyname
word
hostName
(
const
bool
full
=
false
);
//- Return the user's login name
word
userName
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment