2 * Copyright 2019 Intel Corporation
3 * SPDX-License-Identifier: MIT
5 * File operations helpers
19 * Create a new file and opens it for writing-only.
20 * If the given filename already exists, nothing is done and NULL is returned.
21 * `errno` gets set to the failure reason; if that is not EEXIST, the caller
22 * might want to do something other than trying again.
25 os_file_create_unique(const char *filename
, int filemode
);
29 * Returns a char* that the caller must free(), or NULL and sets errno.
32 os_read_file(const char *filename
);
35 * Try to determine if two file descriptors reference the same file description
38 * - 0: They reference the same file description
39 * - > 0: They do not reference the same file description
40 * - < 0: Unable to determine whether they reference the same file description
43 os_same_file_description(int fd1
, int fd2
);
49 #endif /* _OS_FILE_H_ */