1N/A#!/usr/sbin/dtrace -s
1N/A/*
1N/A * creatbyproc.d - file creat()s by process name. DTrace OneLiner.
1N/A *
1N/A * This is a DTrace (not exactly) OneLiner from the DTraceToolkit.
1N/A *
1N/A * $Id: creatbyproc.d 3 2007-08-01 10:50:08Z brendan $
1N/A */
1N/A
1N/A/*
1N/A * In libc, the creat() function has become:
1N/A *
1N/A * creat(const char *path, mode_t mode)
1N/A * {
1N/A * return (openat(AT_FDCWD, path, O_WRONLY|O_CREAT|O_TRUNC, mode));
1N/A * }
1N/A */
1N/A
1N/Ainline uint_t AT_FDCWD = 0xffd19553;
1N/Ainline int CREAT_FLAGS = 0x301; /* O_WRONLY|O_CREAT|O_TRUNC */
1N/A
1N/Asyscall::openat*:entry
1N/A/(uint_t)arg0 == AT_FDCWD && arg2 == CREAT_FLAGS/
1N/A{ printf("%s %s", execname, copyinstr(arg1)); }