× 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'm using Scott's ERROR_H copy for below, which looks like below:
 *------------------------------------------------------------------- 
 * prototype definitions                                              
 *------------------------------------------------------------------- 
D @__errno        PR              *   ExtProc('__errno')              
                                                                      
D strerror        PR              *   ExtProc('strerror')             
D    errnum                     10I 0 value                           
                                                                      
D perror          PR                  ExtProc('perror')               
D    comment                      *   value options(*string)          
                                                                      
 /if not defined(SOCKUTIL_H)                                          
D errno           PR            10I 0                                 
 /endif                                                               
 /endif                                                              
                                                                     
 *-------------------------------------------------------------------
 * procedure definitions:                                            
 *-------------------------------------------------------------------
 /if not defined(SOCKUTIL_H)                                         
 /if defined(ERRNO_LOAD_PROCEDURE)                                   
P errno           B                                                  
D errno           PI            10I 0                                
D p_errno         S               *                                  
D wwreturn        S             10I 0 based(p_errno)                 
C                   eval      p_errno = @__errno                     
c                   return    wwreturn                               
P                 E                                                  
 /endif                                                              
 /endif                                                              
                                                                     
 /define ERRNO_H           


I'm also using Scott K's example to set the alarm action, see below:
 ******************************************************************
 * set the alarm action                                            
P setAlarmAction  B                                                
D                 pi                                               
                                                                   
C                   callp     Qp0sEnableSignals()                  
C                   callp     sigemptyset(act.sa_mask)             
C                   callp     sigaddset(act.sa_mask: SIGALRM)      
C                   eval      act.sa_handler = %paddr(gotAlarm)    
C                   eval      act.sa_flags   = 0                   
C                   eval      act.sa_sigaction = *null             
C                   callp     sigaction(SIGALRM: act: *omit)       
                                                                   
P setAlarmAction  E


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bob Cozzi
Sent: Tuesday, January 17, 2006 10:45 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: alarm() not working as expected

I don't see your declaration for the errno thing.
But mine looks like this:

     D m_nErrNo        S             10I 0 Based(pErrNo)
     C                   eval      pErrNo = errno()
     C                   callp     joblog(%str(strerror(m_nErrNo)))


Where errno is the raw, C language function. Which returns a pointer to
the error number, hence the assignment to the based pointer. The
actually error number is then available in the m_nErrNo field.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.