Skip to content

Commit

Permalink
Add comment regarding utsname restriction on Linux on Z
Browse files Browse the repository at this point in the history
We cannot use `utsname` on Linux as it simply returns "s390x" in
`info.machine`. Add a comment directly in the code as to why this
restriction is there.

Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
  • Loading branch information
fjeremic committed Jan 17, 2019
1 parent 221ea79 commit fd8342d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion runtime/compiler/env/ProcessorDetection.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2018 IBM Corp. and others
* Copyright (c) 2000, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
5 changes: 4 additions & 1 deletion runtime/compiler/z/env/J9CPU.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2018 IBM Corp. and others
* Copyright (c) 2000, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -53,6 +53,9 @@ int32_t
CPU::TO_PORTLIB_get390MachineId()
{
#if defined(J9ZTPF) || defined(J9ZOS390)
// Note we cannot use utsname on Linux as it simply returns "s390x" in info.machine. On z/OS we can indeed use it [1].
//
// [1] https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/rtuna.htm
struct utsname info;

if (::uname(&info) >= 0)
Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/z/env/J9CPU.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2018 IBM Corp. and others
* Copyright (c) 2000, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down
2 changes: 1 addition & 1 deletion runtime/port/linuxs390/j9ri.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014, 2014 IBM Corp. and others
* Copyright (c) 2014, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down

0 comments on commit fd8342d

Please sign in to comment.