diff options
author | Michel Dänzer <mdaenzer@redhat.com> | 2020-01-06 18:24:52 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2020-01-23 17:39:34 +0100 |
commit | f76cbc7901f7d500f5a4f74aedfd29970d1efd00 (patch) | |
tree | 0ee857c4cb81541c004ed1e762607f88449b8f04 /src/util/os_file.h | |
parent | c6468f66c7a47f0e16df2f1200db33eef6d2d1f4 (diff) |
util: Add os_same_file_description helper
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3202>
Diffstat (limited to 'src/util/os_file.h')
-rw-r--r-- | src/util/os_file.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/os_file.h b/src/util/os_file.h index d691302d12d..1972beba32b 100644 --- a/src/util/os_file.h +++ b/src/util/os_file.h @@ -8,6 +8,7 @@ #ifndef _OS_FILE_H_ #define _OS_FILE_H_ +#include <stdbool.h> #include <stdio.h> #ifdef __cplusplus @@ -30,6 +31,13 @@ os_file_create_unique(const char *filename, int filemode); char * os_read_file(const char *filename); +/* + * Returns true if the two file descriptors passed in can be determined to + * reference the same file description, false otherwise + */ +bool +os_same_file_description(int fd1, int fd2); + #ifdef __cplusplus } #endif |