*/
#include "util/hash_table.h"
+#include "util/os_file.h"
#include "etnaviv_priv.h"
#include "etnaviv_drmif.h"
* which is close()d when the device is finalized. */
struct etna_device *etna_device_new_dup(int fd)
{
- int dup_fd = dup(fd);
+ int dup_fd = os_dupfd_cloexec(fd);
struct etna_device *dev = etna_device_new(dup_fd);
if (dev)
#include "etnaviv_context.h"
#include "etnaviv_screen.h"
+#include "util/os_file.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
enum pipe_fd_type type)
{
assert(type == PIPE_FD_TYPE_NATIVE_SYNC);
- *pfence = etna_fence_create(pctx, dup(fd));
+ *pfence = etna_fence_create(pctx, os_dupfd_cloexec(fd));
}
void
etna_screen_fence_get_fd(struct pipe_screen *pscreen,
struct pipe_fence_handle *pfence)
{
- return dup(pfence->fence_fd);
+ return os_dupfd_cloexec(pfence->fence_fd);
}
struct pipe_fence_handle *