Differences

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

Link to this comparison view

gethostname [2021/04/05 11:23] (current)
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}}