User Tools

Site Tools


gethostname

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gethostname [2019/03/18 10:37] (current)
mihael created
Line 1: Line 1:
 +====== Get Hostname ======
  
 +<sxh>
 +
 +**FREE
 +
 +ctl-opt dftactgrp(*no) actgrp(*caller);​
 +
 +
 +dcl-pr gethostname int(10) extproc('​gethostname'​);​
 +  name pointer value;
 +  length int(10) value;
 +end-pr;
 +
 +
 +main();
 +*inlr = *on;
 +
 +
 +dcl-proc main;
 +  dcl-s name char(50);
 +  dcl-s rc int(10);
 +
 +  rc = gethostname(%addr(name) : %size(name));​
 +  dsply %char(rc);
 +
 +  name = %str(%addr(name));​
 +  dsply name;
 +
 +end-proc;
 +
 +</​sxh>​
 +
 +{{tag>​devel ibm rpg}}
gethostname.txt ยท Last modified: 2019/03/18 10:37 by mihael