Skip to content

Commit

Permalink
FILE_TRUNC does not exist on Solaris (rjeczalik#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
gco committed May 22, 2021
1 parent e2a77dc commit 3b3ddac
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 13 deletions.
13 changes: 0 additions & 13 deletions watcher_fen_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ import (
"unsafe"
)

const (
fileAccess = Event(C.FILE_ACCESS)
fileModified = Event(C.FILE_MODIFIED)
fileAttrib = Event(C.FILE_ATTRIB)
fileDelete = Event(C.FILE_DELETE)
fileRenameTo = Event(C.FILE_RENAME_TO)
fileRenameFrom = Event(C.FILE_RENAME_FROM)
fileTrunc = Event(C.FILE_TRUNC)
fileNoFollow = Event(C.FILE_NOFOLLOW)
unmounted = Event(C.UNMOUNTED)
mountedOver = Event(C.MOUNTEDOVER)
)

// PortEvent is a notify's equivalent of port_event_t.
type PortEvent struct {
PortevEvents int // PortevEvents is an equivalent of portev_events.
Expand Down
23 changes: 23 additions & 0 deletions watcher_fen_cgo_consts_illumos.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2014-2015 The Notify Authors. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

package notify

// #include <port.h>
// #include <stdio.h>
// #include <stdlib.h>
import "C"

const (
fileAccess = Event(C.FILE_ACCESS)
fileModified = Event(C.FILE_MODIFIED)
fileAttrib = Event(C.FILE_ATTRIB)
fileDelete = Event(C.FILE_DELETE)
fileRenameTo = Event(C.FILE_RENAME_TO)
fileRenameFrom = Event(C.FILE_RENAME_FROM)
fileTrunc = Event(C.FILE_TRUNC)
fileNoFollow = Event(C.FILE_NOFOLLOW)
unmounted = Event(C.UNMOUNTED)
mountedOver = Event(C.MOUNTEDOVER)
)
23 changes: 23 additions & 0 deletions watcher_fen_cgo_consts_solaris.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2014-2015 The Notify Authors. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

package notify

// #include <port.h>
// #include <stdio.h>
// #include <stdlib.h>
import "C"

const (
fileAccess = Event(C.FILE_ACCESS)
fileModified = Event(C.FILE_MODIFIED)
fileAttrib = Event(C.FILE_ATTRIB)
fileDelete = Event(C.FILE_DELETE)
fileRenameTo = Event(C.FILE_RENAME_TO)
fileRenameFrom = Event(C.FILE_RENAME_FROM)
fileNoFollow = Event(C.FILE_NOFOLLOW)
fileTrunc = Event(0x00100000)
unmounted = Event(C.UNMOUNTED)
mountedOver = Event(C.MOUNTEDOVER)
)

0 comments on commit 3b3ddac

Please sign in to comment.