inotify_others.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // +build !linux
  2. /*
  3. Copyright 2020 The Kubernetes Authors.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. */
  14. package inotify // import "k8s.io/utils/inotify"
  15. import (
  16. "fmt"
  17. "runtime"
  18. )
  19. var errNotSupported = fmt.Errorf("watch not supported on %s", runtime.GOOS)
  20. // NewWatcher creates and returns a new inotify instance using inotify_init(2)
  21. func NewWatcher() (*Watcher, error) {
  22. return nil, errNotSupported
  23. }
  24. // Close closes an inotify watcher instance
  25. // It sends a message to the reader goroutine to quit and removes all watches
  26. // associated with the inotify instance
  27. func (w *Watcher) Close() error {
  28. return errNotSupported
  29. }
  30. // AddWatch adds path to the watched file set.
  31. // The flags are interpreted as described in inotify_add_watch(2).
  32. func (w *Watcher) AddWatch(path string, flags uint32) error {
  33. return errNotSupported
  34. }
  35. // Watch adds path to the watched file set, watching all events.
  36. func (w *Watcher) Watch(path string) error {
  37. return errNotSupported
  38. }
  39. // RemoveWatch removes path from the watched file set.
  40. func (w *Watcher) RemoveWatch(path string) error {
  41. return errNotSupported
  42. }