Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Add dlopen stub for other platforms
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
  • Loading branch information
titanous committed Sep 9, 2019
1 parent 399ea9e commit 0ea02f2
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions dlopen/dlopen_incompatible.go
@@ -0,0 +1,40 @@
// Copyright 2016 CoreOS, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// +build !cgo !linux
package dlopen

import (
"errors"
"unsafe"
)

var errIncompatible = errors.New("package dlopen is incompatible with this platform")

type LibHandle struct {
Handle unsafe.Pointer
Libname string
}

func GetHandle(libs []string) (*LibHandle, error) {
return nil, errIncompatible
}

func (l *LibHandle) GetSymbolPointer(symbol string) (unsafe.Pointer, error) {
return nil, errIncompatible
}

func (l *LibHandle) Close() error {
return errIncompatible
}

0 comments on commit 0ea02f2

Please sign in to comment.