Bug 192239 - NOTE_TRUNCATE not supported
Summary: NOTE_TRUNCATE not supported
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-29 13:22 UTC by ericshane
Modified: 2017-04-23 18:33 UTC (History)
0 users

See Also:


Attachments
a minimal program for printing VNODE events on BSD (985 bytes, text/plain)
2014-07-29 13:22 UTC, ericshane
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ericshane 2014-07-29 13:22:47 UTC
Created attachment 145120 [details]
a minimal program for printing VNODE events on BSD

On OpenBSD /usr/include/sys/event.h defines a filer for watching responding file truncation:

#define·NOTE_TRUNCATE   0x0080       /* vnode was truncated */

On FreeBSD this is not defined, and does not appear to be covered by any other filers

$ echo "test" > file.txt # NOTE_WRITE
$ : > file.txt           # NOTE_TRUNCATE

I'm filing this bug on behalf of the entr utility (http://entrproject.org) since this leaves an edge case where a file is altered without triggering an action.