Changeset 758


Ignore:
Timestamp:
Apr 2, 2004, 10:08:24 PM (21 years ago)
Author:
Gary Byers
Message:

Use readlink() to determine executable pathname under Linux. Use PATH_MAX
on both platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/pmcl-kernel.c

    r757 r758  
    920920#endif
    921921#ifdef LINUX
    922 #error use readlink() on /proc/self/exe
     922  char exepath[PATH_MAX], *p;
     923  int n;
     924
     925  if ((n = readlink("/proc/self/exe", exepath, PATH_MAX)) > 0) {
     926    p = malloc(n+1);
     927    bcopy(exepath,p,n);
     928    p[n]=0;
     929    return p;
     930  }
     931  return argv0;
    923932#endif
    924933}
Note: See TracChangeset for help on using the changeset viewer.