This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Heads up: Changed stat/fstat for sockets
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: cygwin-developers at cygwin dot com
- Date: Fri, 21 Feb 2003 16:03:27 +0100
- Subject: Heads up: Changed stat/fstat for sockets
- Reply-to: cygwin-developers at cygwin dot com
Hi,
just so that nobody is surprised. I've changed stat/fstat on sockets
to return values which are more similar to what Linux returns. It's
a bit difficult to explain. Basically it's now working like that:
- fstat() on an open socket returns the current owner and group in the
st_uid/st_gid fields and 0777 permissions in st_mode (see below).
- stat() on AF_UNIX/AF_LOCAL sockets returns owner and group of the actual
socket file in st_uid/st_gid.
It returns the same st_ino value as the actual socket file on the disk,
the actual file permissions in st_mode and the same st_dev value which
would have been returned if the socket file would have been just a
regular file on disk.
Other fields like st_rdev, st_blocks and st_size are appropriately tweaked
(mostly set to 0).
The device special files /dev/dgsocket, /dev/streamsocket, /dev/tcp and
/dev/udp are now correctly designated as character special files with
distinct minor device numbers.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin at cygwin dot com
Red Hat, Inc.