Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. #include <stdio.h>
  2. #include <ksys.h>
  3. #include <string.h>
  4.  
  5. static char buf[FILENAME_MAX + 1];
  6. static int static_index = 0;
  7.  
  8. char *tmpnam(char *name) {
  9.         ksys_proc_table_t table;
  10.         _ksys_process_info(&table, -1);
  11.  
  12.         char *out = name ? name : buf;
  13.         // PID is also unique for each thread
  14.         sprintf(out, "/tmp0/1/%x_%x.tmp", table.pid, static_index++);
  15.         return out;
  16. }