× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I have wrapped the sys/stat.h C API as follows

     // Will return 0 if successful and -1 if unsuccessful
     D lstat           PR            10I 0 EXTPROC('lstat')
     D  PathName                       *   VALUE
     D  Buffer                         *   VALUE

and then added for the pass to buffer a pointer to this

     D info            DS                  qualified
     D  st_mode                       5U 0
     D  st_ino                       10U 0
     D  st_nlink                      5U 0
     D  st_uid                       10U 0
     D  st_gid                       10U 0
     D  st_size                      10I 0
     D  st_atime                     10I 0
     D  st_mtime                     10I 0
     D  st_ctime                     10I 0
     D  st_dev                       10U 0
     D  st_blksize                   10I 0
     D  st_allocsize                 10I 0
     D  st_objtye                    11A
     D  st_codepage                   5U 0
     D  st_ccsid                      5U 0
     D  st_reserved                  60A
     D  st_ino_gen_id                10U 0

and then made the call to lstat by

     D NULL            C                   CONST(X'00')
     D Success         S             10I 0
     D Buffer          S               *
     D Path            S               *
     D FileInfo        DS                  LikeDS(Info)

      /Free

        PathName = '/<IFSDIRECTORY in ROOT>/AFILE.EXT' + NULL;
        Path = %Addr(PathName);
        Buffer = %Addr(FileInfo);
        Success = lstat(Path:Buffer);

on finding that Success is -1 I want to check errno. How can I pull errno (
this is a variable that is defined in the errno.h header file ) into my RPG?

Thanks in advance,
Bryan



"The significant problems we face cannot be solved at the same level of 
thinking we were at when we created them."         Albert Einstein 



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.