github.com/gotranspile/cxgo@v0.3.7/libs/sys_ioctl.go (about) 1 package libs 2 3 import ( 4 "github.com/gotranspile/cxgo/runtime/csys" 5 "github.com/gotranspile/cxgo/types" 6 ) 7 8 const ( 9 sysIoctlH = "sys/ioctl.h" 10 ) 11 12 func init() { 13 RegisterLibrary(sysIoctlH, func(c *Env) *Library { 14 uintptrT := c.Go().Uintptr() 15 return &Library{ 16 // TODO 17 Imports: map[string]string{ 18 "csys": RuntimePrefix + "csys", 19 }, 20 Idents: map[string]*types.Ident{ 21 "FIONREAD": c.NewIdent("FIONREAD", "csys.FIONREAD", csys.FIONREAD, uintptrT), 22 "ioctl": c.NewIdent("ioctl", "csys.Ioctl", csys.Ioctl, c.VarFuncTT(types.IntT(4), uintptrT, uintptrT)), 23 }, 24 Header: ` 25 #include <` + sysTypesH + `> 26 27 const _cxgo_go_uintptr FIONREAD = 1; 28 _cxgo_sint32 ioctl(_cxgo_go_uintptr fildes, _cxgo_go_uintptr request, ... /* arg */); 29 `, 30 } 31 }) 32 }