# HG changeset patch # User Jim Meyering # Date 1305013619 -7200 # Node ID 8230401f6111dea53e6d8f0665b4572c2fbc208d # Parent 2663098d5483ec7d5ac66489356bc2e5121ab56c openat: add comments * lib/openat-proc.c (openat_proc_name): Add comments, mostly from Eric Blake. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-05-10 Jim Meyering + + openat: add comments + * lib/openat-proc.c (openat_proc_name): Add comments, + mostly from Eric Blake. + 2011-05-09 Eric Blake openat: reduce syscalls in first probe of /proc diff --git a/lib/openat-proc.c b/lib/openat-proc.c --- a/lib/openat-proc.c +++ b/lib/openat-proc.c @@ -80,6 +80,10 @@ proc_status = -1; else { + /* Detect whether /proc/self/fd/../fd exists. On Linux, that name + resolves to /proc/self/fd, which was opened above. However, on + Solaris, it may resolve to /proc/self/fd/fd, which cannot exist, + since all names in /proc/self/fd are numeric. */ char dotdot_buf[PROC_SELF_FD_NAME_SIZE_BOUND (sizeof "../fd" - 1)]; sprintf (dotdot_buf, PROC_SELF_FD_FORMAT, proc_self_fd, "../fd"); proc_status = access (dotdot_buf, F_OK) ? -1 : 1;