Changeset 414:882ca9b959e6 in roaraudio for libroarpulse


Ignore:
Timestamp:
08/10/08 11:38:03 (11 years ago)
Author:
phi
Branch:
default
Message:

added code for pa_get_binary_name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/util.c

    r413 r414  
    66 * supported on all architectures, in which case NULL is returned. */ 
    77char *pa_get_binary_name(char *s, size_t l) { 
     8#ifdef __linux__ 
     9 int ret; 
     10 char path[PATH_MAX]; 
     11 
     12 if ( (ret = readlink("/proc/self/exe", path, PATH_MAX-1)) != -1 ) { 
     13  path[ret] = 0; 
     14  return strncpy(s, pa_path_get_filename(path), l); 
     15 } 
     16#endif 
     17 
    818 return NULL; 
    919} 
Note: See TracChangeset for help on using the changeset viewer.