Subversion Repositories Kolibri OS

Rev

Rev 8793 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include <stdio.h>
  2. #include <sys/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_thread_t table;
  10.         _ksys_thread_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. }
  17.