sprintf(tmp_template, "m_sync_%d_XXXXXX", instance); int temp_fd = mkstemp(tmp_template); if (temp_fd == -1) { printf("can't make file to receive data\n"); }