Go

  • 1.  How to handle syscall functions on a port to z/OS

    Posted Mon June 20, 2022 12:14 PM
    How to handle syscall functions on a port to z/OS?
    Sample code:
    package main                                
    import "fmt"                                
    import "syscall"                            
    func main() {                                
                                                 
       buff := ݨbyte{0}                        
                                                 
       fmt.Println("trying syscall on z/os")    
       syscall.ReadDirent(2,buff)                
    }                                            
    This builds, but on execution generates: syscall.ReadDirent: not implemented on z/OS




    ------------------------------
    Mike Baldwin
    President
    Cartagena Software Limited
    Markham ON
    1-905-887-0755
    ------------------------------


  • 2.  RE: How to handle syscall functions on a port to z/OS

    Posted Tue June 21, 2022 10:13 AM
    Try to use the package golang.org/x/sys/unix.

    ------------------------------
    Philippe Bernardino Leite
    ------------------------------



  • 3.  RE: How to handle syscall functions on a port to z/OS

    Posted Tue June 21, 2022 11:40 AM
    Try to use package golang.org/x/sys/unix.

    ------------------------------
    Philippe Bernardino Leite
    ------------------------------



  • 4.  RE: How to handle syscall functions on a port to z/OS

    Posted Tue June 21, 2022 05:37 PM

    Thanks for the suggestion.
    Test code that has:
    unix.ReadDirent(2,buff)
    generates: undefined: unix.ReadDirent 
    In lpp/IBM/cvg/v1r17/go/src/cmd/vendor/golang.org/x/sys/unix
    I find readdirent_getdents.go which looks like a valid implementation of ReadDirent in package unix;  BUT, it  does not have a zos build tag.

    In lpp/IBM/cvg/v1r17/go/src/cmd/vendor/golang.org/x/sys/unix 
    I cannot see a zos/s390x version of Getdents (used by ReadDirent).
    Where do I find and how do I use a zos/s390x version of ReadDirent?




    ------------------------------
    Mike Baldwin
    President
    Cartagena Software Limited
    Markham ON
    1-905-887-0755
    ------------------------------