/proc/self is not portable

Christopher O Cowan Christopher.O.Cowan at ibm.com
Mon Aug 6 21:48:57 UTC 2018

I'm compiling on AIX, and while it does have a /proc fs, it does not have
the self symlink.   Should this be refactored to do the explicit getpid()

I found 3 instances of this:

$ git grep -n  '/proc/self'
lib/replace/closefrom.c:56:     dirp = opendir("/proc/self/fd");
source4/ntvfs/cifs_posix_cli/svfs_util.c:169:   ret = asprintf(&fd_path,
"/proc/self/%d", fd);
source4/ntvfs/simple/svfs_util.c:162:   ret = asprintf(&fd_path,
"/proc/self/%d", fd);


More information about the samba-technical mailing list