Skip to content

getifaddrs and freeifaddrs not in libc for illumos/solaris 10 #23

Description

@sjorge

I'm having some issues on SmartOS (illumos) because getifaddrs and freeifaddrs are not in libc, but in libsocket.

Replacing the ctypes load to socket instead of c makes it work, not sure how to best dynamically select the other one on illumos.

I'm not sure how to only do it when on illumos or solaris 10 though.

Activity

  1. sjorge commented on Jan 15, 2020

    @sjorge
    Author

    Something like this might work

    try:
    	retval = libc.func()
    except AttributeError as e:
    	if os.uname()[0] == 'SunOS':
    		libc = ctypes.CDLL(ctypes.util.find_library("socket"), use_errno=True)
    		retval = libc.func()
    	else:
    		raise e
    
  2. liv3010m commented on Mar 6, 2020

    @liv3010m

    Thanks!

    After some time trying to get this to work without any success I gave up and replaced the original function "libc = ctypes.CDLL(ctypes.util.find_library("c"), use_errno=True)" to the one you provided "libc = ctypes.CDLL(ctypes.util.find_library("socket"), use_errno=True)".

    Hopefully this package gets fixed.

  3. added a commit that references this issue on Jun 4, 2020
  4. added a commit that references this issue on Jun 4, 2020
  5. jstasiak commented on Jun 4, 2020

    @jstasiak
    Collaborator

    I trust 0e469ad (in master now) handles this.

  6. sjorge commented on Jun 4, 2020

    @sjorge
    Author

    I think that’s good yeah.

  7. liv3010m commented on Jun 5, 2020

    @liv3010m

    Thanks to everybody involved on this.

  8. jstasiak commented on Jun 6, 2020

    @jstasiak
    Collaborator

    The fix has been released in 0.1.7 just now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions