X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Ffd-tracker%2Ffd-tracker.h;h=d321181ae9f2a3a9f40189944b3bfaae6cfcbde1;hb=d4ad24a314cea1020c7cd08b27670f5da495e38d;hp=ff5f49a1b8d2afc62e731e04e2ce66ab36457b78;hpb=df038819ef174fb8b0d5a76c293a3b94ce2a43b9;p=lttng-tools.git diff --git a/src/common/fd-tracker/fd-tracker.h b/src/common/fd-tracker/fd-tracker.h index ff5f49a1b..d321181ae 100644 --- a/src/common/fd-tracker/fd-tracker.h +++ b/src/common/fd-tracker/fd-tracker.h @@ -81,7 +81,9 @@ int fd_tracker_destroy(struct fd_tracker *tracker); * open. */ struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker, - const char *path, int flags, mode_t *mode); + const char *path, + int flags, + mode_t *mode); /* * Open a tracked unsuspendable file descriptor. @@ -106,8 +108,11 @@ struct fs_handle *fd_tracker_open_fs_handle(struct fd_tracker *tracker, * accomodate the request for a new unsuspendable entry. */ int fd_tracker_open_unsuspendable_fd(struct fd_tracker *tracker, - int *out_fds, const char **names, unsigned int fd_count, - fd_open_cb open, void *data); + int *out_fds, + const char **names, + unsigned int fd_count, + fd_open_cb open, + void *data); /* * Close a tracked unsuspendable file descriptor. @@ -125,7 +130,9 @@ int fd_tracker_open_unsuspendable_fd(struct fd_tracker *tracker, * allows the user to know which file descriptors are no longer being tracked. */ int fd_tracker_close_unsuspendable_fd(struct fd_tracker *tracker, - int *fds, unsigned int fd_count, fd_close_cb close, + int *fds, + unsigned int fd_count, + fd_close_cb close, void *data); /* @@ -156,6 +163,20 @@ int fs_handle_get_fd(struct fs_handle *handle); */ void fs_handle_put_fd(struct fs_handle *handle); +/* + * Unlink the file associated to an fs_handle. Note that the unlink + * operation will not be performed immediately. It will only be performed + * once all references to the underlying file (through other fs_handle objects) + * have been released. + * + * However, note that the file will be renamed so as to provide the observable + * effect of an unlink(), that is removing a name from the filesystem. + * + * Returns 0 on success, otherwise a negative value will be returned + * if the operation failed. + */ +int fs_handle_unlink(struct fs_handle *handle); + /* * Frees the handle and discards the underlying fd. */