[PATCH] implement /proc/sysvipc/*

Yaakov (Cygwin/X) yselkowitz@users.sourceforge.net
Fri Apr 1 09:31:00 GMT 2011


These patches implement /proc/sysvipc/*, as found on Linux[1]:

$ ls -l /proc
[...]
dr-xr-xr-x 2 Yaakov         None           0 Apr  1 04:12 sysvipc/
[...]

$ ls -l /proc/sysvipc
total 0
-r--r--r-- 1 Yaakov None 0 Apr  1 04:12 msg
-r--r--r-- 1 Yaakov None 0 Apr  1 04:12 sem
-r--r--r-- 1 Yaakov None 0 Apr  1 04:12 shm

# yes, these lines are very long
$ cat /proc/sysvipc/shm 
       key      shmid perms       size  cpid  lpid nattch   uid   gid cuid   cgid      atime      dtime      ctime
         0     196608  6600     393216  4960  4996      2  1001   513  1001   513 1301639749          0 1301639749
         0      65537  6600     393216  4916  4996      2  1001   513  1001   513 1301639750          0 1301639750
[...]

If cygserver is not running, then the /proc/sysvipc directory still
exists but readdir()s as empty, and the files therein are nonexistent:

$ ls /proc/sysvipc/

$ ls /proc/sysvipc/shm
ls: cannot access /proc/sysvipc/sem: No such file or directory

$ cat /proc/sysvipc/shm
cat: /proc/sysvipc/shm: No such file or directory

The code uses some hints from the Cygwin modifications to ipcs(1).

Patch and new file for winsup/cygwin, and patch for winsup/doc attached.


Yaakov


[1] http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4/html/Reference_Guide/s2-proc-dir-sysvipc.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: doc-proc-sysvipc.patch
Type: text/x-patch
Size: 734 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110401/411a75f4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fhandler_procsysvipc.cc
Type: text/x-c++src
Size: 9299 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110401/411a75f4/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proc-sysvipc.patch
Type: text/x-patch
Size: 6579 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110401/411a75f4/attachment-0002.bin>


More information about the Cygwin-patches mailing list