From: Jérémie Galarneau Date: Wed, 17 Apr 2019 20:55:27 +0000 (-0400) Subject: Add mkdirat utils and runas wrappers X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=18710679a8ac57fda5dbd26cf16bb180dce9e286;hp=18710679a8ac57fda5dbd26cf16bb180dce9e286;p=lttng-tools.git Add mkdirat utils and runas wrappers The lttng_directory_handle allows its user to keep a handle to a directory and to create subdirectories relative to it. On platforms implementing POSIX.2008, a directory file descriptor is used to maintain a handle to an existing directory and used in conjunction with mkdirat() to create subdirectories. Derelict platforms (such as Solaris 10) use an alternative implementation which carries the location of the root directory and builds subdirectory paths on creation. The existing mkdir utils are re-implemented using this new interface (using the special AT_FDCWD file descriptor value, when applicable) to limit code duplication. The implementation of the directory handle and its users is automatically selected based on the presence of the dirfd() function, but can also be explicitly chosen using the --enable/disable-dirfd configuration option. Signed-off-by: Jérémie Galarneau ---